From 5164ef1a546d4bbb4e997380d6e53d6c91e836a8 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 7 Oct 2023 11:30:04 -0400 Subject: [PATCH] Refactor MxOmni/LegoOmni headers to use forward declarations (#148) * Refactor MxOmni/LegoOmni headers to use forward declarations * Fixes * Fix build * Fix deps --- ISLE/isleapp.cpp | 13 ++++++++++++- LEGO1/legofullscreenmovie.cpp | 4 +++- LEGO1/legogamestate.cpp | 2 ++ LEGO1/legonavcontroller.cpp | 1 + LEGO1/legoomni.cpp | 4 +++- LEGO1/legoomni.h | 31 +++++++++++++++---------------- LEGO1/mxdisplaysurface.cpp | 2 ++ LEGO1/mxdsaction.cpp | 5 +++-- LEGO1/mxmusicmanager.cpp | 2 ++ LEGO1/mxnotificationmanager.cpp | 5 +++-- LEGO1/mxomni.cpp | 12 ++++++++++++ LEGO1/mxomni.h | 30 ++++++++++++++++-------------- LEGO1/mxpalette.cpp | 2 ++ LEGO1/mxpresenter.cpp | 7 +++++-- LEGO1/mxsoundmanager.cpp | 2 +- LEGO1/mxstreamer.cpp | 5 +++-- LEGO1/mxthread.cpp | 5 +++-- LEGO1/mxtransitionmanager.cpp | 8 +++++++- LEGO1/mxtransitionmanager.h | 2 ++ LEGO1/skateboard.cpp | 2 ++ 20 files changed, 99 insertions(+), 45 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index c20f1652..87f3ebe2 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -3,14 +3,25 @@ #include -#include "legoomni.h" #include "legoanimationmanager.h" #include "legobuildingmanager.h" +#include "legogamestate.h" +#include "legoinputmanager.h" #include "legomodelpresenter.h" +#include "legoomni.h" #include "legopartpresenter.h" +#include "legoroi.h" +#include "legovideomanager.h" #include "legoworldpresenter.h" +#include "mxbackgroundaudiomanager.h" #include "mxdirectdraw.h" #include "mxdsaction.h" +#include "mxomnicreateflags.h" +#include "mxomnicreateparam.h" +#include "mxstreamer.h" +#include "mxticklemanager.h" +#include "mxtimer.h" +#include "mxtransitionmanager.h" #include "res/resource.h" diff --git a/LEGO1/legofullscreenmovie.cpp b/LEGO1/legofullscreenmovie.cpp index f2a287f3..cb803133 100644 --- a/LEGO1/legofullscreenmovie.cpp +++ b/LEGO1/legofullscreenmovie.cpp @@ -1,6 +1,8 @@ #include "legofullscreenmovie.h" -#include "mxtypes.h" + #include "legoomni.h" +#include "legovideomanager.h" +#include "mxtypes.h" #include "decomp.h" DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24) diff --git a/LEGO1/legogamestate.cpp b/LEGO1/legogamestate.cpp index 0f444f95..a08ce8e2 100644 --- a/LEGO1/legogamestate.cpp +++ b/LEGO1/legogamestate.cpp @@ -1,5 +1,7 @@ #include "legogamestate.h" + #include "legoomni.h" +#include "mxvariabletable.h" #include "decomp.h" // Based on the highest dword offset (0x42c) referenced in the constructor. diff --git a/LEGO1/legonavcontroller.cpp b/LEGO1/legonavcontroller.cpp index 90c0a485..1f056f59 100644 --- a/LEGO1/legonavcontroller.cpp +++ b/LEGO1/legonavcontroller.cpp @@ -1,6 +1,7 @@ #include "legonavcontroller.h" #include "legoomni.h" +#include "legovideomanager.h" #include "legoutil.h" // 0x100f4c28 diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 58eed5c1..2bff73af 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -1,6 +1,8 @@ #include "legoomni.h" -#include "mxdsobject.h" +#include "mxbackgroundaudiomanager.h" +#include "mxdsfile.h" +#include "legogamestate.h" // 0x100f4588 char *g_nocdSourceName = NULL; diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 044275b4..122c77de 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -2,25 +2,24 @@ #define LEGOOMNI_H #include "compat.h" -#include "legoentity.h" -#include "legoinputmanager.h" -#include "legogamestate.h" -#include "legonavcontroller.h" -#include "legopathboundary.h" -#include "legoroi.h" -#include "legovideomanager.h" -#include "mxatomid.h" -#include "mxbackgroundaudiomanager.h" -#include "mxdsaction.h" -#include "mxdsfile.h" -#include "mxdsobject.h" #include "mxomni.h" -#include "mxtransitionmanager.h" -#include "isle.h" -#include "legobuildingmanager.h" -#include "legoplantmanager.h" +#include "mxdsaction.h" +class Isle; +class LegoBuildingManager; +class LegoEntity; +class LegoGameState; +class LegoInputManager; +class LegoNavController; +class LegoPathBoundary; +class LegoPlantManager; +class LegoROI; class LegoSoundManager; +class LegoVideoManager; +class LegoWorld; +class MxAtomId; +class MxBackgroundAudioManager; +class MxDSFile; class MxTransitionManager; // VTABLE 0x100d8638 diff --git a/LEGO1/mxdisplaysurface.cpp b/LEGO1/mxdisplaysurface.cpp index e22244c5..05a50475 100644 --- a/LEGO1/mxdisplaysurface.cpp +++ b/LEGO1/mxdisplaysurface.cpp @@ -1,5 +1,7 @@ #include "mxdisplaysurface.h" + #include "mxomni.h" +#include "mxvideomanager.h" DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac); diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp index 3411a460..0ac01543 100644 --- a/LEGO1/mxdsaction.cpp +++ b/LEGO1/mxdsaction.cpp @@ -1,10 +1,11 @@ #include "mxdsaction.h" +#include "mxomni.h" +#include "mxtimer.h" + #include #include -#include "mxomni.h" - DECOMP_SIZE_ASSERT(MxDSAction, 0x94) // GLOBAL OFFSET: LEGO1 0x10101410 diff --git a/LEGO1/mxmusicmanager.cpp b/LEGO1/mxmusicmanager.cpp index 247b6596..6f49adcc 100644 --- a/LEGO1/mxmusicmanager.cpp +++ b/LEGO1/mxmusicmanager.cpp @@ -1,5 +1,7 @@ #include "mxmusicmanager.h" +#include "mxticklemanager.h" #include "mxomni.h" + #include DECOMP_SIZE_ASSERT(MxMusicManager, 0x58); diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp index 1b097067..cb653ba4 100644 --- a/LEGO1/mxnotificationmanager.cpp +++ b/LEGO1/mxnotificationmanager.cpp @@ -1,7 +1,8 @@ +#include "mxnotificationmanager.h" + #include "legoomni.h" #include "mxautolocker.h" -#include "mxcore.h" -#include "mxnotificationmanager.h" +#include "mxticklemanager.h" #include "mxparam.h" #include "mxtypes.h" diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index ed870b34..c4d6d471 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -1,5 +1,17 @@ #include "mxomni.h" +#include "mxatomidcounter.h" +#include "mxeventmanager.h" +#include "mxmusicmanager.h" +#include "mxnotificationmanager.h" +#include "mxobjectfactory.h" +#include "mxomnicreateparam.h" +#include "mxsoundmanager.h" +#include "mxstreamer.h" +#include "mxticklemanager.h" +#include "mxtimer.h" +#include "mxvideomanager.h" + // 0x101015b8 char g_hdPath[1024]; diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 9c7d6b0a..585068ce 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -1,21 +1,23 @@ #ifndef MXOMNI_H #define MXOMNI_H +#include "mxcore.h" +#include "mxstring.h" #include "mxcriticalsection.h" -#include "mxdsaction.h" -#include "mxeventmanager.h" -#include "mxmusicmanager.h" -#include "mxnotificationmanager.h" -#include "mxobjectfactory.h" -#include "mxomnicreateflags.h" -#include "mxomnicreateparam.h" -#include "mxsoundmanager.h" -#include "mxstreamer.h" -#include "mxticklemanager.h" -#include "mxtimer.h" -#include "mxvariabletable.h" -#include "mxvideomanager.h" -#include "mxatomidcounter.h" + +class MxAtomIdCounterSet; +class MxDSAction; +class MxEventManager; +class MxMusicManager; +class MxNotificationManager; +class MxObjectFactory; +class MxOmniCreateParam; +class MxSoundManager; +class MxStreamer; +class MxTickleManager; +class MxTimer; +class MxVariableTable; +class MxVideoManager; // VTABLE 0x100dc168 // SIZE 0x68 diff --git a/LEGO1/mxpalette.cpp b/LEGO1/mxpalette.cpp index 7fb02f4f..cdd1597f 100644 --- a/LEGO1/mxpalette.cpp +++ b/LEGO1/mxpalette.cpp @@ -1,5 +1,7 @@ #include "mxpalette.h" + #include "mxomni.h" +#include "mxvideomanager.h" // GLOBAL: LEGO1 0x10102188 0x400 PALETTEENTRY g_defaultPaletteEntries[256] = diff --git a/LEGO1/mxpresenter.cpp b/LEGO1/mxpresenter.cpp index b57af821..5afafc79 100644 --- a/LEGO1/mxpresenter.cpp +++ b/LEGO1/mxpresenter.cpp @@ -1,14 +1,17 @@ #include "mxpresenter.h" + +#include "legoomni.h" #include "mxautolocker.h" #include "mxparam.h" -#include "legoomni.h" #include "mxdsanim.h" #include "mxdssound.h" -#include +#include "mxnotificationmanager.h" #include "decomp.h" #include "define.h" +#include + DECOMP_SIZE_ASSERT(MxPresenter, 0x40); // OFFSET: LEGO1 0x100b4d50 diff --git a/LEGO1/mxsoundmanager.cpp b/LEGO1/mxsoundmanager.cpp index 16d504ce..466843e3 100644 --- a/LEGO1/mxsoundmanager.cpp +++ b/LEGO1/mxsoundmanager.cpp @@ -1,5 +1,5 @@ #include "mxsoundmanager.h" - +#include "mxticklemanager.h" #include "mxomni.h" DECOMP_SIZE_ASSERT(MxSoundManager, 0x3c); diff --git a/LEGO1/mxstreamer.cpp b/LEGO1/mxstreamer.cpp index 53d7303f..eef989bc 100644 --- a/LEGO1/mxstreamer.cpp +++ b/LEGO1/mxstreamer.cpp @@ -1,10 +1,11 @@ #include "mxstreamer.h" -#include - #include "legoomni.h" #include "mxdiskstreamcontroller.h" #include "mxramstreamcontroller.h" +#include "mxnotificationmanager.h" + +#include DECOMP_SIZE_ASSERT(MxStreamer, 0x2c); diff --git a/LEGO1/mxthread.cpp b/LEGO1/mxthread.cpp index b63019ed..fed82eca 100644 --- a/LEGO1/mxthread.cpp +++ b/LEGO1/mxthread.cpp @@ -1,9 +1,10 @@ #include "mxthread.h" -#include - #include "mxomni.h" +#include "mxtimer.h" + +#include // OFFSET: LEGO1 0x100bf690 MxResult MxThread::Run() diff --git a/LEGO1/mxtransitionmanager.cpp b/LEGO1/mxtransitionmanager.cpp index d34df54f..8d52266c 100644 --- a/LEGO1/mxtransitionmanager.cpp +++ b/LEGO1/mxtransitionmanager.cpp @@ -1,6 +1,12 @@ #include "mxtransitionmanager.h" -#include "legoutil.h" + #include "legovideomanager.h" +#include "legoinputmanager.h" +#include "legoutil.h" +#include "legoworld.h" +#include "mxbackgroundaudiomanager.h" +#include "mxparam.h" +#include "mxticklemanager.h" DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900); diff --git a/LEGO1/mxtransitionmanager.h b/LEGO1/mxtransitionmanager.h index 7f1d4ead..b4a9ba30 100644 --- a/LEGO1/mxtransitionmanager.h +++ b/LEGO1/mxtransitionmanager.h @@ -5,6 +5,8 @@ #include "mxvideopresenter.h" #include "legoomni.h" +#include + // VTABLE 0x100d7ea0 class MxTransitionManager : public MxCore { diff --git a/LEGO1/skateboard.cpp b/LEGO1/skateboard.cpp index 5c5cbf38..b67e127e 100644 --- a/LEGO1/skateboard.cpp +++ b/LEGO1/skateboard.cpp @@ -1,5 +1,7 @@ #include "skateboard.h" + #include "mxomni.h" +#include "mxnotificationmanager.h" #include "decomp.h"