From 76340398646e7cfadcae7e0101d7b6ece6da4852 Mon Sep 17 00:00:00 2001 From: EGAMatsu Date: Mon, 3 Jun 2024 00:40:58 -0500 Subject: [PATCH] Fix window creation func. --- src/Window_MacClassic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Window_MacClassic.c b/src/Window_MacClassic.c index f57d06c71..97f228730 100644 --- a/src/Window_MacClassic.c +++ b/src/Window_MacClassic.c @@ -49,14 +49,15 @@ void Window_Free(void) { } static void DoCreateWindow(int width, int height) { r = qd.screenBits.bounds; + Rect windR; /* TODO: Make less-crap method of getting center. */ int centerX = r.right/2; int centerY = r.bottom/2; - int ww = (width/2); int hh = (height/2); + int ww = (SCREEN_WIDTH/2); int hh = (SCREEN_HEIGHT/2); SetRect(&bitmapScreen.bounds, 0, 0, width, height); // TODO - SetRect(&r, centerX-ww, centerY-hh, centerX+ww, centerY+hh); - win = NewWindow(NULL, &r, "\pClassiCube", true, 0, (WindowPtr)-1, false, 0); + SetRect(&windR, centerX-ww, centerY-hh, centerX+ww, centerY+hh); + win = NewWindow(NULL, &windR, "\pClassiCube", true, 0, (WindowPtr)-1, false, 0); SetPort(win); }