Merge remote-tracking branch 'origin' into screen-space-related-functions-consistency

This commit is contained in:
aiaf 2024-02-25 09:40:24 +02:00
commit 946593c6f3
34 changed files with 523 additions and 460 deletions

View File

@ -88,13 +88,9 @@ jobs:
path: ./build/${{ env.RELEASE_NAME }}.tar.gz path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release - name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1 uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'

View File

@ -36,7 +36,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Create Build Environment - name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory # Some projects don't allow in-source building, so create a separate build directory
@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Create Build Environment - name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory # Some projects don't allow in-source building, so create a separate build directory

View File

@ -44,7 +44,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive

View File

@ -100,12 +100,9 @@ jobs:
path: ./build/${{ env.RELEASE_NAME }}.tar.gz path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release - name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1 uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'

View File

@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Environment - name: Setup Environment
run: | run: |

View File

@ -105,12 +105,9 @@ jobs:
path: ./build/${{ env.RELEASE_NAME }}.tar.gz path: ./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release - name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1 uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.tar.gz
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Update parse files - name: Update parse files
working-directory: parser working-directory: parser

View File

@ -27,9 +27,9 @@ jobs:
uses: actions/checkout@master uses: actions/checkout@master
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v12 uses: mymindstorm/setup-emsdk@v14
with: with:
version: 3.1.30 version: 3.1.54
actions-cache-folder: 'emsdk-cache' actions-cache-folder: 'emsdk-cache'
- name: Setup Release Version - name: Setup Release Version
@ -75,12 +75,9 @@ jobs:
path: ./build/${{ env.RELEASE_NAME }}.zip path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release - name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1 uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.zip
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'

View File

@ -74,7 +74,7 @@ jobs:
# Setup MSBuild.exe path if required # Setup MSBuild.exe path if required
- name: Setup MSBuild - name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1 uses: microsoft/setup-msbuild@v2
if: matrix.compiler == 'msvc16' if: matrix.compiler == 'msvc16'
- name: Build Library (MinGW-w64 32bit) - name: Build Library (MinGW-w64 32bit)
@ -139,12 +139,9 @@ jobs:
path: ./build/${{ env.RELEASE_NAME }}.zip path: ./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release - name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1 uses: softprops/action-gh-release@v1
with:
files: ./build/${{ env.RELEASE_NAME }}.zip
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
asset_name: ${{ env.RELEASE_NAME }}.zip
asset_content_type: application/zip
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'

View File

@ -22,7 +22,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Add MSBuild to PATH - name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1 uses: microsoft/setup-msbuild@v1

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

@ -13,7 +13,7 @@
#include "raylib.h" #include "raylib.h"
#define NUM_TEXTURES 9 // Currently we have 8 generation algorithms but some are have multiple purposes (Linear and Square Gradients) #define NUM_TEXTURES 9 // Currently we have 8 generation algorithms but some have multiple purposes (Linear and Square Gradients)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Program main entry point // Program main entry point

View File

@ -4918,6 +4918,25 @@
} }
] ]
}, },
{
"name": "SetGamepadVibration",
"description": "Set gamepad vibration for both motors",
"returnType": "void",
"params": [
{
"type": "int",
"name": "gamepad"
},
{
"type": "float",
"name": "leftMotor"
},
{
"type": "float",
"name": "rightMotor"
}
]
},
{ {
"name": "IsMouseButtonPressed", "name": "IsMouseButtonPressed",
"description": "Check if a mouse button has been pressed once", "description": "Check if a mouse button has been pressed once",

View File

@ -4342,6 +4342,16 @@ return {
{type = "const char *", name = "mappings"} {type = "const char *", name = "mappings"}
} }
}, },
{
name = "SetGamepadVibration",
description = "Set gamepad vibration for both motors",
returnType = "void",
params = {
{type = "int", name = "gamepad"},
{type = "float", name = "leftMotor"},
{type = "float", name = "rightMotor"}
}
},
{ {
name = "IsMouseButtonPressed", name = "IsMouseButtonPressed",
description = "Check if a mouse button has been pressed once", description = "Check if a mouse button has been pressed once",

File diff suppressed because it is too large Load Diff

View File

@ -669,7 +669,7 @@
<Param type="unsigned int" name="frames" desc="" /> <Param type="unsigned int" name="frames" desc="" />
</Callback> </Callback>
</Callbacks> </Callbacks>
<Functions count="559"> <Functions count="560">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context"> <Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" /> <Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" /> <Param type="int" name="height" desc="" />
@ -1193,6 +1193,11 @@
<Function name="SetGamepadMappings" retType="int" paramCount="1" desc="Set internal gamepad mappings (SDL_GameControllerDB)"> <Function name="SetGamepadMappings" retType="int" paramCount="1" desc="Set internal gamepad mappings (SDL_GameControllerDB)">
<Param type="const char *" name="mappings" desc="" /> <Param type="const char *" name="mappings" desc="" />
</Function> </Function>
<Function name="SetGamepadVibration" retType="void" paramCount="3" desc="Set gamepad vibration for both motors">
<Param type="int" name="gamepad" desc="" />
<Param type="float" name="leftMotor" desc="" />
<Param type="float" name="rightMotor" desc="" />
</Function>
<Function name="IsMouseButtonPressed" retType="bool" paramCount="1" desc="Check if a mouse button has been pressed once"> <Function name="IsMouseButtonPressed" retType="bool" paramCount="1" desc="Check if a mouse button has been pressed once">
<Param type="int" name="button" desc="" /> <Param type="int" name="button" desc="" />
</Function> </Function>

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

@ -81,6 +81,7 @@
#define MAX_GAMEPADS 4 // Maximum number of gamepads supported #define MAX_GAMEPADS 4 // Maximum number of gamepads supported
#define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad) #define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad)
#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad) #define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad)
#define MAX_GAMEPAD_VIBRATION_TIME 2.0f // Maximum vibration time in seconds
#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported #define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported
#define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue #define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue
#define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue #define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue

View File

@ -613,6 +613,12 @@ int SetGamepadMappings(const char *mappings)
return 0; return 0;
} }
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform");
}
// Set mouse position XY // Set mouse position XY
void SetMousePosition(int x, int y) void SetMousePosition(int x, int y)
{ {

View File

@ -1050,6 +1050,12 @@ int SetGamepadMappings(const char *mappings)
return glfwUpdateGamepadMappings(mappings); return glfwUpdateGamepadMappings(mappings);
} }
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform");
}
// Set mouse position XY // Set mouse position XY
void SetMousePosition(int x, int y) void SetMousePosition(int x, int y)
{ {

View File

@ -938,6 +938,21 @@ int SetGamepadMappings(const char *mappings)
return SDL_GameControllerAddMapping(mappings); return SDL_GameControllerAddMapping(mappings);
} }
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
//Limit input values to between 0.0f and 1.0f
leftMotor = (0.0f > leftMotor) ? 0.0f : leftMotor;
rightMotor = (0.0f > rightMotor) ? 0.0f : rightMotor;
leftMotor = (1.0f < leftMotor) ? 1.0f : leftMotor;
rightMotor = (1.0f < rightMotor) ? 1.0f : rightMotor;
if (IsGamepadAvailable(gamepad))
{
SDL_JoystickRumble(platform.gamepad[gamepad], (Uint16)(leftMotor*65535.0f), (Uint16)(rightMotor*65535.0f), (Uint32)(MAX_GAMEPAD_VIBRATION_TIME*1000.0f));
}
}
// Set mouse position XY // Set mouse position XY
void SetMousePosition(int x, int y) void SetMousePosition(int x, int y)
{ {

View File

@ -519,6 +519,12 @@ int SetGamepadMappings(const char *mappings)
return 0; return 0;
} }
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform");
}
// Set mouse position XY // Set mouse position XY
void SetMousePosition(int x, int y) void SetMousePosition(int x, int y)
{ {

View File

@ -850,6 +850,12 @@ int SetGamepadMappings(const char *mappings)
return 0; return 0;
} }
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform");
}
// Set mouse position XY // Set mouse position XY
void SetMousePosition(int x, int y) void SetMousePosition(int x, int y)
{ {

View File

@ -1162,16 +1162,17 @@ RLAPI int GetCharPressed(void); // Get char presse
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
// Input-related functions: gamepads // Input-related functions: gamepads
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor); // Set gamepad vibration for both motors
// Input-related functions: mouse // Input-related functions: mouse
RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once

View File

@ -224,6 +224,9 @@ __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigne
#ifndef MAX_GAMEPAD_BUTTONS #ifndef MAX_GAMEPAD_BUTTONS
#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad) #define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad)
#endif #endif
#ifndef MAX_GAMEPAD_VIBRATION_TIME
#define MAX_GAMEPAD_VIBRATION_TIME 2.0f // Maximum vibration time in seconds
#endif
#ifndef MAX_TOUCH_POINTS #ifndef MAX_TOUCH_POINTS
#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported #define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported
#endif #endif
@ -1694,7 +1697,6 @@ void WaitTime(double seconds)
// NOTE: Functions with a platform-specific implementation on rcore_<platform>.c // NOTE: Functions with a platform-specific implementation on rcore_<platform>.c
//void OpenURL(const char *url) //void OpenURL(const char *url)
// Set the seed for the random number generator // Set the seed for the random number generator
void SetRandomSeed(unsigned int seed) void SetRandomSeed(unsigned int seed)
{ {

View File

@ -120,7 +120,6 @@
#define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) #define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)
#endif #endif
// Function specifiers definition // Function specifiers definition
#ifndef RLAPI #ifndef RLAPI
#define RLAPI // Functions defined as 'extern' by default (implicit specifiers) #define RLAPI // Functions defined as 'extern' by default (implicit specifiers)
@ -3412,7 +3411,6 @@ void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int
#endif #endif
} }
// Read texture pixel data // Read texture pixel data
void *rlReadTexturePixels(unsigned int id, int width, int height, int format) void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
{ {

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++)

View File

@ -71,7 +71,6 @@
#define SPLINE_SEGMENT_DIVISIONS 24 // Spline segment divisions #define SPLINE_SEGMENT_DIVISIONS 24 // Spline segment divisions
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Types and Structures Definition // Types and Structures Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

View File

@ -1112,7 +1112,6 @@ bool ExportFontAsCode(Font font, const char *fileName)
return success; return success;
} }
// Draw current FPS // Draw current FPS
// NOTE: Uses default font // NOTE: Uses default font
void DrawFPS(int posX, int posY) void DrawFPS(int posX, int posY)
@ -1438,7 +1437,6 @@ const char *TextFormat(const char *text, ...)
return currentBuffer; return currentBuffer;
} }
// Get integer value from text // Get integer value from text
// NOTE: This function replaces atoi() [stdlib.h] // NOTE: This function replaces atoi() [stdlib.h]
int TextToInteger(const char *text) int TextToInteger(const char *text)

View File

@ -1648,7 +1648,6 @@ void ImageResizeNN(Image *image,int newWidth,int newHeight)
UnloadImageColors(pixels); UnloadImageColors(pixels);
} }
// Resize and image to new size // Resize and image to new size
// NOTE: Uses stb default scaling filters (both bicubic): // NOTE: Uses stb default scaling filters (both bicubic):
// STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM // STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM
@ -2102,7 +2101,6 @@ void ImageBlurGaussian(Image *image, int blurSize) {
} }
} }
// Reverse premultiply // Reverse premultiply
for (int i = 0; i < (image->width)*(image->height); i++) for (int i = 0; i < (image->width)*(image->height); i++)
{ {
@ -2152,7 +2150,6 @@ void ImageKernelConvolution(Image *image, float* kernel, int kernelSize)
Vector4 *imageCopy2 = RL_MALLOC((image->height)*(image->width)*sizeof(Vector4)); Vector4 *imageCopy2 = RL_MALLOC((image->height)*(image->width)*sizeof(Vector4));
Vector4 *temp = RL_MALLOC(kernelSize*sizeof(Vector4)); Vector4 *temp = RL_MALLOC(kernelSize*sizeof(Vector4));
for (int i = 0; i < kernelSize; i++) for (int i = 0; i < kernelSize; i++)
{ {
temp[i].x = 0.0f; temp[i].x = 0.0f;