From f91fc66fb61ee7246e49cfed0eec8ba5f13d93ca Mon Sep 17 00:00:00 2001 From: IoIxD Date: Sun, 19 Jul 2026 23:01:43 -0700 Subject: [PATCH] make some updates to get classicmacos.c working but its probably over --- CMakeLists.txt | 4 ++-- src/backend/classicmacos.c | 27 ++++++++++++++++++++++----- src/core.c | 8 ++------ src/dialog/messagebox.c | 2 +- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fde6fd1..b9e90d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,8 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(WIN32) -set(CMAKE_STATIC_LIBRARY_PREFIX "") -set(CMAKE_SHARED_LIBRARY_PREFIX "") + set(CMAKE_STATIC_LIBRARY_PREFIX "") + set(CMAKE_SHARED_LIBRARY_PREFIX "") endif() option(MW_CLASSIC_THEME "Use classic theme" OFF) diff --git a/src/backend/classicmacos.c b/src/backend/classicmacos.c index fb2549e..956e1e0 100644 --- a/src/backend/classicmacos.c +++ b/src/backend/classicmacos.c @@ -1,6 +1,5 @@ #include #include -#include #include "../../external/stb_ds.h" @@ -65,7 +64,11 @@ static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLL } ClosePoly(); - FillCPoly(p, &qd.ltGray); + + PenMode(patCopy); + RGBForeColor(&col); + PaintPoly(p); + KillPoly(p); EndUpdate(handle->cmacos.window); @@ -132,9 +135,23 @@ static void MwLLNextEventImpl(MwLL handle) { switch(event.what) { case updateEvt: { - } - // MwLLDispatch(handle, draw, NULL); - break; + /* + This is our blocker for getting anything running. + This needs to be called at this point to start drawing anything. + ...It locks up and/or crashes the entire system. At least on SheepShaver. + It's not a stack overflow, it's not anything in the drawing functions. + It's *something* else. But because Classic Mac OS development is like + digging up forbidden tombs while stabbing yourself in the eye several times, + I don't know what. + + Fun fact: for as much as everyone loves to glaze about AI being the future + of programming, even Claude got confused when I gave up and tried to ask it + for help. Information about Classic Mac OS probably takes up 0.0001% of its + knowledge base; god knows it's hard enough finding information online about + this! + */ + MwLLDispatch(handle, draw, NULL); + } break; case osEvt: break; case mouseUp: diff --git a/src/core.c b/src/core.c index cb39b1c..98da305 100644 --- a/src/core.c +++ b/src/core.c @@ -1063,9 +1063,7 @@ int MwLibraryInit(void) { #ifdef USE_GDI MwLLGDICallInit, #endif -#ifdef CLASSIC_MAC_OS - MwLLClassicMacOSCallInit, -#endif + #ifdef USE_HAIKU MwLLHaikuCallInit, #endif @@ -1109,9 +1107,7 @@ int MwLibraryInit(void) { #ifdef USE_GDI " GDI" #endif -#ifdef CLASSIC_MAC_OS - " ClassicMacOS" -#endif + "\n"); #endif return 1; diff --git a/src/dialog/messagebox.c b/src/dialog/messagebox.c index f7084ab..6a96f6d 100644 --- a/src/dialog/messagebox.c +++ b/src/dialog/messagebox.c @@ -70,7 +70,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi if((flag & MwMB_ICONMASK) != 0) { MwWidget icon; MwLLPixmap px; - unsigned int* data = NULL; + MwU32* data = NULL; icon = MwCreateWidget(MwImageClass, "image", window, 8, (h - 48) / 2, 48, 48);