Format review

This commit is contained in:
Ray 2026-05-13 09:16:29 +02:00
parent fbf132d1d1
commit c4b4fcc17e

View File

@ -810,8 +810,8 @@ void SetWindowSize(int width, int height)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height; CORE.Window.currentFbo.height = CORE.Window.render.height;
#else #else
@ -1139,9 +1139,9 @@ void SwapScreenBuffer(void)
#if defined(__APPLE__) #if defined(__APPLE__)
unsigned char temp = 0; unsigned char temp = 0;
unsigned char *p = NULL; unsigned char *p = NULL;
for (int i = 0; i < (platform.surfaceWidth * platform.surfaceHeight); i += 1) for (int i = 0; i < (platform.surfaceWidth*platform.surfaceHeight); i += 1)
{ {
p = platform.surfacePixels + (i * 4); p = platform.surfacePixels + (i*4);
temp = p[0]; temp = p[0];
p[0] = p[2]; p[0] = p[2];
p[2] = temp; p[2] = temp;
@ -1357,13 +1357,13 @@ void PollInputEvents(void)
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI))
{ {
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
SetupViewport(platform.window->w * currentMonitor->pixelRatio, platform.window->h * currentMonitor->pixelRatio); SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
CORE.Window.screen.width = platform.window->w; CORE.Window.screen.width = platform.window->w;
CORE.Window.screen.height = platform.window->h; CORE.Window.screen.height = platform.window->h;
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio;
} }
else else
{ {
@ -1406,10 +1406,10 @@ void PollInputEvents(void)
#if defined(__APPLE__) #if defined(__APPLE__)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
SetupViewport(platform.window->w * currentMonitor->pixelRatio, platform.window->h * currentMonitor->pixelRatio); SetupViewport(platform.window->w*currentMonitor->pixelRatio, platform.window->h*currentMonitor->pixelRatio);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height; CORE.Window.currentFbo.height = CORE.Window.render.height;
#endif #endif
@ -1427,7 +1427,7 @@ void PollInputEvents(void)
if (platform.surfacePixels != NULL) if (platform.surfacePixels != NULL)
{ {
RL_FREE(platform.surfacePixels); RL_FREE(platform.surfacePixels);
platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4); platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4);
} }
if (platform.surface != NULL) if (platform.surface != NULL)
@ -1743,8 +1743,8 @@ int InitPlatform(void)
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI))
{ {
#if !defined(__APPLE__) #if !defined(__APPLE__)
CORE.Window.screen.width = CORE.Window.screen.width * GetWindowScaleDPI().x; CORE.Window.screen.width = CORE.Window.screen.width*GetWindowScaleDPI().x;
CORE.Window.screen.height = CORE.Window.screen.height * GetWindowScaleDPI().y; CORE.Window.screen.height = CORE.Window.screen.height*GetWindowScaleDPI().y;
#endif #endif
} }
@ -1828,8 +1828,8 @@ int InitPlatform(void)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height; CORE.Window.currentFbo.height = CORE.Window.render.height;
#else #else
@ -1846,8 +1846,8 @@ int InitPlatform(void)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window); RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f); CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio; CORE.Window.render.width = CORE.Window.screen.width*currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio; CORE.Window.render.height = CORE.Window.screen.height*currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height; CORE.Window.currentFbo.height = CORE.Window.render.height;
#endif #endif
@ -1855,7 +1855,7 @@ int InitPlatform(void)
platform.surfaceWidth = CORE.Window.currentFbo.width; platform.surfaceWidth = CORE.Window.currentFbo.width;
platform.surfaceHeight = CORE.Window.currentFbo.height; platform.surfaceHeight = CORE.Window.currentFbo.height;
platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4); platform.surfacePixels = RL_MALLOC(platform.surfaceWidth*platform.surfaceHeight*4);
if (platform.surfacePixels == NULL) if (platform.surfacePixels == NULL)
{ {
TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize software pixel buffer"); TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize software pixel buffer");