Remove trailing spaces

This commit is contained in:
Ray
2026-03-25 16:51:02 +01:00
parent 5dd4036ed0
commit 0f0983c065
23 changed files with 184 additions and 185 deletions

View File

@ -52,7 +52,7 @@ int main(void)
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE;
// Load model
Model model = LoadModel("resources/models/old_car_new.glb");
@ -61,7 +61,7 @@ int main(void)
TextFormat("resources/shaders/glsl%i/cel.vs", GLSL_VERSION),
TextFormat("resources/shaders/glsl%i/cel.fs", GLSL_VERSION));
celShader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(celShader, "viewPos");
// Apply cel shader to model, keep copy of default shader
Shader defaultShader = model.materials[0].shader;
model.materials[0].shader = celShader;
@ -134,16 +134,16 @@ int main(void)
// Outline pass: cull front faces, draw extruded back faces as silhouette
float thickness = 0.005f;
SetShaderValue(outlineShader, outlineThicknessLoc, &thickness, SHADER_UNIFORM_FLOAT);
rlSetCullFace(RL_CULL_FACE_FRONT);
model.materials[0].shader = outlineShader;
DrawModel(model, Vector3Zero(), 0.75f, WHITE);
if (celEnabled) model.materials[0].shader = celShader; // Apply cel shader to model
else model.materials[0].shader = defaultShader; // Apply default shader to model
rlSetCullFace(RL_CULL_FACE_BACK);
}
@ -167,7 +167,7 @@ int main(void)
UnloadModel(model);
UnloadShader(celShader);
UnloadShader(outlineShader);
CloseWindow();
//--------------------------------------------------------------------------------------

View File

@ -210,7 +210,7 @@ int main(void)
rlClearColor(0, 0, 0, 0);
rlClearScreenBuffers(); // Clear color and depth buffer
rlDisableColorBlend();
BeginMode3D(camera);
// NOTE: We have to use rlEnableShader here. `BeginShaderMode` or thus `rlSetShader`
// will not work, as they won't immediately load the shader program
@ -226,7 +226,7 @@ int main(void)
}
rlDisableShader();
EndMode3D();
rlEnableColorBlend();
// Go back to the default framebufferId (0) and draw our deferred shading

View File

@ -59,7 +59,7 @@ int main(void)
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - game of life");
const int menuWidth = 100;
@ -81,7 +81,7 @@ int main(void)
{ "Puffer train", { 0.1f, 0.5f } }, { "Glider Gun", { 0.2f, 0.2f } }, { "Breeder", { 0.1f, 0.5f } },
{ "Random", { 0.5f, 0.5f } }
};
const int numberOfPresets = sizeof(presetPatterns)/sizeof(presetPatterns[0]);
int zoom = 1;
@ -90,7 +90,7 @@ int main(void)
int framesPerStep = 1;
int frame = 0;
int preset = -1; // No button pressed for preset
int preset = -1; // No button pressed for preset
int mode = MODE_RUN; // Starting mode: running
bool buttonZoomIn = false; // Button states: false not pressed
bool buttonZomOut = false;
@ -185,7 +185,7 @@ int main(void)
EndTextureMode();
imageToDraw = (Image*)RL_MALLOC(sizeof(Image));
*imageToDraw = LoadImageFromTexture(worldOnScreen.texture);
UnloadRenderTexture(worldOnScreen);
}
@ -199,9 +199,9 @@ int main(void)
if (mouseY >= sizeInWorldY) mouseY = sizeInWorldY - 1;
if (firstColor == -1) firstColor = (GetImageColor(*imageToDraw, mouseX, mouseY).r < 5)? 0 : 1;
const int prevColor = (GetImageColor(*imageToDraw, mouseX, mouseY).r < 5)? 0 : 1;
ImageDrawPixel(imageToDraw, mouseX, mouseY, (firstColor) ? BLACK : RAYWHITE);
if (prevColor != firstColor) UpdateTextureRec(currentWorld->texture, (Rectangle){ floorf(offsetX), floorf(offsetY), (float)(sizeInWorldX), (float)(sizeInWorldY) }, imageToDraw->data);
}
else firstColor = -1;
@ -228,7 +228,7 @@ int main(void)
BeginTextureMode(*currentWorld);
ClearBackground(RAYWHITE);
EndTextureMode();
UpdateTextureRec(currentWorld->texture, (Rectangle){ worldWidth*presetPatterns[preset].position.x - pattern.width/2.0f,
worldHeight*presetPatterns[preset].position.y - pattern.height/2.0f,
(float)(pattern.width), (float)(pattern.height) }, pattern.data);
@ -256,7 +256,7 @@ int main(void)
}
UnloadImage(pattern);
mode = MODE_PAUSE;
offsetX = worldWidth*presetPatterns[preset].position.x - (float)windowWidth/zoom/2.0f;
offsetY = worldHeight*presetPatterns[preset].position.y - (float)windowHeight/zoom/2.0f;
@ -293,7 +293,7 @@ int main(void)
// Draw to screen
//----------------------------------------------------------------------------------
BeginDrawing();
DrawTexturePro(currentWorld->texture, textureSourceToScreen, textureOnScreen, (Vector2){ 0, 0 }, 0.0f, WHITE);
DrawLine(windowWidth, 0, windowWidth, screenHeight, (Color){ 218, 218, 218, 255 });