Browse Source

Update raylib

tags/v1.0-RC1
Jens Pitkänen 4 months ago
parent
commit
4544f183c6
100 changed files with 27080 additions and 50429 deletions
  1. 284
    0
      vendor/raylib/CMakeLists.txt
  2. 113
    0
      vendor/raylib/CMakeOptions.txt
  3. 0
    51
      vendor/raylib/LICENSE.md
  4. 634
    0
      vendor/raylib/Makefile
  5. 61
    70
      vendor/raylib/camera.h
  6. 5
    3
      vendor/raylib/config.h
  7. 84
    0
      vendor/raylib/config.h.in
  8. 472
    160
      vendor/raylib/core.c
  9. 101
    91
      vendor/raylib/easings.h
  10. 5
    0
      vendor/raylib/external/ANGLE/EGL/eglplatform.h
  11. 2
    2
      vendor/raylib/external/cgltf.h
  12. 4749
    1741
      vendor/raylib/external/dr_flac.h
  13. 1288
    551
      vendor/raylib/external/dr_mp3.h
  14. 2200
    1053
      vendor/raylib/external/dr_wav.h
  15. 0
    13
      vendor/raylib/external/glfw/CMake/amd64-mingw32msvc.cmake
  16. 0
    13
      vendor/raylib/external/glfw/CMake/i586-mingw32msvc.cmake
  17. 0
    13
      vendor/raylib/external/glfw/CMake/i686-pc-mingw32.cmake
  18. 13
    0
      vendor/raylib/external/glfw/CMake/i686-w64-mingw32-clang.cmake
  19. 1
    1
      vendor/raylib/external/glfw/CMake/i686-w64-mingw32.cmake
  20. 0
    41
      vendor/raylib/external/glfw/CMake/modules/FindVulkan.cmake
  21. 13
    0
      vendor/raylib/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake
  22. 1
    1
      vendor/raylib/external/glfw/CMake/x86_64-w64-mingw32.cmake
  23. 14
    21
      vendor/raylib/external/glfw/CMakeLists.txt
  24. 23
    191
      vendor/raylib/external/glfw/README.md
  25. 0
    1678
      vendor/raylib/external/glfw/deps/glad.c
  26. 3840
    0
      vendor/raylib/external/glfw/deps/glad/gl.h
  27. 0
    3680
      vendor/raylib/external/glfw/deps/glad/glad.h
  28. 10
    10
      vendor/raylib/external/glfw/deps/glad/khrplatform.h
  29. 92
    92
      vendor/raylib/external/glfw/deps/glad/vk_platform.h
  30. 3480
    0
      vendor/raylib/external/glfw/deps/glad/vulkan.h
  31. 1791
    0
      vendor/raylib/external/glfw/deps/glad_gl.c
  32. 593
    0
      vendor/raylib/external/glfw/deps/glad_vulkan.c
  33. 0
    574
      vendor/raylib/external/glfw/deps/linmath.h
  34. 0
    25539
      vendor/raylib/external/glfw/deps/nuklear.h
  35. 0
    381
      vendor/raylib/external/glfw/deps/nuklear_glfw_gl2.h
  36. 0
    1048
      vendor/raylib/external/glfw/deps/stb_image_write.h
  37. 0
    594
      vendor/raylib/external/glfw/deps/tinycthread.c
  38. 0
    443
      vendor/raylib/external/glfw/deps/tinycthread.h
  39. 0
    73
      vendor/raylib/external/glfw/deps/vulkan/vulkan.h
  40. 0
    7334
      vendor/raylib/external/glfw/deps/vulkan/vulkan_core.h
  41. 171
    90
      vendor/raylib/external/glfw/include/GLFW/glfw3.h
  42. 1
    1
      vendor/raylib/external/glfw/include/GLFW/glfw3native.h
  43. 5
    1
      vendor/raylib/external/glfw/src/CMakeLists.txt
  44. 200
    9
      vendor/raylib/external/glfw/src/cocoa_init.m
  45. 1
    1
      vendor/raylib/external/glfw/src/cocoa_joystick.h
  46. 30
    7
      vendor/raylib/external/glfw/src/cocoa_joystick.m
  47. 76
    32
      vendor/raylib/external/glfw/src/cocoa_monitor.m
  48. 30
    2
      vendor/raylib/external/glfw/src/cocoa_platform.h
  49. 212
    298
      vendor/raylib/external/glfw/src/cocoa_window.m
  50. 1
    1
      vendor/raylib/external/glfw/src/context.c
  51. 2
    2
      vendor/raylib/external/glfw/src/egl_context.c
  52. 1
    1
      vendor/raylib/external/glfw/src/egl_context.h
  53. 2
    2
      vendor/raylib/external/glfw/src/glx_context.c
  54. 1
    1
      vendor/raylib/external/glfw/src/glx_context.h
  55. 1
    1
      vendor/raylib/external/glfw/src/init.c
  56. 55
    8
      vendor/raylib/external/glfw/src/input.c
  57. 6
    1
      vendor/raylib/external/glfw/src/internal.h
  58. 1
    1
      vendor/raylib/external/glfw/src/linux_joystick.c
  59. 1
    1
      vendor/raylib/external/glfw/src/mappings.h
  60. 1
    1
      vendor/raylib/external/glfw/src/mappings.h.in
  61. 24
    3
      vendor/raylib/external/glfw/src/monitor.c
  62. 15
    3
      vendor/raylib/external/glfw/src/nsgl_context.h
  63. 91
    11
      vendor/raylib/external/glfw/src/nsgl_context.m
  64. 1
    1
      vendor/raylib/external/glfw/src/null_init.c
  65. 1
    1
      vendor/raylib/external/glfw/src/null_joystick.c
  66. 1
    1
      vendor/raylib/external/glfw/src/null_joystick.h
  67. 7
    1
      vendor/raylib/external/glfw/src/null_monitor.c
  68. 1
    1
      vendor/raylib/external/glfw/src/null_platform.h
  69. 10
    1
      vendor/raylib/external/glfw/src/null_window.c
  70. 3
    3
      vendor/raylib/external/glfw/src/osmesa_context.c
  71. 1
    1
      vendor/raylib/external/glfw/src/osmesa_context.h
  72. 1
    1
      vendor/raylib/external/glfw/src/posix_thread.c
  73. 1
    1
      vendor/raylib/external/glfw/src/posix_thread.h
  74. 1
    1
      vendor/raylib/external/glfw/src/posix_time.c
  75. 1
    1
      vendor/raylib/external/glfw/src/posix_time.h
  76. 1
    1
      vendor/raylib/external/glfw/src/vulkan.c
  77. 122
    57
      vendor/raylib/external/glfw/src/wgl_context.c
  78. 1
    1
      vendor/raylib/external/glfw/src/wgl_context.h
  79. 21
    19
      vendor/raylib/external/glfw/src/win32_init.c
  80. 3
    3
      vendor/raylib/external/glfw/src/win32_joystick.c
  81. 1
    1
      vendor/raylib/external/glfw/src/win32_joystick.h
  82. 18
    1
      vendor/raylib/external/glfw/src/win32_monitor.c
  83. 10
    1
      vendor/raylib/external/glfw/src/win32_platform.h
  84. 1
    1
      vendor/raylib/external/glfw/src/win32_thread.c
  85. 1
    1
      vendor/raylib/external/glfw/src/win32_time.c
  86. 88
    50
      vendor/raylib/external/glfw/src/win32_window.c
  87. 3
    17
      vendor/raylib/external/glfw/src/window.c
  88. 5
    3
      vendor/raylib/external/glfw/src/wl_init.c
  89. 16
    1
      vendor/raylib/external/glfw/src/wl_monitor.c
  90. 1
    2
      vendor/raylib/external/glfw/src/wl_platform.h
  91. 42
    7
      vendor/raylib/external/glfw/src/wl_window.c
  92. 6
    2
      vendor/raylib/external/glfw/src/x11_init.c
  93. 97
    2
      vendor/raylib/external/glfw/src/x11_monitor.c
  94. 3
    1
      vendor/raylib/external/glfw/src/x11_platform.h
  95. 70
    40
      vendor/raylib/external/glfw/src/x11_window.c
  96. 1
    1
      vendor/raylib/external/glfw/src/xkb_unicode.c
  97. 16
    1
      vendor/raylib/external/jar_xm.h
  98. 5726
    4261
      vendor/raylib/external/miniaudio.h
  99. 1
    1
      vendor/raylib/external/par_shapes.h
  100. 0
    0
      vendor/raylib/external/rgif.h

+ 284
- 0
vendor/raylib/CMakeLists.txt View File

@@ -0,0 +1,284 @@
# Setup the project and settings
project(raylib C)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

set(PROJECT_VERSION 2.5.0)
set(API_VERSION 2)

include("CMakeOptions.txt")
include(BuildType)
configure_file(config.h.in ${CMAKE_BINARY_DIR}/cmake/config.h)
include_directories(${CMAKE_BINARY_DIR} .)

# Get the sources together
file(GLOB raylib_sources *.c)
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/rglfw.c)

if(USE_EXTERNAL_GLFW STREQUAL "ON")
find_package(glfw3 3.2.1 REQUIRED)
elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE")
find_package(glfw3 3.2.1 QUIET)
endif()
if (glfw3_FOUND)
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
endif()

# Explicitly check against "ON", because USE_EXTERNAL_GLFW is a tristate option
if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop")
MESSAGE(STATUS "Using raylib's GLFW")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE)

add_subdirectory(external/glfw)

list(APPEND raylib_sources $<TARGET_OBJECTS:glfw_objlib>)
include_directories(BEFORE SYSTEM external/glfw/include)
else()
MESSAGE(STATUS "Using external GLFW")
set(GLFW_PKG_DEPS glfw3)
endif()

add_definitions("-DRAYLIB_CMAKE=1")

if(USE_AUDIO)
MESSAGE(STATUS "Audio Backend: miniaudio")
set(sources ${raylib_sources})
else()
MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
set(RAYLIB_MODULE_AUDIO 0)
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/raudio.c)
set(sources ${raylib_sources})
endif()

### Config options ###
# Translate the config options to what raylib wants
if(${PLATFORM} MATCHES "Desktop")
set(PLATFORM_CPP "PLATFORM_DESKTOP")

if(APPLE)
# Need to force OpenGL 3.3 on OS X
# See: https://github.com/raysan5/raylib/issues/341
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
find_library(OPENGL_LIBRARY OpenGL)
set(LIBS_PRIVATE ${OPENGL_LIBRARY})
link_libraries("${LIBS_PRIVATE}")
if (NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0")
add_definitions(-DGL_SILENCE_DEPRECATION)
MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!")
endif()
elseif(WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(LIBS_PRIVATE ${LIBS_PRIVATE} winmm)
else()
find_library(pthread NAMES pthread)
find_package(OpenGL QUIET)
if ("${OPENGL_LIBRARIES}" STREQUAL "")
set(OPENGL_LIBRARIES "GL")
endif()

if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
find_library(OSS_LIBRARY ossaudio)
endif()

set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
endif()

elseif(${PLATFORM} MATCHES "Web")
set(PLATFORM_CPP "PLATFORM_WEB")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")

set(CMAKE_C_FLAGS "-s USE_GLFW=3 -s ASSERTIONS=1 --profiling")

# Change the name of the output library

elseif(${PLATFORM} MATCHES "Android")
set(PLATFORM_CPP "PLATFORM_ANDROID")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
include(AddIfFlagCompiles)
add_if_flag_compiles(-ffunction-sections CMAKE_C_FLAGS)
add_if_flag_compiles(-funwind-tables CMAKE_C_FLAGS)
add_if_flag_compiles(-fstack-protector-strong CMAKE_C_FLAGS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS)
add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS)
add_definitions(-DANDROID -D__ANDROID_API__=21)
include_directories(external/android/native_app_glue)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate")

find_library(OPENGL_LIBRARY OpenGL)
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)

elseif(${PLATFORM} MATCHES "Raspberry Pi")
set(PLATFORM_CPP "PLATFORM_RPI")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")

endif()

if (${OPENGL_VERSION})
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
if (${OPENGL_VERSION} MATCHES "3.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
elseif (${OPENGL_VERSION} MATCHES "2.1")
set(GRAPHICS "GRAPHICS_API_OPENGL_21")
elseif (${OPENGL_VERSION} MATCHES "1.1")
set(GRAPHICS "GRAPHICS_API_OPENGL_11")
elseif (${OPENGL_VERSION} MATCHES "ES 2.0")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
endif()
if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail")
endif()
endif()

if(NOT GRAPHICS)
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
endif()

include_directories(${OPENGL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR})
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
include(LibraryPathToLinkerFlags)
library_path_to_linker_flags(__PKG_CONFIG_LIBS_PRIVATE "${LIBS_PRIVATE}")

if(STATIC)
MESSAGE(STATUS "Building raylib static library")
if(${PLATFORM} MATCHES "Web")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".bc")
endif()

add_library(raylib_static STATIC ${sources})

target_compile_definitions(raylib_static
PUBLIC ${PLATFORM_CPP}
PUBLIC ${GRAPHICS}
)

set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
string (REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
if (${PLATFORM} MATCHES "Desktop")
target_link_libraries(raylib_static glfw ${GLFW_LIBRARIES} ${LIBS_PRIVATE})
endif()

if (WITH_PIC)
set_property(TARGET raylib_static PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
set_target_properties(raylib_static PROPERTIES PUBLIC_HEADER "raylib.h")
if(NOT WIN32) # Keep lib*.(a|dll) name, but avoid *.lib files overwriting each other on Windows
set_target_properties(raylib_static PROPERTIES OUTPUT_NAME raylib)
endif()
install(
TARGETS raylib_static
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set_target_properties(raylib_static PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")

add_test("pkg-config--static" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh --static)
endif(STATIC)


if(SHARED)
MESSAGE(STATUS "Building raylib shared library")
add_library(raylib SHARED ${sources})

target_compile_definitions(raylib
PUBLIC ${PLATFORM_CPP}
PUBLIC ${GRAPHICS}
)

if(MSVC)
target_compile_definitions(raylib
PRIVATE $<BUILD_INTERFACE:BUILD_LIBTYPE_SHARED>
INTERFACE $<INSTALL_INTERFACE:USE_LIBTYPE_SHARED>
)
endif()

set(PKG_CONFIG_LIBS_EXTRA "")

set_property(TARGET raylib PROPERTY POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MACOSX_RPATH ON)

target_link_libraries(raylib ${LIBS_PRIVATE})
if (${PLATFORM} MATCHES "Desktop")
target_link_libraries(raylib glfw)
endif()
if (UNIX AND ${FILESYSTEM_LACKS_SYMLINKS})
MESSAGE(WARNING "Can't version UNIX shared library on file system without symlink support")
else()
set_target_properties(raylib PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${API_VERSION}
)
endif()
set_target_properties(raylib PROPERTIES
PUBLIC_HEADER "raylib.h"
)

if (WIN32)
install(
TARGETS raylib
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "include"
)
else()
install(
TARGETS raylib
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
endif()
set_target_properties(raylib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")

add_test("pkg-config" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh)
else(SHARED)
add_library(raylib ALIAS raylib_static)
endif(SHARED)

if (NOT DEFINED PKG_CONFIG_LIBS_EXTRA)
set(PKG_CONFIG_LIBS_EXTRA "${PKG_CONFIG_LIBS_PRIVATE}")
endif()
configure_file(../raylib.pc.in raylib.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
configure_file(../cmake/raylib-config-version.cmake raylib-config-version.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")
install(FILES ${PROJECT_SOURCE_DIR}/../cmake/raylib-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")

# populates raylib_{FOUND, INCLUDE_DIRS, LIBRARIES, LDFLAGS, DEFINITIONS}
include(PopulateConfigVariablesLocally)
populate_config_variables_locally(raylib)

# Copy the header files to the build directory
file(COPY "raylib.h" DESTINATION ".")
file(COPY "rlgl.h" DESTINATION ".")
file(COPY "physac.h" DESTINATION ".")
file(COPY "raymath.h" DESTINATION ".")
file(COPY "raudio.h" DESTINATION ".")

# Print the flags for the user
message(STATUS "Compiling with the flags:")
message(STATUS " PLATFORM=" ${PLATFORM_CPP})
message(STATUS " GRAPHICS=" ${GRAPHICS})

# Packaging
SET(CPACK_PACKAGE_NAME "raylib")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md")
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
include(CPack)

enable_testing()

+ 113
- 0
vendor/raylib/CMakeOptions.txt View File

@@ -0,0 +1,113 @@
### Config options ###
include(CMakeDependentOption)
include(EnumOption)

enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi" "Platform to build for.")

enum_option(OPENGL_VERSION "OFF;3.3;2.1;1.1;ES 2.0" "Force a specific OpenGL Version?")

# Shared library is always PIC. Static library should be PIC too if linked into a shared library
option(WITH_PIC "Compile static library as position-independent code" OFF)
option(SHARED "Build raylib as a dynamic library" OFF)
option(STATIC "Build raylib as a static library" ON)
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF)
option(USE_AUDIO "Build raylib with audio module" ON)

enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
if(UNIX AND NOT APPLE)
option(USE_WAYLAND "Use Wayland for window creation" OFF)
endif()

option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")

# core.c
option(SUPPORT_CAMERA_SYSTEM "Provide camera module (camera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON)
option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag" ON)
option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON)
option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF)
option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON)
option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON)
option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON)
option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF)
option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF)
option(SUPPORT_HIGH_DPI "Support high DPI displays" OFF)

# rlgl.h
option(SUPPORT_VR_SIMULATOR "Support VR simulation functionality (stereo rendering)" ON)

# shapes.c
option(SUPPORT_FONT_TEXTURE "Draw rectangle shapes using font texture white character instead of default white texture. Allows drawing rectangles and text with a single draw call, very useful for GUI systems!" ON)
option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON)

# textures.c
option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON)
option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON)
option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON)
option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON)
option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON)
option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON)
option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON)
option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON)
option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF})
option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF})
option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF})
option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF})

# text.c
option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON)
option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON)

# models.c
option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON)
option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON)
option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON)
option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON)
option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON)

# raudio.c
option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON)
option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON)
option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON)
option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON)
option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON)
option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF})

# utils.c
option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON)

if(NOT (STATIC OR SHARED))
message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
endif()

if (DEFINED BUILD_SHARED_LIBS)
set(SHARED ${BUILD_SHARED_LIBS})
if (${BUILD_SHARED_LIBS})
set(STATIC OFF)
else()
set(STATIC ON)
endif()
endif()
if(DEFINED SHARED_RAYLIB)
set(SHARED ${SHARED_RAYLIB})
message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")
endif()
if(DEFINED STATIC_RAYLIB)
set(STATIC ${STATIC_RAYLIB})
message(DEPRECATION "-DSTATIC_RAYLIB is deprecated. Please use -DSTATIC instead.")
endif()

if(${PLATFORM} MATCHES "Desktop" AND APPLE)
if(MACOS_FATLIB)
if (CMAKE_OSX_ARCHITECTURES)
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
endif()
endif()
endif()

# vim: ft=cmake

+ 0
- 51
vendor/raylib/LICENSE.md View File

@@ -1,51 +0,0 @@
license
=======

source code
-----------

raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
BSD-like license that allows static linking with closed source software:
Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you
wrote the original software. If you use this software in a product, an acknowledgment
in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented
as being the original software.

3. This notice may not be removed or altered from any source distribution.

fonts
------

The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/master/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:

* Alpha Beta - Brian Kent (AEnigma)
* Setback - Brian Kent (AEnigma)
* Jupiter Crash - Brian Kent (AEnigma)
* Alagard - Hewett Tsoi
* Romulus - Hewett Tsoi
* Mecha - Captain Falcon
* PixelPlay - Aleksander Shevchuk
* PixAntiqua - Gerhard Großmann
2d art
------

[scarfy spritesheet](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and are licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)

[cyberpunk street environments](https://github.com/raysan5/raylib/blob/master/examples/textures/resources) have been created by Luis Zuno ([@ansimuz](https://twitter.com/ansimuz)) and are licensed as [CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/)

3d models
---------

[medieval city 3d models and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/medieval) have been created by Alberto Cano and are licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode)

+ 634
- 0
vendor/raylib/Makefile View File

@@ -0,0 +1,634 @@
#******************************************************************************
#
# raylib makefile
#
# Platforms supported:
# PLATFORM_DESKTOP: Windows (Win32, Win64)
# PLATFORM_DESKTOP: Linux (32 and 64 bit)
# PLATFORM_DESKTOP: OSX/macOS
# PLATFORM_DESKTOP: FreeBSD, OpenBSD, NetBSD, DragonFly
# PLATFORM_ANDROID: Android (ARM, ARM64)
# PLATFORM_RPI: Raspberry Pi (Raspbian)
# PLATFORM_WEB: HTML5 (Chrome, Firefox)
#
# Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline.
# Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline.
#
# Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from
# the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software in a
# product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#
#******************************************************************************

# Please read the wiki to know how to compile raylib, because there are different methods.
# https://github.com/raysan5/raylib/wiki

.PHONY: all clean install uninstall

# Define required raylib variables
RAYLIB_VERSION = 2.5.0
RAYLIB_API_VERSION = 2

# See below for alternatives.
RAYLIB_PATH = ..

# Define default options

# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP

# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC

# Build mode for library: DEBUG or RELEASE
RAYLIB_BUILD_MODE ?= RELEASE

# Include raylib modules on compilation
# NOTE: Some programs like tools could not require those modules
RAYLIB_MODULE_AUDIO ?= TRUE
RAYLIB_MODULE_MODELS ?= TRUE
RAYLIB_MODULE_RAYGUI ?= FALSE
RAYLIB_MODULE_PHYSAC ?= FALSE

RAYLIB_MODULE_RAYGUI_PATH ?= .
RAYLIB_MODULE_PHYSAC_PATH ?= .

# Use external GLFW library instead of rglfw module
# TODO: Review usage of examples on Linux.
USE_EXTERNAL_GLFW ?= FALSE

# Use Wayland display server protocol on Linux desktop
# by default it uses X11 windowing system
USE_WAYLAND_DISPLAY ?= FALSE

# See below for more GRAPHICS options.

# See below for RAYLIB_RELEASE_PATH.

# See install target for *_INSTALL_PATH locations.

# Use cross-compiler for PLATFORM_RPI
ifeq ($(PLATFORM),PLATFORM_RPI)
USE_RPI_CROSS_COMPILER ?= FALSE
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
endif
endif

# Determine if the file has root access (only for installing raylib)
# "whoami" prints the name of the user that calls him (so, if it is the root
# user, "whoami" prints "root").
ROOT = $(shell whoami)

# By default we suppose we are working on Windows
HOST_PLATFORM_OS ?= WINDOWS

# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
PLATFORM_OS = WINDOWS
else
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS = BSD
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS = OSX
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
endif

# RAYLIB_PATH adjustment for different platforms.
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
# Required for ldconfig or other tools that do not perform path expansion.
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_PREFIX ?= ..
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
endif
endif

ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH ?= D:/emsdk
EMSCRIPTEN_VERSION ?= 1.38.31
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
NODE_VERSION = 8.9.1_64bit
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
endif

ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Android architecture: ARM64
# Starting at 2019 using ARM64 is mandatory for published apps
ANDROID_ARCH ?= ARM
ANDROID_API_VERSION = 21
# Android required path variables
# NOTE: Android NDK is just required to generate the standalone toolchain,
# in case is not already provided
ANDROID_NDK = C:/android-ndk

# Android standalone toolchain path
ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
ifeq ($(ANDROID_ARCH),ARM)
ANDROID_ARCH_NAME = armeabi-v7a
endif
ifeq ($(ANDROID_ARCH),ARM64)
ANDROID_ARCH_NAME = arm64-v8a
endif
endif

# Define raylib source code path
RAYLIB_SRC_PATH ?= $(RAYLIB_PATH)/src

# Define output directory for compiled library, defaults to src directory
# NOTE: If externally provided, make sure directory exists
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src

# Define raylib graphics api depending on selected platform
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# By default use OpenGL 3.3 on desktop platforms
GRAPHICS ?= GRAPHICS_API_OPENGL_33
#GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1
#GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# On RPI OpenGL ES 2.0 must be used
GRAPHICS = GRAPHICS_API_OPENGL_ES2
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0
GRAPHICS = GRAPHICS_API_OPENGL_ES2
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# By default use OpenGL ES 2.0 on Android
GRAPHICS = GRAPHICS_API_OPENGL_ES2
endif

# Define default C compiler and archiver to pack library
# NOTE: define g++ compiler if using C++
CC = gcc
AR = ar

ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX)
# OSX default compiler
CC = clang
GLFW_CFLAGS = -x objective-c
endif
ifeq ($(PLATFORM_OS),BSD)
# FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
AR = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-ar
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# HTML5 emscripten compiler
CC = emcc
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Android toolchain (must be provided for desired architecture and compiler)
ifeq ($(ANDROID_ARCH),ARM)
CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang
AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar
endif
ifeq ($(ANDROID_ARCH),ARM64)
CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang
AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
endif
endif


# Define compiler flags:
# -O1 defines optimization level
# -g include debug information on compilation
# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -std=c99 defines C language mode (standard C from 1999 revision)
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
# -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing)
CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing

ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -g
endif

# Additional flags for compiler (if desired)
# -Wextra enables some extra warning flags that are not enabled by -Wall
# -Wmissing-prototypes warn if a global function is defined without a previous prototype declaration
# -Wstrict-prototypes warn if a function is declared or defined without specifying the argument types
# -Werror=implicit-function-declaration catch function calls without prior declaration
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
CFLAGS += -Werror=implicit-function-declaration
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -s USE_GLFW=3 # Use glfw3 library (context/input management)
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
# -s USE_PTHREADS=1 # multithreading support
# -s WASM=0 # disable Web Assembly, emitted by default
# -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
# -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
CFLAGS += -s USE_GLFW=3
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -s ASSERTIONS=1 --profiling
endif
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Compiler flags for arquitecture
ifeq ($(ANDROID_ARCH),ARM)
CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
endif
ifeq ($(ANDROID_ARCH),ARM64)
CFLAGS += -target aarch64 -mfix-cortex-a53-835769
endif
# Compilation functions attributes options
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC
# Compiler options for the linker
# -Werror=format-security
CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
# Preprocessor macro definitions
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) -DMAL_NO_OSS
endif

# Define required compilation flags for raylib SHARED lib
ifeq ($(RAYLIB_LIBTYPE),SHARED)
# make sure code is compiled as position independent
# BE CAREFUL: It seems that for gcc -fpic is not the same as -fPIC
# MinGW32 just doesn't need -fPIC, it shows warnings
CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED
endif

# Use Wayland display on Linux desktop
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS), LINUX)
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
CFLAGS += -D_GLFW_WAYLAND
endif
endif
endif

# Define include paths for required headers
# NOTE: Several external required libraries (stb and others)
INCLUDE_PATHS = -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw

ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH)
endif
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
# Check the version name. If GLFW3 was built manually, it may have produced
# a static library known as libglfw3.a. In that case, the name should be -lglfw3
LDFLAGS += -lglfw
endif
endif

# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI required libraries
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Android required libraries
INCLUDE_PATHS += -I$(ANDROID_TOOLCHAIN)/sysroot/usr/include
# Include android_native_app_glue.h
INCLUDE_PATHS += -Iexternal/android/native_app_glue
#INCLUDE_PATHS += -I$(ANDROID_NDK)/sources/android/native_app_glue
endif

# Define linker options
ifeq ($(PLATFORM),PLATFORM_ANDROID)
LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a
LDFLAGS += -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
# Force linking of library module to define symbol
LDFLAGS += -u ANativeActivity_onCreate
# Library paths containing required libs
LDFLAGS += -L. -Lsrc -L$(RAYLIB_RELEASE_PATH)
# Avoid unresolved symbol pointing to external main()
LDFLAGS += -Wl,-undefined,dynamic_lookup

LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
endif

# Define all object files required with a wildcard
# The wildcard takes all files that finish with ".c",
# and replaces extentions with ".o", that are the object files
# NOTE: Some objects depend on the PLATFORM to be added or not!
# OBJS = $(patsubst %.c, %.o, $(wildcard *.c))

# Define object required on compilation
OBJS = core.o \
shapes.o \
textures.o \
text.o \
utils.o

ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
OBJS += rglfw.o
endif
endif
ifeq ($(RAYLIB_MODULE_MODELS),TRUE)
OBJS += models.o
endif
ifeq ($(RAYLIB_MODULE_AUDIO),TRUE)
OBJS += raudio.o
endif
ifeq ($(RAYLIB_MODULE_RAYGUI),TRUE)
OBJS += raygui.o
endif
ifeq ($(RAYLIB_MODULE_PHYSAC),TRUE)
OBJS += physac.o
endif

ifeq ($(PLATFORM),PLATFORM_ANDROID)
OBJS += external/android/native_app_glue/android_native_app_glue.o
endif

# Default target entry
all: raylib

# Generate standalone Android toolchain
# NOTE: If the host system is Windows or Linux, generation is different
generate_android_toolchain:
ifeq ($(PLATFORM_OS),WINDOWS)
# NOTE: python should be available in the path
ifeq ($(ANDROID_ARCH),ARM)
$(ANDROID_NDK)/build/tools/python make_standalone_toolchain.py --arch arm --api $(ANDROID_API_VERSION) --install-dir $(ANDROID_TOOLCHAIN)
endif
ifeq ($(ANDROID_ARCH),ARM64)
$(ANDROID_NDK)/build/tools/python make_standalone_toolchain.py --arch arm64 --api $(ANDROID_API_VERSION) --install-dir $(ANDROID_TOOLCHAIN)
endif
endif
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(ANDROID_ARCH),ARM)
$(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-$(ANDROID_API_VERSION) --toolchain=arm-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN)
endif
ifeq ($(ANDROID_ARCH),ARM64)
$(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-$(ANDROID_API_VERSION) --toolchain=aarch64-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN)
endif
endif

# Compile raylib library
# NOTE: Release directory is created if not exist
raylib: $(OBJS)
ifeq ($(PLATFORM),PLATFORM_WEB)
# Compile raylib for web.
emcc -O1 $(OBJS) -o $(RAYLIB_RELEASE_PATH)/libraylib.bc
@echo "raylib library generated (libraylib.bc)!"
else
ifeq ($(RAYLIB_LIBTYPE),SHARED)
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# TODO: Compile resource file raylib.dll.rc for linkage on raylib.dll generation
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a
@echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!"
endif
ifeq ($(PLATFORM_OS),LINUX)
# Compile raylib shared library version $(RAYLIB_VERSION).
# WARNING: you should type "make clean" before doing this target
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(OBJS) -Wl,-soname,libraylib.so.$(RAYLIB_API_VERSION) -lGL -lc -lm -lpthread -ldl -lrt
@echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION)
cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so
endif
ifeq ($(PLATFORM_OS),OSX)
$(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib $(OBJS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa
install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).dylib)!"
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib
endif
ifeq ($(PLATFORM_OS),BSD)
# WARNING: you should type "gmake clean" before doing this target
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Compile raylib shared library version $(RAYLIB_VERSION).
# WARNING: you should type "make clean" before doing this target
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(OBJS) -Wl,-soname,libraylib.so.$(RAYLIB_API_VERSION) -L/opt/vc/lib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
@echo "raylib shared library generated (libraylib.so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION)
cd $(RAYLIB_RELEASE_PATH) && ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
# WARNING: symbolic links creation on Windows should be done using mklink command, no ln available
ifeq ($(HOST_PLATFORM_OS),LINUX)
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
endif
endif
else
# Compile raylib static library version $(RAYLIB_VERSION)
# WARNING: You should type "make clean" before doing this target.
$(AR) rcs $(RAYLIB_RELEASE_PATH)/libraylib.a $(OBJS)
@echo "raylib static library generated (libraylib.a) in $(RAYLIB_RELEASE_PATH)!"
endif
endif

# Compile all modules with their prerequisites

# Compile core module
core.o : core.c raylib.h rlgl.h utils.h raymath.h camera.h gestures.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile rglfw module
rglfw.o : rglfw.c
$(CC) $(CFLAGS) $(GLFW_CFLAGS) -c $< $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile shapes module
shapes.o : shapes.c raylib.h rlgl.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile textures module
textures.o : textures.c raylib.h rlgl.h utils.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile text module
text.o : text.c raylib.h utils.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile utils module
utils.o : utils.c utils.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)

# Compile models module
models.o : models.c raylib.h rlgl.h raymath.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS)

# Compile audio module
raudio.o : raudio.c raylib.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
# Compile raygui module
# NOTE: raygui header should be distributed with raylib.h
raygui.o : raygui.c raygui.h
@echo #define RAYGUI_IMPLEMENTATION > raygui.c
@echo #include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h" > raygui.c
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -DRAYGUI_IMPLEMENTATION
# Compile physac module
# NOTE: physac header should be distributed with raylib.h
physac.o : physac.c physac.h
@echo #define PHYSAC_IMPLEMENTATION > physac.c
@echo #include "$(RAYLIB_MODULE_PHYSAC_PATH)/physac.h" > physac.c
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -DPHYSAC_IMPLEMENTATION


# Install generated and needed files to desired directories.
# On GNU/Linux and BSDs, there are some standard directories that contain extra
# libraries and header files. These directories (often /usr/local/lib and
# /usr/local/include) are for libraries that are installed manually
# (without a package manager). We'll use /usr/local/lib/raysan5 and /usr/local/include/raysan5
# for our -L and -I specification to simplify management of the raylib source package.
# Customize these locations if you like but don't forget to pass them to make
# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig.
# Hint: add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles.
# See below and ../examples/Makefile for more information.
# TODO: Add other platforms. Remove sudo requirement, i.e. add USER mode.

# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
DESTDIR ?= /usr/local
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include

install :
ifeq ($(ROOT),root)
ifeq ($(PLATFORM_OS),LINUX)
# Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH)
# and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information.
# Prepare the environment as needed.
mkdir --parents --verbose $(RAYLIB_INSTALL_PATH)
mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH)
ifeq ($(RAYLIB_LIBTYPE),SHARED)
# Installing raylib to $(RAYLIB_INSTALL_PATH).
cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION)
cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_VERSION) libraylib.so.$(RAYLIB_API_VERSION)
cd $(RAYLIB_INSTALL_PATH); ln -fsv libraylib.so.$(RAYLIB_API_VERSION) libraylib.so
# Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH.
# Not necessary if later embedding RPATH in your executable. See examples/Makefile.
ldconfig $(RAYLIB_INSTALL_PATH)
else
# Installing raylib to $(RAYLIB_INSTALL_PATH).
cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_INSTALL_PATH)/libraylib.a
endif
# Copying raylib development files to $(RAYLIB_H_INSTALL_PATH).
cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h
cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h
cp --update rlgl.h $(RAYLIB_H_INSTALL_PATH)/rlgl.h
cp --update physac.h $(RAYLIB_H_INSTALL_PATH)/physac.h
@echo "raylib development files installed/updated!"
else
@echo "This function currently works on GNU/Linux systems. Add yours today (^;"
endif
else
@echo "Error: Root permissions needed for installation. Try sudo make install"
endif

# Remove raylib dev files installed on the system
# TODO: see 'install' target.
uninstall :
ifeq ($(ROOT),root)
# WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH).
# and $(RAYLIB_H_INSTALL_PATH). Please confirm each item.
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),SHARED)
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION)
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION)
# Uncomment to clean up the runtime linker cache. See install target.
ldconfig
else
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a
endif
rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raylib.h
rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raymath.h
rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/rlgl.h
rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/physac.h
@echo "raylib development files removed!"
else
@echo "This function currently works on GNU/Linux systems. Add yours today (^;"
endif
else
@echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall"
endif

# Clean everything
clean:
ifeq ($(PLATFORM_OS),WINDOWS)
del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so
else
rm -fv *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so*
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
rm -rf $(ANDROID_TOOLCHAIN)
endif
@echo "removed all generated files!"

+ 61
- 70
vendor/raylib/camera.h View File

@@ -16,13 +16,13 @@
* functions must be redefined to manage inputs accordingly.
*
* CONTRIBUTORS:
* Marc Palau: Initial implementation (2014)
* Ramon Santamaria: Supervision, review, update and maintenance
* Marc Palau: Initial implementation (2014)
*
*
* LICENSE: zlib/libpng
*
* Copyright (c) 2015-2017 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2019 Ramon Santamaria (@raysan5)
*
* This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software.
@@ -54,15 +54,6 @@
// NOTE: Below types are required for CAMERA_STANDALONE usage
//----------------------------------------------------------------------------------
#if defined(CAMERA_STANDALONE)
// Camera modes
typedef enum {
CAMERA_CUSTOM = 0,
CAMERA_FREE,
CAMERA_ORBITAL,
CAMERA_FIRST_PERSON,
CAMERA_THIRD_PERSON
} CameraMode;

// Vector2 type
typedef struct Vector2 {
float x;
@@ -77,12 +68,30 @@
} Vector3;

// Camera type, defines a camera position/orientation in 3d space
typedef struct Camera {
Vector3 position;
Vector3 target;
Vector3 up;
float fovy;
} Camera;
typedef struct Camera3D {
Vector3 position; // Camera position
Vector3 target; // Camera target it looks-at
Vector3 up; // Camera up vector (rotation over its axis)
float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
} Camera3D;

typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D
// Camera system modes
typedef enum {
CAMERA_CUSTOM = 0,
CAMERA_FREE,
CAMERA_ORBITAL,
CAMERA_FIRST_PERSON,
CAMERA_THIRD_PERSON
} CameraMode;

// Camera projection modes
typedef enum {
CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC
} CameraType;
#endif

#ifdef __cplusplus
@@ -103,7 +112,7 @@ void UpdateCamera(Camera *camera); // Update camera pos

void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera)
void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera)
void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera)
void SetCameraSmoothZoomControl(int szoomKey); // Set camera smooth zoom key to combine with mouse (free camera)
void SetCameraMoveControls(int frontKey, int backKey,
int rightKey, int leftKey,
int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras)
@@ -124,16 +133,14 @@ void SetCameraMoveControls(int frontKey, int backKey,

#if defined(CAMERA_IMPLEMENTATION)

#include <math.h> // Required for: sqrt(), sin(), cos()
#include <math.h> // Required for: sqrt(), sinf(), cosf()

#ifndef PI
#define PI 3.14159265358979323846
#endif

#ifndef DEG2RAD
#define DEG2RAD (PI/180.0f)
#endif

#ifndef RAD2DEG
#define RAD2DEG (180.0f/PI)
#endif
@@ -193,8 +200,8 @@ typedef enum {
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
static Vector2 cameraAngle = { 0.0f, 0.0f }; // TODO: Remove! Compute it in UpdateCamera()
static float cameraTargetDistance = 0.0f; // TODO: Remove! Compute it in UpdateCamera()
static Vector2 cameraAngle = { 0.0f, 0.0f }; // Camera angle in plane XZ
static float cameraTargetDistance = 0.0f; // Camera distance from position to target
static float playerEyesPosition = 1.85f; // Default player eyes position from ground (in meters)

static int cameraMoveControl[6] = { 'W', 'S', 'D', 'A', 'E', 'Q' };
@@ -227,9 +234,6 @@ static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; }
// Select camera mode (multiple camera modes available)
void SetCameraMode(Camera camera, int mode)
{
// TODO: cameraTargetDistance and cameraAngle should be
// calculated using camera parameters on UpdateCamera()

Vector3 v1 = camera.position;
Vector3 v2 = camera.target;
@@ -252,11 +256,10 @@ void SetCameraMode(Camera camera, int mode)
//cameraAngle.y = -60.0f*DEG2RAD; // Camera angle in plane XY (0 aligned with X, move positive CW)
playerEyesPosition = camera.position.y;
// Lock cursor for first person and third person cameras
if ((mode == CAMERA_FIRST_PERSON) ||
(mode == CAMERA_THIRD_PERSON)) DisableCursor();
else EnableCursor();
if ((mode == CAMERA_FIRST_PERSON) || (mode == CAMERA_THIRD_PERSON)) DisableCursor();
else EnableCursor();

cameraMode = mode;
}
@@ -385,6 +388,11 @@ void UpdateCamera(Camera *camera)
camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sinf(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cosf(cameraAngle.x)*sinf(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER);
}
}
// Update camera position with changes
camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x;
camera->position.y = ((cameraAngle.y <= 0.0f)? 1 : -1)*sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y;
camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z;

} break;
case CAMERA_ORBITAL:
@@ -395,6 +403,11 @@ void UpdateCamera(Camera *camera)
// Camera distance clamp
if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP;
// Update camera position with changes
camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x;
camera->position.y = ((cameraAngle.y <= 0.0f)? 1 : -1)*sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y;
camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z;
} break;
case CAMERA_FIRST_PERSON:
case CAMERA_THIRD_PERSON:
@@ -421,34 +434,17 @@ void UpdateCamera(Camera *camera)
cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY);
cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY);
if (cameraMode == CAMERA_THIRD_PERSON)
{
// Angle clamp
if (cameraAngle.y > CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD;
else if (cameraAngle.y < CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD;

// Camera zoom
cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY);

// Camera distance clamp
if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP;

// Camera is always looking at player
camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cosf(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sinf(cameraAngle.x);
camera->target.y = camera->position.y + CAMERA_THIRD_PERSON_OFFSET.y;
camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sinf(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sinf(cameraAngle.x);
}
else // CAMERA_FIRST_PERSON
// Angle clamp
if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD;
else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD;

// Camera is always looking at player
camera->target.x = camera->position.x - sinf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
camera->target.y = camera->position.y + sinf(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
camera->target.z = camera->position.z - cosf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
if (cameraMode == CAMERA_FIRST_PERSON)
{
// Angle clamp
if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD;
else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD;

// Camera is always looking at player
camera->target.x = camera->position.x - sinf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
camera->target.y = camera->position.y + sinf(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
camera->target.z = camera->position.z - cosf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE;
if (isMoving) swingCounter++;

// Camera position update
@@ -458,21 +454,16 @@ void UpdateCamera(Camera *camera)
camera->up.x = sinf(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER;
camera->up.z = -sinf(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER;
}
else if (cameraMode == CAMERA_THIRD_PERSON)
{
// Camera zoom
cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY);
if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP;
}
} break;
default: break;
}
// Update camera position with changes
if ((cameraMode == CAMERA_FREE) ||
(cameraMode == CAMERA_ORBITAL) ||
(cameraMode == CAMERA_THIRD_PERSON))
{
// TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target...
camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x;
if (cameraAngle.y <= 0.0f) camera->position.y = sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y;
else camera->position.y = -sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y;
camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z;
}
}

// Set camera pan key to combine with mouse movement (free camera)
@@ -482,7 +473,7 @@ void SetCameraPanControl(int panKey) { cameraPanControlKey = panKey; }
void SetCameraAltControl(int altKey) { cameraAltControlKey = altKey; }

// Set camera smooth zoom key to combine with mouse (free camera)
void SetCameraSmoothZoomControl(int szKey) { cameraSmoothZoomControlKey = szKey; }
void SetCameraSmoothZoomControl(int szoomKey) { cameraSmoothZoomControlKey = szoomKey; }

// Set camera move controls (1st person and 3rd person cameras)
void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey)

+ 5
- 3
vendor/raylib/config.h View File

@@ -25,7 +25,7 @@
*
**********************************************************************************************/

#define RAYLIB_VERSION "2.5-dev"
#define RAYLIB_VERSION "2.5"

// Edit to control what features Makefile'd raylib is compiled with
#if defined(RAYLIB_CMAKE)
@@ -43,6 +43,8 @@
// Mouse gestures are directly mapped like touches and processed by gestures system
#define SUPPORT_MOUSE_GESTURES 1
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used
//#define SUPPORT_SSH_KEYBOARD_RPI 1
//Reconfigure standard input to receive key inputs, works with SSH connection.
//#define SUPPORT_BUSY_WAIT_LOOP 1
// Wait for events passively (sleeping while no events) instead of polling them actively every frame
//#define SUPPORT_EVENTS_WAITING 1
@@ -50,6 +52,8 @@
#define SUPPORT_SCREEN_CAPTURE 1
// Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()
#define SUPPORT_GIF_RECORDING 1
// Allow scale all the drawn content to match the high-DPI equivalent size (only PLATFORM_DESKTOP)
//#define SUPPORT_HIGH_DPI 1


//------------------------------------------------------------------------------------
@@ -57,8 +61,6 @@
//------------------------------------------------------------------------------------
// Support VR simulation functionality (stereo rendering)
#define SUPPORT_VR_SIMULATOR 1
// Include stereo rendering distortion shader (shader_distortion.h)
#define SUPPORT_DISTORTION_SHADER 1


//------------------------------------------------------------------------------------

+ 84
- 0
vendor/raylib/config.h.in View File

@@ -0,0 +1,84 @@
/* config.h.in */

// core.c
/* Camera module is included (camera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital */
#cmakedefine SUPPORT_CAMERA_SYSTEM 1
/* Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag */
#cmakedefine SUPPORT_GESTURES_SYSTEM 1
/* Mouse gestures are directly mapped like touches and processed by gestures system. */
#cmakedefine SUPPORT_MOUSE_GESTURES 1
/* Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used */
#cmakedefine SUPPORT_BUSY_WAIT_LOOP 1
/* Wait for events passively (sleeping while no events) instead of polling them actively every frame */
#cmakedefine SUPPORT_EVENTS_WAITING 1
/* Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() */
#cmakedefine SUPPORT_SCREEN_CAPTURE 1
/* Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() */
#cmakedefine SUPPORT_GIF_RECORDING 1
/* Support high DPI displays */
#cmakedefine SUPPORT_HIGH_DPI 1

// rlgl.h
/* Support VR simulation functionality (stereo rendering) */
#cmakedefine SUPPORT_VR_SIMULATOR 1
/* Include stereo rendering distortion shader (shader_distortion.h) */
#cmakedefine SUPPORT_DISTORTION_SHADER 1

// shapes.c
#cmakedefine SUPPORT_FONT_TEXTURE 1
#cmakedefine SUPPORT_QUADS_DRAW_MODE 1

// textures.c
/* Selecte desired fileformats to be supported for image data loading. */
#cmakedefine SUPPORT_FILEFORMAT_PNG 1
#cmakedefine SUPPORT_FILEFORMAT_DDS 1
#cmakedefine SUPPORT_FILEFORMAT_HDR 1
#cmakedefine SUPPORT_FILEFORMAT_KTX 1
#cmakedefine SUPPORT_FILEFORMAT_ASTC 1
#cmakedefine SUPPORT_FILEFORMAT_BMP 1
#cmakedefine SUPPORT_FILEFORMAT_TGA 1
#cmakedefine SUPPORT_FILEFORMAT_JPG 1
#cmakedefine SUPPORT_FILEFORMAT_GIF 1
#cmakedefine SUPPORT_FILEFORMAT_PSD 1
#cmakedefine SUPPORT_FILEFORMAT_PKM 1
#cmakedefine SUPPORT_FILEFORMAT_PVR 1

// Support image export functionality (.png, .bmp, .tga, .jpg)
#define SUPPORT_IMAGE_EXPORT 1

/* Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT() */
#cmakedefine SUPPORT_IMAGE_MANIPULATION 1

/* Support procedural image generation functionality (gradient, spot, perlin-noise, cellular) */
#cmakedefine SUPPORT_IMAGE_GENERATION 1

// text.c
/* Default font is loaded on window initialization to be available for the user to render simple text. NOTE: If enabled, uses external module functions to load default raylib font (module: text) */
#cmakedefine SUPPORT_DEFAULT_FONT 1
/* Selected desired fileformats to be supported for loading. */
#cmakedefine SUPPORT_FILEFORMAT_FNT 1
#cmakedefine SUPPORT_FILEFORMAT_TTF 1

// models.c
/* Selected desired fileformats to be supported for loading. */
#cmakedefine SUPPORT_FILEFORMAT_OBJ 1
#cmakedefine SUPPORT_FILEFORMAT_MTL 1
/* Support procedural mesh generation functions, uses external par_shapes.h library
* NOTE: Some generated meshes DO NOT include generated texture coordinates */
#cmakedefine SUPPORT_MESH_GENERATION 1

// raudio.c
/* Desired fileformats to be supported for loading. */
#cmakedefine SUPPORT_FILEFORMAT_WAV 1
#cmakedefine SUPPORT_FILEFORMAT_OGG 1
#cmakedefine SUPPORT_FILEFORMAT_XM 1
#cmakedefine SUPPORT_FILEFORMAT_MOD 1
#cmakedefine SUPPORT_FILEFORMAT_FLAC 1

// utils.c
/* Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown */
#cmakedefine SUPPORT_TRACELOG 1
/* Support saving image data as PNG fileformat. NOTE: Requires stb_image_write library */
#cmakedefine SUPPORT_SAVE_PNG 1
/* Support saving image data as PMP fileformat. NOTE: Requires stb_image_write library */
#cmakedefine SUPPORT_SAVE_BMP 1

+ 472
- 160
vendor/raylib/core.c
File diff suppressed because it is too large
View File


+ 101
- 91
vendor/raylib/easings.h View File

@@ -1,7 +1,7 @@
/*******************************************************************************************
*
* raylib easings (header only file)
*
*
* Useful easing functions for values animation
*
* This header uses:
@@ -32,31 +32,31 @@
*
* Robert Penner License
* ---------------------------------------------------------------------------------
* Open source under the BSD License.
* Open source under the BSD License.
*
* Copyright (c) 2001 Robert Penner. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the author nor the names of contributors may be used
* to endorse or promote products derived from this software without specific
* - Neither the name of the author nor the names of contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ---------------------------------------------------------------------------------
*
@@ -90,7 +90,11 @@
#define EASEDEF extern
#endif

#include <math.h> // Required for: sin(), cos(), sqrt(), pow()
#include <math.h> // Required for: sinf(), cosf(), sqrt(), pow()

#ifndef PI
#define PI 3.14159265358979323846f //Required as PI is not always defined in math.h
#endif

#ifdef __cplusplus
extern "C" { // Prevents name mangling of functions
@@ -103,151 +107,157 @@ EASEDEF float EaseLinearOut(float t, float b, float c, float d) { return (c*t/d
EASEDEF float EaseLinearInOut(float t,float b, float c, float d) { return (c*t/d + b); }

// Sine Easing functions
EASEDEF float EaseSineIn(float t, float b, float c, float d) { return (-c*cos(t/d*(PI/2)) + c + b); }
EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sin(t/d*(PI/2)) + b); }
EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2*(cos(PI*t/d) - 1) + b); }
EASEDEF float EaseSineIn(float t, float b, float c, float d) { return (-c*cosf(t/d*(PI/2.0f)) + c + b); }
EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sinf(t/d*(PI/2.0f)) + b); }
EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2.0f*(cosf(PI*t/d) - 1.0f) + b); }

// Circular Easing functions
EASEDEF float EaseCircIn(float t, float b, float c, float d) { return (-c*(sqrt(1 - (t/=d)*t) - 1) + b); }
EASEDEF float EaseCircOut(float t, float b, float c, float d) { return (c*sqrt(1 - (t=t/d-1)*t) + b); }
EASEDEF float EaseCircInOut(float t, float b, float c, float d)
EASEDEF float EaseCircIn(float t, float b, float c, float d) { t /= d; return (-c*(sqrt(1.0f - t*t) - 1.0f) + b); }
EASEDEF float EaseCircOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*sqrt(1.0f - t*t) + b); }
EASEDEF float EaseCircInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (-c/2*(sqrt(1 - t*t) - 1) + b);
return (c/2*(sqrt(1 - t*(t-=2)) + 1) + b);
if ((t/=d/2.0f) < 1.0f) return (-c/2.0f*(sqrt(1.0f - t*t) - 1.0f) + b);
t -= 2.0f; return (c/2.0f*(sqrt(1.0f - t*t) + 1.0f) + b);
}

// Cubic Easing functions
EASEDEF float EaseCubicIn(float t, float b, float c, float d) { return (c*(t/=d)*t*t + b); }
EASEDEF float EaseCubicOut(float t, float b, float c, float d) { return (c*((t=t/d-1)*t*t + 1) + b); }
EASEDEF float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (c/2*t*t*t + b);
return (c/2*((t-=2)*t*t + 2) + b);
EASEDEF float EaseCubicIn(float t, float b, float c, float d) { t /= d; return (c*t*t*t + b); }
EASEDEF float EaseCubicOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*(t*t*t + 1.0f) + b); }
EASEDEF float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t/=d/2.0f) < 1.0f) return (c/2.0f*t*t*t + b);
t -= 2.0f; return (c/2.0f*(t*t*t + 2.0f) + b);
}

// Quadratic Easing functions
EASEDEF float EaseQuadIn(float t, float b, float c, float d) { return (c*(t/=d)*t + b); }
EASEDEF float EaseQuadOut(float t, float b, float c, float d) { return (-c*(t/=d)*(t-2) + b); }
EASEDEF float EaseQuadInOut(float t, float b, float c, float d)
EASEDEF float EaseQuadIn(float t, float b, float c, float d) { t /= d; return (c*t*t + b); }
EASEDEF float EaseQuadOut(float t, float b, float c, float d) { t /= d; return (-c*t*(t - 2.0f) + b); }
EASEDEF float EaseQuadInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (((c/2)*(t*t)) + b);
return (-c/2*(((t-2)*(--t)) - 1) + b);
return (-c/2.0f*(((t - 1.0f)*(t - 3.0f)) - 1.0f) + b);
}

// Exponential Easing functions
EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0) ? b : (c*pow(2, 10*(t/d - 1)) + b); }
EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-pow(2, -10*t/d) + 1) + b); }
EASEDEF float EaseExpoInOut(float t, float b, float c, float d)
EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0.0f) ? b : (c*pow(2.0f, 10.0f*(t/d - 1.0f)) + b); }
EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-pow(2.0f, -10.0f*t/d) + 1.0f) + b); }
EASEDEF float EaseExpoInOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if (t == 0.0f) return b;
if (t == d) return (b + c);
if ((t/=d/2) < 1) return (c/2*pow(2, 10*(t - 1)) + b);
return (c/2*(-pow(2, -10*--t) + 2) + b);
if ((t/=d/2.0f) < 1.0f) return (c/2.0f*pow(2.0f, 10.0f*(t - 1.0f)) + b);
return (c/2.0f*(-pow(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b);
}

// Back Easing functions
EASEDEF float EaseBackIn(float t, float b, float c, float d)
EASEDEF float EaseBackIn(float t, float b, float c, float d)
{
float s = 1.70158f;
float postFix = t/=d;
return (c*(postFix)*t*((s + 1)*t - s) + b);
return (c*(postFix)*t*((s + 1.0f)*t - s) + b);
}

EASEDEF float EaseBackOut(float t, float b, float c, float d)
{
{
float s = 1.70158f;
return (c*((t=t/d-1)*t*((s + 1)*t + s) + 1) + b);
t = t/d - 1.0f;
return (c*(t*t*((s + 1.0f)*t + s) + 1.0f) + b);
}

EASEDEF float EaseBackInOut(float t, float b, float c, float d)
{
float s = 1.70158f;
if ((t/=d/2) < 1) return (c/2*(t*t*(((s*=(1.525f)) + 1)*t - s)) + b);
float postFix = t-=2;
return (c/2*((postFix)*t*(((s*=(1.525f)) + 1)*t + s) + 2) + b);
if ((t/=d/2.0f) < 1.0f)
{
s *= 1.525f;
return (c/2.0f*(t*t*((s + 1.0f)*t - s)) + b);
}

float postFix = t-=2.0f;
s *= 1.525f;
return (c/2.0f*((postFix)*t*((s + 1.0f)*t + s) + 2.0f) + b);
}

// Bounce Easing functions
EASEDEF float EaseBounceOut(float t, float b, float c, float d)
EASEDEF float EaseBounceOut(float t, float b, float c, float d)
{
if ((t/=d) < (1/2.75f))
if ((t/=d) < (1.0f/2.75f))
{
return (c*(7.5625f*t*t) + b);
}
else if (t < (2/2.75f))
}
else if (t < (2.0f/2.75f))
{
float postFix = t-=(1.5f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.75f) + b);
}
else if (t < (2.5/2.75))
}
else if (t < (2.5/2.75))
{
float postFix = t-=(2.25f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.9375f) + b);
}
else
}
else
{
float postFix = t-=(2.625f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.984375f) + b);
}
}

EASEDEF float EaseBounceIn(float t, float b, float c, float d) { return (c - EaseBounceOut(d-t, 0, c, d) + b); }
EASEDEF float EaseBounceInOut(float t, float b, float c, float d)
EASEDEF float EaseBounceIn(float t, float b, float c, float d) { return (c - EaseBounceOut(d - t, 0.0f, c, d) + b); }
EASEDEF float EaseBounceInOut(float t, float b, float c, float d)
{
if (t < d/2) return (EaseBounceIn(t*2, 0, c, d)*0.5f + b);
else return (EaseBounceOut(t*2-d, 0, c, d)*0.5f + c*0.5f + b);
if (t < d/2.0f) return (EaseBounceIn(t*2.0f, 0.0f, c, d)*0.5f + b);
else return (EaseBounceOut(t*2.0f - d, 0.0f, c, d)*0.5f + c*0.5f + b);
}

// Elastic Easing functions
EASEDEF float EaseElasticIn(float t, float b, float c, float d)
EASEDEF float EaseElasticIn(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d) == 1) return (b + c);
if (t == 0.0f) return b;
if ((t/=d) == 1.0f) return (b + c);
float p = d*0.3f;
float a = c;
float s = p/4;
float postFix = a*pow(2, 10*(t-=1));
return (-(postFix*sin((t*d-s)*(2*PI)/p )) + b);
float a = c;
float s = p/4.0f;
float postFix = a*pow(2.0f, 10.0f*(t-=1.0f));
return (-(postFix*sinf((t*d-s)*(2.0f*PI)/p )) + b);
}

EASEDEF float EaseElasticOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d) == 1) return (b + c);
if (t == 0.0f) return b;
if ((t/=d) == 1.0f) return (b + c);
float p = d*0.3f;
float a = c;
float s = p/4;
return (a*pow(2,-10*t)*sin((t*d-s)*(2*PI)/p) + c + b);
float a = c;
float s = p/4.0f;
return (a*pow(2.0f,-10.0f*t)*sinf((t*d-s)*(2.0f*PI)/p) + c + b);
}

EASEDEF float EaseElasticInOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d/2) == 2) return (b + c);
if (t == 0.0f) return b;
if ((t/=d/2.0f) == 2.0f) return (b + c);
float p = d*(0.3f*1.5f);
float a = c;
float s = p/4;
float s = p/4.0f;

if (t < 1)
if (t < 1.0f)
{
float postFix = a*pow(2, 10*(t-=1));
return -0.5f*(postFix*sin((t*d-s)*(2*PI)/p)) + b;
float postFix = a*pow(2.0f, 10.0f*(t-=1.0f));
return -0.5f*(postFix*sinf((t*d-s)*(2.0f*PI)/p)) + b;
}
float postFix = a*pow(2, -10*(t-=1));
return (postFix*sin((t*d-s)*(2*PI)/p)*0.5f + c + b);
float postFix = a*pow(2.0f, -10.0f*(t-=1.0f));
return (postFix*sinf((t*d-s)*(2.0f*PI)/p)*0.5f + c + b);
}

#ifdef __cplusplus
}
#endif

#endif // EASINGS_H
#endif // EASINGS_H

+ 5
- 0
vendor/raylib/external/ANGLE/EGL/eglplatform.h View File

@@ -74,11 +74,16 @@
//#include <windows.h>

// raylib edit!!!
#ifndef PLATFORM_UWP
typedef void *PVOID; // PVOID is a pointer to any type. This type is declared in WinNT.h
typedef PVOID HANDLE; // HANDLE is handle to an object. This type is declared in WinNT.h
typedef HANDLE HWND; // HWND is a handle to a window. This type is declared in WinDef.h
typedef HANDLE HDC; // HDC is a handle to a device context (DC). This type is declared in WinDef.h
typedef HANDLE HBITMAP; // HBITMAP is a handle to a bitmap. This type is declared in WinDef.h
#else
//UWP Fix
#include "Windows.h"
#endif

// HDC, HBITMAP and HWND are actually pointers to void. You can cast a long to a HWND like this: HWND h = (HWND)my_long_var;
// but very careful of what information is stored in my_long_var. You have to make sure that you have a pointer in there.

+ 2
- 2
vendor/raylib/external/cgltf.h View File

@@ -369,7 +369,7 @@ typedef struct cgltf_light {
cgltf_float spot_outer_cone_angle;
} cgltf_light;

typedef struct cgltf_node {
struct cgltf_node {
char* name;
cgltf_node* parent;
cgltf_node** children;
@@ -388,7 +388,7 @@ typedef struct cgltf_node {
cgltf_float rotation[4];
cgltf_float scale[3];
cgltf_float matrix[16];
} cgltf_node;
};

typedef struct cgltf_scene {
char* name;

+ 4749
- 1741
vendor/raylib/external/dr_flac.h
File diff suppressed because it is too large
View File


+ 1288
- 551
vendor/raylib/external/dr_mp3.h
File diff suppressed because it is too large
View File


+ 2200
- 1053
vendor/raylib/external/dr_wav.h
File diff suppressed because it is too large
View File


+ 0
- 13
vendor/raylib/external/glfw/CMake/amd64-mingw32msvc.cmake View File

@@ -1,13 +0,0 @@
# Define the environment for cross compiling from Linux to Win64
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc")
SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++")
SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres")
SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib")

# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 0
- 13
vendor/raylib/external/glfw/CMake/i586-mingw32msvc.cmake View File

@@ -1,13 +0,0 @@
# Define the environment for cross compiling from Linux to Win32
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib")

# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 0
- 13
vendor/raylib/external/glfw/CMake/i686-pc-mingw32.cmake View File

@@ -1,13 +0,0 @@
# Define the environment for cross compiling from Linux to Win32
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc")
SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++")
SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres")
SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib")

#Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 13
- 0
vendor/raylib/external/glfw/CMake/i686-w64-mingw32-clang.cmake View File

@@ -0,0 +1,13 @@
# Define the environment for cross-compiling with 32-bit MinGW-w64 Clang
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang")
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++")
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")

# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 1
- 1
vendor/raylib/external/glfw/CMake/i686-w64-mingw32.cmake View File

@@ -1,4 +1,4 @@
# Define the environment for cross compiling from Linux to Win32
# Define the environment for cross-compiling with 32-bit MinGW-w64 GCC
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")

+ 0
- 41
vendor/raylib/external/glfw/CMake/modules/FindVulkan.cmake View File

@@ -1,41 +0,0 @@
# Find Vulkan
#
# VULKAN_INCLUDE_DIR
# VULKAN_LIBRARY
# VULKAN_FOUND

if (WIN32)
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
"$ENV{VULKAN_SDK}/Include"
"$ENV{VK_SDK_PATH}/Include")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
"$ENV{VULKAN_SDK}/Lib"
"$ENV{VULKAN_SDK}/Bin"
"$ENV{VK_SDK_PATH}/Bin")
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
"$ENV{VULKAN_SDK}/Lib"
"$ENV{VULKAN_SDK}/Bin"
"$ENV{VK_SDK_PATH}/Bin")
else()
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
"$ENV{VULKAN_SDK}/Lib32"
"$ENV{VULKAN_SDK}/Bin32"
"$ENV{VK_SDK_PATH}/Bin32")
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
"$ENV{VULKAN_SDK}/Lib32"
"$ENV{VULKAN_SDK}/Bin32"
"$ENV{VK_SDK_PATH}/Bin32")
endif()
else()
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
"$ENV{VULKAN_SDK}/include")
find_library(VULKAN_LIBRARY NAMES vulkan HINTS
"$ENV{VULKAN_SDK}/lib")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR)

mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY)


+ 13
- 0
vendor/raylib/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake View File

@@ -0,0 +1,13 @@
# Define the environment for cross-compiling with 64-bit MinGW-w64 Clang
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang")
SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++")
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")

# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 1
- 1
vendor/raylib/external/glfw/CMake/x86_64-w64-mingw32.cmake View File

@@ -1,4 +1,4 @@
# Define the environment for cross compiling from Linux to Win32
# Define the environment for cross-compiling with 64-bit MinGW-w64 GCC
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")

+ 14
- 21
vendor/raylib/external/glfw/CMakeLists.txt View File

@@ -10,7 +10,7 @@ endif()

set(GLFW_VERSION_MAJOR "3")
set(GLFW_VERSION_MINOR "3")
set(GLFW_VERSION_PATCH "0")
set(GLFW_VERSION_PATCH "1")
set(GLFW_VERSION_EXTRA "")
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
@@ -22,7 +22,7 @@ option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
option(GLFW_INSTALL "Generate installation target" ON)
option(GLFW_VULKAN_STATIC "Use the Vulkan loader statically linked into application" OFF)
option(GLFW_VULKAN_STATIC "Assume the Vulkan loader is linked with the application" OFF)

include(GNUInstallDirs)

@@ -54,13 +54,17 @@ else()
endif()

if (GLFW_VULKAN_STATIC)
if (BUILD_SHARED_LIBS)
# If you absolutely must do this, remove this line and add the Vulkan
# loader static library via the CMAKE_SHARED_LINKER_FLAGS
message(FATAL_ERROR "You are trying to link the Vulkan loader static library into the GLFW shared library")
endif()
set(_GLFW_VULKAN_STATIC 1)
endif()

list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")

find_package(Threads REQUIRED)
find_package(Vulkan)

if (GLFW_BUILD_DOCS)
set(DOXYGEN_SKIP_DOT TRUE)
@@ -157,24 +161,6 @@ else()
message(FATAL_ERROR "No supported platform was detected")
endif()

#--------------------------------------------------------------------
# Add Vulkan static library if requested
#--------------------------------------------------------------------
if (GLFW_VULKAN_STATIC)
if (VULKAN_FOUND AND VULKAN_STATIC_LIBRARY)
list(APPEND glfw_LIBRARIES "${VULKAN_STATIC_LIBRARY}")
if (BUILD_SHARED_LIBS)