Skip to content

Commit 0b9f463

Browse files
committed
REVIEWED: examples: Replace TABS and Remove trailing spaces
1 parent bd21d74 commit 0b9f463

36 files changed

+473
-480
lines changed

examples/audio/audio_fft_spectrum_visualizer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int main(void)
8686
Vector2 iResolution = { (float)screenWidth, (float)screenHeight };
8787

8888
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/fft.fs", GLSL_VERSION));
89-
89+
9090
int iResolutionLocation = GetShaderLocation(shader, "iResolution");
9191
int iChannel0Location = GetShaderLocation(shader, "iChannel0");
9292
SetShaderValue(shader, iResolutionLocation, &iResolution, SHADER_UNIFORM_VEC2);
@@ -153,16 +153,16 @@ int main(void)
153153
// Draw
154154
//----------------------------------------------------------------------------------
155155
BeginDrawing();
156-
156+
157157
ClearBackground(RAYWHITE);
158-
158+
159159
BeginShaderMode(shader);
160160
SetShaderValueTexture(shader, iChannel0Location, fftTexture);
161161
DrawTextureRec(bufferA.texture,
162162
(Rectangle){ 0, 0, (float)screenWidth, (float)-screenHeight },
163163
(Vector2){ 0, 0 }, WHITE);
164164
EndShaderMode();
165-
165+
166166
EndDrawing();
167167
//------------------------------------------------------------------------------
168168
}

examples/core/core_compute_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int main(void)
6464

6565
// Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
6666
base64Text = EncodeDataBase64((unsigned char *)textInput, textInputLen, &base64TextSize);
67-
67+
6868
hashCRC32 = ComputeCRC32((unsigned char *)textInput, textInputLen); // Compute CRC32 hash code (4 bytes)
6969
hashMD5 = ComputeMD5((unsigned char *)textInput, textInputLen); // Compute MD5 hash code, returns static int[4] (16 bytes)
7070
hashSHA1 = ComputeSHA1((unsigned char *)textInput, textInputLen); // Compute SHA1 hash code, returns static int[5] (20 bytes)

examples/core/core_delta_time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main(void)
5959
// GetFrameTime() returns the time it took to draw the last frame, in seconds (usually called delta time)
6060
// Uses the delta time to make the circle look like it's moving at a "consistent" speed regardless of FPS
6161

62-
// Multiply by 6.0 (an arbitrary value) in order to make the speed
62+
// Multiply by 6.0 (an arbitrary value) in order to make the speed
6363
// visually closer to the other circle (at 60 fps), for comparison
6464
deltaCircle.x += GetFrameTime()*6.0f*speed;
6565
// This circle can move faster or slower visually depending on the FPS
@@ -68,7 +68,7 @@ int main(void)
6868
// If either circle is off the screen, reset it back to the start
6969
if (deltaCircle.x > screenWidth) deltaCircle.x = 0;
7070
if (frameCircle.x > screenWidth) frameCircle.x = 0;
71-
71+
7272
// Reset both circles positions
7373
if (IsKeyPressed(KEY_R))
7474
{

examples/core/core_input_actions.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// Simple example for decoding input as actions, allowing remapping of input to different keys or gamepad buttons
1919
// For example instead of using `IsKeyDown(KEY_LEFT)`, you can use `IsActionDown(ACTION_LEFT)`
20-
// which can be reassigned to e.g. KEY_A and also assigned to a gamepad button. the action will trigger with either gamepad or keys
20+
// which can be reassigned to e.g. KEY_A and also assigned to a gamepad button. the action will trigger with either gamepad or keys
2121

2222
#include "raylib.h"
2323

@@ -44,7 +44,7 @@ typedef struct ActionInput {
4444
// Global Variables Definition
4545
//----------------------------------------------------------------------------------
4646
static int gamepadIndex = 0; // Gamepad default index
47-
static ActionInput actionInputs[MAX_ACTION] = { 0 };
47+
static ActionInput actionInputs[MAX_ACTION] = { 0 };
4848

4949
//----------------------------------------------------------------------------------
5050
// Module Functions Declaration
@@ -67,15 +67,15 @@ int main(void)
6767
const int screenHeight = 450;
6868

6969
InitWindow(screenWidth, screenHeight, "raylib [core] example - input actions");
70-
71-
// Set default actions
70+
71+
// Set default actions
7272
char actionSet = 0;
7373
SetActionsDefault();
7474
bool releaseAction = false;
7575

7676
Vector2 position = (Vector2){ 400.0f, 200.0f };
7777
Vector2 size = (Vector2){ 40.0f, 40.0f };
78-
78+
7979
SetTargetFPS(60);
8080
//--------------------------------------------------------------------------------------
8181

@@ -85,7 +85,7 @@ int main(void)
8585
// Update
8686
//----------------------------------------------------------------------------------
8787
gamepadIndex = 0; // Set gamepad being checked
88-
88+
8989
if (IsActionDown(ACTION_UP)) position.y -= 2;
9090
if (IsActionDown(ACTION_DOWN)) position.y += 2;
9191
if (IsActionDown(ACTION_LEFT)) position.x -= 2;
@@ -95,12 +95,12 @@ int main(void)
9595
position.x = (screenWidth-size.x)/2;
9696
position.y = (screenHeight-size.y)/2;
9797
}
98-
98+
9999
// Register release action for one frame
100100
releaseAction = false;
101101
if (IsActionReleased(ACTION_FIRE)) releaseAction = true;
102102

103-
// Switch control scheme by pressing TAB
103+
// Switch control scheme by pressing TAB
104104
if (IsKeyPressed(KEY_TAB))
105105
{
106106
actionSet = !actionSet;
@@ -116,7 +116,7 @@ int main(void)
116116
ClearBackground(GRAY);
117117

118118
DrawRectangleV(position, size, releaseAction? BLUE : RED);
119-
119+
120120
DrawText((actionSet == 0)? "Current input set: WASD (default)" : "Current input set: Cursor", 10, 10, 20, WHITE);
121121
DrawText("Use TAB key to toggles Actions keyset", 10, 50, 20, GREEN);
122122

@@ -140,9 +140,9 @@ int main(void)
140140
static bool IsActionPressed(int action)
141141
{
142142
bool result = false;
143-
143+
144144
if (action < MAX_ACTION) result = (IsKeyPressed(actionInputs[action].key) || IsGamepadButtonPressed(gamepadIndex, actionInputs[action].button));
145-
145+
146146
return result;
147147
}
148148

@@ -151,20 +151,20 @@ static bool IsActionPressed(int action)
151151
static bool IsActionReleased(int action)
152152
{
153153
bool result = false;
154-
154+
155155
if (action < MAX_ACTION) result = (IsKeyReleased(actionInputs[action].key) || IsGamepadButtonReleased(gamepadIndex, actionInputs[action].button));
156-
156+
157157
return result;
158158
}
159159

160160
// Check action key/button down
161161
// NOTE: Combines key down and gamepad button down in one action
162-
static bool IsActionDown(int action)
162+
static bool IsActionDown(int action)
163163
{
164164
bool result = false;
165-
165+
166166
if (action < MAX_ACTION) result = (IsKeyDown(actionInputs[action].key) || IsGamepadButtonDown(gamepadIndex, actionInputs[action].button));
167-
167+
168168
return result;
169169
}
170170

examples/core/core_input_gamepad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main(void)
5050
const float rightStickDeadzoneY = 0.1f;
5151
const float leftTriggerDeadzone = -0.9f;
5252
const float rightTriggerDeadzone = -0.9f;
53-
53+
5454
Rectangle vibrateButton = { 0 };
5555

5656
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
@@ -97,7 +97,7 @@ int main(void)
9797
if (leftTrigger < leftTriggerDeadzone) leftTrigger = -1.0f;
9898
if (rightTrigger < rightTriggerDeadzone) rightTrigger = -1.0f;
9999

100-
if ((TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_1) > -1) ||
100+
if ((TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_1) > -1) ||
101101
(TextFindIndex(TextToLower(GetGamepadName(gamepad)), XBOX_ALIAS_2) > -1))
102102
{
103103
DrawTexture(texXboxPad, 0, 0, DARKGRAY);

examples/core/core_input_gestures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ int main(void)
118118
//--------------------------------------------------------------------------------------
119119
CloseWindow(); // Close window and OpenGL context
120120
//--------------------------------------------------------------------------------------
121-
121+
122122
return 0;
123123
}

examples/core/core_input_virtual_controls.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Example originally created with raylib 5.0, last time updated with raylib 5.0
88
*
9-
* Example contributed by GreenSnakeLinux (@GreenSnakeLinux),
9+
* Example contributed by GreenSnakeLinux (@GreenSnakeLinux),
1010
* reviewed by Ramon Santamaria (@raysan5), oblerion (@oblerion) and danilwhale (@danilwhale)
1111
*
1212
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
@@ -86,7 +86,7 @@ int main(void)
8686
pressedButton = BUTTON_NONE;
8787

8888
// Make sure user is pressing left mouse button if they're from desktop
89-
if ((GetTouchPointCount() > 0) ||
89+
if ((GetTouchPointCount() > 0) ||
9090
((GetTouchPointCount() == 0) && IsMouseButtonDown(MOUSE_BUTTON_LEFT)))
9191
{
9292
// Find nearest D-Pad button to the input position
@@ -113,7 +113,7 @@ int main(void)
113113
default: break;
114114
};
115115
//--------------------------------------------------------------------------
116-
116+
117117
// Draw
118118
//--------------------------------------------------------------------------
119119
BeginDrawing();

examples/core/core_monitor_detector.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@ int main(void)
6666
for (int i = 0; i < monitorCount; i++)
6767
{
6868
monitors[i] = (MonitorInfo){
69-
GetMonitorPosition(i),
70-
GetMonitorName(i),
69+
GetMonitorPosition(i),
70+
GetMonitorName(i),
7171
GetMonitorWidth(i),
7272
GetMonitorHeight(i),
7373
GetMonitorPhysicalWidth(i),
7474
GetMonitorPhysicalHeight(i),
7575
GetMonitorRefreshRate(i)
7676
};
77-
77+
7878
if (monitors[i].position.x < monitorOffsetX) monitorOffsetX = -(int)monitors[i].position.x;
7979

8080
const int width = (int)monitors[i].position.x + monitors[i].width;
8181
const int height = (int)monitors[i].position.y + monitors[i].height;
82-
82+
8383
if (maxWidth < width) maxWidth = width;
8484
if (maxHeight < height) maxHeight = height;
8585
}
8686

87-
if (IsKeyPressed(KEY_ENTER) && (monitorCount > 1))
87+
if (IsKeyPressed(KEY_ENTER) && (monitorCount > 1))
8888
{
8989
currentMonitorIndex += 1;
9090

@@ -95,8 +95,8 @@ int main(void)
9595
}
9696
else currentMonitorIndex = GetCurrentMonitor(); // Get currentMonitorIndex if manually moved
9797

98-
float monitorScale = 0.6f;
99-
98+
float monitorScale = 0.6f;
99+
100100
if (maxHeight > (maxWidth + monitorOffsetX)) monitorScale *= ((float)screenHeight/(float)maxHeight);
101101
else monitorScale *= ((float)screenWidth/(float)(maxWidth + monitorOffsetX));
102102
//----------------------------------------------------------------------------------
@@ -125,9 +125,9 @@ int main(void)
125125
// Draw monitor name and information inside the rectangle
126126
DrawText(TextFormat("[%i] %s", i, monitors[i].name), (int)rec.x + 10, (int)rec.y + (int)(100*monitorScale), (int)(120*monitorScale), BLUE);
127127
DrawText(
128-
TextFormat("Resolution: [%ipx x %ipx]\nRefreshRate: [%ihz]\nPhysical Size: [%imm x %imm]\nPosition: %3.0f x %3.0f",
129-
monitors[i].width,
130-
monitors[i].height,
128+
TextFormat("Resolution: [%ipx x %ipx]\nRefreshRate: [%ihz]\nPhysical Size: [%imm x %imm]\nPosition: %3.0f x %3.0f",
129+
monitors[i].width,
130+
monitors[i].height,
131131
monitors[i].refreshRate,
132132
monitors[i].physicalWidth,
133133
monitors[i].physicalHeight,

examples/core/core_undo_redo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define MAX_UNDO_STATES 26 // Maximum undo states supported for the ring buffer
2424

25-
#define GRID_CELL_SIZE 24
25+
#define GRID_CELL_SIZE 24
2626
#define MAX_GRID_CELLS_X 30
2727
#define MAX_GRID_CELLS_Y 13
2828

@@ -57,7 +57,7 @@ int main(void)
5757
//--------------------------------------------------------------------------------------
5858
const int screenWidth = 800;
5959
const int screenHeight = 450;
60-
60+
6161
// We have multiple options to implement an Undo/Redo system
6262
// Probably the most professional one is using the Command pattern to
6363
// define Actions and store those actions into an array as the events happen,

examples/core/core_viewport_scaling.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// For itteration purposes and teaching example
2121
#define RESOLUTION_COUNT 4
2222

23-
enum ViewportType
23+
enum ViewportType
2424
{
2525
// Only upscale, useful for pixel art
2626
KEEP_ASPECT_INTEGER,
@@ -113,7 +113,7 @@ int main(void)
113113
}
114114
Vector2 mousePosition = GetMousePosition();
115115
bool mousePressed = IsMouseButtonPressed(MOUSE_BUTTON_LEFT);
116-
116+
117117
// Check buttons and rescale
118118
if (CheckCollisionPointRec(mousePosition, decreaseResolutionButton) && mousePressed){
119119
resolutionIndex = (resolutionIndex + RESOLUTION_COUNT - 1) % RESOLUTION_COUNT;

0 commit comments

Comments
 (0)