Skip to content

Commit d56ab67

Browse files
committed
spaces not tabs
1 parent 4bed374 commit d56ab67

File tree

3 files changed

+86
-86
lines changed

3 files changed

+86
-86
lines changed

src/platforms/rcore_desktop_glfw.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1753,12 +1753,12 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
17531753

17541754
if (IsWindowFullscreen()) return;
17551755

1756-
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1757-
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1758-
{
1759-
width = (int)(width / GetWindowScaleDPI().x);
1760-
height = (int)(height / GetWindowScaleDPI().y);
1761-
}
1756+
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1757+
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1758+
{
1759+
width = (int)(width / GetWindowScaleDPI().x);
1760+
height = (int)(height / GetWindowScaleDPI().y);
1761+
}
17621762

17631763
// Set current screen size
17641764
CORE.Window.screen.width = width;

src/platforms/rcore_desktop_rgfw.c

+69-69
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ void CloseWindow(void);
7676

7777
#if defined(_WIN32) || defined(_WIN64)
7878
#define WIN32_LEAN_AND_MEAN
79-
#define Rectangle rectangle_win32
79+
#define Rectangle rectangle_win32
8080
#define CloseWindow CloseWindow_win32
8181
#define ShowCursor __imp_ShowCursor
82-
#define _APISETSTRING_
83-
84-
#undef MAX_PATH
82+
#define _APISETSTRING_
83+
84+
#undef MAX_PATH
8585

86-
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char *lpMultiByteStr, int cbMultiByte, wchar_t *lpWideCharStr, int cchWideChar);
86+
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char *lpMultiByteStr, int cbMultiByte, wchar_t *lpWideCharStr, int cchWideChar);
8787
#endif
8888

8989
#if defined(__APPLE__)
@@ -103,8 +103,8 @@ void CloseWindow(void);
103103
#undef CloseWindow
104104
#undef Rectangle
105105

106-
#undef MAX_PATH
107-
#define MAX_PATH 1025
106+
#undef MAX_PATH
107+
#define MAX_PATH 1025
108108
#endif
109109

110110
#if defined(__APPLE__)
@@ -896,23 +896,23 @@ const char *GetKeyName(int key)
896896
static KeyboardKey ConvertScancodeToKey(u32 keycode);
897897

898898
int RGFW_gpConvTable[18] = {
899-
[RGFW_gamepadY] = GAMEPAD_BUTTON_RIGHT_FACE_UP,
900-
[RGFW_gamepadB] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT,
901-
[RGFW_gamepadA] = GAMEPAD_BUTTON_RIGHT_FACE_DOWN,
902-
[RGFW_gamepadX] = GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
903-
[RGFW_gamepadL1] = GAMEPAD_BUTTON_LEFT_TRIGGER_1,
904-
[RGFW_gamepadR1] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
905-
[RGFW_gamepadL2] = GAMEPAD_BUTTON_LEFT_TRIGGER_2,
906-
[RGFW_gamepadR2] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
907-
[RGFW_gamepadSelect] = GAMEPAD_BUTTON_MIDDLE_LEFT,
908-
[RGFW_gamepadHome] = GAMEPAD_BUTTON_MIDDLE,
909-
[RGFW_gamepadStart] = GAMEPAD_BUTTON_MIDDLE_RIGHT,
910-
[RGFW_gamepadUp] = GAMEPAD_BUTTON_LEFT_FACE_UP,
911-
[RGFW_gamepadRight] = GAMEPAD_BUTTON_LEFT_FACE_RIGHT,
912-
[RGFW_gamepadDown] = GAMEPAD_BUTTON_LEFT_FACE_DOWN,
913-
[RGFW_gamepadLeft] = GAMEPAD_BUTTON_LEFT_FACE_LEFT,
914-
[RGFW_gamepadL3] = GAMEPAD_BUTTON_LEFT_THUMB,
915-
[RGFW_gamepadR3] = GAMEPAD_BUTTON_RIGHT_THUMB,
899+
[RGFW_gamepadY] = GAMEPAD_BUTTON_RIGHT_FACE_UP,
900+
[RGFW_gamepadB] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT,
901+
[RGFW_gamepadA] = GAMEPAD_BUTTON_RIGHT_FACE_DOWN,
902+
[RGFW_gamepadX] = GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
903+
[RGFW_gamepadL1] = GAMEPAD_BUTTON_LEFT_TRIGGER_1,
904+
[RGFW_gamepadR1] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
905+
[RGFW_gamepadL2] = GAMEPAD_BUTTON_LEFT_TRIGGER_2,
906+
[RGFW_gamepadR2] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
907+
[RGFW_gamepadSelect] = GAMEPAD_BUTTON_MIDDLE_LEFT,
908+
[RGFW_gamepadHome] = GAMEPAD_BUTTON_MIDDLE,
909+
[RGFW_gamepadStart] = GAMEPAD_BUTTON_MIDDLE_RIGHT,
910+
[RGFW_gamepadUp] = GAMEPAD_BUTTON_LEFT_FACE_UP,
911+
[RGFW_gamepadRight] = GAMEPAD_BUTTON_LEFT_FACE_RIGHT,
912+
[RGFW_gamepadDown] = GAMEPAD_BUTTON_LEFT_FACE_DOWN,
913+
[RGFW_gamepadLeft] = GAMEPAD_BUTTON_LEFT_FACE_LEFT,
914+
[RGFW_gamepadL3] = GAMEPAD_BUTTON_LEFT_THUMB,
915+
[RGFW_gamepadR3] = GAMEPAD_BUTTON_RIGHT_THUMB,
916916
};
917917

918918
// Register all input events
@@ -923,7 +923,7 @@ void PollInputEvents(void)
923923
// because ProcessGestureEvent() is just called on an event, not every frame
924924
UpdateGestures();
925925
#endif
926-
926+
927927
// Reset keys/chars pressed registered
928928
CORE.Input.Keyboard.keyPressedQueueCount = 0;
929929
CORE.Input.Keyboard.charPressedQueueCount = 0;
@@ -994,7 +994,7 @@ void PollInputEvents(void)
994994
RGFW_event *event = &platform.window->event;
995995
// All input events can be processed after polling
996996

997-
switch (event->type)
997+
switch (event->type)
998998
{
999999
case RGFW_mouseEnter: CORE.Input.Mouse.cursorOnScreen = true; break;
10001000
case RGFW_mouseLeave: CORE.Input.Mouse.cursorOnScreen = false; break;
@@ -1015,7 +1015,7 @@ void PollInputEvents(void)
10151015

10161016
CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char));
10171017
strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event->droppedFiles[i]);
1018-
1018+
10191019
CORE.Window.dropFileCount++;
10201020
}
10211021
else if (CORE.Window.dropFileCount < 1024)
@@ -1034,17 +1034,17 @@ void PollInputEvents(void)
10341034
{
10351035
SetupViewport(platform.window->r.w, platform.window->r.h);
10361036

1037-
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1038-
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1039-
{
1040-
CORE.Window.screen.width = (int)(platform.window->r.w / GetWindowScaleDPI().x);
1041-
CORE.Window.screen.height = (int)(platform.window->r.h / GetWindowScaleDPI().y);
1042-
}
1043-
else
1044-
{
1045-
CORE.Window.screen.width = platform.window->r.w;
1046-
CORE.Window.screen.height = platform.window->r.h;
1047-
}
1037+
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1038+
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1039+
{
1040+
CORE.Window.screen.width = (int)(platform.window->r.w / GetWindowScaleDPI().x);
1041+
CORE.Window.screen.height = (int)(platform.window->r.h / GetWindowScaleDPI().y);
1042+
}
1043+
else
1044+
{
1045+
CORE.Window.screen.width = platform.window->r.w;
1046+
CORE.Window.screen.height = platform.window->r.h;
1047+
}
10481048

10491049
CORE.Window.currentFbo.width = platform.window->r.w;
10501050
CORE.Window.currentFbo.height = platform.window->r.h;
@@ -1179,7 +1179,7 @@ void PollInputEvents(void)
11791179
} break;
11801180
case RGFW_gamepadButtonPressed:
11811181
{
1182-
int button = RGFW_gpConvTable[event->button];
1182+
int button = RGFW_gpConvTable[event->button];
11831183

11841184
if (button >= 0)
11851185
{
@@ -1189,42 +1189,42 @@ void PollInputEvents(void)
11891189
} break;
11901190
case RGFW_gamepadButtonReleased:
11911191
{
1192-
int button = RGFW_gpConvTable[event->button];
1192+
int button = RGFW_gpConvTable[event->button];
11931193

11941194
CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = 0;
11951195
if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0;
11961196
} break;
11971197
case RGFW_gamepadAxisMove:
11981198
{
11991199
int axis = -1;
1200-
float value = 0;
1200+
float value = 0;
12011201

1202-
switch(event->whichAxis)
1202+
switch(event->whichAxis)
12031203
{
1204-
case 0:
1205-
{
1206-
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_X] = event->axis[0].x / 100.0f;
1207-
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_Y] = event->axis[0].y / 100.0f;
1208-
} break;
1209-
case 1:
1210-
{
1211-
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_X] = event->axis[1].x / 100.0f;
1212-
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_Y] = event->axis[1].y / 100.0f;
1213-
} break;
1214-
case 2: axis = GAMEPAD_AXIS_LEFT_TRIGGER;
1215-
case 3:
1204+
case 0:
1205+
{
1206+
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_X] = event->axis[0].x / 100.0f;
1207+
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_Y] = event->axis[0].y / 100.0f;
1208+
} break;
1209+
case 1:
1210+
{
1211+
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_X] = event->axis[1].x / 100.0f;
1212+
CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_Y] = event->axis[1].y / 100.0f;
1213+
} break;
1214+
case 2: axis = GAMEPAD_AXIS_LEFT_TRIGGER;
1215+
case 3:
12161216
{
12171217
if (axis == -1) axis = GAMEPAD_AXIS_RIGHT_TRIGGER;
12181218

1219-
int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2;
1220-
int pressed = (value > 0.1f);
1221-
CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = pressed;
1222-
1223-
if (pressed) CORE.Input.Gamepad.lastButtonPressed = button;
1224-
else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0;
1225-
}
1226-
default: break;
1227-
}
1219+
int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2;
1220+
int pressed = (value > 0.1f);
1221+
CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = pressed;
1222+
1223+
if (pressed) CORE.Input.Gamepad.lastButtonPressed = button;
1224+
else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0;
1225+
}
1226+
default: break;
1227+
}
12281228
} break;
12291229
default: break;
12301230
}
@@ -1322,14 +1322,14 @@ int InitPlatform(void)
13221322
CORE.Window.display.width = screenSize.w;
13231323
CORE.Window.display.height = screenSize.h;
13241324
#else
1325-
CORE.Window.display.width = CORE.Window.screen.width;
1325+
CORE.Window.display.width = CORE.Window.screen.width;
13261326
CORE.Window.display.height = CORE.Window.screen.height;
13271327
#endif
1328-
// TODO: Is this needed by raylib now?
1328+
// TODO: Is this needed by raylib now?
13291329
// If so, rcore_desktop_sdl should be updated too
1330-
//SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
1331-
1332-
if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1);
1330+
//SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
1331+
1332+
if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1);
13331333
RGFW_window_makeCurrent(platform.window);
13341334

13351335
// Check surface and context activation
@@ -1410,5 +1410,5 @@ static KeyboardKey ConvertScancodeToKey(u32 keycode)
14101410
{
14111411
if (keycode > sizeof(keyMappingRGFW)/sizeof(unsigned short)) return 0;
14121412

1413-
return keyMappingRGFW[keycode];
1413+
return keyMappingRGFW[keycode];
14141414
}

src/platforms/rcore_desktop_sdl.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -1451,17 +1451,17 @@ void PollInputEvents(void)
14511451
const int width = event.window.data1;
14521452
const int height = event.window.data2;
14531453
SetupViewport(width, height);
1454-
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1455-
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1456-
{
1457-
CORE.Window.screen.width = (int)(width / GetWindowScaleDPI().x);
1458-
CORE.Window.screen.height = (int)(height / GetWindowScaleDPI().y);
1459-
}
1460-
else
1461-
{
1462-
CORE.Window.screen.width = width;
1463-
CORE.Window.screen.height = height;
1464-
}
1454+
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1455+
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
1456+
{
1457+
CORE.Window.screen.width = (int)(width / GetWindowScaleDPI().x);
1458+
CORE.Window.screen.height = (int)(height / GetWindowScaleDPI().y);
1459+
}
1460+
else
1461+
{
1462+
CORE.Window.screen.width = width;
1463+
CORE.Window.screen.height = height;
1464+
}
14651465
CORE.Window.currentFbo.width = width;
14661466
CORE.Window.currentFbo.height = height;
14671467
CORE.Window.resizedLastFrame = true;

0 commit comments

Comments
 (0)