diff --git a/LEGO1/define.cpp b/LEGO1/define.cpp index df34b3a2..3f3f70ac 100644 --- a/LEGO1/define.cpp +++ b/LEGO1/define.cpp @@ -1,16 +1,14 @@ #include "define.h" // GLOBAL: LEGO1 0x1010141c -MxS32 g_mxcoreCount[101] = { - 0, -6643, -5643, -5058, -4643, -4321, -4058, -3836, -3643, -3473, -3321, -3184, -3058, - -2943, -2836, -2736, -2643, -2556, -2473, -2395, -2321, -2251, -2184, -2120, -2058, -2000, - -1943, -1888, -1836, -1785, -1736, -1689, -1643, -1599, -1556, -1514, -1473, -1434, -1395, - -1358, -1321, -1286, -1251, -1217, -1184, -1152, -1120, -1089, -1058, -1029, -1000, -971, - -943, -915, -888, -862, -836, -810, -785, -761, -736, -713, -689, -666, -643, - -621, -599, -577, -556, -535, -514, -494, -473, -454, -434, -415, -395, -377, - -358, -340, -321, -304, -286, -268, -251, -234, -217, -200, -184, -168, -152, - -136, -120, -104, -89, -74, -58, -43, -29, -14, 0 -}; +MxS32 g_mxcoreCount[101] = {0, -6643, -5643, -5058, -4643, -4321, -4058, -3836, -3643, -3473, -3321, -3184, -3058, + -2943, -2836, -2736, -2643, -2556, -2473, -2395, -2321, -2251, -2184, -2120, -2058, -2000, + -1943, -1888, -1836, -1785, -1736, -1689, -1643, -1599, -1556, -1514, -1473, -1434, -1395, + -1358, -1321, -1286, -1251, -1217, -1184, -1152, -1120, -1089, -1058, -1029, -1000, -971, + -943, -915, -888, -862, -836, -810, -785, -761, -736, -713, -689, -666, -643, + -621, -599, -577, -556, -535, -514, -494, -473, -454, -434, -415, -395, -377, + -358, -340, -321, -304, -286, -268, -251, -234, -217, -200, -184, -168, -152, + -136, -120, -104, -89, -74, -58, -43, -29, -14, 0}; // GLOBAL: LEGO1 0x10101eac const char* g_parseExtraTokens = ":;"; diff --git a/LEGO1/legocameracontroller.cpp b/LEGO1/legocameracontroller.cpp index 88857f29..ad1dbb67 100644 --- a/LEGO1/legocameracontroller.cpp +++ b/LEGO1/legocameracontroller.cpp @@ -25,20 +25,23 @@ void LegoCameraController::FUN_100123e0(Matrix4Data& p_transform, MxU32) // STUB: LEGO1 0x10012740 Vector3Data& LegoCameraController::FUN_10012740() { - static Vector3Data v; - return v; + // Actually returns reference to a member + static Vector3Data g_v; + return g_v; } // STUB: LEGO1 0x100127f0 Vector3Data& LegoCameraController::FUN_100127f0() { - static Vector3Data v; - return v; + // Actually returns reference to a member + static Vector3Data g_v; + return g_v; } // STUB: LEGO1 0x100128a0 Vector3Data& LegoCameraController::FUN_100128a0() { - static Vector3Data v; - return v; + // Actually returns reference to a member + static Vector3Data g_v; + return g_v; } diff --git a/LEGO1/mxcore.cpp b/LEGO1/mxcore.cpp index 18240031..237ed1da 100644 --- a/LEGO1/mxcore.cpp +++ b/LEGO1/mxcore.cpp @@ -11,7 +11,7 @@ MxResult MxCore::Tickle() // FUNCTION: LEGO1 0x100ae1a0 MxCore::MxCore() { - m_id = (MxU32)g_mxcoreCount[0]; + m_id = (MxU32) g_mxcoreCount[0]; g_mxcoreCount[0]++; } diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index 662767ce..1b5006cc 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -76,7 +76,10 @@ class MxPtrList : public MxList { static void Destroy(T* p_obj) { delete p_obj; }; - void SetOwnership(MxBool p_ownership) { MxPtrList::SetDestroy(p_ownership ? MxList::Destroy : MxCollection::Destroy); } + void SetOwnership(MxBool p_ownership) + { + MxCollection::SetDestroy(p_ownership ? MxPtrList::Destroy : MxCollection::Destroy); + } }; template diff --git a/LEGO1/mxstreamlist.cpp b/LEGO1/mxstreamlist.cpp index 0af147fb..46e9841b 100644 --- a/LEGO1/mxstreamlist.cpp +++ b/LEGO1/mxstreamlist.cpp @@ -25,9 +25,13 @@ MxDSAction* MxStreamListMxDSAction::Find(MxDSAction* p_action, MxBool p_delete) // DECOMP ALPHA 0x1008b99d ? MxDSAction* found = NULL; - iterator it; +#ifdef COMPAT_MODE + iterator it; for (it = begin(); it != end(); it++) { +#else + for (iterator it = begin(); it != end(); it++) { +#endif if (p_action->GetObjectId() == -1 || p_action->GetObjectId() == (*it)->GetObjectId()) { if (p_action->GetUnknown24() == -2 || p_action->GetUnknown24() == -3 || p_action->GetUnknown24() == (*it)->GetUnknown24()) { diff --git a/util/compat.h b/util/compat.h index e83b115e..3c83def6 100644 --- a/util/compat.h +++ b/util/compat.h @@ -3,6 +3,10 @@ // Various macros to enable compiling with other/newer compilers. +#ifdef __MINGW32__ +#define COMPAT_MODE +#endif + // Use `COMPAT_CONST` where something ought to be 'const', and a newer compiler would complain if it // wasn't, but we know it isn't 'const' in the original code. #ifdef __MINGW32__