This commit is contained in:
Ray
2026-01-29 19:51:25 +01:00
11 changed files with 20 additions and 20 deletions

View File

@ -413,7 +413,7 @@ static MsfGifBuffer * msf_compress_frame(void * allocContext, int width, int hei
//generate palette //generate palette
typedef struct { uint8_t r, g, b; } Color3; typedef struct { uint8_t r, g, b; } Color3;
Color3 table[256] = { {0} }; Color3 table[256] = { { 0 } };
int tableIdx = 1; //we start counting at 1 because 0 is the transparent color int tableIdx = 1; //we start counting at 1 because 0 is the transparent color
//transparent is always last in the table //transparent is always last in the table
tlb[tlbSize-1] = 0; tlb[tlbSize-1] = 0;
@ -550,7 +550,7 @@ static void msf_free_gif_state(MsfGifState * handle) {
int msf_gif_begin(MsfGifState * handle, int width, int height) { MsfTimeFunc int msf_gif_begin(MsfGifState * handle, int width, int height) { MsfTimeFunc
//NOTE: we cannot stomp the entire struct to zero because we must preserve `customAllocatorContext`. //NOTE: we cannot stomp the entire struct to zero because we must preserve `customAllocatorContext`.
MsfCookedFrame empty = {0}; //god I hate MSVC... MsfCookedFrame empty = { 0 }; //god I hate MSVC...
handle->previousFrame = empty; handle->previousFrame = empty;
handle->currentFrame = empty; handle->currentFrame = empty;
handle->width = width; handle->width = width;
@ -614,7 +614,7 @@ int msf_gif_frame(MsfGifState * handle, uint8_t * pixelData, int centiSecondsPer
} }
MsfGifResult msf_gif_end(MsfGifState * handle) { MsfTimeFunc MsfGifResult msf_gif_end(MsfGifState * handle) { MsfTimeFunc
if (!handle->listHead) { MsfGifResult empty = {0}; return empty; } if (!handle->listHead) { MsfGifResult empty = { 0 }; return empty; }
//first pass: determine total size //first pass: determine total size
size_t total = 1; //1 byte for trailing marker size_t total = 1; //1 byte for trailing marker

View File

@ -183,7 +183,7 @@ int main(void)
if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE); if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE);
// Draw the decal models // Draw the decal models
for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){0}, 1.0f, WHITE); for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){ 0 }, 1.0f, WHITE);
// If we hit the mesh, draw the box for the decal // If we hit the mesh, draw the box for the decal
if (collision.hit) if (collision.hit)
@ -191,7 +191,7 @@ int main(void)
Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f)); Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f));
Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0}); Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0});
placementCube.transform = MatrixInvert(splat); placementCube.transform = MatrixInvert(splat);
DrawModel(placementCube, (Vector3){0}, 1.0f, Fade(WHITE, 0.5f)); DrawModel(placementCube, (Vector3){ 0 }, 1.0f, Fade(WHITE, 0.5f));
} }
DrawGrid(10, 10.0f); DrawGrid(10, 10.0f);

View File

@ -65,7 +65,7 @@ int main(void)
Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION)); Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION));
// Declare Struct used to store camera locs // Declare Struct used to store camera locs
RayLocs marchLocs = {0}; RayLocs marchLocs = { 0 };
// Fill the struct with shader locs // Fill the struct with shader locs
marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos"); marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos");

View File

@ -41,7 +41,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement"); InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement");
// set up camera // set up camera
Camera camera = {0}; Camera camera = { 0 };
camera.position = (Vector3) {20.0f, 5.0f, -20.0f}; camera.position = (Vector3) {20.0f, 5.0f, -20.0f};
camera.target = (Vector3) {0.0f, 0.0f, 0.0f}; camera.target = (Vector3) {0.0f, 0.0f, 0.0f};
camera.up = (Vector3) {0.0f, 1.0f, 0.0f}; camera.up = (Vector3) {0.0f, 1.0f, 0.0f};

View File

@ -58,7 +58,7 @@ int main(void)
int ballCount = 1; int ballCount = 1;
Ball *grabbedBall = NULL; // A pointer to the current ball that is grabbed Ball *grabbedBall = NULL; // A pointer to the current ball that is grabbed
Vector2 pressOffset = {0}; // Mouse press offset relative to the ball that grabbedd Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd
float gravity = 100; // World gravity float gravity = 100; // World gravity

View File

@ -49,8 +49,8 @@ int main(void)
bool showPercentages = false; bool showPercentages = false;
bool showDonut = false; bool showDonut = false;
int hoveredSlice = -1; int hoveredSlice = -1;
Rectangle scrollPanelBounds = {0}; Rectangle scrollPanelBounds = { 0 };
Vector2 scrollContentOffset = {0}; Vector2 scrollContentOffset = { 0 };
Rectangle view = { 0 }; Rectangle view = { 0 };
// UI layout parameters // UI layout parameters

View File

@ -113,7 +113,7 @@ int main(void)
// Set the text (using markdown!) // Set the text (using markdown!)
char text[64] = "Hello ~~World~~ in 3D!"; char text[64] = "Hello ~~World~~ in 3D!";
Vector3 tbox = {0}; Vector3 tbox = { 0 };
int layers = 1; int layers = 1;
int quads = 0; int quads = 0;
float layerDistance = 0.01f; float layerDistance = 0.01f;
@ -133,7 +133,7 @@ int main(void)
Shader alphaDiscard = LoadShader(NULL, TextFormat("resources/shaders/glsl%i/alpha_discard.fs", GLSL_VERSION)); Shader alphaDiscard = LoadShader(NULL, TextFormat("resources/shaders/glsl%i/alpha_discard.fs", GLSL_VERSION));
// Array filled with multiple random colors (when multicolor mode is set) // Array filled with multiple random colors (when multicolor mode is set)
Color multi[TEXT_MAX_LAYERS] = {0}; Color multi[TEXT_MAX_LAYERS] = { 0 };
DisableCursor(); // Limit cursor to relative movement inside the window DisableCursor(); // Limit cursor to relative movement inside the window

View File

@ -65,7 +65,7 @@ int main(void)
TextParticle textParticles[MAX_TEXT_PARTICLES] = { 0 }; TextParticle textParticles[MAX_TEXT_PARTICLES] = { 0 };
int particleCount = 0; int particleCount = 0;
TextParticle *grabbedTextParticle = NULL; TextParticle *grabbedTextParticle = NULL;
Vector2 pressOffset = {0}; Vector2 pressOffset = { 0 };
PrepareFirstTextParticle("raylib => fun videogames programming!", textParticles, &particleCount); PrepareFirstTextParticle("raylib => fun videogames programming!", textParticles, &particleCount);

View File

@ -886,8 +886,8 @@ void ClosePlatform(void)
// NOTE: Reset global state in case the activity is being relaunched // NOTE: Reset global state in case the activity is being relaunched
if (platform.app->destroyRequested != 0) if (platform.app->destroyRequested != 0)
{ {
CORE = (CoreData){0}; CORE = (CoreData){ 0 };
platform = (PlatformData){0}; platform = (PlatformData){ 0 };
} }
} }

View File

@ -915,7 +915,7 @@ void SwapScreenBuffer(void)
{ {
TRACELOG(LOG_ERROR, "DISPLAY: Failed to get DRM resources"); TRACELOG(LOG_ERROR, "DISPLAY: Failed to get DRM resources");
drmModeRmFB(platform.fd, fb); drmModeRmFB(platform.fd, fb);
struct drm_mode_destroy_dumb dreq = {0}; struct drm_mode_destroy_dumb dreq = { 0 };
dreq.handle = creq.handle; dreq.handle = creq.handle;
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
return; return;
@ -955,7 +955,7 @@ void SwapScreenBuffer(void)
{ {
TRACELOG(LOG_ERROR, "DISPLAY: No compatible CRTC found"); TRACELOG(LOG_ERROR, "DISPLAY: No compatible CRTC found");
drmModeRmFB(platform.fd, fb); drmModeRmFB(platform.fd, fb);
struct drm_mode_destroy_dumb dreq = {0}; struct drm_mode_destroy_dumb dreq = { 0 };
dreq.handle = creq.handle; dreq.handle = creq.handle;
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
return; return;
@ -971,7 +971,7 @@ void SwapScreenBuffer(void)
TRACELOG(LOG_ERROR, "DISPLAY: Mode: %dx%d@%d", mode->hdisplay, mode->vdisplay, mode->vrefresh); TRACELOG(LOG_ERROR, "DISPLAY: Mode: %dx%d@%d", mode->hdisplay, mode->vdisplay, mode->vrefresh);
drmModeRmFB(platform.fd, fb); drmModeRmFB(platform.fd, fb);
struct drm_mode_destroy_dumb dreq = {0}; struct drm_mode_destroy_dumb dreq = { 0 };
dreq.handle = creq.handle; dreq.handle = creq.handle;
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
return; return;
@ -989,7 +989,7 @@ void SwapScreenBuffer(void)
// Clean up previous dumb buffer // Clean up previous dumb buffer
if (platform.prevDumbHandle) if (platform.prevDumbHandle)
{ {
struct drm_mode_destroy_dumb dreq = {0}; struct drm_mode_destroy_dumb dreq = { 0 };
dreq.handle = platform.prevDumbHandle; dreq.handle = platform.prevDumbHandle;
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
} }

View File

@ -1556,7 +1556,7 @@ int main(int argc, char *argv[])
"#include <string.h>\n" "#include <string.h>\n"
"#include <stdlib.h>\n" "#include <stdlib.h>\n"
"#include <emscripten/emscripten.h>\n\n" "#include <emscripten/emscripten.h>\n\n"
"static char logText[4096] = {0};\n" "static char logText[4096] = { 0 };\n"
"static int logTextOffset = 0;\n\n" "static int logTextOffset = 0;\n\n"
"void CustomTraceLog(int msgType, const char *text, va_list args)\n{\n" "void CustomTraceLog(int msgType, const char *text, va_list args)\n{\n"
" if (logTextOffset < 3800)\n {\n" " if (logTextOffset < 3800)\n {\n"