mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-30 10:49:18 -05:00
Merge branch 'master' of https://github.com/raysan5/raylib
This commit is contained in:
@ -413,7 +413,7 @@ static MsfGifBuffer * msf_compress_frame(void * allocContext, int width, int hei
|
||||
|
||||
//generate palette
|
||||
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
|
||||
//transparent is always last in the table
|
||||
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
|
||||
//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->currentFrame = empty;
|
||||
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
|
||||
if (!handle->listHead) { MsfGifResult empty = {0}; return empty; }
|
||||
if (!handle->listHead) { MsfGifResult empty = { 0 }; return empty; }
|
||||
|
||||
//first pass: determine total size
|
||||
size_t total = 1; //1 byte for trailing marker
|
||||
|
||||
@ -183,7 +183,7 @@ int main(void)
|
||||
if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE);
|
||||
|
||||
// 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 (collision.hit)
|
||||
@ -191,7 +191,7 @@ int main(void)
|
||||
Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f));
|
||||
Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0});
|
||||
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);
|
||||
|
||||
@ -65,7 +65,7 @@ int main(void)
|
||||
Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION));
|
||||
|
||||
// Declare Struct used to store camera locs
|
||||
RayLocs marchLocs = {0};
|
||||
RayLocs marchLocs = { 0 };
|
||||
|
||||
// Fill the struct with shader locs
|
||||
marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos");
|
||||
|
||||
@ -41,7 +41,7 @@ int main(void)
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement");
|
||||
|
||||
// set up camera
|
||||
Camera camera = {0};
|
||||
Camera camera = { 0 };
|
||||
camera.position = (Vector3) {20.0f, 5.0f, -20.0f};
|
||||
camera.target = (Vector3) {0.0f, 0.0f, 0.0f};
|
||||
camera.up = (Vector3) {0.0f, 1.0f, 0.0f};
|
||||
|
||||
@ -58,7 +58,7 @@ int main(void)
|
||||
|
||||
int ballCount = 1;
|
||||
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
|
||||
|
||||
|
||||
@ -49,8 +49,8 @@ int main(void)
|
||||
bool showPercentages = false;
|
||||
bool showDonut = false;
|
||||
int hoveredSlice = -1;
|
||||
Rectangle scrollPanelBounds = {0};
|
||||
Vector2 scrollContentOffset = {0};
|
||||
Rectangle scrollPanelBounds = { 0 };
|
||||
Vector2 scrollContentOffset = { 0 };
|
||||
Rectangle view = { 0 };
|
||||
|
||||
// UI layout parameters
|
||||
|
||||
@ -113,7 +113,7 @@ int main(void)
|
||||
|
||||
// Set the text (using markdown!)
|
||||
char text[64] = "Hello ~~World~~ in 3D!";
|
||||
Vector3 tbox = {0};
|
||||
Vector3 tbox = { 0 };
|
||||
int layers = 1;
|
||||
int quads = 0;
|
||||
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));
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ int main(void)
|
||||
TextParticle textParticles[MAX_TEXT_PARTICLES] = { 0 };
|
||||
int particleCount = 0;
|
||||
TextParticle *grabbedTextParticle = NULL;
|
||||
Vector2 pressOffset = {0};
|
||||
Vector2 pressOffset = { 0 };
|
||||
|
||||
PrepareFirstTextParticle("raylib => fun videogames programming!", textParticles, &particleCount);
|
||||
|
||||
|
||||
@ -886,8 +886,8 @@ void ClosePlatform(void)
|
||||
// NOTE: Reset global state in case the activity is being relaunched
|
||||
if (platform.app->destroyRequested != 0)
|
||||
{
|
||||
CORE = (CoreData){0};
|
||||
platform = (PlatformData){0};
|
||||
CORE = (CoreData){ 0 };
|
||||
platform = (PlatformData){ 0 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -915,7 +915,7 @@ void SwapScreenBuffer(void)
|
||||
{
|
||||
TRACELOG(LOG_ERROR, "DISPLAY: Failed to get DRM resources");
|
||||
drmModeRmFB(platform.fd, fb);
|
||||
struct drm_mode_destroy_dumb dreq = {0};
|
||||
struct drm_mode_destroy_dumb dreq = { 0 };
|
||||
dreq.handle = creq.handle;
|
||||
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
|
||||
return;
|
||||
@ -955,7 +955,7 @@ void SwapScreenBuffer(void)
|
||||
{
|
||||
TRACELOG(LOG_ERROR, "DISPLAY: No compatible CRTC found");
|
||||
drmModeRmFB(platform.fd, fb);
|
||||
struct drm_mode_destroy_dumb dreq = {0};
|
||||
struct drm_mode_destroy_dumb dreq = { 0 };
|
||||
dreq.handle = creq.handle;
|
||||
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
|
||||
return;
|
||||
@ -971,7 +971,7 @@ void SwapScreenBuffer(void)
|
||||
TRACELOG(LOG_ERROR, "DISPLAY: Mode: %dx%d@%d", mode->hdisplay, mode->vdisplay, mode->vrefresh);
|
||||
|
||||
drmModeRmFB(platform.fd, fb);
|
||||
struct drm_mode_destroy_dumb dreq = {0};
|
||||
struct drm_mode_destroy_dumb dreq = { 0 };
|
||||
dreq.handle = creq.handle;
|
||||
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
|
||||
return;
|
||||
@ -989,7 +989,7 @@ void SwapScreenBuffer(void)
|
||||
// Clean up previous dumb buffer
|
||||
if (platform.prevDumbHandle)
|
||||
{
|
||||
struct drm_mode_destroy_dumb dreq = {0};
|
||||
struct drm_mode_destroy_dumb dreq = { 0 };
|
||||
dreq.handle = platform.prevDumbHandle;
|
||||
drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
|
||||
}
|
||||
|
||||
@ -1556,7 +1556,7 @@ int main(int argc, char *argv[])
|
||||
"#include <string.h>\n"
|
||||
"#include <stdlib.h>\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"
|
||||
"void CustomTraceLog(int msgType, const char *text, va_list args)\n{\n"
|
||||
" if (logTextOffset < 3800)\n {\n"
|
||||
|
||||
Reference in New Issue
Block a user