Fixed some typos.
This commit is contained in:
parent
3b5b6ccd18
commit
2ede3d2cf9
16
src/config.h
16
src/config.h
|
|
@ -65,7 +65,7 @@
|
||||||
// Support automatic generated events, loading and recording of those events when required
|
// Support automatic generated events, loading and recording of those events when required
|
||||||
//#define SUPPORT_EVENTS_AUTOMATION 1
|
//#define SUPPORT_EVENTS_AUTOMATION 1
|
||||||
// Support custom frame control, only for advance users
|
// Support custom frame control, only for advance users
|
||||||
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
|
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
|
||||||
// Enabling this flag allows manual control of the frame processes, use at your own risk
|
// Enabling this flag allows manual control of the frame processes, use at your own risk
|
||||||
//#define SUPPORT_CUSTOM_FRAME_CONTROL 1
|
//#define SUPPORT_CUSTOM_FRAME_CONTROL 1
|
||||||
|
|
||||||
|
|
@ -110,12 +110,12 @@
|
||||||
|
|
||||||
// Default shader vertex attribute names to set location points
|
// Default shader vertex attribute names to set location points
|
||||||
// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
|
// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Binded by default to shader location: 0
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Binded by default to shader location: 1
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Binded by default to shader location: 2
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Binded by default to shader location: 3
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Binded by default to shader location: 4
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
|
||||||
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Binded by default to shader location: 5
|
#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: 5
|
||||||
|
|
||||||
#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
|
#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
|
||||||
#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
|
#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Module: rtextures - Configuration Flags
|
// Module: rtextures - Configuration Flags
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Selecte desired fileformats to be supported for image data loading
|
// Select the desired fileformats to be supported for image data loading
|
||||||
#define SUPPORT_FILEFORMAT_PNG 1
|
#define SUPPORT_FILEFORMAT_PNG 1
|
||||||
//#define SUPPORT_FILEFORMAT_BMP 1
|
//#define SUPPORT_FILEFORMAT_BMP 1
|
||||||
//#define SUPPORT_FILEFORMAT_TGA 1
|
//#define SUPPORT_FILEFORMAT_TGA 1
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ void InitAudioDevice(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mixing happens on a seperate thread which means we need to synchronize. I'm using a mutex here to make things simple, but may
|
// Mixing happens on a separate thread which means we need to synchronize. I'm using a mutex here to make things simple, but may
|
||||||
// want to look at something a bit smarter later on to keep everything real-time, if that's necessary.
|
// want to look at something a bit smarter later on to keep everything real-time, if that's necessary.
|
||||||
if (ma_mutex_init(&AUDIO.System.lock) != MA_SUCCESS)
|
if (ma_mutex_init(&AUDIO.System.lock) != MA_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|
@ -2107,8 +2107,8 @@ void UnloadAudioStream(AudioStream stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update audio stream buffers with data
|
// Update audio stream buffers with data
|
||||||
// NOTE 1: Only updates one buffer of the stream source: unqueue -> update -> queue
|
// NOTE 1: Only updates one buffer of the stream source: dequeue -> update -> queue
|
||||||
// NOTE 2: To unqueue a buffer it needs to be processed: IsAudioStreamProcessed()
|
// NOTE 2: To dequeue a buffer it needs to be processed: IsAudioStreamProcessed()
|
||||||
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount)
|
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount)
|
||||||
{
|
{
|
||||||
if (stream.buffer != NULL)
|
if (stream.buffer != NULL)
|
||||||
|
|
|
||||||
|
|
@ -842,7 +842,7 @@ typedef enum {
|
||||||
CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces
|
CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces
|
||||||
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
|
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
|
||||||
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
|
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
|
||||||
CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map)
|
CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirrectangular map)
|
||||||
} CubemapLayout;
|
} CubemapLayout;
|
||||||
|
|
||||||
// Font type, defines generation method
|
// Font type, defines generation method
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ void SetCameraMoveControls(int keyFront, int keyBack,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Camera mouse movement sensitivity
|
// Camera mouse movement sensitivity
|
||||||
#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.5f // TODO: it should be independant of framerate
|
#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.5f // TODO: it should be independent of framerate
|
||||||
#define CAMERA_MOUSE_SCROLL_SENSITIVITY 1.5f
|
#define CAMERA_MOUSE_SCROLL_SENSITIVITY 1.5f
|
||||||
|
|
||||||
// FREE_CAMERA
|
// FREE_CAMERA
|
||||||
|
|
|
||||||
20
src/rcore.c
20
src/rcore.c
|
|
@ -1317,7 +1317,7 @@ void MaximizeWindow(void)
|
||||||
void MinimizeWindow(void)
|
void MinimizeWindow(void)
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
// NOTE: Following function launches callback that sets appropiate flag!
|
// NOTE: Following function launches callback that sets appropriate flag!
|
||||||
glfwIconifyWindow(CORE.Window.handle);
|
glfwIconifyWindow(CORE.Window.handle);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -2481,10 +2481,10 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode)
|
||||||
|
|
||||||
shader.locs = (int *)RL_CALLOC(RL_MAX_SHADER_LOCATIONS, sizeof(int));
|
shader.locs = (int *)RL_CALLOC(RL_MAX_SHADER_LOCATIONS, sizeof(int));
|
||||||
|
|
||||||
// All locations reseted to -1 (no location)
|
// All locations reset to -1 (no location)
|
||||||
for (int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1;
|
for (int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1;
|
||||||
|
|
||||||
// Get handles to GLSL input attibute locations
|
// Get handles to GLSL input attribute locations
|
||||||
shader.locs[SHADER_LOC_VERTEX_POSITION] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION);
|
shader.locs[SHADER_LOC_VERTEX_POSITION] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION);
|
||||||
shader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD);
|
shader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD);
|
||||||
shader.locs[SHADER_LOC_VERTEX_TEXCOORD02] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2);
|
shader.locs[SHADER_LOC_VERTEX_TEXCOORD02] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2);
|
||||||
|
|
@ -2552,7 +2552,7 @@ void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniform
|
||||||
{
|
{
|
||||||
rlEnableShader(shader.id);
|
rlEnableShader(shader.id);
|
||||||
rlSetUniform(locIndex, value, uniformType, count);
|
rlSetUniform(locIndex, value, uniformType, count);
|
||||||
//rlDisableShader(); // Avoid reseting current shader program, in case other uniforms are set
|
//rlDisableShader(); // Avoid resetting current shader program, in case other uniforms are set
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2617,7 +2617,7 @@ Ray GetMouseRay(Vector2 mouse, Camera camera)
|
||||||
Vector3 farPoint = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView);
|
Vector3 farPoint = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView);
|
||||||
|
|
||||||
// Unproject the mouse cursor in the near plane.
|
// Unproject the mouse cursor in the near plane.
|
||||||
// We need this as the source position because orthographic projects, compared to perspect doesn't have a
|
// We need this as the source position because orthographic projects, compared to perspective doesn't have a
|
||||||
// convergence point, meaning that the "eye" of the camera is more like a plane than a point.
|
// convergence point, meaning that the "eye" of the camera is more like a plane than a point.
|
||||||
Vector3 cameraPlanePointerPos = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, -1.0f }, matProj, matView);
|
Vector3 cameraPlanePointerPos = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, -1.0f }, matProj, matView);
|
||||||
|
|
||||||
|
|
@ -3928,7 +3928,7 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
CORE.Window.screenScale = MatrixIdentity(); // No draw scaling required by default
|
CORE.Window.screenScale = MatrixIdentity(); // No draw scaling required by default
|
||||||
|
|
||||||
// NOTE: Framebuffer (render area - CORE.Window.render.width, CORE.Window.render.height) could include black bars...
|
// NOTE: Framebuffer (render area - CORE.Window.render.width, CORE.Window.render.height) could include black bars...
|
||||||
// ...in top-down or left-right to match display aspect ratio (no weird scalings)
|
// ...in top-down or left-right to match display aspect ratio (no weird scaling)
|
||||||
|
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
glfwSetErrorCallback(ErrorCallback);
|
glfwSetErrorCallback(ErrorCallback);
|
||||||
|
|
@ -4099,8 +4099,8 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
// remember center for switchinging from fullscreen to window
|
// remember center for switchinging from fullscreen to window
|
||||||
if ((CORE.Window.screen.height == CORE.Window.display.height) && (CORE.Window.screen.width == CORE.Window.display.width))
|
if ((CORE.Window.screen.height == CORE.Window.display.height) && (CORE.Window.screen.width == CORE.Window.display.width))
|
||||||
{
|
{
|
||||||
// If screen width/height equal to the dislpay, we can't calclulate the window pos for toggling fullscreened/windowed.
|
// If screen width/height equal to the display, we can't calculate the window pos for toggling full-screened/windowed.
|
||||||
// Toggling fullscreened/windowed with pos(0, 0) can cause problems in some platforms, such as X11.
|
// Toggling full-screened/windowed with pos(0, 0) can cause problems in some platforms, such as X11.
|
||||||
CORE.Window.position.x = CORE.Window.display.width/4;
|
CORE.Window.position.x = CORE.Window.display.width/4;
|
||||||
CORE.Window.position.y = CORE.Window.display.height/4;
|
CORE.Window.position.y = CORE.Window.display.height/4;
|
||||||
}
|
}
|
||||||
|
|
@ -4137,7 +4137,7 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
// framebuffer is rendered correctly but once displayed on a 16:9 monitor, it gets stretched
|
// framebuffer is rendered correctly but once displayed on a 16:9 monitor, it gets stretched
|
||||||
// by the sides to fit all monitor space...
|
// by the sides to fit all monitor space...
|
||||||
|
|
||||||
// Try to setup the most appropiate fullscreen framebuffer for the requested screenWidth/screenHeight
|
// Try to setup the most appropriate fullscreen framebuffer for the requested screenWidth/screenHeight
|
||||||
// It considers device display resolution mode and setups a framebuffer with black bars if required (render size/offset)
|
// It considers device display resolution mode and setups a framebuffer with black bars if required (render size/offset)
|
||||||
// Modified global variables: CORE.Window.screen.width/CORE.Window.screen.height - CORE.Window.render.width/CORE.Window.render.height - CORE.Window.renderOffset.x/CORE.Window.renderOffset.y - CORE.Window.screenScale
|
// Modified global variables: CORE.Window.screen.width/CORE.Window.screen.height - CORE.Window.render.width/CORE.Window.render.height - CORE.Window.renderOffset.x/CORE.Window.renderOffset.y - CORE.Window.screenScale
|
||||||
// TODO: It is a quite cumbersome solution to display size vs requested size, it should be reviewed or removed...
|
// TODO: It is a quite cumbersome solution to display size vs requested size, it should be reviewed or removed...
|
||||||
|
|
@ -4818,7 +4818,7 @@ static void InitTimer(void)
|
||||||
// NOTE: Sleep() granularity could be around 10 ms, it means, Sleep() could
|
// NOTE: Sleep() granularity could be around 10 ms, it means, Sleep() could
|
||||||
// take longer than expected... for that reason we use the busy wait loop
|
// take longer than expected... for that reason we use the busy wait loop
|
||||||
// Ref: http://stackoverflow.com/questions/43057578/c-programming-win32-games-sleep-taking-longer-than-expected
|
// Ref: http://stackoverflow.com/questions/43057578/c-programming-win32-games-sleep-taking-longer-than-expected
|
||||||
// Ref: http://www.geisswerks.com/ryan/FAQS/timing.html --> All about timming on Win32!
|
// Ref: http://www.geisswerks.com/ryan/FAQS/timing.html --> All about timing on Win32!
|
||||||
void WaitTime(double seconds)
|
void WaitTime(double seconds)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_BUSY_WAIT_LOOP) || defined(SUPPORT_PARTIALBUSY_WAIT_LOOP)
|
#if defined(SUPPORT_BUSY_WAIT_LOOP) || defined(SUPPORT_PARTIALBUSY_WAIT_LOOP)
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ static double rgGetCurrentTime(void);
|
||||||
// Module Functions Definition
|
// Module Functions Definition
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Enable only desired getures to be detected
|
// Enable only desired gestures to be detected
|
||||||
void SetGesturesEnabled(unsigned int flags)
|
void SetGesturesEnabled(unsigned int flags)
|
||||||
{
|
{
|
||||||
GESTURES.enabledFlags = flags;
|
GESTURES.enabledFlags = flags;
|
||||||
|
|
@ -300,7 +300,7 @@ void ProcessGestureEvent(GestureEvent event)
|
||||||
{
|
{
|
||||||
if (GESTURES.current == GESTURE_DRAG) GESTURES.Touch.upPosition = event.position[0];
|
if (GESTURES.current == GESTURE_DRAG) GESTURES.Touch.upPosition = event.position[0];
|
||||||
|
|
||||||
// NOTE: GESTURES.Drag.intensity dependend on the resolution of the screen
|
// NOTE: GESTURES.Drag.intensity dependent on the resolution of the screen
|
||||||
GESTURES.Drag.distance = rgVector2Distance(GESTURES.Touch.downPositionA, GESTURES.Touch.upPosition);
|
GESTURES.Drag.distance = rgVector2Distance(GESTURES.Touch.downPositionA, GESTURES.Touch.upPosition);
|
||||||
GESTURES.Drag.intensity = GESTURES.Drag.distance/(float)((rgGetCurrentTime() - GESTURES.Swipe.timeDuration));
|
GESTURES.Drag.intensity = GESTURES.Drag.distance/(float)((rgGetCurrentTime() - GESTURES.Swipe.timeDuration));
|
||||||
|
|
||||||
|
|
@ -472,7 +472,7 @@ Vector2 GetGestureDragVector(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get drag angle
|
// Get drag angle
|
||||||
// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise
|
// NOTE: Angle in degrees, horizontal-right is 0, counterclockwise
|
||||||
float GetGestureDragAngle(void)
|
float GetGestureDragAngle(void)
|
||||||
{
|
{
|
||||||
// NOTE: drag angle is calculated on one touch points TOUCH_ACTION_UP
|
// NOTE: drag angle is calculated on one touch points TOUCH_ACTION_UP
|
||||||
|
|
@ -488,8 +488,8 @@ Vector2 GetGesturePinchVector(void)
|
||||||
return GESTURES.Pinch.vector;
|
return GESTURES.Pinch.vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get angle beween two pinch points
|
// Get angle between two pinch points
|
||||||
// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise
|
// NOTE: Angle in degrees, horizontal-right is 0, counterclockwise
|
||||||
float GetGesturePinchAngle(void)
|
float GetGesturePinchAngle(void)
|
||||||
{
|
{
|
||||||
// NOTE: pinch angle is calculated on two touch points TOUCH_ACTION_MOVE
|
// NOTE: pinch angle is calculated on two touch points TOUCH_ACTION_MOVE
|
||||||
|
|
|
||||||
|
|
@ -1517,7 +1517,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||||
else rlDrawVertexArray(0, mesh.vertexCount);
|
else rlDrawVertexArray(0, mesh.vertexCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind all binded texture maps
|
// Unbind all bound texture maps
|
||||||
for (int i = 0; i < MAX_MATERIAL_MAPS; i++)
|
for (int i = 0; i < MAX_MATERIAL_MAPS; i++)
|
||||||
{
|
{
|
||||||
if (material.maps[i].texture.id > 0)
|
if (material.maps[i].texture.id > 0)
|
||||||
|
|
@ -1738,7 +1738,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
|
||||||
else rlDrawVertexArrayInstanced(0, mesh.vertexCount, instances);
|
else rlDrawVertexArrayInstanced(0, mesh.vertexCount, instances);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind all binded texture maps
|
// Unbind all bound texture maps
|
||||||
for (int i = 0; i < MAX_MATERIAL_MAPS; i++)
|
for (int i = 0; i < MAX_MATERIAL_MAPS; i++)
|
||||||
{
|
{
|
||||||
if (material.maps[i].texture.id > 0)
|
if (material.maps[i].texture.id > 0)
|
||||||
|
|
@ -2559,7 +2559,7 @@ Mesh GenMeshSphere(float radius, int rings, int slices)
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate hemi-sphere mesh (half sphere, no bottom cap)
|
// Generate hemisphere mesh (half sphere, no bottom cap)
|
||||||
Mesh GenMeshHemiSphere(float radius, int rings, int slices)
|
Mesh GenMeshHemiSphere(float radius, int rings, int slices)
|
||||||
{
|
{
|
||||||
Mesh mesh = { 0 };
|
Mesh mesh = { 0 };
|
||||||
|
|
@ -3242,7 +3242,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move data from mapVertices temp arays to vertices float array
|
// Move data from mapVertices temp arrays to vertices float array
|
||||||
mesh.vertexCount = vCounter;
|
mesh.vertexCount = vCounter;
|
||||||
mesh.triangleCount = vCounter/3;
|
mesh.triangleCount = vCounter/3;
|
||||||
|
|
||||||
|
|
@ -3742,7 +3742,7 @@ RayCollision GetRayCollisionBox(Ray ray, BoundingBox box)
|
||||||
// NOTE: We use an additional .01 to fix numerical errors
|
// NOTE: We use an additional .01 to fix numerical errors
|
||||||
collision.normal = Vector3Scale(collision.normal, 2.01f);
|
collision.normal = Vector3Scale(collision.normal, 2.01f);
|
||||||
collision.normal = Vector3Divide(collision.normal, Vector3Subtract(box.max, box.min));
|
collision.normal = Vector3Divide(collision.normal, Vector3Subtract(box.max, box.min));
|
||||||
// The relevant elemets of the vector are now slightly larger than 1.0f (or smaller than -1.0f)
|
// The relevant elements of the vector are now slightly larger than 1.0f (or smaller than -1.0f)
|
||||||
// and the others are somewhere between -1.0 and 1.0 casting to int is exactly our wanted normal!
|
// and the others are somewhere between -1.0 and 1.0 casting to int is exactly our wanted normal!
|
||||||
collision.normal.x = (float)((int)collision.normal.x);
|
collision.normal.x = (float)((int)collision.normal.x);
|
||||||
collision.normal.y = (float)((int)collision.normal.y);
|
collision.normal.y = (float)((int)collision.normal.y);
|
||||||
|
|
@ -4959,7 +4959,7 @@ static Model LoadGLTF(const char *fileName)
|
||||||
|
|
||||||
for (unsigned int j = 0; j < data->meshes[i].primitives[p].attributes_count; j++)
|
for (unsigned int j = 0; j < data->meshes[i].primitives[p].attributes_count; j++)
|
||||||
{
|
{
|
||||||
// Check the different attributes for every pimitive
|
// Check the different attributes for every primitive
|
||||||
if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_position) // POSITION
|
if (data->meshes[i].primitives[p].attributes[j].type == cgltf_attribute_type_position) // POSITION
|
||||||
{
|
{
|
||||||
cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data;
|
cgltf_accessor *attribute = data->meshes[i].primitives[p].attributes[j].data;
|
||||||
|
|
@ -5613,7 +5613,7 @@ static Model LoadM3D(const char *fileName)
|
||||||
// Materials are grouped together
|
// Materials are grouped together
|
||||||
if (mi != m3d->face[i].materialid)
|
if (mi != m3d->face[i].materialid)
|
||||||
{
|
{
|
||||||
// there should be only one material switch per material kind, but be bulletproof for unoptimal model files
|
// there should be only one material switch per material kind, but be bulletproof for non-optimal model files
|
||||||
if (k + 1 >= model.meshCount)
|
if (k + 1 >= model.meshCount)
|
||||||
{
|
{
|
||||||
model.meshCount++;
|
model.meshCount++;
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
#include <stdio.h> // Required for: vsprintf()
|
#include <stdio.h> // Required for: vsprintf()
|
||||||
#include <string.h> // Required for: strcmp(), strstr(), strcpy(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()]
|
#include <string.h> // Required for: strcmp(), strstr(), strcpy(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()]
|
||||||
#include <stdarg.h> // Required for: va_list, va_start(), vsprintf(), va_end() [Used in TextFormat()]
|
#include <stdarg.h> // Required for: va_list, va_start(), vsprintf(), va_end() [Used in TextFormat()]
|
||||||
#include <ctype.h> // Requried for: toupper(), tolower() [Used in TextToUpper(), TextToLower()]
|
#include <ctype.h> // Required for: toupper(), tolower() [Used in TextToUpper(), TextToLower()]
|
||||||
|
|
||||||
#if defined(SUPPORT_FILEFORMAT_TTF)
|
#if defined(SUPPORT_FILEFORMAT_TTF)
|
||||||
#define STB_RECT_PACK_IMPLEMENTATION
|
#define STB_RECT_PACK_IMPLEMENTATION
|
||||||
|
|
@ -584,7 +584,7 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz
|
||||||
glyphCount = (glyphCount > 0)? glyphCount : 95;
|
glyphCount = (glyphCount > 0)? glyphCount : 95;
|
||||||
|
|
||||||
// Fill fontChars in case not provided externally
|
// Fill fontChars in case not provided externally
|
||||||
// NOTE: By default we fill glyphCount consecutevely, starting at 32 (Space)
|
// NOTE: By default we fill glyphCount consecutively, starting at 32 (Space)
|
||||||
|
|
||||||
if (fontChars == NULL)
|
if (fontChars == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1176,7 +1176,7 @@ void ImageFormat(Image *image, int newFormat)
|
||||||
} break;
|
} break;
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R32:
|
case PIXELFORMAT_UNCOMPRESSED_R32:
|
||||||
{
|
{
|
||||||
// WARNING: Image is converted to GRAYSCALE eqeuivalent 32bit
|
// WARNING: Image is converted to GRAYSCALE equivalent 32bit
|
||||||
|
|
||||||
image->data = (float *)RL_MALLOC(image->width*image->height*sizeof(float));
|
image->data = (float *)RL_MALLOC(image->width*image->height*sizeof(float));
|
||||||
|
|
||||||
|
|
@ -1214,7 +1214,7 @@ void ImageFormat(Image *image, int newFormat)
|
||||||
RL_FREE(pixels);
|
RL_FREE(pixels);
|
||||||
pixels = NULL;
|
pixels = NULL;
|
||||||
|
|
||||||
// In case original image had mipmaps, generate mipmaps for formated image
|
// In case original image had mipmaps, generate mipmaps for formatted image
|
||||||
// NOTE: Original mipmaps are replaced by new ones, if custom mipmaps were used, they are lost
|
// NOTE: Original mipmaps are replaced by new ones, if custom mipmaps were used, they are lost
|
||||||
if (image->mipmaps > 1)
|
if (image->mipmaps > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -1331,7 +1331,7 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crop image depending on alpha value
|
// Crop image depending on alpha value
|
||||||
// NOTE: Threshold is defined as a percentatge: 0.0f -> 1.0f
|
// NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f
|
||||||
void ImageAlphaCrop(Image *image, float threshold)
|
void ImageAlphaCrop(Image *image, float threshold)
|
||||||
{
|
{
|
||||||
// Security check to avoid program crash
|
// Security check to avoid program crash
|
||||||
|
|
@ -2531,7 +2531,7 @@ void UnloadImagePalette(Color *colors)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get image alpha border rectangle
|
// Get image alpha border rectangle
|
||||||
// NOTE: Threshold is defined as a percentatge: 0.0f -> 1.0f
|
// NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f
|
||||||
Rectangle GetImageAlphaBorder(Image image, float threshold)
|
Rectangle GetImageAlphaBorder(Image image, float threshold)
|
||||||
{
|
{
|
||||||
Rectangle crop = { 0 };
|
Rectangle crop = { 0 };
|
||||||
|
|
@ -3273,7 +3273,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
|
||||||
faces = GenImageColor(size, size*6, MAGENTA);
|
faces = GenImageColor(size, size*6, MAGENTA);
|
||||||
ImageFormat(&faces, image.format);
|
ImageFormat(&faces, image.format);
|
||||||
|
|
||||||
// NOTE: Image formating does not work with compressed textures
|
// NOTE: Image formatting does not work with compressed textures
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE);
|
for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE);
|
||||||
}
|
}
|
||||||
|
|
@ -3606,7 +3606,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
|
||||||
// NOTE: Vertex position can be transformed using matrices
|
// NOTE: Vertex position can be transformed using matrices
|
||||||
// but the process is way more costly than just calculating
|
// but the process is way more costly than just calculating
|
||||||
// the vertex positions manually, like done above.
|
// the vertex positions manually, like done above.
|
||||||
// I leave here the old implementation for educational pourposes,
|
// I leave here the old implementation for educational purposes,
|
||||||
// just in case someone wants to do some performance test
|
// just in case someone wants to do some performance test
|
||||||
/*
|
/*
|
||||||
rlSetTexture(texture.id);
|
rlSetTexture(texture.id);
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,10 @@
|
||||||
static int logTypeLevel = LOG_INFO; // Minimum log type level
|
static int logTypeLevel = LOG_INFO; // Minimum log type level
|
||||||
|
|
||||||
static TraceLogCallback traceLog = NULL; // TraceLog callback function pointer
|
static TraceLogCallback traceLog = NULL; // TraceLog callback function pointer
|
||||||
static LoadFileDataCallback loadFileData = NULL; // LoadFileData callback funtion pointer
|
static LoadFileDataCallback loadFileData = NULL; // LoadFileData callback function pointer
|
||||||
static SaveFileDataCallback saveFileData = NULL; // SaveFileText callback funtion pointer
|
static SaveFileDataCallback saveFileData = NULL; // SaveFileText callback function pointer
|
||||||
static LoadFileTextCallback loadFileText = NULL; // LoadFileText callback funtion pointer
|
static LoadFileTextCallback loadFileText = NULL; // LoadFileText callback function pointer
|
||||||
static SaveFileTextCallback saveFileText = NULL; // SaveFileText callback funtion pointer
|
static SaveFileTextCallback saveFileText = NULL; // SaveFileText callback function pointer
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Functions to set internal callbacks
|
// Functions to set internal callbacks
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user