diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6d6a2d1d9..3ce54d39e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Hello contributors! Welcome to raylib! Do you enjoy raylib and want to contribute? Nice! You can help with the following points: -- `C programming` - Can you write/review/test/improve the code? +- `C programming` - Can you write/review/test/improve the code? - `Documentation/Tutorials/Example` - Can you write some tutorials/examples? - `Porting to other platforms` - Can you port/adapt/compile raylib on other systems? - `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)? diff --git a/examples/shaders/resources/shaders/glsl100/ascii.fs b/examples/shaders/resources/shaders/glsl100/ascii.fs index 54e20bf66..11b46e471 100644 --- a/examples/shaders/resources/shaders/glsl100/ascii.fs +++ b/examples/shaders/resources/shaders/glsl100/ascii.fs @@ -44,7 +44,7 @@ float GetCharacter(float n, vec2 p) // Main shader logic // ----------------------------------------------------------------------------- -void main() +void main() { vec2 charPixelSize = vec2(fontSize, fontSize); vec2 uvCellSize = charPixelSize/resolution; diff --git a/examples/shaders/resources/shaders/glsl100/hybrid_raymarch.fs b/examples/shaders/resources/shaders/glsl100/hybrid_raymarch.fs index 8f9fa0907..e3287fc04 100644 --- a/examples/shaders/resources/shaders/glsl100/hybrid_raymarch.fs +++ b/examples/shaders/resources/shaders/glsl100/hybrid_raymarch.fs @@ -63,7 +63,7 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t) } // SRC: https://iquilezles.org/articles/boxfunctions -vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) +vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) { vec3 m = 1.0/rd; vec3 n = m*ro; diff --git a/examples/shaders/resources/shaders/glsl100/wave.fs b/examples/shaders/resources/shaders/glsl100/wave.fs index df12df9ba..00097f2c4 100644 --- a/examples/shaders/resources/shaders/glsl100/wave.fs +++ b/examples/shaders/resources/shaders/glsl100/wave.fs @@ -19,7 +19,8 @@ uniform float ampY; uniform float speedX; uniform float speedY; -void main() { +void main() +{ float pixelWidth = 1.0/size.x; float pixelHeight = 1.0/size.y; float aspect = pixelHeight/pixelWidth; diff --git a/examples/shaders/resources/shaders/glsl120/ascii.fs b/examples/shaders/resources/shaders/glsl120/ascii.fs index 09c572ae5..e4e9927b9 100644 --- a/examples/shaders/resources/shaders/glsl120/ascii.fs +++ b/examples/shaders/resources/shaders/glsl120/ascii.fs @@ -42,7 +42,7 @@ float GetCharacter(float n, vec2 p) // Main shader logic // ----------------------------------------------------------------------------- -void main() +void main() { vec2 charPixelSize = vec2(fontSize, fontSize); vec2 uvCellSize = charPixelSize / resolution; diff --git a/examples/shaders/resources/shaders/glsl120/hybrid_raymarch.fs b/examples/shaders/resources/shaders/glsl120/hybrid_raymarch.fs index 3118e1861..6090df6b1 100644 --- a/examples/shaders/resources/shaders/glsl120/hybrid_raymarch.fs +++ b/examples/shaders/resources/shaders/glsl120/hybrid_raymarch.fs @@ -61,7 +61,7 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t) } // SRC: https://iquilezles.org/articles/boxfunctions -vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) +vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) { vec3 m = 1.0/rd; vec3 n = m*ro; diff --git a/examples/shaders/resources/shaders/glsl120/wave.fs b/examples/shaders/resources/shaders/glsl120/wave.fs index dd6bb2e22..9f0f300e1 100644 --- a/examples/shaders/resources/shaders/glsl120/wave.fs +++ b/examples/shaders/resources/shaders/glsl120/wave.fs @@ -17,7 +17,8 @@ uniform float ampY; uniform float speedX; uniform float speedY; -void main() { +void main() +{ float pixelWidth = 1.0/size.x; float pixelHeight = 1.0/size.y; float aspect = pixelHeight/pixelWidth; diff --git a/examples/shaders/resources/shaders/glsl330/ascii.fs b/examples/shaders/resources/shaders/glsl330/ascii.fs index 3f73bf288..3934c5dc1 100644 --- a/examples/shaders/resources/shaders/glsl330/ascii.fs +++ b/examples/shaders/resources/shaders/glsl330/ascii.fs @@ -38,7 +38,7 @@ float GetCharacter(int n, vec2 p) // Main shader logic // ----------------------------------------------------------------------------- -void main() +void main() { vec2 charPixelSize = vec2(fontSize, fontSize); vec2 uvCellSize = charPixelSize/resolution; diff --git a/examples/shaders/resources/shaders/glsl330/deferred_shading.fs b/examples/shaders/resources/shaders/glsl330/deferred_shading.fs index 18102e934..93a13319c 100644 --- a/examples/shaders/resources/shaders/glsl330/deferred_shading.fs +++ b/examples/shaders/resources/shaders/glsl330/deferred_shading.fs @@ -23,7 +23,8 @@ uniform vec3 viewPosition; const float QUADRATIC = 0.032; const float LINEAR = 0.09; -void main() { +void main() +{ vec3 fragPosition = texture(gPosition, texCoord).rgb; vec3 normal = texture(gNormal, texCoord).rgb; vec3 albedo = texture(gAlbedoSpec, texCoord).rgb; diff --git a/examples/shaders/resources/shaders/glsl330/deferred_shading.vs b/examples/shaders/resources/shaders/glsl330/deferred_shading.vs index f2b1bd7c4..3a6c1612c 100644 --- a/examples/shaders/resources/shaders/glsl330/deferred_shading.vs +++ b/examples/shaders/resources/shaders/glsl330/deferred_shading.vs @@ -5,7 +5,8 @@ layout (location = 1) in vec2 vertexTexCoord; out vec2 texCoord; -void main() { +void main() +{ gl_Position = vec4(vertexPosition, 1.0); texCoord = vertexTexCoord; } diff --git a/examples/shaders/resources/shaders/glsl330/gbuffer.fs b/examples/shaders/resources/shaders/glsl330/gbuffer.fs index c86e20a9e..cbb6d38dc 100644 --- a/examples/shaders/resources/shaders/glsl330/gbuffer.fs +++ b/examples/shaders/resources/shaders/glsl330/gbuffer.fs @@ -10,7 +10,8 @@ in vec3 fragNormal; uniform sampler2D diffuseTexture; uniform sampler2D specularTexture; -void main() { +void main() +{ // store the fragment position vector in the first gbuffer texture gPosition = fragPosition; // also store the per-fragment normals into the gbuffer diff --git a/examples/shaders/resources/shaders/glsl330/hybrid_raymarch.fs b/examples/shaders/resources/shaders/glsl330/hybrid_raymarch.fs index f1fafc640..073fef4f1 100644 --- a/examples/shaders/resources/shaders/glsl330/hybrid_raymarch.fs +++ b/examples/shaders/resources/shaders/glsl330/hybrid_raymarch.fs @@ -59,7 +59,7 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t) } // https://iquilezles.org/articles/boxfunctions -vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) +vec2 iBox(in vec3 ro, in vec3 rd, in vec3 rad) { vec3 m = 1.0/rd; vec3 n = m*ro; diff --git a/examples/shaders/resources/shaders/glsl330/wave.fs b/examples/shaders/resources/shaders/glsl330/wave.fs index 393f1bde2..be07ccd05 100644 --- a/examples/shaders/resources/shaders/glsl330/wave.fs +++ b/examples/shaders/resources/shaders/glsl330/wave.fs @@ -22,7 +22,8 @@ uniform float ampY; uniform float speedX; uniform float speedY; -void main() { +void main() +{ float pixelWidth = 1.0/size.x; float pixelHeight = 1.0/size.y; float aspect = pixelHeight/pixelWidth; diff --git a/examples/shapes/shapes_ball_physics.c b/examples/shapes/shapes_ball_physics.c index 293be1cd5..b790c7e90 100644 --- a/examples/shapes/shapes_ball_physics.c +++ b/examples/shapes/shapes_ball_physics.c @@ -139,14 +139,14 @@ int main(void) Ball *ball = &balls[i]; // The ball is not grabbed - if (!ball->grabbed) + if (!ball->grabbed) { // Ball repositioning using the velocity ball->pos.x += ball->vel.x * delta; ball->pos.y += ball->vel.y * delta; // Does the ball hit the screen right boundary? - if ((ball->pos.x + ball->radius) >= screenWidth) + if ((ball->pos.x + ball->radius) >= screenWidth) { ball->pos.x = screenWidth - ball->radius; // Ball repositioning ball->vel.x = -ball->vel.x*ball->elasticity; // Elasticity makes the ball lose 10% of its velocity on hit @@ -159,12 +159,12 @@ int main(void) } // The same for y axis - if ((ball->pos.y + ball->radius) >= screenHeight) + if ((ball->pos.y + ball->radius) >= screenHeight) { ball->pos.y = screenHeight - ball->radius; ball->vel.y = -ball->vel.y*ball->elasticity; } - else if ((ball->pos.y - ball->radius) <= 0) + else if ((ball->pos.y - ball->radius) <= 0) { ball->pos.y = ball->radius; ball->vel.y = -ball->vel.y*ball->elasticity; diff --git a/projects/4coder/main.c b/projects/4coder/main.c index 062d1d7db..e33f9a1db 100644 --- a/projects/4coder/main.c +++ b/projects/4coder/main.c @@ -1,7 +1,8 @@ #include #include "raylib.h" -int main() { +int main() +{ int screenWidth = 800; int screenHeight = 450; @@ -17,7 +18,8 @@ int main() { SetTargetFPS(60); - while (!WindowShouldClose()) { + while (!WindowShouldClose()) + { cam.position.x = sin(GetTime())*10.0f; cam.position.z = cos(GetTime())*10.0f; diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 986197b9d..3dd3eb9df 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -894,7 +894,8 @@ void SwapScreenBuffer(void) const canvas = Module.canvas; const ctx = canvas.getContext('2d'); - if (!Module.__img || (Module.__img.width !== width) || (Module.__img.height !== height)) { + if (!Module.__img || (Module.__img.width !== width) || (Module.__img.height !== height)) + { Module.__img = ctx.createImageData(width, height); } diff --git a/src/platforms/rcore_web_emscripten.c b/src/platforms/rcore_web_emscripten.c index ba2489a31..92caae99f 100644 --- a/src/platforms/rcore_web_emscripten.c +++ b/src/platforms/rcore_web_emscripten.c @@ -875,7 +875,8 @@ void SwapScreenBuffer(void) //const canvas = Module['canvas']; const ctx = canvas.getContext('2d'); - if (!Module.__img || (Module.__img.width !== width) || (Module.__img.height !== height)) { + if (!Module.__img || (Module.__img.width !== width) || (Module.__img.height !== height)) + { Module.__img = ctx.createImageData(width, height); } diff --git a/tools/rlparser/rlparser.c b/tools/rlparser/rlparser.c index f96dcc0bd..e69f7ad56 100644 --- a/tools/rlparser/rlparser.c +++ b/tools/rlparser/rlparser.c @@ -721,7 +721,8 @@ int main(int argc, char *argv[]) char v = structs[i].fieldType[originalIndex][k]; if ((v == '*') || (v == ' ') || (v == ',')) { - if (nameEnd != -1) { + if (nameEnd != -1) + { // Don't copy to last additional field if (fieldsRemaining != additionalFields) { @@ -1011,7 +1012,8 @@ int main(int argc, char *argv[]) ((linePtr[c - 4] == 'v') && (linePtr[c - 3] == 'o') && (linePtr[c - 2] == 'i') && - (linePtr[c - 1] == 'd'))) { + (linePtr[c - 1] == 'd'))) + { break; }