From a0087e75fbcf1a7dcf7e14f2b2f3cc500cc8e109 Mon Sep 17 00:00:00 2001 From: EGAMatsu Date: Sun, 2 Jun 2024 18:04:17 -0500 Subject: [PATCH] Ditto; But the window SHOULD be centered, and have the correct size. --- src/Platform_MacClassic.c | 8 +++++++- src/Window_MacClassic.c | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Platform_MacClassic.c b/src/Platform_MacClassic.c index bf5bf72ea..cabf4b9a3 100644 --- a/src/Platform_MacClassic.c +++ b/src/Platform_MacClassic.c @@ -115,6 +115,12 @@ cc_uint64 Stopwatch_ElapsedMicroseconds(cc_uint64 beg, cc_uint64 end) { return (end - beg) / 1000; } +void Stopwatch_Init(void) { + //TODO + cc_uint64 doSomething = Stopwatch_Measure(); +} + + /*########################################################################################################################* *-----------------------------------------------------Directory/File------------------------------------------------------* @@ -414,7 +420,7 @@ cc_bool Platform_DescribeError(cc_result res, cc_string* dst) { void Platform_Init(void) { printf("Macintosh ClassiCube has started to init.\n"); // Test, just to see if it's actually *running* at all. - Stopwatch_Measure(); + Stopwatch_Init(); } cc_result Platform_Encrypt(const void* data, int len, cc_string* dst) { diff --git a/src/Window_MacClassic.c b/src/Window_MacClassic.c index 99757adf3..605999235 100644 --- a/src/Window_MacClassic.c +++ b/src/Window_MacClassic.c @@ -31,9 +31,12 @@ void Window_Free(void) { } static void DoCreateWindow(int width, int height) { Rect r = qd.screenBits.bounds; + /* TODO: Make less-crap method of getting center. */ + int centerX = r.right/2; + int centerY = r.bottom/2; // TODO - SetRect(&r, r.left + 5, r.top + 45, r.right - 5, r.bottom - 5); + SetRect(&r, centerX-(width/2), centerY-(height/2), centerX+(width/2), centerY+(height/2)); win = NewWindow(NULL, &r, "\pClassiCube", true, 0, (WindowPtr)-1, false, 0); SetPort(win); }