Merge branch 'raysan5:master' into master

This commit is contained in:
Sergei Baigerov 2024-02-23 14:39:49 +08:00 committed by GitHub
commit 5c67ab8780
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 9 deletions

View File

@ -2,7 +2,7 @@
include(CMakeDependentOption) include(CMakeDependentOption)
include(EnumOption) include(EnumOption)
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM" "Platform to build for.") enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?") enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")

View File

@ -91,6 +91,11 @@ elseif ("${PLATFORM}" MATCHES "DRM")
endif () endif ()
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl) set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
elseif ("${PLATFORM}" MATCHES "SDL")
find_package(SDL2 REQUIRED)
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL2::SDL2)
endif () endif ()
if (NOT ${OPENGL_VERSION} MATCHES "OFF") if (NOT ${OPENGL_VERSION} MATCHES "OFF")

View File

@ -71,8 +71,8 @@ USE_EXTERNAL_GLFW ?= FALSE
# PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally # PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
# WARNING: Library is not included in raylib, it MUST be configured by users # WARNING: Library is not included in raylib, it MUST be configured by users
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/include SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/lib/x64 SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system) # Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
# NOTE: This variable is only used for PLATFORM_OS: LINUX # NOTE: This variable is only used for PLATFORM_OS: LINUX

View File

@ -55,7 +55,6 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: anytype, optim
exe.linkSystemLibrary("winmm"); exe.linkSystemLibrary("winmm");
exe.linkSystemLibrary("gdi32"); exe.linkSystemLibrary("gdi32");
exe.linkSystemLibrary("opengl32"); exe.linkSystemLibrary("opengl32");
exe.addIncludePath(.{ .path = "external/glfw/deps/mingw" });
exe.defineCMacro("PLATFORM_DESKTOP", null); exe.defineCMacro("PLATFORM_DESKTOP", null);
}, },

View File

@ -438,7 +438,7 @@ INCLUDE_PATHS = -I.
# Define additional directories containing required header files # Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
INCLUDE_PATHS += -Iexternal/glfw/include -Iexternal/glfw/deps/mingw INCLUDE_PATHS += -Iexternal/glfw/include
ifeq ($(PLATFORM_OS),BSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
endif endif
@ -447,7 +447,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH) INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
endif endif
ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM),PLATFORM_WEB)
INCLUDE_PATHS += -Iexternal/glfw/include -Iexternal/glfw/deps/mingw INCLUDE_PATHS += -Iexternal/glfw/include
endif endif
ifeq ($(PLATFORM),PLATFORM_DRM) ifeq ($(PLATFORM),PLATFORM_DRM)
INCLUDE_PATHS += -I/usr/include/libdrm INCLUDE_PATHS += -I/usr/include/libdrm

View File

@ -97,7 +97,6 @@ pub fn addRaylib(b: *std.Build, target: anytype, optimize: std.builtin.OptimizeM
raylib.linkSystemLibrary("winmm"); raylib.linkSystemLibrary("winmm");
raylib.linkSystemLibrary("gdi32"); raylib.linkSystemLibrary("gdi32");
raylib.linkSystemLibrary("opengl32"); raylib.linkSystemLibrary("opengl32");
raylib.addIncludePath(.{ .path = "external/glfw/deps/mingw" });
raylib.defineCMacro("PLATFORM_DESKTOP", null); raylib.defineCMacro("PLATFORM_DESKTOP", null);
}, },

View File

@ -5368,7 +5368,7 @@ static bool GetPoseAtTimeGLTF(cgltf_accessor *input, cgltf_accessor *output, flo
} }
} }
float t = (time - tstart)/(tend - tstart); float t = (time - tstart)/fmax((tend - tstart), EPSILON);
t = (t < 0.0f)? 0.0f : t; t = (t < 0.0f)? 0.0f : t;
t = (t > 1.0f)? 1.0f : t; t = (t > 1.0f)? 1.0f : t;
@ -5506,7 +5506,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo
strncpy(animations[i].name, animData.name, sizeof(animations[i].name)); strncpy(animations[i].name, animData.name, sizeof(animations[i].name));
animations[i].name[sizeof(animations[i].name) - 1] = '\0'; animations[i].name[sizeof(animations[i].name) - 1] = '\0';
animations[i].frameCount = (int)(animDuration*1000.0f/GLTF_ANIMDELAY); animations[i].frameCount = (int)(animDuration*1000.0f/GLTF_ANIMDELAY) + 1;
animations[i].framePoses = RL_MALLOC(animations[i].frameCount*sizeof(Transform *)); animations[i].framePoses = RL_MALLOC(animations[i].frameCount*sizeof(Transform *));
for (int j = 0; j < animations[i].frameCount; j++) for (int j = 0; j < animations[i].frameCount; j++)