Use existing ints instead of new ones

This commit is contained in:
Fayaz Shaikh 2026-03-02 21:24:47 -05:00
parent 25055da1ff
commit f5054f28a7
2 changed files with 6 additions and 8 deletions

View file

@ -84,9 +84,6 @@ BOOL g_bWidescreen = TRUE;
int g_iScreenWidth = 1920; int g_iScreenWidth = 1920;
int g_iScreenHeight = 1080; int g_iScreenHeight = 1080;
UINT g_ScreenWidth = 1920;
UINT g_ScreenHeight = 1080;
// Fullscreen toggle state // Fullscreen toggle state
static bool g_isFullscreen = false; static bool g_isFullscreen = false;
static WINDOWPLACEMENT g_wpPrev = { sizeof(g_wpPrev) }; static WINDOWPLACEMENT g_wpPrev = { sizeof(g_wpPrev) };
@ -431,8 +428,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SIZE: case WM_SIZE:
{ {
// Set the screen width and height used for calculating the aspect ratio // Set the screen width and height used for calculating the aspect ratio
g_ScreenWidth = LOWORD(lParam); g_iScreenWidth = LOWORD(lParam);
g_ScreenHeight = HIWORD(lParam); g_iScreenHeight = HIWORD(lParam);
app.DebugPrintf("width: %d, height: %d\n", g_iScreenWidth, g_iScreenHeight);
} }
break; break;
default: default:

View file

@ -48,12 +48,12 @@ void glLoadIdentity()
RenderManager.MatrixSetIdentity(); RenderManager.MatrixSetIdentity();
} }
extern UINT g_ScreenWidth; extern int g_iScreenWidth;
extern UINT g_ScreenHeight; extern int g_iScreenHeight;
void gluPerspective(float fovy, float aspect, float zNear, float zFar) void gluPerspective(float fovy, float aspect, float zNear, float zFar)
{ {
float dynamicAspect = (float)g_ScreenWidth / (float)g_ScreenHeight; float dynamicAspect = (float)g_iScreenWidth / (float)g_iScreenHeight;
RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar); RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar);
} }