From bc5ca621a48182f8609a09f4a330f1bf1586faa3 Mon Sep 17 00:00:00 2001 From: Christian Semmler <mail@csemmler.com> Date: Wed, 13 Dec 2023 05:48:14 -0500 Subject: [PATCH] (Proposal) Introduction of naming convention checker (`ncc`) (#322) * Add ncc tool * Add symlink * Fixes * Try this * Try this * Try this * Try this * Add include path * Update style * Update style * Add more rules * Fix style * Update styles * Fix name parameter * Fix MxParam p * Fix m_unk0x pattern * Allow 4 digits for relative hex * Add missing offset * Fix some parameters * Fix some vtables * Fix more vtables * Update rules, fixes * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * Fix last issue * Update readme * Update readme * Update CONTRIBUTING.md * Fix annotations * Rename * Update CONTRIBUTING.md * Update README.md --- .github/workflows/format.yml | 4 +- .github/workflows/naming.yml | 29 ++ CONTRIBUTING.md | 8 +- ISLE/isleapp.cpp | 24 +- ISLE/isleapp.h | 2 +- LEGO1/act1state.h | 4 +- LEGO1/act2brick.cpp | 2 +- LEGO1/act2brick.h | 8 +- LEGO1/act2policestation.cpp | 2 +- LEGO1/act2policestation.h | 6 +- LEGO1/act3.h | 12 +- LEGO1/act3state.h | 8 +- LEGO1/ambulance.cpp | 22 +- LEGO1/ambulance.h | 28 +- LEGO1/ambulancemissionstate.h | 10 +- LEGO1/animstate.h | 4 +- LEGO1/beachhouseentity.cpp | 2 +- LEGO1/beachhouseentity.h | 6 +- LEGO1/bike.cpp | 6 +- LEGO1/bike.h | 6 +- LEGO1/buildingentity.h | 4 +- LEGO1/bumpbouy.h | 4 +- LEGO1/carrace.h | 4 +- LEGO1/carracestate.h | 4 +- LEGO1/doors.h | 4 +- LEGO1/dunebuggy.cpp | 4 +- LEGO1/dunebuggy.h | 10 +- LEGO1/elevatorbottom.cpp | 2 +- LEGO1/elevatorbottom.h | 6 +- LEGO1/gasstation.cpp | 2 +- LEGO1/gasstation.h | 8 +- LEGO1/gasstationentity.h | 4 +- LEGO1/gasstationstate.cpp | 8 +- LEGO1/gasstationstate.h | 4 +- LEGO1/gifmanager.cpp | 10 +- LEGO1/gifmanager.h | 22 +- LEGO1/helicopter.cpp | 22 +- LEGO1/helicopter.h | 18 +- LEGO1/helicopterstate.h | 8 +- LEGO1/historybook.cpp | 2 +- LEGO1/historybook.h | 6 +- LEGO1/hospital.cpp | 2 +- LEGO1/hospital.h | 6 +- LEGO1/hospitalentity.h | 4 +- LEGO1/hospitalstate.h | 4 +- LEGO1/infocenter.cpp | 2 +- LEGO1/infocenter.h | 8 +- LEGO1/infocenterdoor.cpp | 2 +- LEGO1/infocenterdoor.h | 6 +- LEGO1/infocenterentity.h | 4 +- LEGO1/infocenterstate.h | 6 +- LEGO1/isle.h | 4 +- LEGO1/isleactor.h | 4 +- LEGO1/islepathactor.cpp | 10 +- LEGO1/islepathactor.h | 16 +- LEGO1/jetski.cpp | 6 +- LEGO1/jetski.h | 6 +- LEGO1/jetskirace.h | 4 +- LEGO1/jetskiracestate.h | 4 +- LEGO1/jukebox.h | 4 +- LEGO1/jukeboxentity.h | 4 +- LEGO1/jukeboxstate.h | 4 +- LEGO1/lego3dmanager.h | 4 +- LEGO1/lego3dview.h | 2 +- LEGO1/lego3dwavepresenter.h | 4 +- LEGO1/legoact2state.h | 4 +- LEGO1/legoactioncontrolpresenter.h | 4 +- LEGO1/legoactor.cpp | 28 +- LEGO1/legoactor.h | 24 +- LEGO1/legoactorpresenter.h | 4 +- LEGO1/legoanimationmanager.cpp | 8 +- LEGO1/legoanimationmanager.h | 12 +- LEGO1/legoanimmmpresenter.h | 4 +- LEGO1/legoanimpresenter.h | 4 +- LEGO1/legobackgroundcolor.cpp | 16 +- LEGO1/legobackgroundcolor.h | 6 +- LEGO1/legobuildingmanager.cpp | 4 +- LEGO1/legobuildingmanager.h | 2 +- LEGO1/legocachesound.h | 4 +- LEGO1/legocameracontroller.h | 4 +- LEGO1/legocarbuild.cpp | 2 +- LEGO1/legocarbuild.h | 8 +- LEGO1/legocarbuildanimpresenter.h | 4 +- LEGO1/legocarraceactor.h | 4 +- LEGO1/legocontrolmanager.h | 4 +- LEGO1/legoentity.cpp | 8 +- LEGO1/legoentity.h | 12 +- LEGO1/legoentitypresenter.cpp | 6 +- LEGO1/legoentitypresenter.h | 12 +- LEGO1/legoeventnotificationparam.h | 4 +- LEGO1/legoextraactor.h | 4 +- LEGO1/legofullscreenmovie.cpp | 8 +- LEGO1/legogamestate.cpp | 22 +- LEGO1/legogamestate.h | 32 +- LEGO1/legohideanimpresenter.h | 4 +- LEGO1/legoinputmanager.cpp | 26 +- LEGO1/legoinputmanager.h | 4 +- LEGO1/legojetski.h | 4 +- LEGO1/legojetskiraceactor.h | 4 +- LEGO1/legolocomotionanimpresenter.h | 4 +- LEGO1/legoloopinganimpresenter.h | 4 +- LEGO1/legomodelpresenter.cpp | 4 +- LEGO1/legomodelpresenter.h | 6 +- LEGO1/legonavcontroller.cpp | 16 +- LEGO1/legonavcontroller.h | 20 +- LEGO1/legoomni.cpp | 60 +-- LEGO1/legoomni.h | 28 +- LEGO1/legopalettepresenter.h | 4 +- LEGO1/legopartpresenter.cpp | 6 +- LEGO1/legopartpresenter.h | 6 +- LEGO1/legopathactor.h | 18 +- LEGO1/legopathcontroller.h | 4 +- LEGO1/legopathpresenter.h | 4 +- LEGO1/legophonemepresenter.cpp | 8 +- LEGO1/legophonemepresenter.h | 8 +- LEGO1/legorace.cpp | 32 +- LEGO1/legorace.h | 38 +- LEGO1/legoraceactor.h | 4 +- LEGO1/legoroi.cpp | 8 +- LEGO1/legosoundmanager.cpp | 4 +- LEGO1/legosoundmanager.h | 4 +- LEGO1/legostate.cpp | 2 +- LEGO1/legostate.h | 6 +- LEGO1/legostream.cpp | 6 +- LEGO1/legotexturepresenter.h | 4 +- LEGO1/legoutil.cpp | 68 +-- LEGO1/legoutil.h | 2 +- LEGO1/legovehiclebuildstate.cpp | 14 +- LEGO1/legovehiclebuildstate.h | 16 +- LEGO1/legovideomanager.cpp | 12 +- LEGO1/legovideomanager.h | 12 +- LEGO1/legoworld.cpp | 4 +- LEGO1/legoworld.h | 18 +- LEGO1/legoworldpresenter.cpp | 8 +- LEGO1/legoworldpresenter.h | 8 +- LEGO1/motorcycle.cpp | 8 +- LEGO1/motorcycle.h | 10 +- LEGO1/mxatomid.cpp | 2 +- LEGO1/mxatomid.h | 4 +- LEGO1/mxaudiomanager.cpp | 6 +- LEGO1/mxaudiomanager.h | 2 +- LEGO1/mxaudiopresenter.h | 4 +- LEGO1/mxautolocker.cpp | 4 +- LEGO1/mxautolocker.h | 2 +- LEGO1/mxbackgroundaudiomanager.cpp | 162 +++---- LEGO1/mxbackgroundaudiomanager.h | 26 +- LEGO1/mxbitmap.cpp | 48 +- LEGO1/mxbitmap.h | 10 +- LEGO1/mxcompositemediapresenter.h | 4 +- LEGO1/mxcompositepresenter.cpp | 16 +- LEGO1/mxcompositepresenter.h | 12 +- LEGO1/mxcontrolpresenter.cpp | 16 +- LEGO1/mxcontrolpresenter.h | 16 +- LEGO1/mxcore.cpp | 2 +- LEGO1/mxcore.h | 10 +- LEGO1/mxdirect3d.cpp | 10 +- LEGO1/mxdirect3d.h | 19 +- LEGO1/mxdirectdraw.cpp | 126 +++--- LEGO1/mxdirectdraw.h | 39 +- LEGO1/mxdiskstreamcontroller.cpp | 14 +- LEGO1/mxdiskstreamcontroller.h | 26 +- LEGO1/mxdiskstreamprovider.cpp | 6 +- LEGO1/mxdiskstreamprovider.h | 8 +- LEGO1/mxdisplaysurface.cpp | 39 +- LEGO1/mxdisplaysurface.h | 21 +- LEGO1/mxdsaction.cpp | 40 +- LEGO1/mxdsaction.h | 32 +- LEGO1/mxdsactionlist.h | 4 +- LEGO1/mxdsanim.h | 4 +- LEGO1/mxdsbuffer.cpp | 22 +- LEGO1/mxdsbuffer.h | 12 +- LEGO1/mxdschunk.cpp | 2 +- LEGO1/mxdschunk.h | 16 +- LEGO1/mxdsevent.h | 4 +- LEGO1/mxdsfile.cpp | 20 +- LEGO1/mxdsfile.h | 18 +- LEGO1/mxdsmediaaction.cpp | 16 +- LEGO1/mxdsmediaaction.h | 16 +- LEGO1/mxdsmultiaction.cpp | 18 +- LEGO1/mxdsmultiaction.h | 20 +- LEGO1/mxdsobject.cpp | 20 +- LEGO1/mxdsobject.h | 30 +- LEGO1/mxdsobjectaction.h | 4 +- LEGO1/mxdsparallelaction.h | 4 +- LEGO1/mxdsselectaction.cpp | 6 +- LEGO1/mxdsselectaction.h | 10 +- LEGO1/mxdsserialaction.h | 4 +- LEGO1/mxdssound.cpp | 4 +- LEGO1/mxdssound.h | 10 +- LEGO1/mxdssource.h | 4 +- LEGO1/mxdsstill.h | 4 +- LEGO1/mxdsstreamingaction.cpp | 38 +- LEGO1/mxdsstreamingaction.h | 14 +- LEGO1/mxdssubscriber.h | 4 +- LEGO1/mxentity.h | 4 +- LEGO1/mxeventpresenter.h | 4 +- LEGO1/mxflcpresenter.h | 4 +- LEGO1/mxhashtable.h | 22 +- LEGO1/mxioinfo.cpp | 78 ++-- LEGO1/mxlist.h | 28 +- LEGO1/mxloopingflcpresenter.cpp | 4 +- LEGO1/mxloopingflcpresenter.h | 2 +- LEGO1/mxloopingmidipresenter.h | 4 +- LEGO1/mxloopingsmkpresenter.cpp | 2 +- LEGO1/mxloopingsmkpresenter.h | 2 +- LEGO1/mxmediapresenter.cpp | 2 +- LEGO1/mxmediapresenter.h | 4 +- LEGO1/mxmidipresenter.h | 4 +- LEGO1/mxmusicmanager.cpp | 32 +- LEGO1/mxmusicmanager.h | 20 +- LEGO1/mxmusicpresenter.h | 4 +- LEGO1/mxnextactiondatastart.h | 12 +- LEGO1/mxnotificationmanager.cpp | 2 +- LEGO1/mxnotificationmanager.h | 2 +- LEGO1/mxobjectfactory.h | 4 +- LEGO1/mxomni.cpp | 46 +- LEGO1/mxomni.h | 8 +- LEGO1/mxomnicreateflags.h | 46 +- LEGO1/mxomnicreateparam.cpp | 16 +- LEGO1/mxomnicreateparam.h | 8 +- LEGO1/mxpalette.cpp | 16 +- LEGO1/mxpalette.h | 4 +- LEGO1/mxpresenter.cpp | 12 +- LEGO1/mxpresenter.h | 4 +- LEGO1/mxqueue.h | 6 +- LEGO1/mxramstreamcontroller.cpp | 6 +- LEGO1/mxramstreamcontroller.h | 10 +- LEGO1/mxramstreamprovider.h | 4 +- LEGO1/mxrect32.h | 4 +- LEGO1/mxregion.cpp | 6 +- LEGO1/mxregion.h | 8 +- LEGO1/mxregionlist.h | 8 +- LEGO1/mxsmkpresenter.h | 4 +- LEGO1/mxsoundmanager.cpp | 6 +- LEGO1/mxsoundmanager.h | 4 +- LEGO1/mxsoundpresenter.h | 4 +- LEGO1/mxstillpresenter.cpp | 26 +- LEGO1/mxstillpresenter.h | 4 +- LEGO1/mxstreamchunk.h | 8 +- LEGO1/mxstreamcontroller.cpp | 26 +- LEGO1/mxstreamcontroller.h | 32 +- LEGO1/mxstreamer.cpp | 25 +- LEGO1/mxstreamer.h | 8 +- LEGO1/mxstreamprovider.cpp | 2 +- LEGO1/mxstreamprovider.h | 6 +- LEGO1/mxstring.cpp | 42 +- LEGO1/mxstring.h | 10 +- LEGO1/mxstringlist.h | 2 +- LEGO1/mxthread.cpp | 11 +- LEGO1/mxthread.h | 4 +- LEGO1/mxticklemanager.h | 2 +- LEGO1/mxtimer.cpp | 14 +- LEGO1/mxtimer.h | 8 +- LEGO1/mxtransitionmanager.cpp | 116 ++--- LEGO1/mxtransitionmanager.h | 26 +- LEGO1/mxtype17notificationparam.h | 12 +- LEGO1/mxtypes.h | 24 +- LEGO1/mxvariable.cpp | 4 +- LEGO1/mxvariable.h | 2 +- LEGO1/mxvariabletable.h | 2 +- LEGO1/mxvideomanager.cpp | 28 +- LEGO1/mxvideomanager.h | 6 +- LEGO1/mxvideoparam.cpp | 20 +- LEGO1/mxvideoparam.h | 18 +- LEGO1/mxvideoparamflags.cpp | 8 +- LEGO1/mxvideoparamflags.h | 68 +-- LEGO1/mxvideopresenter.cpp | 86 ++-- LEGO1/mxvideopresenter.h | 16 +- LEGO1/mxwavepresenter.cpp | 10 +- LEGO1/mxwavepresenter.h | 6 +- LEGO1/pizza.cpp | 14 +- LEGO1/pizza.h | 22 +- LEGO1/pizzamissionstate.cpp | 4 +- LEGO1/pizzamissionstate.h | 18 +- LEGO1/pizzeria.h | 4 +- LEGO1/pizzeriastate.h | 4 +- LEGO1/police.cpp | 2 +- LEGO1/police.h | 6 +- LEGO1/policeentity.h | 4 +- LEGO1/policestate.h | 4 +- LEGO1/racecar.cpp | 2 +- LEGO1/racecar.h | 6 +- LEGO1/racestate.cpp | 4 +- LEGO1/racestate.h | 16 +- LEGO1/radio.h | 4 +- LEGO1/radiostate.h | 4 +- LEGO1/realtime/orientableroi.h | 6 +- LEGO1/realtime/roi.h | 4 +- LEGO1/registrationbook.cpp | 2 +- LEGO1/registrationbook.h | 6 +- LEGO1/score.cpp | 40 +- LEGO1/score.h | 14 +- LEGO1/scorestate.h | 4 +- LEGO1/skateboard.cpp | 8 +- LEGO1/skateboard.h | 8 +- LEGO1/towtrack.cpp | 18 +- LEGO1/towtrack.h | 24 +- LEGO1/towtrackmissionstate.h | 10 +- tools/README.md | 14 +- tools/ncc/ncc.py | 661 ++++++++++++++++++++++++++++ tools/ncc/ncc.style | 21 + tools/ncc/skip.yml | 13 + tools/requirements.txt | 2 + 303 files changed, 2592 insertions(+), 1844 deletions(-) create mode 100644 .github/workflows/naming.yml create mode 100644 tools/ncc/ncc.py create mode 100644 tools/ncc/ncc.style create mode 100644 tools/ncc/skip.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 17380db7..22b39806 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -37,5 +37,5 @@ jobs: - name: Run pylint and black shell: bash run: | - pylint tools --ignore=build - black --check tools + pylint tools --ignore=build,ncc + black --check tools --exclude=ncc diff --git a/.github/workflows/naming.yml b/.github/workflows/naming.yml new file mode 100644 index 00000000..11738779 --- /dev/null +++ b/.github/workflows/naming.yml @@ -0,0 +1,29 @@ +name: Naming + +on: [push, pull_request] + +jobs: + ncc: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "16" + + - name: Install python libraries + run: | + pip install -r tools/requirements.txt + + - name: Run ncc + run: | + python3 tools/ncc/ncc.py \ + --clang-lib ${{ env.LLVM_PATH }}/lib/libclang.so \ + --style tools/ncc/ncc.style \ + --skip tools/ncc/skip.yml \ + --definition WINAPI FAR HWND__=HWND \ + --include util \ + --path LEGO1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c65bc1c..0d2c6894 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,13 +43,7 @@ We are currently using [clang-format](https://clang.llvm.org/docs/ClangFormat.ht ### Naming conventions -The following conventions should generally be applied everywhere except for the utility libraries (`LEGO1/realtime`, `LEGO1/tgl`, `LEGO1/viewmanager`) and any 3rd party libraries (`3rdparty`). - -- `PascalCase` for classes, function names, and enumerations. -- `m_camelCase` for member variables. -- `g_camelCase` for global variables. -- `p_camelCase` for function parameters. -- Within the Omni engine (file pattern: `mx*`), instead of C++ primitives (e.g. `int`, `long`, etc.), use types in [`mxtypes.h`](LEGO1/mxtypes.h) instead. This will help us ensure that variables will be the correct size regardless of the underlying compiler/platform/architecture. +We are currently using a customized version of [ncc](https://github.com/nithinn/ncc) with a configuration file that aims to replicate the naming conventions employed by the original developers. `ncc` requires Clang `16.x`; please refer to the [tool](/tools/ncc) and the [GitHub action](/.github/workflows/naming.yml) for guidance. ## Questions? diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index bbacb494..b6c48b4a 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -40,7 +40,7 @@ IsleApp::IsleApp() m_backBuffersInVram = 1; m_using8bit = 0; m_using16bit = 1; - m_unk24 = 0; + m_unk0x24 = 0; m_drawCursor = 0; m_use3dSound = 1; m_useMusic = 1; @@ -54,7 +54,7 @@ IsleApp::IsleApp() m_windowActive = 1; m_videoParam = MxVideoParam(MxRect32(0, 0, 639, 479), NULL, 1, MxVideoParamFlags()); - m_videoParam.flags().Set16Bit(MxDirectDraw::GetPrimaryBitDepth() == 16); + m_videoParam.Flags().Set16Bit(MxDirectDraw::GetPrimaryBitDepth() == 16); m_windowHandle = NULL; m_cursorArrow = NULL; @@ -157,19 +157,19 @@ void IsleApp::SetupVideoFlags( char* deviceId ) { - m_videoParam.flags().SetFullScreen(fullScreen); - m_videoParam.flags().SetFlipSurfaces(flipSurfaces); - m_videoParam.flags().SetBackBuffers(!backBuffers); - m_videoParam.flags().Set_f2bit0(!param_6); - m_videoParam.flags().Set_f1bit7(param_7); - m_videoParam.flags().SetWideViewAngle(wideViewAngle); - m_videoParam.flags().Set_f2bit1(1); + m_videoParam.Flags().SetFullScreen(fullScreen); + m_videoParam.Flags().SetFlipSurfaces(flipSurfaces); + m_videoParam.Flags().SetBackBuffers(!backBuffers); + m_videoParam.Flags().SetF2bit0(!param_6); + m_videoParam.Flags().SetF1bit7(param_7); + m_videoParam.Flags().SetWideViewAngle(wideViewAngle); + m_videoParam.Flags().SetF2bit1(1); m_videoParam.SetDeviceName(deviceId); if (using8bit) { - m_videoParam.flags().Set16Bit(0); + m_videoParam.Flags().Set16Bit(0); } if (using16bit) { - m_videoParam.flags().Set16Bit(1); + m_videoParam.Flags().Set16Bit(1); } } @@ -494,7 +494,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine) m_backBuffersInVram, m_using8bit, m_using16bit, - m_unk24, + m_unk0x24, FALSE, m_wideViewAngle, m_deviceId diff --git a/ISLE/isleapp.h b/ISLE/isleapp.h index f83823f0..5abc3a22 100644 --- a/ISLE/isleapp.h +++ b/ISLE/isleapp.h @@ -50,7 +50,7 @@ public: // 20 BOOL m_using16bit; - int m_unk24; + int m_unk0x24; BOOL m_use3dSound; BOOL m_useMusic; diff --git a/LEGO1/act1state.h b/LEGO1/act1state.h index 09a3ecd8..f0393498 100644 --- a/LEGO1/act1state.h +++ b/LEGO1/act1state.h @@ -17,9 +17,9 @@ public: }; // FUNCTION: LEGO1 0x100338b0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Act1State::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, Act1State::ClassName()) || LegoState::IsA(p_name); }; }; diff --git a/LEGO1/act2brick.cpp b/LEGO1/act2brick.cpp index 01face28..77e46622 100644 --- a/LEGO1/act2brick.cpp +++ b/LEGO1/act2brick.cpp @@ -21,7 +21,7 @@ MxResult Act2Brick::Tickle() } // STUB: LEGO1 0x1007a8c0 -MxLong Act2Brick::Notify(MxParam& p) +MxLong Act2Brick::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/act2brick.h b/LEGO1/act2brick.h index 220be48a..adb3bf2f 100644 --- a/LEGO1/act2brick.h +++ b/LEGO1/act2brick.h @@ -10,8 +10,8 @@ public: Act2Brick(); virtual ~Act2Brick() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 - virtual MxResult Tickle() override; // vtable+0x08 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 + virtual MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x1007a360 inline virtual const char* ClassName() const override // vtable+0x0c @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x1007a370 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(Act2Brick::ClassName(), name) || LegoEntity::IsA(name); + return !strcmp(Act2Brick::ClassName(), p_name) || LegoEntity::IsA(p_name); } }; diff --git a/LEGO1/act2policestation.cpp b/LEGO1/act2policestation.cpp index aa6c024b..9116b70a 100644 --- a/LEGO1/act2policestation.cpp +++ b/LEGO1/act2policestation.cpp @@ -1,7 +1,7 @@ #include "act2policestation.h" // STUB: LEGO1 0x1004e0e0 -MxLong Act2PoliceStation::Notify(MxParam& p) +MxLong Act2PoliceStation::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/act2policestation.h b/LEGO1/act2policestation.h index 05ca5155..2ca1a4e8 100644 --- a/LEGO1/act2policestation.h +++ b/LEGO1/act2policestation.h @@ -7,7 +7,7 @@ // SIZE 0x68 class Act2PoliceStation : public LegoEntity { public: - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x1000e200 inline virtual const char* ClassName() const override // vtable+0x0c @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1000e210 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Act2PoliceStation::ClassName()) || LegoEntity::IsA(name); + return !strcmp(p_name, Act2PoliceStation::ClassName()) || LegoEntity::IsA(p_name); } }; diff --git a/LEGO1/act3.h b/LEGO1/act3.h index edc88571..3d627267 100644 --- a/LEGO1/act3.h +++ b/LEGO1/act3.h @@ -19,17 +19,17 @@ public: } // FUNCTION: LEGO1 0x10072520 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Act3::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Act3::ClassName()) || LegoWorld::IsA(p_name); } - inline void SetUnkown420c(MxEntity* p_entity) { m_unk420c = p_entity; } + inline void SetUnkown420c(MxEntity* p_entity) { m_unk0x420c = p_entity; } protected: - undefined m_unkf8[0x4114]; - MxEntity* m_unk420c; - undefined m_unk4210[0x64]; + undefined m_unk0xf8[0x4114]; + MxEntity* m_unk0x420c; + undefined m_unk0x4210[0x64]; }; #endif // ACT3_H diff --git a/LEGO1/act3state.h b/LEGO1/act3state.h index accb6ee7..5da94fac 100644 --- a/LEGO1/act3state.h +++ b/LEGO1/act3state.h @@ -7,7 +7,7 @@ // SIZE 0xc class Act3State : public LegoState { public: - inline Act3State() { m_unk08 = 0; } + inline Act3State() { m_unk0x08 = 0; } // FUNCTION: LEGO1 0x1000e300 inline virtual const char* ClassName() const override // vtable+0x0c @@ -17,16 +17,16 @@ public: } // FUNCTION: LEGO1 0x1000e310 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Act3State::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, Act3State::ClassName()) || LegoState::IsA(p_name); } virtual MxBool VTable0x14() override; private: // FIXME: May be part of LegoState? Uncertain... - MxU32 m_unk08; + MxU32 m_unk0x08; }; #endif // ACT3STATE_H diff --git a/LEGO1/ambulance.cpp b/LEGO1/ambulance.cpp index 24a67146..1d9ca918 100644 --- a/LEGO1/ambulance.cpp +++ b/LEGO1/ambulance.cpp @@ -7,15 +7,15 @@ DECOMP_SIZE_ASSERT(Ambulance, 0x184); // FUNCTION: LEGO1 0x10035ee0 Ambulance::Ambulance() { - this->m_unk168 = 0; - this->m_unk16a = -1; - this->m_unk164 = 0; - this->m_unk16c = 0; - this->m_unk174 = -1; - this->m_unk16e = 0; - this->m_unk178 = -1; - this->m_unk170 = 0; - this->m_unk172 = 0; - this->m_unk13c = 40.0; - this->m_unk17c = 1.0; + this->m_unk0x168 = 0; + this->m_unk0x16a = -1; + this->m_unk0x164 = 0; + this->m_unk0x16c = 0; + this->m_unk0x174 = -1; + this->m_unk0x16e = 0; + this->m_unk0x178 = -1; + this->m_unk0x170 = 0; + this->m_unk0x172 = 0; + this->m_unk0x13c = 40.0; + this->m_unk0x17c = 1.0; } diff --git a/LEGO1/ambulance.h b/LEGO1/ambulance.h index ff74df56..eb46a1ed 100644 --- a/LEGO1/ambulance.h +++ b/LEGO1/ambulance.h @@ -17,25 +17,25 @@ public: } // FUNCTION: LEGO1 0x10035fb0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Ambulance::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, Ambulance::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: Ambulance fields - undefined m_unk160[4]; - MxS32 m_unk164; - MxS16 m_unk168; - MxS16 m_unk16a; - MxS16 m_unk16c; - MxS16 m_unk16e; - MxS16 m_unk170; - MxS16 m_unk172; - MxS32 m_unk174; - MxS32 m_unk178; - MxFloat m_unk17c; - undefined m_unk180[4]; + undefined m_unk0x160[4]; + MxS32 m_unk0x164; + MxS16 m_unk0x168; + MxS16 m_unk0x16a; + MxS16 m_unk0x16c; + MxS16 m_unk0x16e; + MxS16 m_unk0x170; + MxS16 m_unk0x172; + MxS32 m_unk0x174; + MxS32 m_unk0x178; + MxFloat m_unk0x17c; + undefined m_unk0x180[4]; }; #endif // AMBULANCE_H diff --git a/LEGO1/ambulancemissionstate.h b/LEGO1/ambulancemissionstate.h index ee848999..7cfe559c 100644 --- a/LEGO1/ambulancemissionstate.h +++ b/LEGO1/ambulancemissionstate.h @@ -17,14 +17,14 @@ public: } // FUNCTION: LEGO1 0x10037610 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, AmbulanceMissionState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, AmbulanceMissionState::ClassName()) || LegoState::IsA(p_name); } - inline MxU16 GetColor(MxU8 id) + inline MxU16 GetColor(MxU8 p_id) { - switch (id) { + switch (p_id) { case 1: return m_color1; case 2: @@ -41,7 +41,7 @@ public: } protected: - undefined m_unk8[0x12]; + undefined m_unk0x8[0x12]; MxU16 m_color1; MxU16 m_color2; MxU16 m_color3; diff --git a/LEGO1/animstate.h b/LEGO1/animstate.h index d2692441..26882700 100644 --- a/LEGO1/animstate.h +++ b/LEGO1/animstate.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10065080 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, AnimState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, AnimState::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/beachhouseentity.cpp b/LEGO1/beachhouseentity.cpp index 60d58285..66b07f60 100644 --- a/LEGO1/beachhouseentity.cpp +++ b/LEGO1/beachhouseentity.cpp @@ -1,7 +1,7 @@ #include "beachhouseentity.h" // STUB: LEGO1 0x100150a0 -MxLong BeachHouseEntity::Notify(MxParam& p) +MxLong BeachHouseEntity::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/beachhouseentity.h b/LEGO1/beachhouseentity.h index 007c9cf6..cf6a8909 100644 --- a/LEGO1/beachhouseentity.h +++ b/LEGO1/beachhouseentity.h @@ -7,7 +7,7 @@ // SIZE 0x68 class BeachHouseEntity : public BuildingEntity { public: - virtual MxLong Notify(MxParam& p) override; // vtable+04 + virtual MxLong Notify(MxParam& p_param) override; // vtable+04 // FUNCTION: LEGO1 0x1000ee80 inline virtual const char* ClassName() const override // vtable+0x0c @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1000ee90 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, BeachHouseEntity::ClassName()) || BuildingEntity::IsA(name); + return !strcmp(p_name, BeachHouseEntity::ClassName()) || BuildingEntity::IsA(p_name); } }; diff --git a/LEGO1/bike.cpp b/LEGO1/bike.cpp index ac79db87..3c27ebc5 100644 --- a/LEGO1/bike.cpp +++ b/LEGO1/bike.cpp @@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(Bike, 0x164); // FUNCTION: LEGO1 0x10076670 Bike::Bike() { - this->m_unk13c = 20.0; - this->m_unk150 = 3.0; - this->m_unk148 = 1; + this->m_unk0x13c = 20.0; + this->m_unk0x150 = 3.0; + this->m_unk0x148 = 1; } diff --git a/LEGO1/bike.h b/LEGO1/bike.h index 5e85784b..f3d5c90d 100644 --- a/LEGO1/bike.h +++ b/LEGO1/bike.h @@ -18,14 +18,14 @@ public: } // FUNCTION: LEGO1 0x10076700 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Bike::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, Bike::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: Bike fields - undefined m_unk160[4]; + undefined m_unk0x160[4]; }; #endif // BIKE_H diff --git a/LEGO1/buildingentity.h b/LEGO1/buildingentity.h index 6948031d..f0ba4c3c 100644 --- a/LEGO1/buildingentity.h +++ b/LEGO1/buildingentity.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10014f30 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, BuildingEntity::ClassName()) || LegoEntity::IsA(name); + return !strcmp(p_name, BuildingEntity::ClassName()) || LegoEntity::IsA(p_name); } }; diff --git a/LEGO1/bumpbouy.h b/LEGO1/bumpbouy.h index 9c581c16..8399c7ef 100644 --- a/LEGO1/bumpbouy.h +++ b/LEGO1/bumpbouy.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x10027500 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, BumpBouy::ClassName()) || LegoAnimActor::IsA(name); + return !strcmp(p_name, BumpBouy::ClassName()) || LegoAnimActor::IsA(p_name); } }; diff --git a/LEGO1/carrace.h b/LEGO1/carrace.h index ee57aacc..b876fd4d 100644 --- a/LEGO1/carrace.h +++ b/LEGO1/carrace.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x10016b30 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, CarRace::ClassName()) || LegoRace::IsA(name); + return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name); } }; diff --git a/LEGO1/carracestate.h b/LEGO1/carracestate.h index 523e109e..c922354f 100644 --- a/LEGO1/carracestate.h +++ b/LEGO1/carracestate.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000dd40 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, CarRaceState::ClassName()) || RaceState::IsA(name); + return !strcmp(p_name, CarRaceState::ClassName()) || RaceState::IsA(p_name); } }; diff --git a/LEGO1/doors.h b/LEGO1/doors.h index 032525e0..a2c142a4 100644 --- a/LEGO1/doors.h +++ b/LEGO1/doors.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000e440 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Doors::ClassName()) || LegoPathActor::IsA(name); + return !strcmp(p_name, Doors::ClassName()) || LegoPathActor::IsA(p_name); } }; diff --git a/LEGO1/dunebuggy.cpp b/LEGO1/dunebuggy.cpp index ac1be042..a32b612d 100644 --- a/LEGO1/dunebuggy.cpp +++ b/LEGO1/dunebuggy.cpp @@ -7,6 +7,6 @@ DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c); // FUNCTION: LEGO1 0x10067bb0 DuneBuggy::DuneBuggy() { - this->m_unk13c = 25.0; - this->m_unk164 = 1.0; + this->m_unk0x13c = 25.0; + this->m_unk0x164 = 1.0; } diff --git a/LEGO1/dunebuggy.h b/LEGO1/dunebuggy.h index c31cdbb3..1accaa05 100644 --- a/LEGO1/dunebuggy.h +++ b/LEGO1/dunebuggy.h @@ -18,16 +18,16 @@ public: } // FUNCTION: LEGO1 0x10067c40 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, DuneBuggy::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, DuneBuggy::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: Double check DuneBuggy field types - undefined4 m_unk160; - MxFloat m_unk164; - undefined4 m_unk168; + undefined4 m_unk0x160; + MxFloat m_unk0x164; + undefined4 m_unk0x168; }; #endif // DUNEBUGGY_H diff --git a/LEGO1/elevatorbottom.cpp b/LEGO1/elevatorbottom.cpp index 434db69e..247defb0 100644 --- a/LEGO1/elevatorbottom.cpp +++ b/LEGO1/elevatorbottom.cpp @@ -13,7 +13,7 @@ ElevatorBottom::~ElevatorBottom() } // STUB: LEGO1 0x10018150 -MxLong ElevatorBottom::Notify(MxParam& p) +MxLong ElevatorBottom::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/elevatorbottom.h b/LEGO1/elevatorbottom.h index 1c957f50..2a0f2570 100644 --- a/LEGO1/elevatorbottom.h +++ b/LEGO1/elevatorbottom.h @@ -9,7 +9,7 @@ public: ElevatorBottom(); virtual ~ElevatorBottom() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x10017f20 inline virtual const char* ClassName() const override // vtable+0x0c @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x10017f30 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ElevatorBottom::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, ElevatorBottom::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/gasstation.cpp b/LEGO1/gasstation.cpp index dc5c441b..24325511 100644 --- a/LEGO1/gasstation.cpp +++ b/LEGO1/gasstation.cpp @@ -13,7 +13,7 @@ GasStation::~GasStation() } // STUB: LEGO1 0x10004a60 -MxLong GasStation::Notify(MxParam& p) +MxLong GasStation::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/gasstation.h b/LEGO1/gasstation.h index 201b287c..d6761980 100644 --- a/LEGO1/gasstation.h +++ b/LEGO1/gasstation.h @@ -11,8 +11,8 @@ public: GasStation(); virtual ~GasStation() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 - virtual MxResult Tickle() override; // vtable+0x8 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 + virtual MxResult Tickle() override; // vtable+0x8 // FUNCTION: LEGO1 0x10004780 inline virtual const char* ClassName() const override // vtable+0x0c @@ -22,9 +22,9 @@ public: } // FUNCTION: LEGO1 0x10004790 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, GasStation::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, GasStation::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/gasstationentity.h b/LEGO1/gasstationentity.h index 2b345843..17aa22cf 100644 --- a/LEGO1/gasstationentity.h +++ b/LEGO1/gasstationentity.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000eb30 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, GasStationEntity::ClassName()) || BuildingEntity::IsA(name); + return !strcmp(p_name, GasStationEntity::ClassName()) || BuildingEntity::IsA(p_name); } }; diff --git a/LEGO1/gasstationstate.cpp b/LEGO1/gasstationstate.cpp index bf9f0ed9..b4ec4dfd 100644 --- a/LEGO1/gasstationstate.cpp +++ b/LEGO1/gasstationstate.cpp @@ -11,8 +11,8 @@ GasStationState::GasStationState() m_unk0x1e = 0; m_unk0x20 = 0; - undefined4* unk = m_unk0x08; - unk[0] = -1; - unk[1] = -1; - unk[2] = -1; + undefined4* unk0x08 = m_unk0x08; + unk0x08[0] = -1; + unk0x08[1] = -1; + unk0x08[2] = -1; } diff --git a/LEGO1/gasstationstate.h b/LEGO1/gasstationstate.h index 8e3df658..2fb7e512 100644 --- a/LEGO1/gasstationstate.h +++ b/LEGO1/gasstationstate.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x100061e0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, GasStationState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, GasStationState::ClassName()) || LegoState::IsA(p_name); } private: diff --git a/LEGO1/gifmanager.cpp b/LEGO1/gifmanager.cpp index ef4beb22..0fc25b96 100644 --- a/LEGO1/gifmanager.cpp +++ b/LEGO1/gifmanager.cpp @@ -6,15 +6,15 @@ DECOMP_SIZE_ASSERT(GifMap, 0x08); DECOMP_SIZE_ASSERT(GifManagerBase, 0x14); DECOMP_SIZE_ASSERT(GifManager, 0x30); -GifMapEntry* DAT_100f0100; +GifMapEntry* g_unk0x100f0100; // FUNCTION: LEGO1 0x10001cc0 -GifMapEntry* GifMap::FindNode(const char*& string) +GifMapEntry* GifMap::FindNode(const char*& p_string) { - GifMapEntry* ret = m_unk4; + GifMapEntry* ret = m_unk0x4; GifMapEntry* current = ret->m_parent; - while (current != DAT_100f0100) { - if (strcmp(current->m_key, string) <= 0) { + while (current != g_unk0x100f0100) { + if (strcmp(current->m_key, p_string) <= 0) { ret = current; current = current->m_right; } diff --git a/LEGO1/gifmanager.h b/LEGO1/gifmanager.h index b5c52971..3226b4b0 100644 --- a/LEGO1/gifmanager.h +++ b/LEGO1/gifmanager.h @@ -27,19 +27,19 @@ public: class GifMap { public: - GifMapEntry* FindNode(const char*& string); + GifMapEntry* FindNode(const char*& p_string); - inline GifData* Get(const char* string) + inline GifData* Get(const char* p_string) { GifData* ret = NULL; - GifMapEntry* entry = FindNode(string); - if (((m_unk4 == entry || strcmp(string, entry->m_key) > 0) ? m_unk4 : entry) != entry) + GifMapEntry* entry = FindNode(p_string); + if (((m_unk0x4 == entry || strcmp(p_string, entry->m_key) > 0) ? m_unk0x4 : entry) != entry) ret = entry->m_value; return ret; } - undefined4 m_unk0; - GifMapEntry* m_unk4; + undefined4 m_unk0x0; + GifMapEntry* m_unk0x4; }; // VTABLE: LEGO1 0x100d86d4 @@ -48,12 +48,12 @@ public: // STUB: LEGO1 0x1005a310 virtual ~GifManagerBase() {} // vtable+00 - inline GifData* Get(const char* name) { return m_unk8.Get(name); } + inline GifData* Get(const char* p_name) { return m_unk0x8.Get(p_name); } protected: - undefined4 m_unk0; - undefined4 m_unk4; - GifMap m_unk8; + undefined4 m_unk0x0; + undefined4 m_unk0x4; + GifMap m_unk0x8; }; // VTABLE: LEGO1 0x100d86fc @@ -63,7 +63,7 @@ public: virtual ~GifManager() {} // vtable+00 protected: - undefined m_unk[0x1c]; + undefined m_unk0x14[0x1c]; }; #endif // GIFMANAGER_H diff --git a/LEGO1/helicopter.cpp b/LEGO1/helicopter.cpp index 4397ae55..582e2539 100644 --- a/LEGO1/helicopter.cpp +++ b/LEGO1/helicopter.cpp @@ -13,7 +13,7 @@ DECOMP_SIZE_ASSERT(Helicopter, 0x230) // FUNCTION: LEGO1 0x10001e60 Helicopter::Helicopter() { - m_unk13c = 60; + m_unk0x13c = 60; } // FUNCTION: LEGO1 0x10003230 @@ -63,16 +63,16 @@ void Helicopter::VTable0xe4() } } m_state->SetUnknown8(0); - FUN_1003ee00(m_unk22c, 0x16); - FUN_1003ee00(m_unk22c, 0x17); - FUN_1003ee00(m_unk22c, 0x18); - FUN_1003ee00(m_unk22c, 0x19); - FUN_1003ee00(m_unk22c, 0x1a); - FUN_1003ee00(m_unk22c, 0x1b); - FUN_1003ee00(m_unk22c, 0x1c); - FUN_1003ee00(m_unk22c, 0x1d); - FUN_1003ee00(m_unk22c, 0x1e); - FUN_1003ee00(m_unk22c, 0x1f); + FUN_1003ee00(m_unk0x22c, 0x16); + FUN_1003ee00(m_unk0x22c, 0x17); + FUN_1003ee00(m_unk0x22c, 0x18); + FUN_1003ee00(m_unk0x22c, 0x19); + FUN_1003ee00(m_unk0x22c, 0x1a); + FUN_1003ee00(m_unk0x22c, 0x1b); + FUN_1003ee00(m_unk0x22c, 0x1c); + FUN_1003ee00(m_unk0x22c, 0x1d); + FUN_1003ee00(m_unk0x22c, 0x1e); + FUN_1003ee00(m_unk0x22c, 0x1f); AnimationManager()->FUN_1005f6d0(TRUE); ControlManager()->Unregister(this); } diff --git a/LEGO1/helicopter.h b/LEGO1/helicopter.h index 8bf00412..1bb7c22a 100644 --- a/LEGO1/helicopter.h +++ b/LEGO1/helicopter.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x10003080 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Helicopter::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, Helicopter::ClassName()) || IslePathActor::IsA(p_name); } virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 @@ -32,14 +32,14 @@ public: virtual ~Helicopter() override; // vtable+0x0 protected: - Matrix4Data m_unk160; - Matrix4Data m_unk1a8; - undefined4 m_unk1f0; - Vector4Data m_unk1f4; - Vector4Data m_unk20c; - undefined4 m_unk224; + Matrix4Data m_unk0x160; + Matrix4Data m_unk0x1a8; + undefined4 m_unk0x1f0; + Vector4Data m_unk0x1f4; + Vector4Data m_unk0x20c; + undefined4 m_unk0x224; HelicopterState* m_state; - MxAtomId m_unk22c; + MxAtomId m_unk0x22c; private: void GetState(); diff --git a/LEGO1/helicopterstate.h b/LEGO1/helicopterstate.h index f95e331b..3525303d 100644 --- a/LEGO1/helicopterstate.h +++ b/LEGO1/helicopterstate.h @@ -16,15 +16,15 @@ public: } // FUNCTION: LEGO1 0x1000e0e0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, HelicopterState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, HelicopterState::ClassName()) || LegoState::IsA(p_name); } - inline void SetUnknown8(undefined4 p_unk8) { m_unk8 = p_unk8; } + inline void SetUnknown8(undefined4 p_unk0x8) { m_unk0x8 = p_unk0x8; } protected: - undefined4 m_unk8; + undefined4 m_unk0x8; }; #endif // HELICOPTERSTATE_H diff --git a/LEGO1/historybook.cpp b/LEGO1/historybook.cpp index f41930e6..d00e8acd 100644 --- a/LEGO1/historybook.cpp +++ b/LEGO1/historybook.cpp @@ -13,7 +13,7 @@ HistoryBook::~HistoryBook() } // STUB: LEGO1 0x10082680 -MxLong HistoryBook::Notify(MxParam& p) +MxLong HistoryBook::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/historybook.h b/LEGO1/historybook.h index 5d75c7b9..18154c79 100644 --- a/LEGO1/historybook.h +++ b/LEGO1/historybook.h @@ -10,7 +10,7 @@ public: HistoryBook(); virtual ~HistoryBook() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x10082390 inline virtual const char* ClassName() const override // vtable+0x0c @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100823a0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, HistoryBook::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, HistoryBook::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/hospital.cpp b/LEGO1/hospital.cpp index 09e9c1e0..3d8ff578 100644 --- a/LEGO1/hospital.cpp +++ b/LEGO1/hospital.cpp @@ -13,7 +13,7 @@ Hospital::~Hospital() } // STUB: LEGO1 0x10074990 -MxLong Hospital::Notify(MxParam& p) +MxLong Hospital::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/hospital.h b/LEGO1/hospital.h index 07cd2a9d..014c301d 100644 --- a/LEGO1/hospital.h +++ b/LEGO1/hospital.h @@ -10,7 +10,7 @@ public: Hospital(); virtual ~Hospital() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x04 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x100746b0 inline virtual const char* ClassName() const override // vtable+0x0c @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100746c0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Hospital::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Hospital::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/hospitalentity.h b/LEGO1/hospitalentity.h index 0b9e5596..9dc597f1 100644 --- a/LEGO1/hospitalentity.h +++ b/LEGO1/hospitalentity.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000ec50 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, HospitalEntity::ClassName()) || BuildingEntity::IsA(name); + return !strcmp(p_name, HospitalEntity::ClassName()) || BuildingEntity::IsA(p_name); } }; diff --git a/LEGO1/hospitalstate.h b/LEGO1/hospitalstate.h index cb0a52e0..795342b0 100644 --- a/LEGO1/hospitalstate.h +++ b/LEGO1/hospitalstate.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x10076410 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, HospitalState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, HospitalState::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/infocenter.cpp b/LEGO1/infocenter.cpp index 35968db9..f062f1e9 100644 --- a/LEGO1/infocenter.cpp +++ b/LEGO1/infocenter.cpp @@ -13,7 +13,7 @@ Infocenter::~Infocenter() } // STUB: LEGO1 0x1006ef10 -MxLong Infocenter::Notify(MxParam& p) +MxLong Infocenter::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/infocenter.h b/LEGO1/infocenter.h index bce246a5..3b4e7856 100644 --- a/LEGO1/infocenter.h +++ b/LEGO1/infocenter.h @@ -10,8 +10,8 @@ public: Infocenter(); virtual ~Infocenter() override; - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 - virtual MxResult Tickle() override; // vtable+0x8 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 + virtual MxResult Tickle() override; // vtable+0x8 // FUNCTION: LEGO1 0x1006eb40 inline virtual const char* ClassName() const override // vtable+0x0c @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x1006eb50 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Infocenter::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Infocenter::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/infocenterdoor.cpp b/LEGO1/infocenterdoor.cpp index ed23a6ac..c6d85394 100644 --- a/LEGO1/infocenterdoor.cpp +++ b/LEGO1/infocenterdoor.cpp @@ -13,7 +13,7 @@ InfocenterDoor::~InfocenterDoor() } // STUB: LEGO1 0x100379e0 -MxLong InfocenterDoor::Notify(MxParam& p) +MxLong InfocenterDoor::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/infocenterdoor.h b/LEGO1/infocenterdoor.h index 0fe6f9d6..1586dbc8 100644 --- a/LEGO1/infocenterdoor.h +++ b/LEGO1/infocenterdoor.h @@ -10,7 +10,7 @@ public: InfocenterDoor(); virtual ~InfocenterDoor(); // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x100377b0 inline virtual const char* ClassName() const override // vtable+0x0c @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100377c0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, InfocenterDoor::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, InfocenterDoor::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/infocenterentity.h b/LEGO1/infocenterentity.h index 9d37244c..44121ae2 100644 --- a/LEGO1/infocenterentity.h +++ b/LEGO1/infocenterentity.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000ea10 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(name); + return !strcmp(p_name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(p_name); } }; diff --git a/LEGO1/infocenterstate.h b/LEGO1/infocenterstate.h index 5dc27c61..322e7bec 100644 --- a/LEGO1/infocenterstate.h +++ b/LEGO1/infocenterstate.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x10071850 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, InfocenterState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, InfocenterState::ClassName()) || LegoState::IsA(p_name); } inline MxU32 GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; } @@ -55,7 +55,7 @@ private: undefined4 unk13; */ - undefined pad[0x70]; + undefined m_pad[0x70]; MxU32 m_buffer[7]; // 0x78 }; diff --git a/LEGO1/isle.h b/LEGO1/isle.h index da83a203..42984858 100644 --- a/LEGO1/isle.h +++ b/LEGO1/isle.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10030920 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Isle::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Isle::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/isleactor.h b/LEGO1/isleactor.h index 3dbc528a..aa205483 100644 --- a/LEGO1/isleactor.h +++ b/LEGO1/isleactor.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x1000e670 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, IsleActor::ClassName()) || LegoActor::IsA(name); + return !strcmp(p_name, IsleActor::ClassName()) || LegoActor::IsA(p_name); } }; diff --git a/LEGO1/islepathactor.cpp b/LEGO1/islepathactor.cpp index 805fc287..89151230 100644 --- a/LEGO1/islepathactor.cpp +++ b/LEGO1/islepathactor.cpp @@ -37,10 +37,10 @@ void IslePathActor::VTable0xd8() // FUNCTION: LEGO1 0x1001a200 IslePathActor::IslePathActor() { - this->m_pLegoWorld = NULL; - this->m_unk13c = 6.0; - this->m_unk15c = 1.0; - this->m_unk158 = 0; + this->m_world = NULL; + this->m_unk0x13c = 6.0; + this->m_unk0x15c = 1.0; + this->m_unk0x158 = 0; } // FUNCTION: LEGO1 0x1001a280 @@ -62,7 +62,7 @@ void IslePathActor::VTable0xe4() } // STUB: LEGO1 0x1001b2a0 -void IslePathActor::VTable0xe8(MxU32 p_1, MxBool p_2, MxU8 p_3) +void IslePathActor::VTable0xe8(MxU32, MxBool, MxU8) { // TODO } diff --git a/LEGO1/islepathactor.h b/LEGO1/islepathactor.h index be728a74..f0e616c4 100644 --- a/LEGO1/islepathactor.h +++ b/LEGO1/islepathactor.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x10002eb0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, IslePathActor::ClassName()) || LegoPathActor::IsA(name); + return !strcmp(p_name, IslePathActor::ClassName()) || LegoPathActor::IsA(p_name); } // SYNTHETIC: LEGO1 0x10002ff0 @@ -36,16 +36,16 @@ public: virtual void VTable0xdc(); // vtable+0xdc virtual void VTable0xe0(); // vtable+0xe0 virtual void VTable0xe4(); // vtable+0xe4 - virtual void VTable0xe8(MxU32 p_1, MxBool p_2, MxU8 p_3); // vtable+0xe8 + virtual void VTable0xe8(MxU32, MxBool, MxU8); // vtable+0xe8 virtual void VTable0xec(); // vtable+0xec - inline void SetWorld(LegoWorld* p_world) { m_pLegoWorld = p_world; } - inline LegoWorld* GetWorld() { return m_pLegoWorld; } + inline void SetWorld(LegoWorld* p_world) { m_world = p_world; } + inline LegoWorld* GetWorld() { return m_world; } private: - LegoWorld* m_pLegoWorld; // 0x154 - MxFloat m_unk158; - MxFloat m_unk15c; + LegoWorld* m_world; // 0x154 + MxFloat m_unk0x158; + MxFloat m_unk0x15c; }; #endif // ISLEPATHACTOR_H diff --git a/LEGO1/jetski.cpp b/LEGO1/jetski.cpp index 859e9ff9..8bdf3fff 100644 --- a/LEGO1/jetski.cpp +++ b/LEGO1/jetski.cpp @@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(Jetski, 0x164); // FUNCTION: LEGO1 0x1007e3b0 Jetski::Jetski() { - this->m_unk13c = 25.0; - this->m_unk150 = 2.0; - this->m_unk148 = 1; + this->m_unk0x13c = 25.0; + this->m_unk0x150 = 2.0; + this->m_unk0x148 = 1; } diff --git a/LEGO1/jetski.h b/LEGO1/jetski.h index e4ca95d9..8c669ca6 100644 --- a/LEGO1/jetski.h +++ b/LEGO1/jetski.h @@ -18,14 +18,14 @@ public: } // FUNCTION: LEGO1 0x1007e440 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Jetski::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, Jetski::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: Jetski fields - undefined m_unk160[4]; + undefined m_unk0x160[4]; }; #endif // JETSKI_H diff --git a/LEGO1/jetskirace.h b/LEGO1/jetskirace.h index 3d7c2a09..9488ed04 100644 --- a/LEGO1/jetskirace.h +++ b/LEGO1/jetskirace.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000db00 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, JetskiRace::ClassName()) || LegoRace::IsA(name); + return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name); } }; diff --git a/LEGO1/jetskiracestate.h b/LEGO1/jetskiracestate.h index fe419433..9724e4a1 100644 --- a/LEGO1/jetskiracestate.h +++ b/LEGO1/jetskiracestate.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000dc50 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, JetskiRaceState::ClassName()) || RaceState::IsA(name); + return !strcmp(p_name, JetskiRaceState::ClassName()) || RaceState::IsA(p_name); } }; diff --git a/LEGO1/jukebox.h b/LEGO1/jukebox.h index 11bf1a02..1f04bac3 100644 --- a/LEGO1/jukebox.h +++ b/LEGO1/jukebox.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1005d700 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, JukeBox::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, JukeBox::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/jukeboxentity.h b/LEGO1/jukeboxentity.h index 03510a6f..3e175568 100644 --- a/LEGO1/jukeboxentity.h +++ b/LEGO1/jukeboxentity.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10085cd0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, JukeBoxEntity::ClassName()) || LegoEntity::IsA(name); + return !strcmp(p_name, JukeBoxEntity::ClassName()) || LegoEntity::IsA(p_name); } }; diff --git a/LEGO1/jukeboxstate.h b/LEGO1/jukeboxstate.h index ee1a5436..8a481437 100644 --- a/LEGO1/jukeboxstate.h +++ b/LEGO1/jukeboxstate.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000f320 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, JukeBoxState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, JukeBoxState::ClassName()) || LegoState::IsA(p_name); } virtual MxBool VTable0x14() override; // vtable+0x14 diff --git a/LEGO1/lego3dmanager.h b/LEGO1/lego3dmanager.h index 64be10b9..f7638649 100644 --- a/LEGO1/lego3dmanager.h +++ b/LEGO1/lego3dmanager.h @@ -8,8 +8,8 @@ public: inline Lego3DView* GetLego3DView() { return this->m_3dView; } private: - int m_unk00; - int m_unk04; + int m_unk0x00; + int m_unk0x04; Lego3DView* m_3dView; }; diff --git a/LEGO1/lego3dview.h b/LEGO1/lego3dview.h index 626ecbd6..e62a220f 100644 --- a/LEGO1/lego3dview.h +++ b/LEGO1/lego3dview.h @@ -8,7 +8,7 @@ public: inline ViewManager* GetViewManager() { return this->m_viewManager; } private: - char unknown[0x88]; + char m_pad[0x88]; ViewManager* m_viewManager; }; diff --git a/LEGO1/lego3dwavepresenter.h b/LEGO1/lego3dwavepresenter.h index b33c623d..a2363518 100644 --- a/LEGO1/lego3dwavepresenter.h +++ b/LEGO1/lego3dwavepresenter.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000d8a0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Lego3DWavePresenter::ClassName()) || MxWavePresenter::IsA(name); + return !strcmp(p_name, Lego3DWavePresenter::ClassName()) || MxWavePresenter::IsA(p_name); } }; diff --git a/LEGO1/legoact2state.h b/LEGO1/legoact2state.h index 01194600..a26cdd7d 100644 --- a/LEGO1/legoact2state.h +++ b/LEGO1/legoact2state.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000df90 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoAct2State::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, LegoAct2State::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/legoactioncontrolpresenter.h b/LEGO1/legoactioncontrolpresenter.h index 943abe03..98815348 100644 --- a/LEGO1/legoactioncontrolpresenter.h +++ b/LEGO1/legoactioncontrolpresenter.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x1000d0f0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoActionControlPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, LegoActionControlPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 diff --git a/LEGO1/legoactor.cpp b/LEGO1/legoactor.cpp index c67a792f..d4c90cb9 100644 --- a/LEGO1/legoactor.cpp +++ b/LEGO1/legoactor.cpp @@ -6,46 +6,46 @@ DECOMP_SIZE_ASSERT(LegoActor, 0x78) // FUNCTION: LEGO1 0x10002cc0 MxFloat LegoActor::VTable0x50() { - return m_unk68; + return m_unk0x68; } // FUNCTION: LEGO1 0x10002cd0 -void LegoActor::VTable0x54(MxFloat p_unk) +void LegoActor::VTable0x54(MxFloat p_unk0x68) { - m_unk68 = p_unk; + m_unk0x68 = p_unk0x68; } // FUNCTION: LEGO1 0x10002ce0 -void LegoActor::VTable0x58(MxFloat p_unk) +void LegoActor::VTable0x58(MxFloat p_unk0x70) { - m_unk70 = p_unk; + m_unk0x70 = p_unk0x70; } // FUNCTION: LEGO1 0x10002cf0 MxFloat LegoActor::VTable0x5c() { - return m_unk70; + return m_unk0x70; } // FUNCTION: LEGO1 0x10002d00 undefined LegoActor::VTable0x60() { - return m_unk74; + return m_unk0x74; } // FUNCTION: LEGO1 0x10002d10 -void LegoActor::VTable0x64(undefined p_unk) +void LegoActor::VTable0x64(undefined p_unk0x74) { - m_unk74 = p_unk; + m_unk0x74 = p_unk0x74; } // End header // FUNCTION: LEGO1 0x1002d110 LegoActor::LegoActor() { - m_unk68 = 0.0f; - m_unk6c = 0; - m_unk70 = 0.0f; - m_unk10 = 0; - m_unk74 = 0; + m_unk0x68 = 0.0f; + m_unk0x6c = 0; + m_unk0x70 = 0.0f; + m_unk0x10 = 0; + m_unk0x74 = 0; } diff --git a/LEGO1/legoactor.h b/LEGO1/legoactor.h index f0223e5b..1459e29f 100644 --- a/LEGO1/legoactor.h +++ b/LEGO1/legoactor.h @@ -18,23 +18,23 @@ public: } // FUNCTION: LEGO1 0x1002d220 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name); + return !strcmp(p_name, LegoActor::ClassName()) || LegoEntity::IsA(p_name); } - virtual MxFloat VTable0x50(); // vtable+0x50 - virtual void VTable0x54(MxFloat p_unk); // vtable+0x54 - virtual void VTable0x58(MxFloat p_unk); // vtable+0x58 - virtual MxFloat VTable0x5c(); // vtable+0x5c - virtual undefined VTable0x60(); // vtable+0x60 - virtual void VTable0x64(undefined p_unk); // vtable+0x64 + virtual MxFloat VTable0x50(); // vtable+0x50 + virtual void VTable0x54(MxFloat p_unk0x68); // vtable+0x54 + virtual void VTable0x58(MxFloat p_unk0x70); // vtable+0x58 + virtual MxFloat VTable0x5c(); // vtable+0x5c + virtual undefined VTable0x60(); // vtable+0x60 + virtual void VTable0x64(undefined p_unk0x74); // vtable+0x64 private: - MxFloat m_unk68; - undefined4 m_unk6c; - MxFloat m_unk70; - undefined m_unk74; + MxFloat m_unk0x68; + undefined4 m_unk0x6c; + MxFloat m_unk0x70; + undefined m_unk0x74; }; #endif // LEGOACTOR_H diff --git a/LEGO1/legoactorpresenter.h b/LEGO1/legoactorpresenter.h index ff7fef74..359960dc 100644 --- a/LEGO1/legoactorpresenter.h +++ b/LEGO1/legoactorpresenter.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000cb20 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(name); + return !strcmp(p_name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name); } }; diff --git a/LEGO1/legoanimationmanager.cpp b/LEGO1/legoanimationmanager.cpp index ffb420f6..55ac2856 100644 --- a/LEGO1/legoanimationmanager.cpp +++ b/LEGO1/legoanimationmanager.cpp @@ -4,9 +4,9 @@ int g_legoAnimationManagerConfig = 1; // FUNCTION: LEGO1 0x1005eb50 -void LegoAnimationManager::configureLegoAnimationManager(int param_1) +void LegoAnimationManager::configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig) { - g_legoAnimationManagerConfig = param_1; + g_legoAnimationManagerConfig = p_legoAnimationManagerConfig; } // STUB: LEGO1 0x1005eb60 @@ -28,13 +28,13 @@ void LegoAnimationManager::Init() } // STUB: LEGO1 0x1005f6d0 -void LegoAnimationManager::FUN_1005f6d0(MxBool p) +void LegoAnimationManager::FUN_1005f6d0(MxBool) { // TODO } // STUB: LEGO1 0x100619f0 -MxLong LegoAnimationManager::Notify(MxParam& p) +MxLong LegoAnimationManager::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/legoanimationmanager.h b/LEGO1/legoanimationmanager.h index 89fb427c..d2578383 100644 --- a/LEGO1/legoanimationmanager.h +++ b/LEGO1/legoanimationmanager.h @@ -10,8 +10,8 @@ public: LegoAnimationManager(); virtual ~LegoAnimationManager() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 - virtual MxResult Tickle() override; // vtable+0x8 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 + virtual MxResult Tickle() override; // vtable+0x8 // FUNCTION: LEGO1 0x1005ec80 inline virtual const char* ClassName() const override // vtable+0x0c @@ -21,14 +21,14 @@ public: } // FUNCTION: LEGO1 0x1005ec90 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); } - void FUN_1005f6d0(MxBool p); + void FUN_1005f6d0(MxBool); - __declspec(dllexport) static void configureLegoAnimationManager(int param_1); + __declspec(dllexport) static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); private: void Init(); diff --git a/LEGO1/legoanimmmpresenter.h b/LEGO1/legoanimmmpresenter.h index ddcabeee..9fc9d19f 100644 --- a/LEGO1/legoanimmmpresenter.h +++ b/LEGO1/legoanimmmpresenter.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1004a960 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoAnimMMPresenter::ClassName()) || MxCompositePresenter::IsA(name); + return !strcmp(p_name, LegoAnimMMPresenter::ClassName()) || MxCompositePresenter::IsA(p_name); } }; diff --git a/LEGO1/legoanimpresenter.h b/LEGO1/legoanimpresenter.h index 532d8c8a..5961f74a 100644 --- a/LEGO1/legoanimpresenter.h +++ b/LEGO1/legoanimpresenter.h @@ -16,9 +16,9 @@ public: } // FUNCTION: LEGO1 0x10068540 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } private: diff --git a/LEGO1/legobackgroundcolor.cpp b/LEGO1/legobackgroundcolor.cpp index f25bdf9e..e682356b 100644 --- a/LEGO1/legobackgroundcolor.cpp +++ b/LEGO1/legobackgroundcolor.cpp @@ -29,27 +29,27 @@ void LegoBackgroundColor::SetValue(const char* p_colorString) if (!videomanager || !p_colorString) return; - float converted_r, converted_g, converted_b; + float convertedR, convertedG, convertedB; char* colorStringCopy = strcpy(new char[strlen(p_colorString) + 1], p_colorString); char* colorStringSplit = strtok(colorStringCopy, g_delimiter); if (!strcmp(colorStringSplit, g_set)) { colorStringSplit = strtok(0, g_delimiter); if (colorStringSplit) - h = (float) (atoi(colorStringSplit) * 0.01); + m_h = (float) (atoi(colorStringSplit) * 0.01); colorStringSplit = strtok(0, g_delimiter); if (colorStringSplit) - s = (float) (atoi(colorStringSplit) * 0.01); + m_s = (float) (atoi(colorStringSplit) * 0.01); colorStringSplit = strtok(0, g_delimiter); if (colorStringSplit) - v = (float) (atoi(colorStringSplit) * 0.01); + m_v = (float) (atoi(colorStringSplit) * 0.01); - ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b); - videomanager->SetSkyColor(converted_r, converted_g, converted_b); + ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB); + videomanager->SetSkyColor(convertedR, convertedG, convertedB); } else if (!strcmp(colorStringSplit, g_reset)) { - ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b); - videomanager->SetSkyColor(converted_r, converted_g, converted_b); + ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB); + videomanager->SetSkyColor(convertedR, convertedG, convertedB); } delete[] colorStringCopy; diff --git a/LEGO1/legobackgroundcolor.h b/LEGO1/legobackgroundcolor.h index 0d9c7c5f..c11508bc 100644 --- a/LEGO1/legobackgroundcolor.h +++ b/LEGO1/legobackgroundcolor.h @@ -11,9 +11,9 @@ public: virtual void SetValue(const char* p_colorString) override; private: - float h; - float s; - float v; + float m_h; + float m_s; + float m_v; }; #endif // LEGOBACKGROUNDCOLOR_H diff --git a/LEGO1/legobuildingmanager.cpp b/LEGO1/legobuildingmanager.cpp index 19a49bf6..34652509 100644 --- a/LEGO1/legobuildingmanager.cpp +++ b/LEGO1/legobuildingmanager.cpp @@ -4,9 +4,9 @@ int g_buildingManagerConfig = 1; // FUNCTION: LEGO1 0x1002f8b0 -void LegoBuildingManager::configureLegoBuildingManager(int param_1) +void LegoBuildingManager::configureLegoBuildingManager(MxS32 p_buildingManagerConfig) { - g_buildingManagerConfig = param_1; + g_buildingManagerConfig = p_buildingManagerConfig; } // FUNCTION: LEGO1 0x1002f8c0 diff --git a/LEGO1/legobuildingmanager.h b/LEGO1/legobuildingmanager.h index 4a822bcf..38c9cd57 100644 --- a/LEGO1/legobuildingmanager.h +++ b/LEGO1/legobuildingmanager.h @@ -17,7 +17,7 @@ public: return "LegoBuildingManager"; } - __declspec(dllexport) static void configureLegoBuildingManager(int param_1); + __declspec(dllexport) static void configureLegoBuildingManager(MxS32); private: void Init(); diff --git a/LEGO1/legocachesound.h b/LEGO1/legocachesound.h index 61daa73b..e045a719 100644 --- a/LEGO1/legocachesound.h +++ b/LEGO1/legocachesound.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10006590 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoCacheSound::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, LegoCacheSound::ClassName()) || MxCore::IsA(p_name); } private: diff --git a/LEGO1/legocameracontroller.h b/LEGO1/legocameracontroller.h index d12f333d..c6dd1573 100644 --- a/LEGO1/legocameracontroller.h +++ b/LEGO1/legocameracontroller.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10011ed0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); } }; diff --git a/LEGO1/legocarbuild.cpp b/LEGO1/legocarbuild.cpp index 86c9ba09..f75e4653 100644 --- a/LEGO1/legocarbuild.cpp +++ b/LEGO1/legocarbuild.cpp @@ -21,7 +21,7 @@ MxResult LegoCarBuild::Tickle() } // STUB: LEGO1 0x10024050 -MxLong LegoCarBuild::Notify(MxParam& p) +MxLong LegoCarBuild::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/legocarbuild.h b/LEGO1/legocarbuild.h index 2f2fbcd2..b4a93e7c 100644 --- a/LEGO1/legocarbuild.h +++ b/LEGO1/legocarbuild.h @@ -10,8 +10,8 @@ public: LegoCarBuild(); virtual ~LegoCarBuild() override; - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 - virtual MxResult Tickle() override; // vtable+0x8 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 + virtual MxResult Tickle() override; // vtable+0x8 // FUNCTION: LEGO1 0x10022940 inline virtual const char* ClassName() const override // vtable+0x0c @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x10022950 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoCarBuild::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, LegoCarBuild::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/legocarbuildanimpresenter.h b/LEGO1/legocarbuildanimpresenter.h index 0003a917..8be926f7 100644 --- a/LEGO1/legocarbuildanimpresenter.h +++ b/LEGO1/legocarbuildanimpresenter.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x10078520 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoCarBuildAnimPresenter::ClassName()) || LegoAnimPresenter::IsA(name); + return !strcmp(p_name, LegoCarBuildAnimPresenter::ClassName()) || LegoAnimPresenter::IsA(p_name); } }; diff --git a/LEGO1/legocarraceactor.h b/LEGO1/legocarraceactor.h index 592dfdb3..d03b20eb 100644 --- a/LEGO1/legocarraceactor.h +++ b/LEGO1/legocarraceactor.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x10081670 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoCarRaceActor::ClassName()) || LegoRaceActor::IsA(name); + return !strcmp(p_name, LegoCarRaceActor::ClassName()) || LegoRaceActor::IsA(p_name); } }; diff --git a/LEGO1/legocontrolmanager.h b/LEGO1/legocontrolmanager.h index 68ca2faa..591effb6 100644 --- a/LEGO1/legocontrolmanager.h +++ b/LEGO1/legocontrolmanager.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x10028cc0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoControlManager::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, LegoControlManager::ClassName()) || MxCore::IsA(p_name); } void Register(MxCore* p_listener); diff --git a/LEGO1/legoentity.cpp b/LEGO1/legoentity.cpp index 9a1107dd..0213145e 100644 --- a/LEGO1/legoentity.cpp +++ b/LEGO1/legoentity.cpp @@ -22,11 +22,11 @@ void LegoEntity::Init() m_roi = NULL; m_cameraFlag = 0; m_actionArgString = NULL; - m_unk10 = 0; - m_unk11 = 0; + m_unk0x10 = 0; + m_unk0x11 = 0; m_actionType = ExtraActionType_unknown; m_actionArgNumber = -1; - m_unk59 = 4; + m_unk0x59 = 4; } // STUB: LEGO1 0x10010650 @@ -142,7 +142,7 @@ void LegoEntity::VTable0x4c() } // STUB: LEGO1 0x100114f0 -MxLong LegoEntity::Notify(MxParam& p) +MxLong LegoEntity::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/legoentity.h b/LEGO1/legoentity.h index 5cb2be1f..8d4471d4 100644 --- a/LEGO1/legoentity.h +++ b/LEGO1/legoentity.h @@ -17,7 +17,7 @@ public: __declspec(dllexport) virtual ~LegoEntity() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x1000c2f0 inline const char* ClassName() const override // vtable+0xc @@ -27,9 +27,9 @@ public: } // FUNCTION: LEGO1 0x1000c300 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name); + return !strcmp(p_name, LegoEntity::ClassName()) || MxEntity::IsA(p_name); } virtual MxResult Create(MxDSObject& p_dsObject); // vtable+0x18 @@ -52,15 +52,15 @@ protected: void Init(); void SetWorld(); - undefined m_unk10; - undefined m_unk11; + undefined m_unk0x10; + undefined m_unk0x11; Vector3Data m_worldLocation; // 0x14 Vector3Data m_worldDirection; // 0x28 Vector3Data m_worldUp; // 0x3c MxFloat m_worldSpeed; // 0x50 LegoROI* m_roi; // 0x54 MxBool m_cameraFlag; // 0x58 - undefined m_unk59; + undefined m_unk0x59; // For tokens from the extra string that look like this: // "Action:openram;\lego\scripts\Race\CarRaceR;0" ExtraActionType m_actionType; // 0x5c diff --git a/LEGO1/legoentitypresenter.cpp b/LEGO1/legoentitypresenter.cpp index 05bcb7bf..dc1a44eb 100644 --- a/LEGO1/legoentitypresenter.cpp +++ b/LEGO1/legoentitypresenter.cpp @@ -14,7 +14,7 @@ LegoEntityPresenter::LegoEntityPresenter() // FUNCTION: LEGO1 0x100535c0 void LegoEntityPresenter::Init() { - m_unk4c = 0; + m_unk0x4c = 0; } // FUNCTION: LEGO1 0x100535d0 @@ -24,9 +24,9 @@ LegoEntityPresenter::~LegoEntityPresenter() } // FUNCTION: LEGO1 0x10053630 -undefined4 LegoEntityPresenter::vtable6c(undefined4 p_unknown) +undefined4 LegoEntityPresenter::VTable0x6c(undefined4 p_unk0x4c) { - m_unk4c = p_unknown; + m_unk0x4c = p_unk0x4c; return 0; } diff --git a/LEGO1/legoentitypresenter.h b/LEGO1/legoentitypresenter.h index efa85b50..9e072498 100644 --- a/LEGO1/legoentitypresenter.h +++ b/LEGO1/legoentitypresenter.h @@ -18,19 +18,19 @@ public: } // FUNCTION: LEGO1 0x100534c0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoEntityPresenter::ClassName()) || MxCompositePresenter::IsA(name); + return !strcmp(p_name, LegoEntityPresenter::ClassName()) || MxCompositePresenter::IsA(p_name); } - virtual void Destroy() override; // vtable+0x38 - virtual void Init(); // vtable+0x68 - virtual undefined4 vtable6c(undefined4 p_unknown); // vtable+0x6c + virtual void Destroy() override; // vtable+0x38 + virtual void Init(); // vtable+0x68 + virtual undefined4 VTable0x6c(undefined4 p_unk0x4c); // vtable+0x6c private: void Destroy(MxBool p_fromDestructor); - undefined4 m_unk4c; + undefined4 m_unk0x4c; }; #endif // LEGOENTITYPRESENTER_H diff --git a/LEGO1/legoeventnotificationparam.h b/LEGO1/legoeventnotificationparam.h index 30b77a35..5f0195ec 100644 --- a/LEGO1/legoeventnotificationparam.h +++ b/LEGO1/legoeventnotificationparam.h @@ -16,7 +16,7 @@ public: MxS32 p_y, MxU8 p_key ) - : MxNotificationParam(p_type, p_sender), m_modifier(p_modifier), m_x(p_x), m_y(p_y), m_key(p_key), m_unk1c(0) + : MxNotificationParam(p_type, p_sender), m_modifier(p_modifier), m_x(p_x), m_y(p_y), m_key(p_key), m_unk0x1c(0) { } @@ -28,7 +28,7 @@ protected: MxS32 m_x; // 0x10 MxS32 m_y; // 0x14 MxU8 m_key; // 0x18 - MxU32 m_unk1c; // 0x1c + MxU32 m_unk0x1c; // 0x1c }; #endif // LEGOEVENTNOTIFICATIONPARAM_H diff --git a/LEGO1/legoextraactor.h b/LEGO1/legoextraactor.h index f0838e45..6b8a9198 100644 --- a/LEGO1/legoextraactor.h +++ b/LEGO1/legoextraactor.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x1002b7c0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(name); + return !strcmp(p_name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(p_name); } }; diff --git a/LEGO1/legofullscreenmovie.cpp b/LEGO1/legofullscreenmovie.cpp index d2db6ac2..110a88d0 100644 --- a/LEGO1/legofullscreenmovie.cpp +++ b/LEGO1/legofullscreenmovie.cpp @@ -8,10 +8,10 @@ DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24) // GLOBAL: LEGO1 0x100f3be8 -const char* g_str_enable = "enable"; +const char* g_strEnable = "enable"; // GLOBAL: LEGO1 0x100f3bf4 -const char* g_str_disable = "disable"; +const char* g_strDisable = "disable"; // FUNCTION: LEGO1 0x1003c500 LegoFullScreenMovie::LegoFullScreenMovie(const char* p_key, const char* p_value) @@ -30,12 +30,12 @@ void LegoFullScreenMovie::SetValue(const char* p_option) LegoVideoManager* videomanager = VideoManager(); if (videomanager) { - if (!strcmp(m_value.GetData(), g_str_enable)) { + if (!strcmp(m_value.GetData(), g_strEnable)) { videomanager->EnableFullScreenMovie(TRUE); return; } - if (!strcmp(m_value.GetData(), g_str_disable)) { + if (!strcmp(m_value.GetData(), g_strDisable)) { videomanager->EnableFullScreenMovie(FALSE); return; } diff --git a/LEGO1/legogamestate.cpp b/LEGO1/legogamestate.cpp index 99e3f47e..599b4c79 100644 --- a/LEGO1/legogamestate.cpp +++ b/LEGO1/legogamestate.cpp @@ -38,7 +38,7 @@ ColorStringStruct g_colorSaveData[43] = { // NOTE: This offset = the end of the variables table, the last entry // in that table is a special entry, the string "END_OF_VARIABLES" // GLOBAL: LEGO1 0x100f3e50 -extern const char* s_endOfVariables; +extern const char* g_endOfVariables; // FUNCTION: LEGO1 0x10039550 LegoGameState::LegoGameState() @@ -94,9 +94,9 @@ MxResult LegoGameState::Save(MxULong p_slot) if (fileStream.Open(savePath.GetData(), LegoStream::WriteBit) != FAILURE) { MxU32 maybeVersion = 0x1000C; fileStream.Write(&maybeVersion, 4); - fileStream.Write(&m_unk24, 2); - fileStream.Write(&m_unk10, 2); - fileStream.Write(&m_unkC, 1); + fileStream.Write(&m_unk0x24, 2); + fileStream.Write(&m_unk0x10, 2); + fileStream.Write(&m_unk0xc, 1); for (MxS32 i = 0; i < sizeof(g_colorSaveData) / sizeof(g_colorSaveData[0]); ++i) { if (LegoStream::WriteVariable(&fileStream, variableTable, g_colorSaveData[i].m_targetName) == FAILURE) @@ -140,9 +140,9 @@ void LegoGameState::SetSavePath(char* p_savePath) // FUNCTION: LEGO1 0x1003a020 MxResult LegoGameState::WriteEndOfVariables(LegoStream* p_stream) { - MxU8 len = strlen(s_endOfVariables); + MxU8 len = strlen(g_endOfVariables); if (p_stream->Write(&len, 1) == SUCCESS) - return p_stream->Write(s_endOfVariables, len); + return p_stream->Write(g_endOfVariables, len); return FAILURE; } @@ -167,19 +167,19 @@ void LegoGameState::GetFileSavePath(MxString* p_outPath, MxULong p_slotn) } // STUB: LEGO1 0x1003a2e0 -void LegoGameState::SerializePlayersInfo(MxS16 p) +void LegoGameState::SerializePlayersInfo(MxS16) { // TODO } // STUB: LEGO1 0x1003a720 -void LegoGameState::FUN_1003a720(MxU32 p_unk) +void LegoGameState::FUN_1003a720(MxU32) { // TODO } // STUB: LEGO1 0x1003b060 -void LegoGameState::HandleAction(MxU32 p_unk) +void LegoGameState::HandleAction(MxU32) { // TODO } @@ -256,7 +256,7 @@ void LegoGameState::RegisterState(LegoState* p_state) } // STUB: LEGO1 0x1003cdd0 -void LegoGameState::SerializeScoreHistory(MxS16 p) +void LegoGameState::SerializeScoreHistory(MxS16) { // TODO } @@ -264,5 +264,5 @@ void LegoGameState::SerializeScoreHistory(MxS16 p) // FUNCTION: LEGO1 0x1003cea0 void LegoGameState::SetSomeEnumState(undefined4 p_state) { - m_unk10 = p_state; + m_unk0x10 = p_state; } diff --git a/LEGO1/legogamestate.h b/LEGO1/legogamestate.h index 82ff4d9c..073352e5 100644 --- a/LEGO1/legogamestate.h +++ b/LEGO1/legogamestate.h @@ -22,20 +22,20 @@ public: __declspec(dllexport) LegoGameState(); __declspec(dllexport) ~LegoGameState(); __declspec(dllexport) MxResult Load(MxULong); - __declspec(dllexport) MxResult Save(MxULong p); - __declspec(dllexport) void SerializePlayersInfo(MxS16 p); - __declspec(dllexport) void SerializeScoreHistory(MxS16 p); - __declspec(dllexport) void SetSavePath(char* p); + __declspec(dllexport) MxResult Save(MxULong); + __declspec(dllexport) void SerializePlayersInfo(MxS16); + __declspec(dllexport) void SerializeScoreHistory(MxS16); + __declspec(dllexport) void SetSavePath(char*); LegoState* GetState(COMPAT_CONST char* p_stateName); LegoState* CreateState(COMPAT_CONST char* p_stateName); void GetFileSavePath(MxString* p_outPath, MxULong p_slotn); - void FUN_1003a720(MxU32 p_unk); - void HandleAction(MxU32 p_unk); + void FUN_1003a720(MxU32); + void HandleAction(MxU32); - inline MxU32 GetUnknown10() { return m_unk10; } - inline void SetUnknown424(undefined4 p_unk424) { m_unk424 = p_unk424; } + inline MxU32 GetUnknown10() { return m_unk0x10; } + inline void SetUnknown424(undefined4 p_unk0x424) { m_unk0x424 = p_unk0x424; } void SetSomeEnumState(undefined4 p_state); @@ -48,19 +48,19 @@ private: char* m_savePath; // 0x0 MxS16 m_stateCount; LegoState** m_stateArray; - MxU8 m_unkC; - MxU32 m_unk10; + MxU8 m_unk0xc; + MxU32 m_unk0x10; undefined4 m_unk0x14; LegoBackgroundColor* m_backgroundColor; // 0x18 LegoBackgroundColor* m_tempBackgroundColor; // 0x1c LegoFullScreenMovie* m_fullScreenMovie; // 0x20 - MxU16 m_unk24; // 0x24 - undefined m_unk28[1020]; - undefined4 m_unk424; - undefined4 m_unk428; - undefined4 m_unk42c; + MxU16 m_unk0x24; // 0x24 + undefined m_unk0x28[1020]; + undefined4 m_unk0x424; + undefined4 m_unk0x428; + undefined4 m_unk0x42c; }; -MxBool ROIHandlerFunction(char* p_0, char* p_output, MxU32 p_copyLen); +MxBool ROIHandlerFunction(char* p_input, char* p_output, MxU32 p_copyLen); #endif // LEGOGAMESTATE_H diff --git a/LEGO1/legohideanimpresenter.h b/LEGO1/legohideanimpresenter.h index a2334e5b..aca44424 100644 --- a/LEGO1/legohideanimpresenter.h +++ b/LEGO1/legohideanimpresenter.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1006d890 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || LegoAnimPresenter::IsA(name); + return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name); } private: diff --git a/LEGO1/legoinputmanager.cpp b/LEGO1/legoinputmanager.cpp index 04b1c5f1..cdfd4bb3 100644 --- a/LEGO1/legoinputmanager.cpp +++ b/LEGO1/legoinputmanager.cpp @@ -74,15 +74,15 @@ void LegoInputManager::Destroy() } // FUNCTION: LEGO1 0x1005c030 -void LegoInputManager::CreateAndAcquireKeyboard(HWND hwnd) +void LegoInputManager::CreateAndAcquireKeyboard(HWND p_hwnd) { - HINSTANCE hinstance = (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE); + HINSTANCE hinstance = (HINSTANCE) GetWindowLong(p_hwnd, GWL_HINSTANCE); HRESULT hresult = DirectInputCreate(hinstance, 0x500, &m_directInput, NULL); // 0x500 for DX5 if (hresult == DI_OK) { HRESULT createdeviceresult = m_directInput->CreateDevice(GUID_SysKeyboard, &m_directInputDevice, NULL); if (createdeviceresult == DI_OK) { - m_directInputDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND); + m_directInputDevice->SetCooperativeLevel(p_hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND); m_directInputDevice->SetDataFormat(&c_dfDIKeyboard); m_directInputDevice->Acquire(); } @@ -138,10 +138,10 @@ MxResult LegoInputManager::GetJoystickId() // FUNCTION: LEGO1 0x1005c320 MxResult LegoInputManager::GetJoystickState( - MxU32* joystick_x, - MxU32* joystick_y, - DWORD* buttons_state, - MxU32* pov_position + MxU32* p_joystickX, + MxU32* p_joystickY, + DWORD* p_buttonsState, + MxU32* p_povPosition ) { if (m_useJoystick != FALSE) { @@ -165,23 +165,23 @@ MxResult LegoInputManager::GetJoystickState( MMRESULT mmresult = joyGetPosEx(m_joyid, &joyinfoex); if (mmresult == MMSYSERR_NOERROR) { - *buttons_state = joyinfoex.dwButtons; + *p_buttonsState = joyinfoex.dwButtons; MxU32 xmin = m_joyCaps.wXmin; MxU32 ymax = m_joyCaps.wYmax; MxU32 ymin = m_joyCaps.wYmin; MxS32 ydiff = ymax - ymin; - *joystick_x = ((joyinfoex.dwXpos - xmin) * 100) / (m_joyCaps.wXmax - xmin); - *joystick_y = ((joyinfoex.dwYpos - m_joyCaps.wYmin) * 100) / ydiff; + *p_joystickX = ((joyinfoex.dwXpos - xmin) * 100) / (m_joyCaps.wXmax - xmin); + *p_joystickY = ((joyinfoex.dwYpos - m_joyCaps.wYmin) * 100) / ydiff; if ((m_joyCaps.wCaps & (JOYCAPS_POV4DIR | JOYCAPS_POVCTS)) != 0) { if (joyinfoex.dwPOV == JOY_POVCENTERED) { - *pov_position = (MxU32) -1; + *p_povPosition = (MxU32) -1; return SUCCESS; } - *pov_position = joyinfoex.dwPOV / 100; + *p_povPosition = joyinfoex.dwPOV / 100; return SUCCESS; } else { - *pov_position = (MxU32) -1; + *p_povPosition = (MxU32) -1; return SUCCESS; } } diff --git a/LEGO1/legoinputmanager.h b/LEGO1/legoinputmanager.h index 11ededd8..fcb9b560 100644 --- a/LEGO1/legoinputmanager.h +++ b/LEGO1/legoinputmanager.h @@ -40,10 +40,10 @@ public: MxResult Create(HWND p_hwnd); void Destroy(); - void CreateAndAcquireKeyboard(HWND hwnd); + void CreateAndAcquireKeyboard(HWND p_hwnd); void ReleaseDX(); MxResult GetJoystickId(); - MxResult GetJoystickState(MxU32* joystick_x, MxU32* joystick_y, DWORD* buttons_state, MxU32* pov_position); + MxResult GetJoystickState(MxU32* p_joystickX, MxU32* p_joystickY, DWORD* p_buttonsState, MxU32* p_povPosition); void SetTimer(); void KillTimer(); void SetCamera(LegoCameraController* p_camera); diff --git a/LEGO1/legojetski.h b/LEGO1/legojetski.h index ca3d8da7..b7909a46 100644 --- a/LEGO1/legojetski.h +++ b/LEGO1/legojetski.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x10013ea0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoJetski::ClassName()) || LegoJetskiRaceActor::IsA(name); + return !strcmp(p_name, LegoJetski::ClassName()) || LegoJetskiRaceActor::IsA(p_name); } }; diff --git a/LEGO1/legojetskiraceactor.h b/LEGO1/legojetskiraceactor.h index b7f04043..d2ab88d8 100644 --- a/LEGO1/legojetskiraceactor.h +++ b/LEGO1/legojetskiraceactor.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x10081da0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoJetskiRaceActor::ClassName()) || LegoCarRaceActor::IsA(name); + return !strcmp(p_name, LegoJetskiRaceActor::ClassName()) || LegoCarRaceActor::IsA(p_name); } }; diff --git a/LEGO1/legolocomotionanimpresenter.h b/LEGO1/legolocomotionanimpresenter.h index 8a4cf5a6..e7d7af25 100644 --- a/LEGO1/legolocomotionanimpresenter.h +++ b/LEGO1/legolocomotionanimpresenter.h @@ -16,9 +16,9 @@ public: } // FUNCTION: LEGO1 0x1006ce60 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || LegoLoopingAnimPresenter::IsA(name); + return !strcmp(p_name, ClassName()) || LegoLoopingAnimPresenter::IsA(p_name); } private: diff --git a/LEGO1/legoloopinganimpresenter.h b/LEGO1/legoloopinganimpresenter.h index b3ea4fb8..7f033a98 100644 --- a/LEGO1/legoloopinganimpresenter.h +++ b/LEGO1/legoloopinganimpresenter.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000c9b0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || LegoAnimPresenter::IsA(name); + return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name); } }; diff --git a/LEGO1/legomodelpresenter.cpp b/LEGO1/legomodelpresenter.cpp index 99e73b65..75ed1750 100644 --- a/LEGO1/legomodelpresenter.cpp +++ b/LEGO1/legomodelpresenter.cpp @@ -4,7 +4,7 @@ int g_modelPresenterConfig = 1; // FUNCTION: LEGO1 0x1007f660 -void LegoModelPresenter::configureLegoModelPresenter(int param_1) +void LegoModelPresenter::configureLegoModelPresenter(MxS32 p_modelPresenterConfig) { - g_modelPresenterConfig = param_1; + g_modelPresenterConfig = p_modelPresenterConfig; } diff --git a/LEGO1/legomodelpresenter.h b/LEGO1/legomodelpresenter.h index c389cb0e..b529fede 100644 --- a/LEGO1/legomodelpresenter.h +++ b/LEGO1/legomodelpresenter.h @@ -7,7 +7,7 @@ // SIZE 0x6c (discovered through inline constructor at 0x10009ae6) class LegoModelPresenter : public MxVideoPresenter { public: - __declspec(dllexport) static void configureLegoModelPresenter(int param_1); + __declspec(dllexport) static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig); // FUNCTION: LEGO1 0x1000ccb0 inline const char* ClassName() const override // vtable+0xc @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1000ccc0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoModelPresenter::ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, LegoModelPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } }; diff --git a/LEGO1/legonavcontroller.cpp b/LEGO1/legonavcontroller.cpp index b4bf4f0f..a806edd0 100644 --- a/LEGO1/legonavcontroller.cpp +++ b/LEGO1/legonavcontroller.cpp @@ -35,18 +35,18 @@ LegoNavController::LegoNavController() { ResetToDefault(); - this->unk_18 = 0.0f; - this->unk_1C = 0.0f; + this->m_unk0x18 = 0.0f; + this->m_unk0x1c = 0.0f; this->m_targetMovementSpeed = 0.0f; this->m_targetTurnSpeed = 0.0f; this->m_movementAccel = 0.0f; this->m_turnAccel = 0.0f; this->m_trackDefault = FALSE; - this->m_unk5D = FALSE; - this->m_unk6C = FALSE; - this->m_unk64 = 0; - this->m_unk68 = 0; - this->m_unk60 = 0; + this->m_unk0x5d = FALSE; + this->m_unk0x6c = FALSE; + this->m_unk0x64 = 0; + this->m_unk0x68 = 0; + this->m_unk0x60 = 0; MxTimer* timer = Timer(); this->m_time = timer->GetTime(); @@ -66,7 +66,7 @@ void LegoNavController::SetControlMax(int p_hMax, int p_vMax) this->m_hMax = p_hMax; this->m_vMax = p_vMax; - if (VideoManager()->GetVideoParam().flags().GetFullScreen()) { + if (VideoManager()->GetVideoParam().Flags().GetFullScreen()) { this->m_hMax = 640; this->m_vMax = 480; } diff --git a/LEGO1/legonavcontroller.h b/LEGO1/legonavcontroller.h index 1758b6af..ffaf99cb 100644 --- a/LEGO1/legonavcontroller.h +++ b/LEGO1/legonavcontroller.h @@ -47,9 +47,9 @@ public: } // FUNCTION: LEGO1 0x10054b90 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); } void SetControlMax(int p_hMax, int p_vMax); @@ -64,8 +64,8 @@ private: int m_vMax; int m_mouseDeadzone; float m_zeroThreshold; - float unk_18; - float unk_1C; + float m_unk0x18; + float m_unk0x1c; float m_targetMovementSpeed; float m_targetTurnSpeed; float m_movementMaxSpeed; @@ -82,12 +82,12 @@ private: MxBool m_turnUseVelocity; int m_time; MxBool m_trackDefault; - MxBool m_unk5D; - char m_unk5E[2]; - int m_unk60; - int m_unk64; - int m_unk68; - MxBool m_unk6C; + MxBool m_unk0x5d; + char m_unk0x5e[2]; + int m_unk0x60; + int m_unk0x64; + int m_unk0x68; + MxBool m_unk0x6c; }; #endif // LEGONAVCONTROLLER_H diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 51bb0c0a..c59258d6 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -355,21 +355,21 @@ LegoOmni::~LegoOmni() void LegoOmni::Init() { MxOmni::Init(); - m_unk68 = 0; + m_unk0x68 = 0; m_inputMgr = NULL; - m_unk6c = 0; + m_unk0x6c = 0; m_gifManager = NULL; m_worldList = NULL; m_currentWorld = NULL; - m_unk80 = FALSE; + m_unk0x80 = FALSE; m_currentVehicle = NULL; - m_unkLegoSaveDataWriter = NULL; + m_saveDataWriter = NULL; m_plantManager = NULL; m_gameState = NULL; m_animationManager = NULL; m_buildingManager = NULL; m_bkgAudioManager = NULL; - m_unk13c = TRUE; + m_unk0x13c = TRUE; m_transitionManager = NULL; } @@ -380,20 +380,20 @@ void LegoOmni::Destroy() } // FUNCTION: LEGO1 0x10058e70 -MxResult LegoOmni::Create(MxOmniCreateParam& p) +MxResult LegoOmni::Create(MxOmniCreateParam& p_param) { MxResult result = FAILURE; MxAutoLocker lock(&this->m_criticalsection); - p.CreateFlags().CreateObjectFactory(FALSE); - p.CreateFlags().CreateVideoManager(FALSE); - p.CreateFlags().CreateSoundManager(FALSE); - p.CreateFlags().CreateTickleManager(FALSE); + p_param.CreateFlags().CreateObjectFactory(FALSE); + p_param.CreateFlags().CreateVideoManager(FALSE); + p_param.CreateFlags().CreateSoundManager(FALSE); + p_param.CreateFlags().CreateTickleManager(FALSE); if (!(m_tickleManager = new MxTickleManager())) return FAILURE; - if (MxOmni::Create(p) != SUCCESS) + if (MxOmni::Create(p_param) != SUCCESS) return FAILURE; m_objectFactory = new LegoObjectFactory(); @@ -409,14 +409,14 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p) } if (m_videoManager = new LegoVideoManager()) { - if (m_videoManager->Create(p.GetVideoParam(), 100, 0) != SUCCESS) { + if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) { delete m_videoManager; m_videoManager = NULL; } } if (m_inputMgr = new LegoInputManager()) { - if (m_inputMgr->Create(p.GetWindowHandle()) != SUCCESS) { + if (m_inputMgr->Create(p_param.GetWindowHandle()) != SUCCESS) { delete m_inputMgr; m_inputMgr = NULL; } @@ -430,7 +430,7 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p) m_gameState = new LegoGameState(); m_worldList = new LegoWorldList(); - if (m_unk6c && m_gifManager && m_worldList && m_plantManager && m_animationManager && m_buildingManager) { + if (m_unk0x6c && m_gifManager && m_worldList && m_plantManager && m_animationManager && m_buildingManager) { // TODO: initialize a bunch of MxVariables RegisterScripts(); FUN_1001a700(); @@ -466,7 +466,7 @@ LegoOmni* LegoOmni::GetInstance() } // STUB: LEGO1 0x1005af10 -void LegoOmni::RemoveWorld(const MxAtomId& p1, MxLong p2) +void LegoOmni::RemoveWorld(const MxAtomId&, MxLong) { // TODO } @@ -479,7 +479,7 @@ LegoEntity* LegoOmni::FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_ent } // STUB: LEGO1 0x1005b1d0 -MxResult LegoOmni::DeleteObject(MxDSAction& ds) +MxResult LegoOmni::DeleteObject(MxDSAction& p_dsAction) { // TODO return FAILURE; @@ -511,10 +511,10 @@ void LegoOmni::NotifyCurrentEntity(MxNotificationParam* p_param) } // FUNCTION: LEGO1 0x1005b3c0 -MxBool LegoOmni::DoesEntityExist(MxDSAction& ds) +MxBool LegoOmni::DoesEntityExist(MxDSAction& p_dsAction) { - if (MxOmni::DoesEntityExist(ds)) { - if (FindByEntityIdOrAtomId(ds.GetAtomId(), ds.GetObjectId()) == NULL) { + if (MxOmni::DoesEntityExist(p_dsAction)) { + if (FindByEntityIdOrAtomId(p_dsAction.GetAtomId(), p_dsAction.GetObjectId()) == NULL) { return TRUE; } } @@ -536,17 +536,17 @@ void LegoOmni::CreateBackgroundAudio() } // FUNCTION: LEGO1 0x1005b580 -MxResult LegoOmni::Start(MxDSAction* action) +MxResult LegoOmni::Start(MxDSAction* p_dsAction) { - MxResult result = MxOmni::Start(action); - this->m_action.SetAtomId(action->GetAtomId()); - this->m_action.SetObjectId(action->GetObjectId()); - this->m_action.SetUnknown24(action->GetUnknown24()); + MxResult result = MxOmni::Start(p_dsAction); + this->m_action.SetAtomId(p_dsAction->GetAtomId()); + this->m_action.SetObjectId(p_dsAction->GetObjectId()); + this->m_action.SetUnknown24(p_dsAction->GetUnknown24()); return result; } // STUB: LEGO1 0x1005b5f0 -MxLong LegoOmni::Notify(MxParam& p) +MxLong LegoOmni::Notify(MxParam& p_param) { // TODO return 0; @@ -636,21 +636,21 @@ void SetOmniUserMessage(void (*p_userMsg)(const char*, int)) MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs) { char* buf; - _MMCKINFO tmp_chunk; + _MMCKINFO tmpChunk; if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) { return NULL; } - if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'S', 't')) { - if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'O', 'b')) { + if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'S', 't')) { + if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'O', 'b')) { - buf = new char[tmp_chunk.cksize]; + buf = new char[tmpChunk.cksize]; if (!buf) { return NULL; } - if (p_file->Read((MxU8*) buf, tmp_chunk.cksize) != 0) { + if (p_file->Read((MxU8*) buf, tmpChunk.cksize) != 0) { return NULL; } diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 644f2536..5aba7c50 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -61,15 +61,15 @@ extern MxAtomId* g_nocdSourceName; class LegoOmni : public MxOmni { public: __declspec(dllexport) void CreateBackgroundAudio(); - __declspec(dllexport) void RemoveWorld(const MxAtomId& p1, MxLong p2); - __declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary**, int&); + __declspec(dllexport) void RemoveWorld(const MxAtomId&, MxLong); + __declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary**, MxS32&); __declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static LegoOmni* GetInstance(); LegoOmni(); virtual ~LegoOmni(); // vtable+00 - virtual MxLong Notify(MxParam& p) override; // vtable+04 + virtual MxLong Notify(MxParam& p_param) override; // vtable+04 // FUNCTION: LEGO1 0x10058aa0 inline virtual const char* ClassName() const override // vtable+0c @@ -79,17 +79,17 @@ public: } // FUNCTION: LEGO1 0x10058ab0 - inline virtual MxBool IsA(const char* name) const override // vtable+10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+10 { - return !strcmp(name, LegoOmni::ClassName()) || MxOmni::IsA(name); + return !strcmp(p_name, LegoOmni::ClassName()) || MxOmni::IsA(p_name); } virtual void Init() override; // vtable+14 - virtual MxResult Create(MxOmniCreateParam& p) override; // vtable+18 + virtual MxResult Create(MxOmniCreateParam& p_param) override; // vtable+18 virtual void Destroy() override; // vtable+1c - virtual MxResult Start(MxDSAction* action) override; // vtable+20 - virtual MxResult DeleteObject(MxDSAction& ds) override; // vtable+24 - virtual MxBool DoesEntityExist(MxDSAction& ds) override; // vtable+28 + virtual MxResult Start(MxDSAction* p_dsAction) override; // vtable+20 + virtual MxResult DeleteObject(MxDSAction& p_dsAction) override; // vtable+24 + virtual MxBool DoesEntityExist(MxDSAction& p_dsAction) override; // vtable+28 virtual MxEntity* FindWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p_presenter) override; // vtable+30 virtual void NotifyCurrentEntity(MxNotificationParam* p_param) override; // vtable+34 virtual void StartTimer() override; // vtable+38 @@ -114,16 +114,16 @@ public: MxDSAction& GetCurrentAction() { return m_action; } private: - undefined4 m_unk68; - undefined4 m_unk6c; + undefined4 m_unk0x68; + undefined4 m_unk0x6c; LegoInputManager* m_inputMgr; // 0x70 GifManager* m_gifManager; LegoWorldList* m_worldList; // 0x78 LegoWorld* m_currentWorld; - MxBool m_unk80; + MxBool m_unk0x80; LegoNavController* m_navController; // 0x84 LegoWorld* m_currentVehicle; // 0x88 - LegoUnkSaveDataWriter* m_unkLegoSaveDataWriter; + LegoUnkSaveDataWriter* m_saveDataWriter; LegoPlantManager* m_plantManager; // 0x90 LegoAnimationManager* m_animationManager; LegoBuildingManager* m_buildingManager; // 0x98 @@ -131,7 +131,7 @@ private: MxDSAction m_action; MxBackgroundAudioManager* m_bkgAudioManager; // 0x134 MxTransitionManager* m_transitionManager; // 0x138 - MxBool m_unk13c; + MxBool m_unk0x13c; }; __declspec(dllexport) MxBackgroundAudioManager* BackgroundAudioManager(); diff --git a/LEGO1/legopalettepresenter.h b/LEGO1/legopalettepresenter.h index c0b001fd..e29b5391 100644 --- a/LEGO1/legopalettepresenter.h +++ b/LEGO1/legopalettepresenter.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x10079f40 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, ClassName()) || MxVideoPresenter::IsA(p_name); } virtual void Destroy() override; // vtable+0x38 diff --git a/LEGO1/legopartpresenter.cpp b/LEGO1/legopartpresenter.cpp index 6733081f..1ae834f9 100644 --- a/LEGO1/legopartpresenter.cpp +++ b/LEGO1/legopartpresenter.cpp @@ -7,8 +7,8 @@ int g_partPresenterConfig1 = 1; int g_partPresenterConfig2 = 100; // FUNCTION: LEGO1 0x1007c990 -void LegoPartPresenter::configureLegoPartPresenter(int param_1, int param_2) +void LegoPartPresenter::configureLegoPartPresenter(MxS32 p_partPresenterConfig1, MxS32 p_partPresenterConfig2) { - g_partPresenterConfig1 = param_1; - g_partPresenterConfig2 = param_2; + g_partPresenterConfig1 = p_partPresenterConfig1; + g_partPresenterConfig2 = p_partPresenterConfig2; } diff --git a/LEGO1/legopartpresenter.h b/LEGO1/legopartpresenter.h index 7c1be719..936d4876 100644 --- a/LEGO1/legopartpresenter.h +++ b/LEGO1/legopartpresenter.h @@ -15,12 +15,12 @@ public: } // FUNCTION: LEGO1 0x1000cf80 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoPartPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, LegoPartPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } - __declspec(dllexport) static void configureLegoPartPresenter(int param_1, int param_2); + __declspec(dllexport) static void configureLegoPartPresenter(MxS32, MxS32); }; #endif // LEGOPARTPRESENTER_H diff --git a/LEGO1/legopathactor.h b/LEGO1/legopathactor.h index fbf2a51c..119a8e79 100644 --- a/LEGO1/legopathactor.h +++ b/LEGO1/legopathactor.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x1000c440 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoPathActor::ClassName()) || LegoActor::IsA(name); + return !strcmp(p_name, LegoPathActor::ClassName()) || LegoActor::IsA(p_name); } virtual void VTable0x68(); // vtable+0x68 @@ -53,13 +53,13 @@ public: protected: // TODO: the types - undefined unk78[0xc4]; - MxFloat m_unk13c; - MxS32 m_unk140; - MxS32 m_unk144; - undefined m_unk148; - MxS32 m_unk14c; - MxFloat m_unk150; + undefined m_pad[0xc4]; + MxFloat m_unk0x13c; + MxS32 m_unk0x140; + MxS32 m_unk0x144; + undefined m_unk0x148; + MxS32 m_unk0x14c; + MxFloat m_unk0x150; }; #endif // LEGOPATHACTOR_H diff --git a/LEGO1/legopathcontroller.h b/LEGO1/legopathcontroller.h index 612b6d9f..7bb6d30d 100644 --- a/LEGO1/legopathcontroller.h +++ b/LEGO1/legopathcontroller.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x10045120 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoPathController::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, LegoPathController::ClassName()) || MxCore::IsA(p_name); } }; diff --git a/LEGO1/legopathpresenter.h b/LEGO1/legopathpresenter.h index c93caef5..8fe2d5ee 100644 --- a/LEGO1/legopathpresenter.h +++ b/LEGO1/legopathpresenter.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x100449b0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual void RepeatingTickle() override; // vtable+0x24 diff --git a/LEGO1/legophonemepresenter.cpp b/LEGO1/legophonemepresenter.cpp index f96d3760..31948367 100644 --- a/LEGO1/legophonemepresenter.cpp +++ b/LEGO1/legophonemepresenter.cpp @@ -16,8 +16,8 @@ LegoPhonemePresenter::~LegoPhonemePresenter() // FUNCTION: LEGO1 0x1004e3b0 void LegoPhonemePresenter::Init() { - m_unk68 = 0; - m_unk6c = 0; - m_unk70 = 0; - m_unk84 = 0; + m_unk0x68 = 0; + m_unk0x6c = 0; + m_unk0x70 = 0; + m_unk0x84 = 0; } diff --git a/LEGO1/legophonemepresenter.h b/LEGO1/legophonemepresenter.h index 00fa6dde..7b620723 100644 --- a/LEGO1/legophonemepresenter.h +++ b/LEGO1/legophonemepresenter.h @@ -22,11 +22,11 @@ public: private: void Init(); - int m_unk68; - int m_unk6c; - undefined m_unk70; + int m_unk0x68; + int m_unk0x6c; + undefined m_unk0x70; MxString m_string; // 0x74 - undefined m_unk84; + undefined m_unk0x84; }; #endif // LEGOPHONEMEPRESENTER_H diff --git a/LEGO1/legorace.cpp b/LEGO1/legorace.cpp index 2ff6ca01..d5eefbd5 100644 --- a/LEGO1/legorace.cpp +++ b/LEGO1/legorace.cpp @@ -25,21 +25,21 @@ MxBool LegoRace::VTable0x5c() // FUNCTION: LEGO1 0x10015aa0 LegoRace::LegoRace() { - this->m_unkf8 = 0; - this->m_unkfc = 0; - this->m_unk100 = 0; - this->m_unk104 = 0; - this->m_unk108 = 0; - this->m_unk10c = 0; - this->m_unk140 = 0; - this->m_unk110 = 0; - this->m_unk114 = 0; - this->m_unk118 = 0; - this->m_unk128 = 0; - this->m_unk12c = 0; - this->m_unk120 = 0; - this->m_unk124 = 0; - this->m_unk11c = 0; + this->m_unk0xf8 = 0; + this->m_unk0xfc = 0; + this->m_unk0x100 = 0; + this->m_unk0x104 = 0; + this->m_unk0x108 = 0; + this->m_unk0x10c = 0; + this->m_unk0x140 = 0; + this->m_unk0x110 = 0; + this->m_unk0x114 = 0; + this->m_unk0x118 = 0; + this->m_unk0x128 = 0; + this->m_unk0x12c = 0; + this->m_unk0x120 = 0; + this->m_unk0x124 = 0; + this->m_unk0x11c = 0; NotificationManager()->Register(this); } @@ -75,7 +75,7 @@ LegoRace::~LegoRace() } // STUB: LEGO1 0x10015e00 -MxLong LegoRace::Notify(MxParam& p) +MxLong LegoRace::Notify(MxParam& p_param) { // TODO return 0; diff --git a/LEGO1/legorace.h b/LEGO1/legorace.h index cdc4171f..8ae52d8e 100644 --- a/LEGO1/legorace.h +++ b/LEGO1/legorace.h @@ -12,7 +12,7 @@ public: LegoRace(); virtual ~LegoRace() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x10015ba0 inline const char* ClassName() const override // vtable+0xc @@ -22,9 +22,9 @@ public: } // FUNCTION: LEGO1 0x10015bb0 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoRace::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, LegoRace::ClassName()) || LegoWorld::IsA(p_name); } virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 @@ -38,22 +38,22 @@ public: virtual void VTable0x7c(undefined4, undefined4); // vtable+0x7c private: - undefined4 m_unkf8; // 0xf8 - undefined4 m_unkfc; // 0xfc - undefined4 m_unk100; // 0x100 - undefined4 m_unk104; // 0x104 - undefined4 m_unk108; // 0x108 - undefined4 m_unk10c; // 0x10c - undefined4 m_unk110; // 0x110 - undefined4 m_unk114; // 0x114 - undefined4 m_unk118; // 0x118 - undefined4 m_unk11c; // 0x11c - undefined4 m_unk120; // 0x120 - this may be the current vehcle (function at 0x10015880) - undefined4 m_unk124; // 0x124 - something game state - undefined4 m_unk128; // 0x128 - undefined4 m_unk12c; // 0x12c - undefined4 m_unk130[4]; // unconfirmed bytes, ghidra claims these are integers - undefined4 m_unk140; + undefined4 m_unk0xf8; // 0xf8 + undefined4 m_unk0xfc; // 0xfc + undefined4 m_unk0x100; // 0x100 + undefined4 m_unk0x104; // 0x104 + undefined4 m_unk0x108; // 0x108 + undefined4 m_unk0x10c; // 0x10c + undefined4 m_unk0x110; // 0x110 + undefined4 m_unk0x114; // 0x114 + undefined4 m_unk0x118; // 0x118 + undefined4 m_unk0x11c; // 0x11c + undefined4 m_unk0x120; // 0x120 - this may be the current vehcle (function at 0x10015880) + undefined4 m_unk0x124; // 0x124 - something game state + undefined4 m_unk0x128; // 0x128 + undefined4 m_unk0x12c; // 0x12c + undefined4 m_unk0x130[4]; // unconfirmed bytes, ghidra claims these are integers + undefined4 m_unk0x140; }; #endif // LEGORACE_H diff --git a/LEGO1/legoraceactor.h b/LEGO1/legoraceactor.h index cedd2b24..9a4e34ec 100644 --- a/LEGO1/legoraceactor.h +++ b/LEGO1/legoraceactor.h @@ -14,9 +14,9 @@ public: } // FUNCTION: LEGO1 0x10014b10 - inline MxBool IsA(const char* name) const override // vtable+0x10 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoRaceActor::ClassName()) || LegoAnimActor::IsA(name); + return !strcmp(p_name, LegoRaceActor::ClassName()) || LegoAnimActor::IsA(p_name); } }; diff --git a/LEGO1/legoroi.cpp b/LEGO1/legoroi.cpp index 70cb1faf..77dc2f78 100644 --- a/LEGO1/legoroi.cpp +++ b/LEGO1/legoroi.cpp @@ -8,7 +8,7 @@ typedef struct { MxS32 m_red; MxS32 m_green; MxS32 m_blue; - MxS32 m_unk10; + MxS32 m_unk0x10; } ROIColorAlias; // GLOBAL: LEGO1 0x100dbe28 @@ -36,9 +36,9 @@ MxS32 g_roiConfig = 100; ROIHandler g_someHandlerFunction = NULL; // FUNCTION: LEGO1 0x100a81c0 -void LegoROI::configureLegoROI(MxS32 p_roi) +void LegoROI::configureLegoROI(MxS32 p_roiConfig) { - g_roiConfig = p_roi; + g_roiConfig = p_roiConfig; } // FUNCTION: LEGO1 0x100a9bf0 @@ -74,7 +74,7 @@ MxBool LegoROI::ColorAliasLookup(char* p_param, MxFloat& p_red, MxFloat& p_green p_red = g_roiColorAliases[i].m_red * g_normalizeByteToFloat; p_green = g_roiColorAliases[i].m_green * g_normalizeByteToFloat; p_blue = g_roiColorAliases[i].m_blue * g_normalizeByteToFloat; - p_other = g_roiColorAliases[i].m_unk10 * g_normalizeByteToFloat; + p_other = g_roiColorAliases[i].m_unk0x10 * g_normalizeByteToFloat; return TRUE; } i++; diff --git a/LEGO1/legosoundmanager.cpp b/LEGO1/legosoundmanager.cpp index 028fa092..a74ca419 100644 --- a/LEGO1/legosoundmanager.cpp +++ b/LEGO1/legosoundmanager.cpp @@ -17,8 +17,8 @@ LegoSoundManager::~LegoSoundManager() // FUNCTION: LEGO1 0x100299a0 void LegoSoundManager::Init() { - unk0x40 = 0; - unk0x3c = 0; + m_unk0x40 = 0; + m_unk0x3c = 0; } // STUB: LEGO1 0x100299b0 diff --git a/LEGO1/legosoundmanager.h b/LEGO1/legosoundmanager.h index e1e24337..2caef869 100644 --- a/LEGO1/legosoundmanager.h +++ b/LEGO1/legosoundmanager.h @@ -18,8 +18,8 @@ private: void Init(); void Destroy(MxBool p_fromDestructor); - undefined4 unk0x3c; - undefined4 unk0x40; + undefined4 m_unk0x3c; + undefined4 m_unk0x40; }; #endif // LEGOSOUNDMANAGER_H diff --git a/LEGO1/legostate.cpp b/LEGO1/legostate.cpp index 55ca5705..c99fb708 100644 --- a/LEGO1/legostate.cpp +++ b/LEGO1/legostate.cpp @@ -20,7 +20,7 @@ MxBool LegoState::SetFlag() } // FUNCTION: LEGO1 0x10005fb0 -MxResult LegoState::VTable0x1C(LegoFileStream* p_legoFileStream) +MxResult LegoState::VTable0x1c(LegoFileStream* p_legoFileStream) { if (p_legoFileStream->IsWriteMode()) { p_legoFileStream->FUN_10006030(this->ClassName()); diff --git a/LEGO1/legostate.h b/LEGO1/legostate.h index 095b67e9..55f0a1af 100644 --- a/LEGO1/legostate.h +++ b/LEGO1/legostate.h @@ -19,14 +19,14 @@ public: } // FUNCTION: LEGO1 0x100060e0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoState::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, LegoState::ClassName()) || MxCore::IsA(p_name); } virtual MxBool VTable0x14(); // vtable+0x14 virtual MxBool SetFlag(); // vtable+0x18 - virtual MxResult VTable0x1C(LegoFileStream* p_legoFileStream); // vtable+0x1C + virtual MxResult VTable0x1c(LegoFileStream* p_legoFileStream); // vtable+0x1C }; #endif // LEGOSTATE_H diff --git a/LEGO1/legostream.cpp b/LEGO1/legostream.cpp index d9e32b2f..0cfe0a51 100644 --- a/LEGO1/legostream.cpp +++ b/LEGO1/legostream.cpp @@ -8,9 +8,9 @@ // This is a pointer to the end of the global variable name table, which has // the text "END_OF_VARIABLES" in it. -// TODO: make s_endOfVariables reference the actual end of the variable array. +// TODO: make g_endOfVariables reference the actual end of the variable array. // GLOBAL: LEGO1 0x100f3e50 -const char* s_endOfVariables = "END_OF_VARIABLES"; +const char* g_endOfVariables = "END_OF_VARIABLES"; // Very likely but not certain sizes. // The classes are only used on the stack in functions we have not 100% matched @@ -50,7 +50,7 @@ MxS32 LegoStream::ReadVariable(LegoStream* p_stream, MxVariableTable* p_to) char nameBuffer[256]; if (p_stream->Read(nameBuffer, length) == SUCCESS) { nameBuffer[length] = '\0'; - if (strcmp(nameBuffer, s_endOfVariables) == 0) + if (strcmp(nameBuffer, g_endOfVariables) == 0) // 2 -> "This was the last entry, done reading." result = 2; else { diff --git a/LEGO1/legotexturepresenter.h b/LEGO1/legotexturepresenter.h index 76e1524d..22a23500 100644 --- a/LEGO1/legotexturepresenter.h +++ b/LEGO1/legotexturepresenter.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1000ce60 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoTexturePresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, LegoTexturePresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual MxResult AddToManager() override; // vtable+0x34 diff --git a/LEGO1/legoutil.cpp b/LEGO1/legoutil.cpp index b1ba6add..c4728524 100644 --- a/LEGO1/legoutil.cpp +++ b/LEGO1/legoutil.cpp @@ -35,67 +35,67 @@ ExtraActionType MatchActionString(const char* p_str) } // FUNCTION: LEGO1 0x1003eae0 -void ConvertHSVToRGB(float h, float s, float v, float* r_out, float* b_out, float* g_out) +void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut) { double calc; double p; - MxLong hue_index; + MxLong hueIndex; double v9; double v12; double v13; - double s_dbl = s; + double sDbl = p_s; - if (s > 0.5f) - calc = (1.0f - v) * s + v; + if (p_s > 0.5f) + calc = (1.0f - p_v) * p_s + p_v; else - calc = (v + 1.0) * s_dbl; + calc = (p_v + 1.0) * sDbl; if (calc <= 0.0) { - *g_out = 0.0f; - *b_out = 0.0f; - *r_out = 0.0f; + *p_gOut = 0.0f; + *p_bOut = 0.0f; + *p_rOut = 0.0f; return; } - p = s * 2.0f - calc; - hue_index = h * 6.0; - v9 = (h * 6.0 - (float) hue_index) * ((calc - p) / calc) * calc; + p = p_s * 2.0f - calc; + hueIndex = p_h * 6.0; + v9 = (p_h * 6.0 - (float) hueIndex) * ((calc - p) / calc) * calc; v12 = p + v9; v13 = calc - v9; - switch (hue_index) { + switch (hueIndex) { case 0: - *r_out = calc; - *b_out = v12; - *g_out = p; + *p_rOut = calc; + *p_bOut = v12; + *p_gOut = p; break; case 1: - *r_out = v13; - *b_out = calc; - *g_out = p; + *p_rOut = v13; + *p_bOut = calc; + *p_gOut = p; break; case 2: - *r_out = p; - *b_out = calc; - *g_out = v12; + *p_rOut = p; + *p_bOut = calc; + *p_gOut = v12; break; case 3: - *r_out = p; - *b_out = v13; - *g_out = calc; + *p_rOut = p; + *p_bOut = v13; + *p_gOut = calc; break; case 4: - *r_out = v12; - *b_out = p; - *g_out = calc; + *p_rOut = v12; + *p_bOut = p; + *p_gOut = calc; break; case 5: - *r_out = calc; - *b_out = p; - *g_out = v13; + *p_rOut = calc; + *p_bOut = p; + *p_gOut = v13; break; case 6: - *r_out = calc; - *b_out = p; - *g_out = v13; + *p_rOut = calc; + *p_bOut = p; + *p_gOut = v13; break; default: return; diff --git a/LEGO1/legoutil.h b/LEGO1/legoutil.h index d9035b14..24db48a0 100644 --- a/LEGO1/legoutil.h +++ b/LEGO1/legoutil.h @@ -54,7 +54,7 @@ inline void GetString(char** p_source, const char* p_dest, T* p_obj, void (T::*p } ExtraActionType MatchActionString(const char*); -void ConvertHSVToRGB(float r, float g, float b, float* out_r, float* out_g, float* out_b); +void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut); void FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id); void SetAppCursor(WPARAM p_wparam); diff --git a/LEGO1/legovehiclebuildstate.cpp b/LEGO1/legovehiclebuildstate.cpp index f662293a..b0dccde2 100644 --- a/LEGO1/legovehiclebuildstate.cpp +++ b/LEGO1/legovehiclebuildstate.cpp @@ -8,18 +8,18 @@ DECOMP_SIZE_ASSERT(LegoVehicleBuildState::UnkStruct, 0xc); // FUNCTION: LEGO1 0x10017c00 LegoVehicleBuildState::UnkStruct::UnkStruct() { - m_unk04 = 0; - m_unk00 = 0; - m_unk06 = 0; - m_unk08 = 0; + m_unk0x04 = 0; + m_unk0x00 = 0; + m_unk0x06 = 0; + m_unk0x08 = 0; } // FUNCTION: LEGO1 0x10025f30 LegoVehicleBuildState::LegoVehicleBuildState(char* p_classType) { this->m_className = p_classType; - this->m_unk4c = 0; - this->m_unk4d = 0; - this->m_unk4e = 0; + this->m_unk0x4c = 0; + this->m_unk0x4d = 0; + this->m_unk0x4e = 0; this->m_placedPartCount = 0; } diff --git a/LEGO1/legovehiclebuildstate.h b/LEGO1/legovehiclebuildstate.h index ae59d1f5..a39740bb 100644 --- a/LEGO1/legovehiclebuildstate.h +++ b/LEGO1/legovehiclebuildstate.h @@ -25,16 +25,16 @@ public: public: struct UnkStruct { - undefined4 m_unk00; - undefined2 m_unk04; - undefined2 m_unk06; - undefined2 m_unk08; + undefined4 m_unk0x00; + undefined2 m_unk0x04; + undefined2 m_unk0x06; + undefined2 m_unk0x08; UnkStruct(); }; private: - UnkStruct m_unk08[4]; // 0x08 + UnkStruct m_unk0x08[4]; // 0x08 // This can be one of the following: // * LegoRaceCarBuildState @@ -48,9 +48,9 @@ private: // * 3 == cutscene/dialogue // * 6 == exit(ing) build screen MxU32 m_animationState; // 0x48 - undefined m_unk4c; // 0x4c - undefined m_unk4d; // 0x4d - undefined m_unk4e; // 0x4e + undefined m_unk0x4c; // 0x4c + undefined m_unk0x4d; // 0x4d + undefined m_unk0x4e; // 0x4e MxU8 m_placedPartCount; // 0x4f }; diff --git a/LEGO1/legovideomanager.cpp b/LEGO1/legovideomanager.cpp index 0ec7ec07..92440dd4 100644 --- a/LEGO1/legovideomanager.cpp +++ b/LEGO1/legovideomanager.cpp @@ -5,14 +5,14 @@ DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590); // FUNCTION: LEGO1 0x1007aa20 LegoVideoManager::LegoVideoManager() { - m_unk64 = 0; + m_unk0x64 = 0; m_3dManager = NULL; - m_unk6c = 0; + m_unk0x6c = 0; m_direct3d = 0; m_unk0xe6 = FALSE; memset(m_unk0x78, 0, sizeof(m_unk0x78)); m_unk0x78[0] = 0x6c; - m_unk4e8 = 0; + m_unk0x4e8 = 0; m_isFullscreenMovie = FALSE; m_palette = NULL; m_prefCounter = NULL; @@ -47,11 +47,11 @@ void LegoVideoManager::Destroy() m_arialFont = NULL; } - // delete m_unk64; //TODO: delete d3drm + // delete m_unk0x64; //TODO: delete d3drm delete m_3dManager; MxVideoManager::Destroy(); - // todo: delete m_unk4e8 + // todo: delete m_unk0x4e8 delete[] m_prefCounter; } @@ -94,7 +94,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue) m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE); // TODO 3d manager - // m_3dManager->m_pViewport->vtable1c(red, green, blue) + // m_3dManager->m_pViewport->VTable0x1c(red, green, blue) } // STUB: LEGO1 0x1007c560 diff --git a/LEGO1/legovideomanager.h b/LEGO1/legovideomanager.h index 060e9f10..02558785 100644 --- a/LEGO1/legovideomanager.h +++ b/LEGO1/legovideomanager.h @@ -19,12 +19,12 @@ public: __declspec(dllexport) int DisableRMDevice(); void EnableFullScreenMovie(MxBool p_enable); __declspec(dllexport) void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale); - __declspec(dllexport) void MoveCursor(int x, int y); + __declspec(dllexport) void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY); inline Lego3DManager* Get3DManager() { return this->m_3dManager; } inline MxDirect3D* GetDirect3D() { return this->m_direct3d; } - void SetSkyColor(float r, float g, float b); + void SetSkyColor(float p_red, float p_green, float p_blue); inline void SetUnkE4(MxBool p_unk0xe4) { this->m_unk0xe4 = p_unk0xe4; } // FUNCTION: LEGO1 0x1007c4c0 @@ -36,10 +36,10 @@ public: virtual void Destroy() override; // vtable+0x18 private: - undefined4 m_unk64; + undefined4 m_unk0x64; Lego3DManager* m_3dManager; // 0x68 - undefined4 m_unk6c; - undefined4 m_unk70; + undefined4 m_unk0x6c; + undefined4 m_unk0x70; MxDirect3D* m_direct3d; // 0x74 undefined4 m_unk0x78[27]; MxBool m_unk0xe4; @@ -47,7 +47,7 @@ private: MxBool m_unk0xe6; PALETTEENTRY m_paletteEntries[256]; // 0xe7 undefined m_padding0x4e7; - undefined4 m_unk4e8; + undefined4 m_unk0x4e8; MxBool m_isFullscreenMovie; // 0x4ec MxPalette* m_palette; // 0x4f0 LARGE_INTEGER* m_prefCounter; // 0x4f4 diff --git a/LEGO1/legoworld.cpp b/LEGO1/legoworld.cpp index 938abe3a..2379b375 100644 --- a/LEGO1/legoworld.cpp +++ b/LEGO1/legoworld.cpp @@ -17,13 +17,13 @@ void LegoWorld::VTable0x60() } // STUB: LEGO1 0x10015820 -void FUN_10015820(MxU32 p_unk1, MxU32 p_unk2) +void FUN_10015820(MxU32, MxU32) { // TODO } // STUB: LEGO1 0x10015910 -void FUN_10015910(MxU32 p_unk1) +void FUN_10015910(MxU32) { // TODO } diff --git a/LEGO1/legoworld.h b/LEGO1/legoworld.h index 8914604a..2e97076f 100644 --- a/LEGO1/legoworld.h +++ b/LEGO1/legoworld.h @@ -14,7 +14,7 @@ public: __declspec(dllexport) LegoWorld(); __declspec(dllexport) virtual ~LegoWorld(); // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x1001d690 inline virtual const char* ClassName() const override // vtable+0x0c @@ -24,9 +24,9 @@ public: } // FUNCTION: LEGO1 0x1001d6a0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoWorld::ClassName()) || LegoEntity::IsA(name); + return !strcmp(p_name, LegoWorld::ClassName()) || LegoEntity::IsA(p_name); } virtual void Stop(); // vtable+50 @@ -44,15 +44,15 @@ protected: LegoPathControllerList m_list0x68; // 0x68 MxPresenterList m_list0x80; // 0x80 LegoCameraController* m_camera; // 0x98 - undefined m_unk9c[0x1c]; + undefined m_unk0x9c[0x1c]; MxPresenterList m_list0xb8; // 0xb8 - undefined m_unkd0[0x26]; - undefined m_unkf6; - undefined m_unkf7; + undefined m_unk0xd0[0x26]; + undefined m_unk0xf6; + undefined m_unk0xf7; }; -void FUN_10015820(MxU32 p_unk1, MxU32 p_unk2); -void FUN_10015910(MxU32 p_unk1); +void FUN_10015820(MxU32, MxU32); +void FUN_10015910(MxU32); void SetIsWorldActive(MxBool p_isWorldActive); // SYNTHETIC: LEGO1 0x1001eed0 diff --git a/LEGO1/legoworldpresenter.cpp b/LEGO1/legoworldpresenter.cpp index 0a6f0c21..9cd12880 100644 --- a/LEGO1/legoworldpresenter.cpp +++ b/LEGO1/legoworldpresenter.cpp @@ -1,18 +1,18 @@ #include "legoworldpresenter.h" // GLOBAL: LEGO1 0x100f75d4 -undefined4 g_LegoWorldPresenterQuality = 1; +undefined4 g_legoWorldPresenterQuality = 1; // FUNCTION: LEGO1 0x100665b0 -void LegoWorldPresenter::configureLegoWorldPresenter(int p_quality) +void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality) { - g_LegoWorldPresenterQuality = p_quality; + g_legoWorldPresenterQuality = p_legoWorldPresenterQuality; } // FUNCTION: LEGO1 0x100665c0 LegoWorldPresenter::LegoWorldPresenter() { - m_unk50 = 50000; + m_unk0x50 = 50000; } // STUB: LEGO1 0x10066770 diff --git a/LEGO1/legoworldpresenter.h b/LEGO1/legoworldpresenter.h index 3c34097d..bcae2f5e 100644 --- a/LEGO1/legoworldpresenter.h +++ b/LEGO1/legoworldpresenter.h @@ -10,7 +10,7 @@ public: LegoWorldPresenter(); virtual ~LegoWorldPresenter() override; // vtable+0x0 - __declspec(dllexport) static void configureLegoWorldPresenter(int param_1); + __declspec(dllexport) static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality); // FUNCTION: LEGO1 0x10066630 inline virtual const char* ClassName() const override // vtable+0x0c @@ -20,13 +20,13 @@ public: } // FUNCTION: LEGO1 0x10066640 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, LegoWorldPresenter::ClassName()) || LegoEntityPresenter::IsA(name); + return !strcmp(p_name, LegoWorldPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name); } private: - undefined4 m_unk50; + undefined4 m_unk0x50; }; #endif // LEGOWORLDPRESENTER_H diff --git a/LEGO1/motorcycle.cpp b/LEGO1/motorcycle.cpp index 34a05a46..18fabd8a 100644 --- a/LEGO1/motorcycle.cpp +++ b/LEGO1/motorcycle.cpp @@ -5,8 +5,8 @@ DECOMP_SIZE_ASSERT(Motorcycle, 0x16c); // FUNCTION: LEGO1 0x100357b0 Motorcycle::Motorcycle() { - this->m_unk13c = 40.0; - this->m_unk150 = 1.75; - this->m_unk148 = 1; - this->m_unk164 = 1.0; + this->m_unk0x13c = 40.0; + this->m_unk0x150 = 1.75; + this->m_unk0x148 = 1; + this->m_unk0x164 = 1.0; } diff --git a/LEGO1/motorcycle.h b/LEGO1/motorcycle.h index 52f692e8..3b847873 100644 --- a/LEGO1/motorcycle.h +++ b/LEGO1/motorcycle.h @@ -18,15 +18,15 @@ public: } // FUNCTION: LEGO1 0x10035850 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Motorcycle::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, Motorcycle::ClassName()) || IslePathActor::IsA(p_name); } private: - undefined m_unk160[4]; - MxFloat m_unk164; - undefined m_unk168[4]; + undefined m_unk0x160[4]; + MxFloat m_unk0x164; + undefined m_unk0x168[4]; }; #endif // MOTORCYCLE_H diff --git a/LEGO1/mxatomid.cpp b/LEGO1/mxatomid.cpp index d3a6033b..722f5432 100644 --- a/LEGO1/mxatomid.cpp +++ b/LEGO1/mxatomid.cpp @@ -61,7 +61,7 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId) // FUNCTION: LEGO1 0x100ad210 MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode) { - MxAtomId _unused; + MxAtomId unused; MxAtomIdCounter* counter = new MxAtomIdCounter(p_str); switch (p_mode) { diff --git a/LEGO1/mxatomid.h b/LEGO1/mxatomid.h index 5797c4a6..5d4cd10f 100644 --- a/LEGO1/mxatomid.h +++ b/LEGO1/mxatomid.h @@ -14,12 +14,12 @@ enum LookupMode { class MxAtomId { public: __declspec(dllexport) MxAtomId(const char*, LookupMode); - __declspec(dllexport) MxAtomId& operator=(const MxAtomId& id); + __declspec(dllexport) MxAtomId& operator=(const MxAtomId& p_atomId); __declspec(dllexport) ~MxAtomId(); MxAtomId() { this->m_internal = 0; } - inline MxBool operator==(const MxAtomId& other) const { return this->m_internal == other.m_internal; } + inline MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; } void Clear(); diff --git a/LEGO1/mxaudiomanager.cpp b/LEGO1/mxaudiomanager.cpp index 6d8e6b66..318a8446 100644 --- a/LEGO1/mxaudiomanager.cpp +++ b/LEGO1/mxaudiomanager.cpp @@ -3,7 +3,7 @@ DECOMP_SIZE_ASSERT(MxAudioManager, 0x30); // GLOBAL: LEGO1 0x10102108 -MxS32 MxAudioManager::g_unkCount = 0; +MxS32 MxAudioManager::g_count = 0; // FUNCTION: LEGO1 0x10029910 MxS32 MxAudioManager::GetVolume() @@ -33,7 +33,7 @@ void MxAudioManager::Init() void MxAudioManager::Destroy(MxBool p_fromDestructor) { this->m_criticalSection.Enter(); - g_unkCount--; + g_count--; Init(); this->m_criticalSection.Leave(); @@ -51,7 +51,7 @@ MxResult MxAudioManager::InitPresenters() this->m_criticalSection.Enter(); success = TRUE; result = SUCCESS; - g_unkCount++; + g_count++; } if (result) diff --git a/LEGO1/mxaudiomanager.h b/LEGO1/mxaudiomanager.h index cae9b318..c910a493 100644 --- a/LEGO1/mxaudiomanager.h +++ b/LEGO1/mxaudiomanager.h @@ -18,7 +18,7 @@ public: private: void Destroy(MxBool p_fromDestructor); - static MxS32 g_unkCount; + static MxS32 g_count; protected: void Init(); diff --git a/LEGO1/mxaudiopresenter.h b/LEGO1/mxaudiopresenter.h index 583d0c7f..f1d207e1 100644 --- a/LEGO1/mxaudiopresenter.h +++ b/LEGO1/mxaudiopresenter.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x1000d290 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxAudioPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, MxAudioPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual MxS32 GetVolume(); // vtable+0x5c diff --git a/LEGO1/mxautolocker.cpp b/LEGO1/mxautolocker.cpp index 56e83967..d5749ad5 100644 --- a/LEGO1/mxautolocker.cpp +++ b/LEGO1/mxautolocker.cpp @@ -1,9 +1,9 @@ #include "mxautolocker.h" // FUNCTION: LEGO1 0x100b8ed0 -MxAutoLocker::MxAutoLocker(MxCriticalSection* critsect) +MxAutoLocker::MxAutoLocker(MxCriticalSection* p_criticalSection) { - this->m_criticalSection = critsect; + this->m_criticalSection = p_criticalSection; if (this->m_criticalSection != 0) this->m_criticalSection->Enter(); } diff --git a/LEGO1/mxautolocker.h b/LEGO1/mxautolocker.h index ea8c2d1a..e5838486 100644 --- a/LEGO1/mxautolocker.h +++ b/LEGO1/mxautolocker.h @@ -5,7 +5,7 @@ class MxAutoLocker { public: - MxAutoLocker(MxCriticalSection* cs); + MxAutoLocker(MxCriticalSection* p_criticalSection); ~MxAutoLocker(); private: diff --git a/LEGO1/mxbackgroundaudiomanager.cpp b/LEGO1/mxbackgroundaudiomanager.cpp index b89b5cf4..74c34e06 100644 --- a/LEGO1/mxbackgroundaudiomanager.cpp +++ b/LEGO1/mxbackgroundaudiomanager.cpp @@ -14,12 +14,12 @@ DECOMP_SIZE_ASSERT(MxBackgroundAudioManager, 0x150) MxBackgroundAudioManager::MxBackgroundAudioManager() { NotificationManager()->Register(this); - m_unka0 = 0; - m_unk138 = 0; - m_unk13c = 0; - m_unk140 = 0; + m_unk0xa0 = 0; + m_unk0x138 = 0; + m_unk0x13c = 0; + m_unk0x140 = 0; m_targetVolume = 0; - m_unk148 = 0; + m_unk0x148 = 0; m_musicEnabled = FALSE; } @@ -76,7 +76,7 @@ void MxBackgroundAudioManager::DestroyMusic() // FUNCTION: LEGO1 0x1007ee40 MxResult MxBackgroundAudioManager::Tickle() { - switch (m_unk13c) { + switch (m_unk0x13c) { case MxPresenter::TickleState_Starting: FadeInOrFadeOut(); return SUCCESS; @@ -94,17 +94,17 @@ MxResult MxBackgroundAudioManager::Tickle() // FUNCTION: LEGO1 0x1007ee70 void MxBackgroundAudioManager::FUN_1007ee70() { - if (m_unka0 && m_unka0->GetAction()) { - DeleteObject(*m_unk138->GetAction()); + if (m_unk0xa0 && m_unk0xa0->GetAction()) { + DeleteObject(*m_unk0x138->GetAction()); } - if (m_unk138) { - m_unka0 = m_unk138; + if (m_unk0x138) { + m_unk0xa0 = m_unk0x138; m_action1 = m_action2; - m_unk138 = NULL; + m_unk0x138 = NULL; m_action2.SetObjectId(-1); m_action2.SetAtomId(MxAtomId()); - m_unk13c = NULL; + m_unk0x13c = NULL; } } @@ -113,41 +113,41 @@ void MxBackgroundAudioManager::FUN_1007ef40() { MxU32 compare; MxU32 volume; - if (m_unka0 == NULL) { - if (m_unk138) { + if (m_unk0xa0 == NULL) { + if (m_unk0x138) { compare = 30; - if (m_unk148 == 0) { - compare = m_unk148; + if (m_unk0x148 == 0) { + compare = m_unk0x148; } - volume = m_unk138->GetVolume(); + volume = m_unk0x138->GetVolume(); if (volume < compare) { - if (m_unk140 + m_unk138->GetVolume() <= compare) { - compare = m_unk140 + compare; + if (m_unk0x140 + m_unk0x138->GetVolume() <= compare) { + compare = m_unk0x140 + compare; } - m_unk138->SetVolume(compare); + m_unk0x138->SetVolume(compare); } else { - m_unk138->SetVolume(compare); - m_unka0 = m_unk138; + m_unk0x138->SetVolume(compare); + m_unk0xa0 = m_unk0x138; m_action1 = m_action2; - m_unk138 = NULL; + m_unk0x138 = NULL; m_action2.SetObjectId(-1); m_action2.SetAtomId(MxAtomId()); - m_unk13c = NULL; + m_unk0x13c = NULL; } } } - else if (m_unka0->GetAction() != NULL) { - if (m_unka0->GetVolume() == 0) { - DeleteObject(*m_unka0->GetAction()); + else if (m_unk0xa0->GetAction() != NULL) { + if (m_unk0xa0->GetVolume() == 0) { + DeleteObject(*m_unk0xa0->GetAction()); } else { - compare = m_unka0->GetVolume(); + compare = m_unk0xa0->GetVolume(); volume = 0; - if (compare != m_unk140 && -1 < compare - m_unk140) { - volume = m_unka0->GetVolume() - m_unk140; + if (compare != m_unk0x140 && -1 < compare - m_unk0x140) { + volume = m_unk0xa0->GetVolume() - m_unk0x140; } - m_unk138->SetVolume(volume); + m_unk0x138->SetVolume(volume); } } } @@ -156,81 +156,81 @@ void MxBackgroundAudioManager::FUN_1007ef40() void MxBackgroundAudioManager::FadeInOrFadeOut() { // This function probably is the fade in/out routine - if (m_unka0 != NULL) { - undefined4 volume = m_unka0->GetVolume(); + if (m_unk0xa0 != NULL) { + undefined4 volume = m_unk0xa0->GetVolume(); MxU32 compare = 30; - if (m_unk148 == 0) { + if (m_unk0x148 == 0) { compare = m_targetVolume; } if (volume < compare) { - volume = m_unk140 + volume; + volume = m_unk0x140 + volume; if (compare <= volume) { volume = compare; } - m_unka0->SetVolume(volume); + m_unk0xa0->SetVolume(volume); } else if (compare < volume) { - volume = volume - m_unk140; + volume = volume - m_unk0x140; if (volume <= compare) { volume = compare; } - m_unka0->SetVolume(volume); + m_unk0xa0->SetVolume(volume); } else { - m_unka0->SetVolume(volume); - m_unk13c = 0; + m_unk0xa0->SetVolume(volume); + m_unk0x13c = 0; } } else { - m_unk13c = 0; + m_unk0x13c = 0; } } // FUNCTION: LEGO1 0x1007f170 -MxLong MxBackgroundAudioManager::Notify(MxParam& p) +MxLong MxBackgroundAudioManager::Notify(MxParam& p_param) { - switch (((MxNotificationParam&) p).GetNotification()) { + switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationStartAction: - StartAction(p); + StartAction(p_param); return 1; case c_notificationEndAction: - StopAction(p); + StopAction(p_param); return 1; } return 0; } // FUNCTION: LEGO1 0x1007f1b0 -void MxBackgroundAudioManager::StartAction(MxParam& p) +void MxBackgroundAudioManager::StartAction(MxParam& p_param) { // TODO: the sender is most likely a MxAudioPresenter? - m_unk138 = (MxAudioPresenter*) ((MxNotificationParam&) p).GetSender(); - m_action2.SetAtomId(m_unk138->GetAction()->GetAtomId()); - m_action2.SetObjectId(m_unk138->GetAction()->GetObjectId()); - m_targetVolume = ((MxDSSound*) (m_unk138->GetAction()))->GetVolume(); - m_unk138->SetVolume(0); + m_unk0x138 = (MxAudioPresenter*) ((MxNotificationParam&) p_param).GetSender(); + m_action2.SetAtomId(m_unk0x138->GetAction()->GetAtomId()); + m_action2.SetObjectId(m_unk0x138->GetAction()->GetObjectId()); + m_targetVolume = ((MxDSSound*) (m_unk0x138->GetAction()))->GetVolume(); + m_unk0x138->SetVolume(0); } // FUNCTION: LEGO1 0x1007f200 -void MxBackgroundAudioManager::StopAction(MxParam& p) +void MxBackgroundAudioManager::StopAction(MxParam& p_param) { - if (((MxNotificationParam&) p).GetSender() == m_unka0) { - m_unka0 = NULL; + if (((MxNotificationParam&) p_param).GetSender() == m_unk0xa0) { + m_unk0xa0 = NULL; m_action1.SetAtomId(MxAtomId()); m_action1.SetObjectId(-1); } - else if (((MxNotificationParam&) p).GetSender() == m_unk138) { - m_unk138 = NULL; + else if (((MxNotificationParam&) p_param).GetSender() == m_unk0x138) { + m_unk0x138 = NULL; m_action2.SetAtomId(MxAtomId()); m_action2.SetObjectId(-1); } - Lego()->HandleNotificationType2(p); + Lego()->HandleNotificationType2(p_param); } // FUNCTION: LEGO1 0x1007f2f0 -MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2) +MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, undefined4 p_unk0x13c) { if (!m_musicEnabled) { return SUCCESS; @@ -253,8 +253,8 @@ MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_ GetCurrentAction().SetUnknown24(action.GetUnknown24()); if (result == SUCCESS) { - m_unk13c = p_unknown2; - m_unk140 = p_unknown; + m_unk0x13c = p_unk0x13c; + m_unk0x140 = p_unk0x140; } return result; } @@ -267,52 +267,52 @@ void MxBackgroundAudioManager::Stop() if (m_action2.GetObjectId() != -1) DeleteObject(m_action2); - m_unk138 = 0; + m_unk0x138 = 0; m_action2.SetAtomId(MxAtomId()); m_action2.SetObjectId(-1); if (m_action1.GetObjectId() != -1) DeleteObject(m_action1); - m_unka0 = 0; + m_unk0xa0 = 0; m_action1.SetAtomId(MxAtomId()); - m_unk148 = 0; + m_unk0x148 = 0; m_action1.SetObjectId(-1); - m_unk13c = 0; + m_unk0x13c = 0; } // FUNCTION: LEGO1 0x1007f570 void MxBackgroundAudioManager::LowerVolume() { - if (m_unk148 == 0) { - if (m_unk13c == 0) { - m_unk13c = 2; + if (m_unk0x148 == 0) { + if (m_unk0x13c == 0) { + m_unk0x13c = 2; } - m_unk140 = 20; + m_unk0x140 = 20; } - m_unk148++; + m_unk0x148++; } // FUNCTION: LEGO1 0x1007f5b0 void MxBackgroundAudioManager::RaiseVolume() { - if (m_unk148 != 0) { - m_unk148--; - if (m_unk148 == 0) { - if (m_unk13c == 0) { - m_unk13c = 2; + if (m_unk0x148 != 0) { + m_unk0x148--; + if (m_unk0x148 == 0) { + if (m_unk0x13c == 0) { + m_unk0x13c = 2; } - m_unk140 = 10; + m_unk0x140 = 10; } } } // FUNCTION: LEGO1 0x1007f5f0 -void MxBackgroundAudioManager::Enable(MxBool p) +void MxBackgroundAudioManager::Enable(MxBool p_enable) { - if (this->m_musicEnabled != p) { - this->m_musicEnabled = p; - if (!p) { + if (this->m_musicEnabled != p_enable) { + this->m_musicEnabled = p_enable; + if (!p_enable) { Stop(); } } @@ -321,6 +321,6 @@ void MxBackgroundAudioManager::Enable(MxBool p) // FUNCTION: LEGO1 0x1007f650 void MxBackgroundAudioManager::Init() { - this->m_unka0 = 0; - this->m_unk13c = 0; + this->m_unk0xa0 = 0; + this->m_unk0x13c = 0; } diff --git a/LEGO1/mxbackgroundaudiomanager.h b/LEGO1/mxbackgroundaudiomanager.h index 17fcab81..cb03624c 100644 --- a/LEGO1/mxbackgroundaudiomanager.h +++ b/LEGO1/mxbackgroundaudiomanager.h @@ -15,8 +15,8 @@ public: MxBackgroundAudioManager(); virtual ~MxBackgroundAudioManager() override; - virtual MxLong Notify(MxParam& p) override; // vtable+0x04 - virtual MxResult Tickle() override; // vtable+0x08 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x04 + virtual MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x1007eb70 inline virtual const char* ClassName() const override // vtable+0x0c @@ -26,20 +26,20 @@ public: } // FUNCTION: LEGO1 0x1007eb80 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxBackgroundAudioManager::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxBackgroundAudioManager::ClassName()) || MxCore::IsA(p_name); } - void StartAction(MxParam& p); - void StopAction(MxParam& p); - MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2); + void StartAction(MxParam& p_param); + void StopAction(MxParam& p_param); + MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, undefined4 p_unk0x13c); void FUN_1007ee70(); void FUN_1007ef40(); void FadeInOrFadeOut(); - __declspec(dllexport) void Enable(unsigned char p); + __declspec(dllexport) void Enable(MxBool p_enable); virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS); void Stop(); @@ -53,13 +53,13 @@ private: MxBool m_musicEnabled; // 0x8 MxDSAction m_action1; // 0xc - MxAudioPresenter* m_unka0; + MxAudioPresenter* m_unk0xa0; MxDSAction m_action2; // 0xa4 - MxAudioPresenter* m_unk138; - MxS32 m_unk13c; - MxS32 m_unk140; + MxAudioPresenter* m_unk0x138; + MxS32 m_unk0x13c; + MxS32 m_unk0x140; MxS32 m_targetVolume; - MxS16 m_unk148; + MxS16 m_unk0x148; MxAtomId m_script; }; diff --git a/LEGO1/mxbitmap.cpp b/LEGO1/mxbitmap.cpp index 38c0e710..0aec1a6e 100644 --- a/LEGO1/mxbitmap.cpp +++ b/LEGO1/mxbitmap.cpp @@ -21,13 +21,13 @@ inline MxLong AlignToFourByte(MxLong p_value) // Same as the one from legoutil.h, but flipped the other way // TODO: While it's not outside the realm of possibility that they // reimplemented Abs for only this file, that seems odd, right? -inline MxLong _Abs(MxLong p_value) +inline MxLong AbsFlipped(MxLong p_value) { return p_value > 0 ? p_value : -p_value; } // FUNCTION: LEGO1 0x1004e0d0 -int MxBitmap::vtable28(int) +int MxBitmap::VTable0x28(int) { return -1; } @@ -64,9 +64,9 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, if (m_info) { m_data = new MxU8[size]; if (m_data) { - m_bmiHeader = &m_info->bmiHeader; - m_paletteData = m_info->bmiColors; - memset(&m_info->bmiHeader, 0, sizeof(m_info->bmiHeader)); + m_bmiHeader = &m_info->m_bmiHeader; + m_paletteData = m_info->m_bmiColors; + memset(&m_info->m_bmiHeader, 0, sizeof(m_info->m_bmiHeader)); m_bmiHeader->biSize = sizeof(*m_bmiHeader); // should be 40 bytes m_bmiHeader->biWidth = p_width; @@ -103,8 +103,8 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info) { MxResult result = FAILURE; - MxLong width = p_info->bmiHeader.biWidth; - MxLong height = p_info->bmiHeader.biHeight; + MxLong width = p_info->m_bmiHeader.biWidth; + MxLong height = p_info->m_bmiHeader.biHeight; MxLong size = AlignToFourByte(width) * height; this->m_info = new MxBITMAPINFO; @@ -112,8 +112,8 @@ MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info) this->m_data = new MxU8[size]; if (this->m_data) { memcpy(this->m_info, p_info, sizeof(*this->m_info)); - this->m_bmiHeader = &this->m_info->bmiHeader; - this->m_paletteData = this->m_info->bmiColors; + this->m_bmiHeader = &this->m_info->m_bmiHeader; + this->m_paletteData = this->m_info->m_bmiColors; result = SUCCESS; } } @@ -140,16 +140,16 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap) this->m_info = new MxBITMAPINFO; if (this->m_info) { - MxLong height = _Abs(p_bitmap->m_bmiHeader->biHeight); + MxLong height = AbsFlipped(p_bitmap->m_bmiHeader->biHeight); this->m_data = new MxU8[AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height]; if (this->m_data) { memcpy(this->m_info, p_bitmap->m_info, sizeof(*this->m_info)); - height = _Abs(p_bitmap->m_bmiHeader->biHeight); + height = AbsFlipped(p_bitmap->m_bmiHeader->biHeight); memcpy(this->m_data, p_bitmap->m_data, AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height); result = SUCCESS; - this->m_bmiHeader = &this->m_info->bmiHeader; - this->m_paletteData = this->m_info->bmiColors; + this->m_bmiHeader = &this->m_info->m_bmiHeader; + this->m_paletteData = this->m_info->m_bmiColors; } } @@ -196,18 +196,18 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) this->m_info = new MxBITMAPINFO; if (this->m_info) { ret = ReadFile(p_handle, this->m_info, sizeof(*this->m_info), &bytesRead, NULL); - if (ret && (this->m_info->bmiHeader.biBitCount == 8)) { + if (ret && (this->m_info->m_bmiHeader.biBitCount == 8)) { MxLong size = hdr.bfSize - (sizeof(MxBITMAPINFO) + sizeof(BITMAPFILEHEADER)); this->m_data = new MxU8[size]; if (this->m_data) { ret = ReadFile(p_handle, this->m_data, size, &bytesRead, NULL); if (ret) { - this->m_bmiHeader = &this->m_info->bmiHeader; - this->m_paletteData = this->m_info->bmiColors; - if (this->m_info->bmiHeader.biSizeImage == 0) { - MxLong height = _Abs(this->m_info->bmiHeader.biHeight); - this->m_info->bmiHeader.biSizeImage = - AlignToFourByte(this->m_info->bmiHeader.biWidth) * height; + this->m_bmiHeader = &this->m_info->m_bmiHeader; + this->m_paletteData = this->m_info->m_bmiColors; + if (this->m_info->m_bmiHeader.biSizeImage == 0) { + MxLong height = AbsFlipped(this->m_info->m_bmiHeader.biHeight); + this->m_info->m_bmiHeader.biSizeImage = + AlignToFourByte(this->m_info->m_bmiHeader.biWidth) * height; } result = SUCCESS; } @@ -232,12 +232,12 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) } // STUB: LEGO1 0x100bce70 -void MxBitmap::vtable2c(int, int, int, int, int, int, int) +void MxBitmap::VTable0x2c(int, int, int, int, int, int, int) { } // STUB: LEGO1 0x100bd020 -void MxBitmap::vtable30(int, int, int, int, int, int, int) +void MxBitmap::VTable0x30(int, int, int, int, int, int, int) { } @@ -378,8 +378,8 @@ MxResult MxBitmap::ImportColorsToPalette(RGBQUAD* p_rgbquad, MxPalette* p_palett goto done; } else { - MxPalette local_pal; - if (local_pal.GetEntries(entries)) + MxPalette palette; + if (palette.GetEntries(entries)) goto done; } diff --git a/LEGO1/mxbitmap.h b/LEGO1/mxbitmap.h index 63bb4aaf..766c86dd 100644 --- a/LEGO1/mxbitmap.h +++ b/LEGO1/mxbitmap.h @@ -17,8 +17,8 @@ // SIZE 0x428 struct MxBITMAPINFO { - BITMAPINFOHEADER bmiHeader; - RGBQUAD bmiColors[256]; + BITMAPINFOHEADER m_bmiHeader; + RGBQUAD m_bmiColors[256]; }; // Non-standard value for biCompression in the BITMAPINFOHEADER struct. @@ -40,9 +40,9 @@ public: virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c virtual MxResult LoadFile(HANDLE p_handle); // vtable+20 __declspec(dllexport) virtual MxLong Read(const char* p_filename); // vtable+24 - virtual int vtable28(int); - virtual void vtable2c(int, int, int, int, int, int, int); - virtual void vtable30(int, int, int, int, int, int, int); + virtual int VTable0x28(int); + virtual void VTable0x2c(int, int, int, int, int, int, int); + virtual void VTable0x30(int, int, int, int, int, int, int); __declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34 virtual void ImportPalette(MxPalette* p_palette); // vtable+38 virtual MxResult SetBitDepth(MxBool); // vtable+3c diff --git a/LEGO1/mxcompositemediapresenter.h b/LEGO1/mxcompositemediapresenter.h index fd20db16..80126469 100644 --- a/LEGO1/mxcompositemediapresenter.h +++ b/LEGO1/mxcompositemediapresenter.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x10073f20 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxCompositeMediaPresenter::ClassName()) || MxCompositePresenter::IsA(name); + return !strcmp(p_name, MxCompositeMediaPresenter::ClassName()) || MxCompositePresenter::IsA(p_name); } }; diff --git a/LEGO1/mxcompositepresenter.cpp b/LEGO1/mxcompositepresenter.cpp index 1274baf8..43ad4cc1 100644 --- a/LEGO1/mxcompositepresenter.cpp +++ b/LEGO1/mxcompositepresenter.cpp @@ -10,10 +10,10 @@ DECOMP_SIZE_ASSERT(MxCompositePresenter, 0x4c); // FUNCTION: LEGO1 0x1000caf0 -MxBool MxCompositePresenter::VTable0x64(undefined4 p_unknown) +MxBool MxCompositePresenter::VTable0x64(undefined4 p_undefined) { if (m_compositePresenter) - return m_compositePresenter->VTable0x64(p_unknown); + return m_compositePresenter->VTable0x64(p_undefined); return TRUE; } @@ -106,29 +106,29 @@ void MxCompositePresenter::EndAction() } // FUNCTION: LEGO1 0x100b6760 -MxLong MxCompositePresenter::Notify(MxParam& p) +MxLong MxCompositePresenter::Notify(MxParam& p_param) { MxAutoLocker lock(&m_criticalSection); - switch (((MxNotificationParam&) p).GetNotification()) { + switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationEndAction: - VTable0x58(p); + VTable0x58(p_param); break; case MXPRESENTER_NOTIFICATION: - VTable0x5c(p); + VTable0x5c(p_param); } return 0; } // STUB: LEGO1 0x100b67f0 -void MxCompositePresenter::VTable0x58(MxParam& p) +void MxCompositePresenter::VTable0x58(MxParam& p_param) { // TODO } // STUB: LEGO1 0x100b69b0 -void MxCompositePresenter::VTable0x5c(MxParam& p) +void MxCompositePresenter::VTable0x5c(MxParam& p_param) { // TODO } diff --git a/LEGO1/mxcompositepresenter.h b/LEGO1/mxcompositepresenter.h index a0ca62d5..5ce6b84f 100644 --- a/LEGO1/mxcompositepresenter.h +++ b/LEGO1/mxcompositepresenter.h @@ -13,7 +13,7 @@ public: MxCompositePresenter(); virtual ~MxCompositePresenter() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x04 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x100b6210 inline virtual const char* ClassName() const override // vtable+0x0c @@ -23,9 +23,9 @@ public: } // FUNCTION: LEGO1 0x100b6220 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxCompositePresenter::ClassName()) || MxPresenter::IsA(name); + return !strcmp(p_name, MxCompositePresenter::ClassName()) || MxPresenter::IsA(p_name); } virtual MxResult StartAction(MxStreamController*, MxDSAction* p_action) override; // vtable+0x3c @@ -33,10 +33,10 @@ public: virtual void SetTickleState(TickleState p_tickleState) override; // vtable+0x44 virtual MxBool HasTickleStatePassed(TickleState p_tickleState) override; // vtable+0x48 virtual void Enable(MxBool p_enable) override; // vtable+0x54 - virtual void VTable0x58(MxParam& p); // vtable+0x58 - virtual void VTable0x5c(MxParam& p); // vtable+0x5c + virtual void VTable0x58(MxParam& p_param); // vtable+0x58 + virtual void VTable0x5c(MxParam& p_param); // vtable+0x5c virtual void VTable0x60(MxPresenter* p_presenter); // vtable+0x60 - virtual MxBool VTable0x64(undefined4 p_unknown); // vtable+0x64 + virtual MxBool VTable0x64(undefined4 p_undefined); // vtable+0x64 private: MxCompositePresenterList m_list; // 0x40 diff --git a/LEGO1/mxcontrolpresenter.cpp b/LEGO1/mxcontrolpresenter.cpp index a3ffc3d6..07802a08 100644 --- a/LEGO1/mxcontrolpresenter.cpp +++ b/LEGO1/mxcontrolpresenter.cpp @@ -8,19 +8,19 @@ DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) // FUNCTION: LEGO1 0x10043f50 MxControlPresenter::MxControlPresenter() { - this->m_unk4c = 0; - this->m_unk4e = -1; - this->m_unk50 = 0; - this->m_unk52 = 0; - this->m_unk58 = 0; - this->m_unk54 = 0; + this->m_unk0x4c = 0; + this->m_unk0x4e = -1; + this->m_unk0x50 = 0; + this->m_unk0x52 = 0; + this->m_unk0x58 = 0; + this->m_unk0x54 = 0; } // FUNCTION: LEGO1 0x10044110 MxControlPresenter::~MxControlPresenter() { - if (this->m_unk58) { - delete this->m_unk58; + if (this->m_unk0x58) { + delete this->m_unk0x58; } } diff --git a/LEGO1/mxcontrolpresenter.h b/LEGO1/mxcontrolpresenter.h index 716a7cc0..dfe104bf 100644 --- a/LEGO1/mxcontrolpresenter.h +++ b/LEGO1/mxcontrolpresenter.h @@ -19,20 +19,20 @@ public: } // FUNCTION: LEGO1 0x10044010 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(name); + return !strcmp(p_name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 private: - undefined2 m_unk4c; - MxS16 m_unk4e; - undefined m_unk50; - undefined2 m_unk52; - undefined2 m_unk54; - undefined4* m_unk58; + undefined2 m_unk0x4c; + MxS16 m_unk0x4e; + undefined m_unk0x50; + undefined2 m_unk0x52; + undefined2 m_unk0x54; + undefined4* m_unk0x58; }; #endif // MXCONTROLPRESENTER_H diff --git a/LEGO1/mxcore.cpp b/LEGO1/mxcore.cpp index 3a8270df..18c37597 100644 --- a/LEGO1/mxcore.cpp +++ b/LEGO1/mxcore.cpp @@ -21,7 +21,7 @@ MxCore::~MxCore() } // FUNCTION: LEGO1 0x100ae1f0 -MxLong MxCore::Notify(MxParam& p) +MxLong MxCore::Notify(MxParam& p_param) { return 0; } diff --git a/LEGO1/mxcore.h b/LEGO1/mxcore.h index 6bae0ddb..2933973e 100644 --- a/LEGO1/mxcore.h +++ b/LEGO1/mxcore.h @@ -13,9 +13,9 @@ class MxParam; class MxCore { public: __declspec(dllexport) MxCore(); - __declspec(dllexport) virtual ~MxCore(); // vtable+00 - __declspec(dllexport) virtual MxLong Notify(MxParam& p); // vtable+04 - virtual MxResult Tickle(); // vtable+08 + __declspec(dllexport) virtual ~MxCore(); // vtable+00 + __declspec(dllexport) virtual MxLong Notify(MxParam& p_param); // vtable+04 + virtual MxResult Tickle(); // vtable+08 // FUNCTION: LEGO1 0x100144c0 inline virtual const char* ClassName() const // vtable+0c @@ -25,9 +25,9 @@ public: } // FUNCTION: LEGO1 0x100140d0 - inline virtual MxBool IsA(const char* name) const // vtable+10 + inline virtual MxBool IsA(const char* p_name) const // vtable+10 { - return !strcmp(name, MxCore::ClassName()); + return !strcmp(p_name, MxCore::ClassName()); } inline MxU32 GetId() { return m_id; } diff --git a/LEGO1/mxdirect3d.cpp b/LEGO1/mxdirect3d.cpp index 64c39984..58a982b3 100644 --- a/LEGO1/mxdirect3d.cpp +++ b/LEGO1/mxdirect3d.cpp @@ -11,7 +11,7 @@ MxDirect3D::MxDirect3D() { this->m_pDirect3d = NULL; this->m_pDirect3dDevice = NULL; - this->m_unk88c = NULL; + this->m_unk0x88c = NULL; this->m_pDeviceModeFinder = NULL; } @@ -52,7 +52,7 @@ BOOL MxDirect3D::Create( success = TRUE; if (!success) - FUN_1009D920(); + FUN_1009d920(); return success; } @@ -164,10 +164,10 @@ void MxDirect3D::BuildErrorString(const char* p_format, ...) } // FUNCTION: LEGO1 0x1009c6c0 -MxResult MxDeviceEnumerate::_DoEnumerate() +MxResult MxDeviceEnumerate::DoEnumerate() { // TODO: what does ECX refer to in this context? - if (m_unk010_flag) + if (m_unk0x010) return FAILURE; HRESULT ret = DirectDrawEnumerate(EnumerateCallback, this); @@ -176,7 +176,7 @@ MxResult MxDeviceEnumerate::_DoEnumerate() return FAILURE; } - m_unk010_flag = TRUE; + m_unk0x010 = TRUE; return SUCCESS; } diff --git a/LEGO1/mxdirect3d.h b/LEGO1/mxdirect3d.h index f038ee7f..34178023 100644 --- a/LEGO1/mxdirect3d.h +++ b/LEGO1/mxdirect3d.h @@ -13,7 +13,7 @@ public: MxDeviceModeFinder(); ~MxDeviceModeFinder(); - undefined4 m_unknown[56]; + undefined4 m_pad[56]; MxDirectDraw::DeviceModesInfo* m_deviceInfo; // +0xe0 }; @@ -23,17 +23,18 @@ public: class MxDeviceEnumerate { public: MxDeviceEnumerate(); - virtual MxResult _DoEnumerate(); + virtual MxResult DoEnumerate(); + BOOL FUN_1009c070(); const char* EnumerateErrorToString(HRESULT p_error); - undefined4 m_unk004; - undefined4 m_unk008; - undefined4 m_unk00c; - MxBool m_unk010_flag; // +0x10 + undefined4 m_unk0x004; + undefined4 m_unk0x008; + undefined4 m_unk0x00c; + MxBool m_unk0x010; // +0x10 - undefined4 m_unknown[97]; + undefined4 m_unk0x014[97]; }; // VTABLE: LEGO1 0x100db800 @@ -68,8 +69,8 @@ private: MxDeviceModeFinder* m_pDeviceModeFinder; // +0x880 IDirect3D* m_pDirect3d; // +0x884 IDirect3DDevice* m_pDirect3dDevice; - undefined4 m_unk88c; - undefined4 m_unk890; + undefined4 m_unk0x88c; + undefined4 m_unk0x890; }; BOOL FAR PASCAL EnumerateCallback(GUID FAR*, LPSTR, LPSTR, LPVOID); diff --git a/LEGO1/mxdirectdraw.cpp b/LEGO1/mxdirectdraw.cpp index adba7ac1..923459ed 100644 --- a/LEGO1/mxdirectdraw.cpp +++ b/LEGO1/mxdirectdraw.cpp @@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(MxDirectDraw::DeviceModesInfo, 0x17c); #endif // GLOBAL: LEGO1 0x10100c68 -BOOL g_is_PALETTEINDEXED8 = 0; +BOOL g_isPaletteIndexed8 = 0; // FUNCTION: LEGO1 0x1009d490 MxDirectDraw::MxDirectDraw() @@ -24,7 +24,7 @@ MxDirectDraw::MxDirectDraw() m_pText1Surface = NULL; m_pText2Surface = NULL; m_hWndMain = NULL; - m_bIgnoreWM_SIZE = FALSE; + m_bIgnoreWMSIZE = FALSE; m_bPrimaryPalettized = FALSE; m_bOnlySystemMemory = FALSE; m_bFullScreen = FALSE; @@ -65,7 +65,7 @@ int MxDirectDraw::GetPrimaryBitDepth() pDDraw->GetDisplayMode(&ddsd); dwRGBBitCount = ddsd.ddpfPixelFormat.dwRGBBitCount; - g_is_PALETTEINDEXED8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0; + g_isPaletteIndexed8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0; pDDraw->Release(); } @@ -89,13 +89,13 @@ BOOL MxDirectDraw::Create( CacheOriginalPaletteEntries(); - if (!RecreateDirectDraw(&m_pCurrentDeviceModesList->p_guid)) { + if (!RecreateDirectDraw(&m_pCurrentDeviceModesList->m_guid)) { return FALSE; } m_bFlipSurfaces = surface_fullscreen; m_bOnlySystemMemory = onlySystemMemory; - m_bIsOnPrimaryDevice = !m_pCurrentDeviceModesList->p_guid; + m_bIsOnPrimaryDevice = !m_pCurrentDeviceModesList->m_guid; BOOL fullscreen = 1; if (m_bIsOnPrimaryDevice) { @@ -131,12 +131,12 @@ BOOL MxDirectDraw::RecreateDirectDraw(GUID** ppGUID) // FUNCTION: LEGO1 0x1009d6c0 BOOL MxDirectDraw::CacheOriginalPaletteEntries() { - HDC DC; + HDC dc; - if (g_is_PALETTEINDEXED8) { - DC = GetDC(0); - GetSystemPaletteEntries(DC, 0, _countof(m_originalPaletteEntries), m_originalPaletteEntries); - ReleaseDC(0, DC); + if (g_isPaletteIndexed8) { + dc = GetDC(0); + GetSystemPaletteEntries(dc, 0, _countof(m_originalPaletteEntries), m_originalPaletteEntries); + ReleaseDC(0, dc); } return TRUE; } @@ -150,7 +150,7 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa HDC hdc; int i; - if (g_is_PALETTEINDEXED8) { + if (g_isPaletteIndexed8) { hdc = GetDC(NULL); GetSystemPaletteEntries(hdc, 0, arraySize, m_paletteEntries); ReleaseDC(NULL, hdc); @@ -197,7 +197,7 @@ void MxDirectDraw::Destroy() { DestroyButNotDirectDraw(); - FUN_1009D920(); + FUN_1009d920(); if (m_pDirectDraw != NULL) { m_pDirectDraw->Release(); @@ -218,9 +218,9 @@ void MxDirectDraw::DestroyButNotDirectDraw() RestoreOriginalPaletteEntries(); if (m_bFullScreen) { if (m_pDirectDraw != NULL) { - m_bIgnoreWM_SIZE = TRUE; + m_bIgnoreWMSIZE = TRUE; m_pDirectDraw->RestoreDisplayMode(); - m_bIgnoreWM_SIZE = FALSE; + m_bIgnoreWMSIZE = FALSE; } } @@ -261,14 +261,14 @@ void MxDirectDraw::DestroyButNotDirectDraw() } // FUNCTION: LEGO1 0x1009d920 -void MxDirectDraw::FUN_1009D920() +void MxDirectDraw::FUN_1009d920() { RestoreOriginalPaletteEntries(); if (m_pDirectDraw != NULL) { - m_bIgnoreWM_SIZE = TRUE; + m_bIgnoreWMSIZE = TRUE; m_pDirectDraw->RestoreDisplayMode(); m_pDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL); - m_bIgnoreWM_SIZE = FALSE; + m_bIgnoreWMSIZE = FALSE; } } @@ -278,9 +278,9 @@ BOOL MxDirectDraw::DDInit(BOOL fullscreen) HRESULT result; if (fullscreen) { - m_bIgnoreWM_SIZE = 1; + m_bIgnoreWMSIZE = TRUE; result = m_pDirectDraw->SetCooperativeLevel(m_hWndMain, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - m_bIgnoreWM_SIZE = 0; + m_bIgnoreWMSIZE = FALSE; } else { result = m_pDirectDraw->SetCooperativeLevel(m_hWndMain, DDSCL_NORMAL); @@ -301,8 +301,8 @@ BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp) { Mode mode = {width, height, bpp}; - for (int i = 0; i < m_pCurrentDeviceModesList->count; i++) { - if (m_pCurrentDeviceModesList->m_mode_ARRAY[i] == mode) { + for (int i = 0; i < m_pCurrentDeviceModesList->m_count; i++) { + if (m_pCurrentDeviceModesList->m_modeArray[i] == mode) { return TRUE; } } @@ -311,18 +311,18 @@ BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp) } // FUNCTION: LEGO1 0x1009da20 -void EnableResizing(HWND hwnd, BOOL flag) +void EnableResizing(HWND p_hwnd, BOOL p_flag) { - static DWORD dwStyle; + static DWORD g_dwStyle; - if (!flag) { - dwStyle = GetWindowLong(hwnd, GWL_STYLE); - if (dwStyle & WS_THICKFRAME) { - SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) ^ WS_THICKFRAME); + if (!p_flag) { + g_dwStyle = GetWindowLong(p_hwnd, GWL_STYLE); + if (g_dwStyle & WS_THICKFRAME) { + SetWindowLong(p_hwnd, GWL_STYLE, GetWindowLong(p_hwnd, GWL_STYLE) ^ WS_THICKFRAME); } } else { - SetWindowLong(hwnd, GWL_STYLE, dwStyle); + SetWindowLong(p_hwnd, GWL_STYLE, g_dwStyle); } } @@ -348,14 +348,14 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) } if (!IsSupportedMode(width, height, bpp)) { - width = m_pCurrentDeviceModesList->m_mode_ARRAY[0].width; - height = m_pCurrentDeviceModesList->m_mode_ARRAY[0].height; - bpp = m_pCurrentDeviceModesList->m_mode_ARRAY[0].bitsPerPixel; + width = m_pCurrentDeviceModesList->m_modeArray[0].m_width; + height = m_pCurrentDeviceModesList->m_modeArray[0].m_height; + bpp = m_pCurrentDeviceModesList->m_modeArray[0].m_bitsPerPixel; } - m_bIgnoreWM_SIZE = TRUE; + m_bIgnoreWMSIZE = TRUE; result = m_pDirectDraw->SetDisplayMode(width, height, bpp); - m_bIgnoreWM_SIZE = FALSE; + m_bIgnoreWMSIZE = FALSE; if (result != DD_OK) { Error("SetDisplayMode failed", result); return FALSE; @@ -370,7 +370,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) return FALSE; } - m_bIgnoreWM_SIZE = TRUE; + m_bIgnoreWMSIZE = TRUE; dwStyle = GetWindowLong(m_hWndMain, GWL_STYLE); dwStyle &= ~(WS_POPUP | WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPED); dwStyle |= WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPED; @@ -393,12 +393,12 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); SetWindowPos(m_hWndMain, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); - m_bIgnoreWM_SIZE = FALSE; + m_bIgnoreWMSIZE = FALSE; } - m_currentMode.width = width; - m_currentMode.height = height; - m_currentMode.bitsPerPixel = bpp; + m_currentMode.m_width = width; + m_currentMode.m_height = height; + m_currentMode.m_bitsPerPixel = bpp; if (!DDCreateSurfaces()) { return FALSE; @@ -406,7 +406,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) DDSURFACEDESC ddsd; - FUN_1009E020(); + FUN_1009e020(); if (!GetDDSurfaceDesc(&ddsd, m_pBackBuffer)) { return FALSE; @@ -506,8 +506,8 @@ BOOL MxDirectDraw::DDCreateSurfaces() Error("CreateSurface for window front buffer failed", result); return FALSE; } - ddsd.dwHeight = m_currentMode.height; - ddsd.dwWidth = m_currentMode.width; + ddsd.dwHeight = m_currentMode.m_height; + ddsd.dwWidth = m_currentMode.m_width; ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; if (m_bOnlySystemMemory) @@ -543,7 +543,7 @@ BOOL MxDirectDraw::DDCreateSurfaces() } // FUNCTION: LEGO1 0x1009e020 -void MxDirectDraw::FUN_1009E020() +void MxDirectDraw::FUN_1009e020() { HRESULT result; byte* line; @@ -631,7 +631,7 @@ BOOL MxDirectDraw::CreateTextSurfaces() HRESULT result; DDCOLORKEY ddck; DDSURFACEDESC ddsd; - HDC DC; + HDC dc; char dummyinfo[] = "000x000x00 (RAMP) 0000"; char dummyfps[] = "000.00 fps (000.00 fps (000.00 fps) 00000 tps)"; @@ -640,7 +640,7 @@ BOOL MxDirectDraw::CreateTextSurfaces() } m_hFont = CreateFontA( - m_currentMode.width <= 600 ? 12 : 24, + m_currentMode.m_width <= 600 ? 12 : 24, 0, 0, 0, @@ -656,11 +656,11 @@ BOOL MxDirectDraw::CreateTextSurfaces() "Arial" ); - DC = GetDC(NULL); - SelectObject(DC, m_hFont); - GetTextExtentPointA(DC, dummyfps, strlen(dummyfps), &m_text1SizeOnSurface); - GetTextExtentPointA(DC, dummyinfo, strlen(dummyinfo), &m_text2SizeOnSurface); - ReleaseDC(NULL, DC); + dc = GetDC(NULL); + SelectObject(dc, m_hFont); + GetTextExtentPointA(dc, dummyfps, strlen(dummyfps), &m_text1SizeOnSurface); + GetTextExtentPointA(dc, dummyinfo, strlen(dummyinfo), &m_text2SizeOnSurface); + ReleaseDC(NULL, dc); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -774,8 +774,8 @@ BOOL MxDirectDraw::CreateZBuffer(DWORD memorytype, DWORD depth) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - ddsd.dwHeight = m_currentMode.height; - ddsd.dwWidth = m_currentMode.width; + ddsd.dwHeight = m_currentMode.m_height; + ddsd.dwWidth = m_currentMode.m_width; ddsd.dwZBufferBitDepth = depth; ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_ZBUFFERBITDEPTH; ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | memorytype; @@ -889,24 +889,24 @@ int MxDirectDraw::FlipToGDISurface() } // FUNCTION: LEGO1 0x1009e830 -void MxDirectDraw::Error(const char* message, int error) +void MxDirectDraw::Error(const char* p_message, MxS32 p_error) { // GLOBAL: LEGO1 0x10100c70 - static BOOL isInsideError = FALSE; - if (!isInsideError) { - isInsideError = TRUE; + static BOOL g_isInsideError = FALSE; + if (!g_isInsideError) { + g_isInsideError = TRUE; Destroy(); if (m_pErrorHandler) { - m_pErrorHandler(message, error, m_pErrorHandlerArg); + m_pErrorHandler(p_message, p_error, m_pErrorHandlerArg); } - isInsideError = FALSE; + g_isInsideError = FALSE; } } // FUNCTION: LEGO1 0x1009e880 -const char* MxDirectDraw::ErrorToString(HRESULT error) +const char* MxDirectDraw::ErrorToString(HRESULT p_error) { - switch (error) { + switch (p_error) { case DD_OK: return "No error.\0"; case DDERR_ALREADYINITIALIZED: @@ -1122,11 +1122,11 @@ MxDirectDraw::DeviceModesInfo::DeviceModesInfo() // FUNCTION: LEGO1 0x1009efd0 MxDirectDraw::DeviceModesInfo::~DeviceModesInfo() { - if (p_guid != NULL) { - delete p_guid; + if (m_guid != NULL) { + delete m_guid; } - if (m_mode_ARRAY != NULL) { - delete m_mode_ARRAY; + if (m_modeArray != NULL) { + delete m_modeArray; } } diff --git a/LEGO1/mxdirectdraw.h b/LEGO1/mxdirectdraw.h index 3e6087cf..8c51b220 100644 --- a/LEGO1/mxdirectdraw.h +++ b/LEGO1/mxdirectdraw.h @@ -1,11 +1,11 @@ #ifndef MXDIRECTDRAW_H #define MXDIRECTDRAW_H +#include "mxtypes.h" + #include <ddraw.h> #include <windows.h> -extern BOOL g_is_PALETTEINDEXED8; - // VTABLE: LEGO1 0x100db818 // SIZE 0x880 class MxDirectDraw { @@ -14,23 +14,26 @@ public: // size 0x0c struct Mode { - int width; - int height; - int bitsPerPixel; + MxS32 m_width; + MxS32 m_height; + MxS32 m_bitsPerPixel; - int operator==(const Mode& rMode) const + MxS32 operator==(const Mode& p_mode) const { - return ((width == rMode.width) && (height == rMode.height) && (bitsPerPixel == rMode.bitsPerPixel)); + return ( + (m_width == p_mode.m_width) && (m_height == p_mode.m_height) && + (m_bitsPerPixel == p_mode.m_bitsPerPixel) + ); } }; - // size 0x17c + // SIZE 0x17c struct DeviceModesInfo { - GUID* p_guid; - Mode* m_mode_ARRAY; - int count; + GUID* m_guid; + Mode* m_modeArray; + MxS32 m_count; DDCAPS m_ddcaps; - void* a_178; + void* m_unk0x178; DeviceModesInfo(); ~DeviceModesInfo(); @@ -53,10 +56,10 @@ protected: SIZE m_text2SizeOnSurface; HWND m_hWndMain; HFONT m_hFont; - BOOL m_bIgnoreWM_SIZE; + BOOL m_bIgnoreWMSIZE; BOOL m_bPrimaryPalettized; BOOL m_bFullScreen; - void* a_850; + void* m_unk0x850; BOOL m_bOnlySystemMemory; BOOL m_bIsOnPrimaryDevice; ErrorHandler m_pErrorHandler; @@ -88,7 +91,7 @@ public: ); virtual void Destroy(); virtual void DestroyButNotDirectDraw(); - virtual const char* ErrorToString(HRESULT error); + virtual const char* ErrorToString(HRESULT p_error); protected: BOOL CacheOriginalPaletteEntries(); @@ -98,7 +101,7 @@ protected: BOOL DDCreateSurfaces(); BOOL DDInit(BOOL fullscreen); BOOL DDSetMode(int width, int height, int bpp); - void Error(const char* message, int error); + void Error(const char* p_message, MxS32 p_error); BOOL GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf); BOOL IsSupportedMode(int width, int height, int bpp); @@ -110,8 +113,8 @@ protected: BOOL TextToTextSurface(const char* text, IDirectDrawSurface* pSurface, SIZE& textSizeOnSurface); BOOL TextToTextSurface1(const char* text); BOOL TextToTextSurface2(const char* lpString); - void FUN_1009E020(); - void FUN_1009D920(); + void FUN_1009e020(); + void FUN_1009d920(); }; #endif // MXDIRECTDRAW_H diff --git a/LEGO1/mxdiskstreamcontroller.cpp b/LEGO1/mxdiskstreamcontroller.cpp index 197ef841..b9acfb9d 100644 --- a/LEGO1/mxdiskstreamcontroller.cpp +++ b/LEGO1/mxdiskstreamcontroller.cpp @@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(MxDiskStreamController, 0xc8); // FUNCTION: LEGO1 0x100c7120 MxDiskStreamController::MxDiskStreamController() { - m_unk8c = 0; + m_unk0x8c = 0; } // STUB: LEGO1 0x100c7530 @@ -46,40 +46,40 @@ MxResult MxDiskStreamController::Open(const char* p_filename) } // FUNCTION: LEGO1 0x100c7880 -MxResult MxDiskStreamController::vtable0x18(undefined4 p_unknown, undefined4 p_unknown2) +MxResult MxDiskStreamController::VTable0x18(undefined4, undefined4) { return SUCCESS; } // FUNCTION: LEGO1 0x100c7960 -MxResult MxDiskStreamController::vtable0x34(undefined4 p_unknown) +MxResult MxDiskStreamController::VTable0x34(undefined4) { return FAILURE; } // STUB: LEGO1 0x100c7ac0 -MxResult MxDiskStreamController::vtable0x28() +MxResult MxDiskStreamController::VTable0x28() { // TODO return FAILURE; } // STUB: LEGO1 0x100c7c00 -MxResult MxDiskStreamController::vtable0x30(undefined4 p_unknown) +MxResult MxDiskStreamController::VTable0x30(MxDSAction* p_action) { // TODO return FAILURE; } // STUB: LEGO1 0x100c7ff0 -MxResult MxDiskStreamController::vtable0x20(MxDSAction* p_action) +MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action) { // TODO return FAILURE; } // STUB: LEGO1 0x100c8160 -MxResult MxDiskStreamController::vtable0x24(undefined4 p_unknown) +MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action) { // TODO return FAILURE; diff --git a/LEGO1/mxdiskstreamcontroller.h b/LEGO1/mxdiskstreamcontroller.h index fc9b7d7e..2e320fa0 100644 --- a/LEGO1/mxdiskstreamcontroller.h +++ b/LEGO1/mxdiskstreamcontroller.h @@ -16,14 +16,14 @@ public: MxDiskStreamController(); virtual ~MxDiskStreamController() override; - virtual MxResult Tickle() override; // vtable+0x8 - virtual MxResult Open(const char* p_filename) override; // vtable+0x14 - virtual MxResult vtable0x18(undefined4 p_unknown, undefined4 p_unknown2) override; // vtable+0x18 - virtual MxResult vtable0x20(MxDSAction* p_action) override; // vtable+0x20 - virtual MxResult vtable0x24(undefined4 p_unknown) override; // vtable+0x24 - virtual MxResult vtable0x28() override; // vtable+0x28 - virtual MxResult vtable0x30(undefined4 p_unknown) override; // vtable+0x30 - virtual MxResult vtable0x34(undefined4 p_unknown); // vtable+0x34 + virtual MxResult Tickle() override; // vtable+0x8 + virtual MxResult Open(const char* p_filename) override; // vtable+0x14 + virtual MxResult VTable0x18(undefined4, undefined4) override; // vtable+0x18 + virtual MxResult VTable0x20(MxDSAction* p_action) override; // vtable+0x20 + virtual MxResult VTable0x24(MxDSAction* p_action) override; // vtable+0x24 + virtual MxResult VTable0x28() override; // vtable+0x28 + virtual MxResult VTable0x30(MxDSAction* p_action) override; // vtable+0x30 + virtual MxResult VTable0x34(undefined4); // vtable+0x34 // FUNCTION: LEGO1 0x100c7360 inline virtual const char* ClassName() const override // vtable+0x0c @@ -33,21 +33,21 @@ public: } // FUNCTION: LEGO1 0x100c7370 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDiskStreamController::ClassName()) || MxStreamController::IsA(name); + return !strcmp(p_name, MxDiskStreamController::ClassName()) || MxStreamController::IsA(p_name); } private: MxStreamListMxDSAction m_list0x64; // 0x64 - undefined m_unk70; // 0x70 + undefined m_unk0x70; // 0x70 list<MxDSBuffer*> m_list0x74; // 0x74 MxStreamListMxDSAction m_list0x80; // 0x80 - undefined2 m_unk8c; // 0x8c + undefined2 m_unk0x8c; // 0x8c MxStreamListMxDSAction m_list0x90; // 0x90 MxCriticalSection m_critical9c; // 0x9c MxStreamListMxDSAction m_list0xb8; // 0xb8 - undefined m_unkc4; // 0xc4 + undefined m_unk0xc4; // 0xc4 }; // TEMPLATE: LEGO1 0x100c7330 diff --git a/LEGO1/mxdiskstreamprovider.cpp b/LEGO1/mxdiskstreamprovider.cpp index 614aab48..e4f8c2a1 100644 --- a/LEGO1/mxdiskstreamprovider.cpp +++ b/LEGO1/mxdiskstreamprovider.cpp @@ -29,7 +29,7 @@ MxDiskStreamProvider::MxDiskStreamProvider() { this->m_pFile = NULL; this->m_remainingWork = 0; - this->m_unk35 = 0; + this->m_unk0x35 = 0; } // STUB: LEGO1 0x100d1240 @@ -71,7 +71,7 @@ done: } // STUB: LEGO1 0x100d15e0 -void MxDiskStreamProvider::vtable0x20(undefined4 p_unknown1) +void MxDiskStreamProvider::VTable0x20(undefined4) { // TODO } @@ -81,7 +81,7 @@ MxResult MxDiskStreamProvider::WaitForWorkToComplete() { while (m_remainingWork != 0) { m_busySemaphore.Wait(INFINITE); - if (m_unk35 != 0) + if (m_unk0x35 != 0) PerformWork(); } return SUCCESS; diff --git a/LEGO1/mxdiskstreamprovider.h b/LEGO1/mxdiskstreamprovider.h index d6bc68a1..20b78f81 100644 --- a/LEGO1/mxdiskstreamprovider.h +++ b/LEGO1/mxdiskstreamprovider.h @@ -37,9 +37,9 @@ public: } // FUNCTION: LEGO1 0x100d1170 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDiskStreamProvider::ClassName()) || MxStreamProvider::IsA(name); + return !strcmp(p_name, MxDiskStreamProvider::ClassName()) || MxStreamProvider::IsA(p_name); } MxResult WaitForWorkToComplete(); @@ -49,7 +49,7 @@ public: virtual MxResult SetResourceToGet(MxStreamController* p_resource) override; // vtable+0x14 virtual MxU32 GetFileSize() override; // vtable+0x18 virtual MxU32 GetStreamBuffersNum() override; // vtable+0x1c - virtual void vtable0x20(undefined4 p_unknown1) override; // vtable+0x20 + virtual void VTable0x20(undefined4) override; // vtable+0x20 virtual MxU32 GetLengthInDWords() override; // vtable+0x24 virtual MxU32* GetBufferForDWords() override; // vtable+0x28 @@ -57,7 +57,7 @@ private: MxDiskStreamProviderThread m_thread; // 0x10 MxSemaphore m_busySemaphore; // 0x2c undefined m_remainingWork; // 0x34 - undefined m_unk35; // 0x35 + undefined m_unk0x35; // 0x35 MxCriticalSection m_criticalSection; // 0x38 MxStreamListMxDSAction m_list; // 0x54 }; diff --git a/LEGO1/mxdisplaysurface.cpp b/LEGO1/mxdisplaysurface.cpp index fe849489..957bc568 100644 --- a/LEGO1/mxdisplaysurface.cpp +++ b/LEGO1/mxdisplaysurface.cpp @@ -70,10 +70,10 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) this->m_initialized = TRUE; this->m_videoParam = p_videoParam; - if (!this->m_videoParam.flags().GetFullScreen()) - this->m_videoParam.flags().SetFlipSurfaces(FALSE); + if (!this->m_videoParam.Flags().GetFullScreen()) + this->m_videoParam.Flags().SetFlipSurfaces(FALSE); - if (!this->m_videoParam.flags().GetFlipSurfaces()) { + if (!this->m_videoParam.Flags().GetFlipSurfaces()) { this->m_videoParam.SetBackBuffers(1); } else { @@ -84,10 +84,10 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) else if (backBuffers > 2) this->m_videoParam.SetBackBuffers(2); - this->m_videoParam.flags().SetBackBuffers(TRUE); + this->m_videoParam.Flags().SetBackBuffers(TRUE); } - if (this->m_videoParam.flags().GetFullScreen()) { + if (this->m_videoParam.Flags().GetFullScreen()) { MxS32 width = this->m_videoParam.GetRect().GetWidth(); MxS32 height = this->m_videoParam.GetRect().GetHeight(); @@ -100,7 +100,7 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) if (lpDirectDraw->GetDisplayMode(&ddsd)) goto done; - MxS32 bitdepth = !this->m_videoParam.flags().Get16Bit() ? 8 : 16; + MxS32 bitdepth = !this->m_videoParam.Flags().Get16Bit() ? 8 : 16; if (ddsd.dwWidth != width || ddsd.dwHeight != height || ddsd.ddpfPixelFormat.dwRGBBitCount != bitdepth) { if (lpDirectDraw->SetDisplayMode(width, height, bitdepth)) @@ -108,7 +108,7 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) } } - if (this->m_videoParam.flags().GetFlipSurfaces()) { + if (this->m_videoParam.Flags().GetFlipSurfaces()) { memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwBackBufferCount = this->m_videoParam.GetBackBuffers(); @@ -139,7 +139,7 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) ddsd.dwHeight = this->m_videoParam.GetRect().GetHeight(); ddsd.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE | DDSCAPS_OFFSCREENPLAIN; - if (!this->m_videoParam.flags().GetBackBuffers()) + if (!this->m_videoParam.Flags().GetBackBuffers()) ddsd.ddsCaps.dwCaps = DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; if (lpDirectDraw->CreateSurface(&ddsd, &this->m_ddSurface2, NULL)) @@ -185,13 +185,13 @@ void MxDisplaySurface::SetPalette(MxPalette* p_palette) } // STUB: LEGO1 0x100bacc0 -MxBool MxDisplaySurface::vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) +MxBool MxDisplaySurface::VTable0x28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) { return 0; } // STUB: LEGO1 0x100bb1d0 -MxBool MxDisplaySurface::vtable30( +MxBool MxDisplaySurface::VTable0x30( undefined4, undefined4, undefined4, @@ -206,7 +206,7 @@ MxBool MxDisplaySurface::vtable30( } // STUB: LEGO1 0x100bb850 -undefined4 MxDisplaySurface::vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) +undefined4 MxDisplaySurface::VTable0x34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) { return 0; } @@ -233,13 +233,13 @@ void MxDisplaySurface::ReleaseDC(HDC p_hdc) } // STUB: LEGO1 0x100bbc60 -LPDIRECTDRAWSURFACE MxDisplaySurface::vtable44(MxBitmap*, undefined4*, undefined4, undefined4) +LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(MxBitmap*, undefined4*, undefined4, undefined4) { return NULL; } // STUB: LEGO1 0x100bc200 -void MxDisplaySurface::vtable24( +void MxDisplaySurface::VTable0x24( LPDDSURFACEDESC, MxBitmap*, undefined4, @@ -253,8 +253,17 @@ void MxDisplaySurface::vtable24( } // STUB: LEGO1 0x100bc630 -MxBool MxDisplaySurface:: - vtable2c(LPDDSURFACEDESC, MxBitmap*, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool) +MxBool MxDisplaySurface::VTable0x2c( + LPDDSURFACEDESC, + MxBitmap*, + undefined4, + undefined4, + undefined4, + undefined4, + undefined4, + undefined4, + MxBool +) { return 0; } diff --git a/LEGO1/mxdisplaysurface.h b/LEGO1/mxdisplaysurface.h index 6bc2b14e..280100f4 100644 --- a/LEGO1/mxdisplaysurface.h +++ b/LEGO1/mxdisplaysurface.h @@ -29,7 +29,7 @@ public: virtual MxResult Create(MxVideoParam& p_videoParam); virtual void Clear(); virtual void SetPalette(MxPalette* p_palette); - virtual void vtable24( + virtual void VTable0x24( LPDDSURFACEDESC, MxBitmap*, undefined4, @@ -39,8 +39,8 @@ public: undefined4, undefined4 ); - virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); - virtual MxBool vtable2c( + virtual MxBool VTable0x28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); + virtual MxBool VTable0x2c( LPDDSURFACEDESC, MxBitmap*, undefined4, @@ -51,12 +51,21 @@ public: undefined4, MxBool ); - virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool); - virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); + virtual MxBool VTable0x30( + undefined4, + undefined4, + undefined4, + undefined4, + undefined4, + undefined4, + undefined4, + MxBool + ); + virtual undefined4 VTable0x34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); virtual void GetDC(HDC* p_hdc); virtual void ReleaseDC(HDC p_hdc); - virtual LPDIRECTDRAWSURFACE vtable44(MxBitmap*, undefined4*, undefined4, undefined4); + virtual LPDIRECTDRAWSURFACE VTable0x44(MxBitmap*, undefined4*, undefined4, undefined4); inline LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return this->m_ddSurface1; } inline LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return this->m_ddSurface2; } diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp index a01bceff..3b71011d 100644 --- a/LEGO1/mxdsaction.cpp +++ b/LEGO1/mxdsaction.cpp @@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(MxDSAction, 0x94) // GLOBAL: LEGO1 0x10101410 -MxU16 g_unkSep = TWOCC(',', ' '); +MxU16 g_sep = TWOCC(',', ' '); // FUNCTION: LEGO1 0x100ad810 MxDSAction::MxDSAction() @@ -26,10 +26,10 @@ MxDSAction::MxDSAction() this->m_location.Fill(FLT_MAX); this->m_direction.Fill(FLT_MAX); this->m_up.Fill(FLT_MAX); - this->m_unk84 = NULL; - this->m_unk88 = 0; + this->m_unk0x84 = NULL; + this->m_unk0x88 = 0; this->m_origin = NULL; - this->m_unkTimingField = INT_MIN; + this->m_unk0x90 = INT_MIN; } // FUNCTION: LEGO1 0x100ad940 @@ -51,15 +51,15 @@ MxBool MxDSAction::HasId(MxU32 p_objectId) } // FUNCTION: LEGO1 0x100ada40 -void MxDSAction::SetUnkTimingField(MxLong p_unkTimingField) +void MxDSAction::SetUnknown90(MxLong p_unk0x90) { - this->m_unkTimingField = p_unkTimingField; + this->m_unk0x90 = p_unk0x90; } // FUNCTION: LEGO1 0x100ada50 -MxLong MxDSAction::GetUnkTimingField() +MxLong MxDSAction::GetUnknown90() { - return this->m_unkTimingField; + return this->m_unk0x90; } // FUNCTION: LEGO1 0x100ada80 @@ -82,10 +82,10 @@ void MxDSAction::CopyFrom(MxDSAction& p_dsAction) this->m_up.CopyFrom(p_dsAction.m_up); AppendData(p_dsAction.m_extraLength, p_dsAction.m_extraData); - this->m_unk84 = p_dsAction.m_unk84; - this->m_unk88 = p_dsAction.m_unk88; + this->m_unk0x84 = p_dsAction.m_unk0x84; + this->m_unk0x88 = p_dsAction.m_unk0x88; this->m_origin = p_dsAction.m_origin; - this->m_unkTimingField = p_dsAction.m_unkTimingField; + this->m_unk0x90 = p_dsAction.m_unk0x90; } // FUNCTION: LEGO1 0x100adbe0 @@ -124,7 +124,7 @@ MxDSAction* MxDSAction::Clone() // FUNCTION: LEGO1 0x100adcd0 MxLong MxDSAction::GetElapsedTime() { - return Timer()->GetTime() - this->m_unkTimingField; + return Timer()->GetTime() - this->m_unk0x90; } // FUNCTION: LEGO1 0x100add00 @@ -165,8 +165,8 @@ void MxDSAction::MergeFrom(MxDSAction& p_dsAction) // Taking those references forces the compiler to move the values onto the stack. // The original code most likely looked different, but this yields a 100% match. - MxU16& _extraLength = extraLength; - char*& _extraData = extraData; + MxU16& extraLengthRef = extraLength; + char*& extraDataRef = extraData; if (extraLength && extraData) { if (!this->m_extraData || !strncmp("XXX", this->m_extraData, 3)) { delete[] this->m_extraData; @@ -183,13 +183,13 @@ void MxDSAction::AppendData(MxU16 p_extraLength, const char* p_extraData) return; if (this->m_extraLength) { - char* concat = new char[p_extraLength + this->m_extraLength + sizeof(g_unkSep)]; + char* concat = new char[p_extraLength + this->m_extraLength + sizeof(g_sep)]; memcpy(concat, this->m_extraData, this->m_extraLength); - *(MxU16*) &concat[this->m_extraLength] = g_unkSep; - memcpy(&concat[this->m_extraLength + sizeof(g_unkSep)], p_extraData, p_extraLength); + *(MxU16*) &concat[this->m_extraLength] = g_sep; + memcpy(&concat[this->m_extraLength + sizeof(g_sep)], p_extraData, p_extraLength); - this->m_extraLength += p_extraLength + sizeof(g_unkSep); + this->m_extraLength += p_extraLength + sizeof(g_sep); delete[] this->m_extraData; this->m_extraData = concat; } @@ -205,9 +205,9 @@ void MxDSAction::AppendData(MxU16 p_extraLength, const char* p_extraData) } // FUNCTION: LEGO1 0x100adf70 -void MxDSAction::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSAction::Deserialize(char** p_source, MxS16 p_unk0x24) { - MxDSObject::Deserialize(p_source, p_unk24); + MxDSObject::Deserialize(p_source, p_unk0x24); GetScalar(p_source, this->m_flags); GetScalar(p_source, this->m_startTime); diff --git a/LEGO1/mxdsaction.h b/LEGO1/mxdsaction.h index 9047c730..94421b1f 100644 --- a/LEGO1/mxdsaction.h +++ b/LEGO1/mxdsaction.h @@ -37,21 +37,21 @@ public: } // FUNCTION: LEGO1 0x100ad990 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSAction::ClassName()) || MxDSObject::IsA(name); + return !strcmp(p_name, MxDSAction::ClassName()) || MxDSObject::IsA(p_name); } - virtual MxU32 GetSizeOnDisk() override; // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24) override; // vtable+1c; - virtual MxLong GetDuration(); // vtable+24; - virtual void SetDuration(MxLong p_duration); // vtable+28; - virtual MxDSAction* Clone(); // vtable+2c; - virtual void MergeFrom(MxDSAction& p_dsAction); // vtable+30; - virtual MxBool HasId(MxU32 p_objectId); // vtable+34; - virtual void SetUnkTimingField(MxLong p_unkTimingField); // vtable+38; - virtual MxLong GetUnkTimingField(); // vtable+3c; - virtual MxLong GetElapsedTime(); // vtable+40; + virtual MxU32 GetSizeOnDisk() override; // vtable+18; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24) override; // vtable+1c; + virtual MxLong GetDuration(); // vtable+24; + virtual void SetDuration(MxLong p_duration); // vtable+28; + virtual MxDSAction* Clone(); // vtable+2c; + virtual void MergeFrom(MxDSAction& p_dsAction); // vtable+30; + virtual MxBool HasId(MxU32 p_objectId); // vtable+34; + virtual void SetUnknown90(MxLong p_unk0x90); // vtable+38; + virtual MxLong GetUnknown90(); // vtable+3c; + virtual MxLong GetElapsedTime(); // vtable+40; void AppendData(MxU16 p_extraLength, const char* p_extraData); @@ -63,7 +63,7 @@ public: inline MxS32 GetLoopCount() { return m_loopCount; } inline void SetLoopCount(MxS32 p_loopCount) { m_loopCount = p_loopCount; } inline const Vector3Data& GetLocation() const { return m_location; } - inline void SetUnknown84(MxCore* p_unk84) { m_unk84 = p_unk84; } + inline void SetUnknown84(MxCore* p_unk0x84) { m_unk0x84 = p_unk0x84; } inline MxCore* GetOrigin() { return m_origin; } inline void SetOrigin(MxCore* p_origin) { m_origin = p_origin; } @@ -89,10 +89,10 @@ protected: Vector3Data m_up; // 0x68 char* m_extraData; // 0x7c MxU16 m_extraLength; // 0x80 - MxCore* m_unk84; // 0x84 - undefined4 m_unk88; // 0x88 + MxCore* m_unk0x84; // 0x84 + undefined4 m_unk0x88; // 0x88 MxCore* m_origin; // 0x8c - MxLong m_unkTimingField; // 0x90 + MxLong m_unk0x90; // 0x90 }; #endif // MXDSACTION_H diff --git a/LEGO1/mxdsactionlist.h b/LEGO1/mxdsactionlist.h index 25343785..73252d9d 100644 --- a/LEGO1/mxdsactionlist.h +++ b/LEGO1/mxdsactionlist.h @@ -16,14 +16,14 @@ class MxDSAction; // SIZE 0x1c class MxDSActionList : public MxList<MxDSAction*> { public: - MxDSActionList() { this->m_unk18 = 0; } + MxDSActionList() { this->m_unk0x18 = 0; } virtual MxS8 Compare(MxDSAction*, MxDSAction*) override; // vtable+0x14 static void Destroy(MxDSAction* p_action); private: - undefined m_unk18; + undefined m_unk0x18; }; // VTABLE: LEGO1 0x100d7e68 diff --git a/LEGO1/mxdsanim.h b/LEGO1/mxdsanim.h index 41b8cfa5..ee206e6a 100644 --- a/LEGO1/mxdsanim.h +++ b/LEGO1/mxdsanim.h @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x100c9070 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSAnim::ClassName()) || MxDSMediaAction::IsA(name); + return !strcmp(p_name, MxDSAnim::ClassName()) || MxDSMediaAction::IsA(p_name); } virtual MxDSAction* Clone() override; // vtable+2c; diff --git a/LEGO1/mxdsbuffer.cpp b/LEGO1/mxdsbuffer.cpp index ed280db8..47753711 100644 --- a/LEGO1/mxdsbuffer.cpp +++ b/LEGO1/mxdsbuffer.cpp @@ -8,17 +8,17 @@ DECOMP_SIZE_ASSERT(MxDSBuffer, 0x34); // FUNCTION: LEGO1 0x100c6470 MxDSBuffer::MxDSBuffer() { - m_unk20 = 0; + m_unk0x20 = 0; m_pBuffer = NULL; m_pIntoBuffer = NULL; m_pIntoBuffer2 = NULL; - m_unk14 = 0; - m_unk18 = 0; - m_unk1c = 0; + m_unk0x14 = 0; + m_unk0x18 = 0; + m_unk0x1c = 0; m_writeOffset = 0; m_bytesRemaining = 0; m_mode = MxDSBufferType_Preallocated; - m_unk30 = 0; + m_unk0x30 = 0; } // FUNCTION: LEGO1 0x100c6530 @@ -33,8 +33,8 @@ MxDSBuffer::~MxDSBuffer() } } - m_unk14 = 0; - m_unk1c = 0; + m_unk0x14 = 0; + m_unk0x1c = 0; } // FUNCTION: LEGO1 0x100c6640 @@ -119,10 +119,10 @@ MxResult MxDSBuffer::SetBufferPointer(MxU32* p_buffer, MxU32 p_size) } // FUNCTION: LEGO1 0x100c6f80 -void MxDSBuffer::FUN_100c6f80(MxU32 p_unk) +void MxDSBuffer::FUN_100c6f80(MxU32 p_writeOffset) { - if (p_unk < m_writeOffset) { - m_pIntoBuffer2 = m_pBuffer + p_unk; - m_pIntoBuffer = m_pBuffer + p_unk; + if (p_writeOffset < m_writeOffset) { + m_pIntoBuffer2 = m_pBuffer + p_writeOffset; + m_pIntoBuffer = m_pBuffer + p_writeOffset; } } diff --git a/LEGO1/mxdsbuffer.h b/LEGO1/mxdsbuffer.h index e253b2a5..9ceaca3a 100644 --- a/LEGO1/mxdsbuffer.h +++ b/LEGO1/mxdsbuffer.h @@ -27,7 +27,7 @@ public: MxResult AllocateBuffer(MxU32 p_bufferSize, MxDSBufferType p_mode); MxResult SetBufferPointer(MxU32* p_buffer, MxU32 p_size); - void FUN_100c6f80(MxU32 p_unk); + void FUN_100c6f80(MxU32 p_writeOffset); inline MxU8* GetBuffer() { return m_pBuffer; } inline MxU32 GetWriteOffset() { return m_writeOffset; } @@ -36,14 +36,14 @@ private: MxU8* m_pBuffer; MxU8* m_pIntoBuffer; MxU8* m_pIntoBuffer2; - undefined4 m_unk14; - undefined4 m_unk18; - undefined4 m_unk1c; - undefined2 m_unk20; + undefined4 m_unk0x14; + undefined4 m_unk0x18; + undefined4 m_unk0x1c; + undefined2 m_unk0x20; MxDSBufferType m_mode; MxU32 m_writeOffset; MxU32 m_bytesRemaining; - undefined4 m_unk30; + undefined4 m_unk0x30; }; #endif // MXDSBUFFER_H diff --git a/LEGO1/mxdschunk.cpp b/LEGO1/mxdschunk.cpp index 1898d6a8..8b64bc0c 100644 --- a/LEGO1/mxdschunk.cpp +++ b/LEGO1/mxdschunk.cpp @@ -7,7 +7,7 @@ MxDSChunk::MxDSChunk() { m_flags = 0; m_data = NULL; - m_unk0c = -1; + m_unk0x0c = -1; m_time = 0; m_length = 0; } diff --git a/LEGO1/mxdschunk.h b/LEGO1/mxdschunk.h index 33836860..2c43b83e 100644 --- a/LEGO1/mxdschunk.h +++ b/LEGO1/mxdschunk.h @@ -28,12 +28,12 @@ public: } // FUNCTION: LEGO1 0x100be0d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSChunk::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxDSChunk::ClassName()) || MxCore::IsA(p_name); } - inline void SetFlags(MxU16 flags) { m_flags = flags; } + inline void SetFlags(MxU16 p_flags) { m_flags = p_flags; } inline void SetTime(MxLong p_time) { m_time = p_time; } inline void SetLength(MxU32 p_length) { m_length = p_length; } inline void SetData(MxU8* p_data) { m_data = p_data; } @@ -50,11 +50,11 @@ public: } private: - MxU16 m_flags; // 0x8 - undefined4 m_unk0c; // 0xc - MxLong m_time; // 0x10 - MxU32 m_length; // 0x14 - MxU8* m_data; // 0x18 + MxU16 m_flags; // 0x8 + undefined4 m_unk0x0c; // 0xc + MxLong m_time; // 0x10 + MxU32 m_length; // 0x14 + MxU8* m_data; // 0x18 }; #endif // MXDSCHUNK_H diff --git a/LEGO1/mxdsevent.h b/LEGO1/mxdsevent.h index 4a4e5202..8c6e825e 100644 --- a/LEGO1/mxdsevent.h +++ b/LEGO1/mxdsevent.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x100c9670 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSEvent::ClassName()) || MxDSMediaAction::IsA(name); + return !strcmp(p_name, MxDSEvent::ClassName()) || MxDSMediaAction::IsA(p_name); } virtual MxDSAction* Clone() override; // vtable+2c; diff --git a/LEGO1/mxdsfile.cpp b/LEGO1/mxdsfile.cpp index 497b3d82..3e03ad6e 100644 --- a/LEGO1/mxdsfile.cpp +++ b/LEGO1/mxdsfile.cpp @@ -12,20 +12,20 @@ MxDSFile::~MxDSFile() } // FUNCTION: LEGO1 0x100cc4b0 -MxDSFile::MxDSFile(const char* filename, MxULong skipReadingChunks) +MxDSFile::MxDSFile(const char* p_filename, MxULong p_skipReadingChunks) { - m_filename = filename; - m_skipReadingChunks = skipReadingChunks; + m_filename = p_filename; + m_skipReadingChunks = p_skipReadingChunks; } // FUNCTION: LEGO1 0x100cc590 -MxLong MxDSFile::Open(MxULong uStyle) +MxLong MxDSFile::Open(MxULong p_uStyle) { MXIOINFO& io = m_io; MxLong longResult = 1; memset(&io, 0, sizeof(MXIOINFO)); - if (io.Open(m_filename.GetData(), uStyle) != 0) { + if (io.Open(m_filename.GetData(), p_uStyle) != 0) { return -1; } @@ -63,7 +63,7 @@ MxLong MxDSFile::ReadChunks() } m_io.Read(&m_header, 0xc); - if ((m_header.majorVersion == SI_MAJOR_VERSION) && (m_header.minorVersion == SI_MINOR_VERSION)) { + if ((m_header.m_majorVersion == SI_MAJOR_VERSION) && (m_header.m_minorVersion == SI_MINOR_VERSION)) { childChunk.ckid = FOURCC('M', 'x', 'O', 'f'); if (m_io.Descend(&childChunk, &topChunk, 0) != 0) { return -1; @@ -106,19 +106,19 @@ MxResult MxDSFile::Read(unsigned char* p_buf, MxULong p_nbytes) } // FUNCTION: LEGO1 0x100cc7b0 -MxLong MxDSFile::Seek(MxLong lOffset, int iOrigin) +MxLong MxDSFile::Seek(MxLong p_lOffset, MxS32 p_iOrigin) { - return (m_position = m_io.Seek(lOffset, iOrigin)) == -1 ? -1 : 0; + return (m_position = m_io.Seek(p_lOffset, p_iOrigin)) == -1 ? -1 : 0; } // FUNCTION: LEGO1 0x100cc7e0 MxULong MxDSFile::GetBufferSize() { - return m_header.bufferSize; + return m_header.m_bufferSize; } // FUNCTION: LEGO1 0x100cc7f0 MxULong MxDSFile::GetStreamBuffersNum() { - return m_header.streamBuffersNum; + return m_header.m_streamBuffersNum; } diff --git a/LEGO1/mxdsfile.h b/LEGO1/mxdsfile.h index eb38975a..0cdcdf43 100644 --- a/LEGO1/mxdsfile.h +++ b/LEGO1/mxdsfile.h @@ -9,7 +9,7 @@ // VTABLE: LEGO1 0x100dc890 class MxDSFile : public MxDSSource { public: - __declspec(dllexport) MxDSFile(const char* filename, MxULong skipReadingChunks); + __declspec(dllexport) MxDSFile(const char* p_filename, MxULong p_skipReadingChunks); __declspec(dllexport) virtual ~MxDSFile(); // vtable+0x0 // FUNCTION: LEGO1 0x100c0120 @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100c0130 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSFile::ClassName()) || MxDSSource::IsA(name); + return !strcmp(p_name, MxDSFile::ClassName()) || MxDSSource::IsA(p_name); } __declspec(dllexport) virtual MxLong Open(MxULong); // vtable+0x14 @@ -37,13 +37,13 @@ public: private: MxLong ReadChunks(); struct ChunkHeader { - ChunkHeader() : majorVersion(0), minorVersion(0), bufferSize(0), streamBuffersNum(0) {} + ChunkHeader() : m_majorVersion(0), m_minorVersion(0), m_bufferSize(0), m_streamBuffersNum(0) {} - MxU16 majorVersion; - MxU16 minorVersion; - MxULong bufferSize; - MxS16 streamBuffersNum; - MxS16 reserved; + MxU16 m_majorVersion; + MxU16 m_minorVersion; + MxULong m_bufferSize; + MxS16 m_streamBuffersNum; + MxS16 m_reserved; }; MxString m_filename; diff --git a/LEGO1/mxdsmediaaction.cpp b/LEGO1/mxdsmediaaction.cpp index ccb12a07..d5d7446a 100644 --- a/LEGO1/mxdsmediaaction.cpp +++ b/LEGO1/mxdsmediaaction.cpp @@ -8,12 +8,12 @@ DECOMP_SIZE_ASSERT(MxDSMediaAction, 0xb8) MxDSMediaAction::MxDSMediaAction() { this->m_mediaSrcPath = NULL; - this->m_unk9c.m_unk00 = 0; - this->m_unk9c.m_unk04 = 0; + this->m_unk0x9c.m_unk0x00 = 0; + this->m_unk0x9c.m_unk0x04 = 0; this->m_framesPerSecond = 0; this->m_mediaFormat = 0; this->m_paletteManagement = 1; - this->m_unkb4 = -1; + this->m_unk0xb4 = -1; this->m_sustainTime = 0; this->SetType(MxDSType_MediaAction); } @@ -29,7 +29,7 @@ void MxDSMediaAction::CopyFrom(MxDSMediaAction& p_dsMediaAction) { CopyMediaSrcPath(p_dsMediaAction.m_mediaSrcPath); - this->m_unk9c = p_dsMediaAction.m_unk9c; + this->m_unk0x9c = p_dsMediaAction.m_unk0x9c; this->m_framesPerSecond = p_dsMediaAction.m_framesPerSecond; this->m_mediaFormat = p_dsMediaAction.m_mediaFormat; this->m_paletteManagement = p_dsMediaAction.m_paletteManagement; @@ -80,13 +80,13 @@ MxU32 MxDSMediaAction::GetSizeOnDisk() } // FUNCTION: LEGO1 0x100c8f60 -void MxDSMediaAction::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSMediaAction::Deserialize(char** p_source, MxS16 p_unk0x24) { - MxDSAction::Deserialize(p_source, p_unk24); + MxDSAction::Deserialize(p_source, p_unk0x24); GetString(p_source, this->m_mediaSrcPath, this, &MxDSMediaAction::CopyMediaSrcPath); - GetScalar(p_source, this->m_unk9c.m_unk00); - GetScalar(p_source, this->m_unk9c.m_unk04); + GetScalar(p_source, this->m_unk0x9c.m_unk0x00); + GetScalar(p_source, this->m_unk0x9c.m_unk0x04); GetScalar(p_source, this->m_framesPerSecond); GetScalar(p_source, this->m_mediaFormat); GetScalar(p_source, this->m_paletteManagement); diff --git a/LEGO1/mxdsmediaaction.h b/LEGO1/mxdsmediaaction.h index 8f7036bb..27965be9 100644 --- a/LEGO1/mxdsmediaaction.h +++ b/LEGO1/mxdsmediaaction.h @@ -23,13 +23,13 @@ public: } // FUNCTION: LEGO1 0x100c8bf0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSMediaAction::ClassName()) || MxDSAction::IsA(name); + return !strcmp(p_name, MxDSMediaAction::ClassName()) || MxDSAction::IsA(p_name); } - virtual MxU32 GetSizeOnDisk() override; // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24) override; // vtable+1c; + virtual MxU32 GetSizeOnDisk() override; // vtable+18; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24) override; // vtable+1c; void CopyMediaSrcPath(const char* p_mediaSrcPath); @@ -41,14 +41,14 @@ private: MxU32 m_sizeOnDisk; // 0x94 char* m_mediaSrcPath; // 0x98 struct { - undefined4 m_unk00; - undefined4 m_unk04; - } m_unk9c; // 0x9c + undefined4 m_unk0x00; + undefined4 m_unk0x04; + } m_unk0x9c; // 0x9c MxS32 m_framesPerSecond; // 0xa4 MxS32 m_mediaFormat; // 0xa8 MxS32 m_paletteManagement; // 0xac MxLong m_sustainTime; // 0xb0 - undefined4 m_unkb4; // 0xb4 + undefined4 m_unk0xb4; // 0xb4 }; #endif // MXDSMEDIAACTION_H diff --git a/LEGO1/mxdsmultiaction.cpp b/LEGO1/mxdsmultiaction.cpp index 27cd806e..2b3c3801 100644 --- a/LEGO1/mxdsmultiaction.cpp +++ b/LEGO1/mxdsmultiaction.cpp @@ -40,14 +40,14 @@ MxDSMultiAction& MxDSMultiAction::operator=(MxDSMultiAction& p_dsMultiAction) } // FUNCTION: LEGO1 0x100ca290 -void MxDSMultiAction::SetUnkTimingField(MxLong p_unkTimingField) +void MxDSMultiAction::SetUnknown90(MxLong p_unk0x90) { - this->m_unkTimingField = p_unkTimingField; + this->m_unk0x90 = p_unk0x90; MxDSActionListCursor cursor(this->m_actions); MxDSAction* action; while (cursor.Next(action)) - action->SetUnkTimingField(p_unkTimingField); + action->SetUnknown90(p_unk0x90); } // FUNCTION: LEGO1 0x100ca370 @@ -89,14 +89,14 @@ MxDSAction* MxDSMultiAction::Clone() } // FUNCTION: LEGO1 0x100ca5e0 -undefined4 MxDSMultiAction::unk14() +undefined4 MxDSMultiAction::VTable0x14() { - undefined4 result = MxDSAction::unk14(); + undefined4 result = MxDSAction::VTable0x14(); MxDSActionListCursor cursor(this->m_actions); MxDSAction* action; while (cursor.Next(action)) - result += action->unk14(); + result += action->VTable0x14(); return result; } @@ -117,9 +117,9 @@ MxU32 MxDSMultiAction::GetSizeOnDisk() } // FUNCTION: LEGO1 0x100ca7b0 -void MxDSMultiAction::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSMultiAction::Deserialize(char** p_source, MxS16 p_unk0x24) { - MxDSAction::Deserialize(p_source, p_unk24); + MxDSAction::Deserialize(p_source, p_unk0x24); MxU32 extraFlag = *(MxU32*) (*p_source + 4) & 1; *p_source += 12; @@ -132,7 +132,7 @@ void MxDSMultiAction::Deserialize(char** p_source, MxS16 p_unk24) MxU32 extraFlag = *(MxU32*) (*p_source + 4) & 1; *p_source += 8; - MxDSAction* action = (MxDSAction*) DeserializeDSObjectDispatch(p_source, p_unk24); + MxDSAction* action = (MxDSAction*) DeserializeDSObjectDispatch(p_source, p_unk0x24); *p_source += extraFlag; this->m_actions->Append(action); diff --git a/LEGO1/mxdsmultiaction.h b/LEGO1/mxdsmultiaction.h index 0190e4cd..1f9b693b 100644 --- a/LEGO1/mxdsmultiaction.h +++ b/LEGO1/mxdsmultiaction.h @@ -22,19 +22,19 @@ public: } // FUNCTION: LEGO1 0x100c9f60 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSMultiAction::ClassName()) || MxDSAction::IsA(name); + return !strcmp(p_name, MxDSMultiAction::ClassName()) || MxDSAction::IsA(p_name); } - virtual undefined4 unk14() override; // vtable+14; - virtual MxU32 GetSizeOnDisk() override; // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24) override; // vtable+1c; - virtual void SetAtomId(MxAtomId p_atomId) override; // vtable+20; - virtual MxDSAction* Clone() override; // vtable+2c; - virtual void MergeFrom(MxDSAction& p_dsAction) override; // vtable+30; - virtual MxBool HasId(MxU32 p_objectId) override; // vtable+34; - virtual void SetUnkTimingField(MxLong p_unkTimingField) override; // vtable+38; + virtual undefined4 VTable0x14() override; // vtable+14; + virtual MxU32 GetSizeOnDisk() override; // vtable+18; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24) override; // vtable+1c; + virtual void SetAtomId(MxAtomId p_atomId) override; // vtable+20; + virtual MxDSAction* Clone() override; // vtable+2c; + virtual void MergeFrom(MxDSAction& p_dsAction) override; // vtable+30; + virtual MxBool HasId(MxU32 p_objectId) override; // vtable+34; + virtual void SetUnknown90(MxLong p_unk0x90) override; // vtable+38; inline MxDSActionList* GetActionList() const { return m_actions; }; diff --git a/LEGO1/mxdsobject.cpp b/LEGO1/mxdsobject.cpp index 4a90fc23..8b31e8c9 100644 --- a/LEGO1/mxdsobject.cpp +++ b/LEGO1/mxdsobject.cpp @@ -24,11 +24,11 @@ MxDSObject::MxDSObject() { this->SetType(MxDSType_Object); this->m_sourceName = NULL; - this->m_unk14 = 0; + this->m_unk0x14 = 0; this->m_objectName = NULL; - this->m_unk24 = -1; + this->m_unk0x24 = -1; this->m_objectId = -1; - this->m_unk28 = 0; + this->m_unk0x28 = 0; } // FUNCTION: LEGO1 0x100bf7e0 @@ -42,12 +42,12 @@ MxDSObject::~MxDSObject() void MxDSObject::CopyFrom(MxDSObject& p_dsObject) { this->SetSourceName(p_dsObject.m_sourceName); - this->m_unk14 = p_dsObject.m_unk14; + this->m_unk0x14 = p_dsObject.m_unk0x14; this->SetObjectName(p_dsObject.m_objectName); this->m_objectId = p_dsObject.m_objectId; - this->m_unk24 = p_dsObject.m_unk24; + this->m_unk0x24 = p_dsObject.m_unk0x24; this->m_atomId = p_dsObject.m_atomId; - this->m_unk28 = p_dsObject.m_unk28; + this->m_unk0x28 = p_dsObject.m_unk0x28; } // FUNCTION: LEGO1 0x100bf8c0 @@ -99,7 +99,7 @@ void MxDSObject::SetSourceName(const char* p_sourceName) } // FUNCTION: LEGO1 0x100bf9c0 -undefined4 MxDSObject::unk14() +undefined4 MxDSObject::VTable0x14() { return 10; } @@ -127,14 +127,14 @@ MxU32 MxDSObject::GetSizeOnDisk() } // FUNCTION: LEGO1 0x100bfa20 -void MxDSObject::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSObject::Deserialize(char** p_source, MxS16 p_unk0x24) { GetString(p_source, this->m_sourceName, this, &MxDSObject::SetSourceName); - GetScalar(p_source, this->m_unk14); + GetScalar(p_source, this->m_unk0x14); GetString(p_source, this->m_objectName, this, &MxDSObject::SetObjectName); GetScalar(p_source, this->m_objectId); - this->m_unk24 = p_unk24; + this->m_unk0x24 = p_unk0x24; } // FUNCTION: LEGO1 0x100bfb30 diff --git a/LEGO1/mxdsobject.h b/LEGO1/mxdsobject.h index 4760b3ca..3f47f13e 100644 --- a/LEGO1/mxdsobject.h +++ b/LEGO1/mxdsobject.h @@ -23,36 +23,36 @@ public: inline virtual const char* ClassName() const override { return "MxDSObject"; }; // vtable+0c // FUNCTION: LEGO1 0x100bf740 - inline virtual MxBool IsA(const char* name) const override + inline virtual MxBool IsA(const char* p_name) const override { - return !strcmp(name, MxDSObject::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxDSObject::ClassName()) || MxCore::IsA(p_name); }; // vtable+10; - virtual undefined4 unk14(); // vtable+14; + virtual undefined4 VTable0x14(); // vtable+14; virtual MxU32 GetSizeOnDisk(); // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24); // vtable+1c; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24); // vtable+1c; inline virtual void SetAtomId(MxAtomId p_atomId) { this->m_atomId = p_atomId; } // vtable+20; inline MxDSType GetType() const { return (MxDSType) this->m_type; } inline const char* GetSourceName() const { return this->m_sourceName; } inline MxU32 GetObjectId() { return this->m_objectId; } inline const MxAtomId& GetAtomId() { return this->m_atomId; } - inline MxS16 GetUnknown24() { return this->m_unk24; } + inline MxS16 GetUnknown24() { return this->m_unk0x24; } inline void SetType(MxDSType p_type) { this->m_type = p_type; } inline void SetObjectId(MxU32 p_objectId) { this->m_objectId = p_objectId; } - inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; } + inline void SetUnknown24(MxS16 p_unk0x24) { this->m_unk0x24 = p_unk0x24; } private: - MxU32 m_sizeOnDisk; // 0x8 - MxU16 m_type; // 0xc - char* m_sourceName; // 0x10 - undefined4 m_unk14; // 0x14 - char* m_objectName; // 0x18 - MxU32 m_objectId; // 0x1c - MxAtomId m_atomId; // 0x20 - MxS16 m_unk24; // 0x24 - undefined4 m_unk28; // 0x28 + MxU32 m_sizeOnDisk; // 0x8 + MxU16 m_type; // 0xc + char* m_sourceName; // 0x10 + undefined4 m_unk0x14; // 0x14 + char* m_objectName; // 0x18 + MxU32 m_objectId; // 0x1c + MxAtomId m_atomId; // 0x20 + MxS16 m_unk0x24; // 0x24 + undefined4 m_unk0x28; // 0x28 }; MxDSObject* DeserializeDSObjectDispatch(char**, MxS16); diff --git a/LEGO1/mxdsobjectaction.h b/LEGO1/mxdsobjectaction.h index 433dfa06..3286f110 100644 --- a/LEGO1/mxdsobjectaction.h +++ b/LEGO1/mxdsobjectaction.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100c88f0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSObjectAction::ClassName()) || MxDSMediaAction::IsA(name); + return !strcmp(p_name, MxDSObjectAction::ClassName()) || MxDSMediaAction::IsA(p_name); } virtual MxDSAction* Clone() override; // vtable+2c; diff --git a/LEGO1/mxdsparallelaction.h b/LEGO1/mxdsparallelaction.h index c5e8ae4a..65028ce3 100644 --- a/LEGO1/mxdsparallelaction.h +++ b/LEGO1/mxdsparallelaction.h @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x100caf10 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSParallelAction::ClassName()) || MxDSMultiAction::IsA(name); + return !strcmp(p_name, MxDSParallelAction::ClassName()) || MxDSMultiAction::IsA(p_name); } virtual MxLong GetDuration() override; // vtable+24; diff --git a/LEGO1/mxdsselectaction.cpp b/LEGO1/mxdsselectaction.cpp index 4bdfbd60..10825c54 100644 --- a/LEGO1/mxdsselectaction.cpp +++ b/LEGO1/mxdsselectaction.cpp @@ -74,10 +74,10 @@ MxU32 MxDSSelectAction::GetSizeOnDisk() } // FUNCTION: LEGO1 0x100cbf60 -void MxDSSelectAction::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSSelectAction::Deserialize(char** p_source, MxS16 p_unk0x24) { MxString string; - MxDSAction::Deserialize(p_source, p_unk24); + MxDSAction::Deserialize(p_source, p_unk0x24); MxU32 extraFlag = *(MxU32*) (*p_source + 4) & 1; *p_source += 12; @@ -117,7 +117,7 @@ void MxDSSelectAction::Deserialize(char** p_source, MxS16 p_unk24) MxU32 extraFlag = *(MxU32*) (*p_source + 4) & 1; *p_source += 8; - MxDSAction* action = (MxDSAction*) DeserializeDSObjectDispatch(p_source, p_unk24); + MxDSAction* action = (MxDSAction*) DeserializeDSObjectDispatch(p_source, p_unk0x24); if (index == i) this->m_actions->Append(action); diff --git a/LEGO1/mxdsselectaction.h b/LEGO1/mxdsselectaction.h index 44e40a2a..4f41f7d2 100644 --- a/LEGO1/mxdsselectaction.h +++ b/LEGO1/mxdsselectaction.h @@ -23,14 +23,14 @@ public: } // FUNCTION: LEGO1 0x100cb700 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSSelectAction::ClassName()) || MxDSParallelAction::IsA(name); + return !strcmp(p_name, MxDSSelectAction::ClassName()) || MxDSParallelAction::IsA(p_name); } - virtual MxU32 GetSizeOnDisk() override; // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24) override; // vtable+1c; - virtual MxDSAction* Clone() override; // vtable+2c; + virtual MxU32 GetSizeOnDisk() override; // vtable+18; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24) override; // vtable+1c; + virtual MxDSAction* Clone() override; // vtable+2c; private: MxString m_unk0x9c; diff --git a/LEGO1/mxdsserialaction.h b/LEGO1/mxdsserialaction.h index e6f6277f..ea758afa 100644 --- a/LEGO1/mxdsserialaction.h +++ b/LEGO1/mxdsserialaction.h @@ -22,9 +22,9 @@ public: } // FUNCTION: LEGO1 0x100caae0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSSerialAction::ClassName()) || MxDSMultiAction::IsA(name); + return !strcmp(p_name, MxDSSerialAction::ClassName()) || MxDSMultiAction::IsA(p_name); } virtual MxLong GetDuration() override; // vtable+24; diff --git a/LEGO1/mxdssound.cpp b/LEGO1/mxdssound.cpp index 09f5d6d4..1ff2a4d1 100644 --- a/LEGO1/mxdssound.cpp +++ b/LEGO1/mxdssound.cpp @@ -46,9 +46,9 @@ MxDSAction* MxDSSound::Clone() } // FUNCTION: LEGO1 0x100c95a0 -void MxDSSound::Deserialize(char** p_source, MxS16 p_unk24) +void MxDSSound::Deserialize(char** p_source, MxS16 p_unk0x24) { - MxDSMediaAction::Deserialize(p_source, p_unk24); + MxDSMediaAction::Deserialize(p_source, p_unk0x24); GetScalar(p_source, this->m_volume); } diff --git a/LEGO1/mxdssound.h b/LEGO1/mxdssound.h index cb1d21d5..0eaa5fce 100644 --- a/LEGO1/mxdssound.h +++ b/LEGO1/mxdssound.h @@ -21,14 +21,14 @@ public: } // FUNCTION: LEGO1 0x100c9340 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSSound::ClassName()) || MxDSMediaAction::IsA(name); + return !strcmp(p_name, MxDSSound::ClassName()) || MxDSMediaAction::IsA(p_name); } - virtual MxU32 GetSizeOnDisk() override; // vtable+18; - virtual void Deserialize(char** p_source, MxS16 p_unk24) override; // vtable+1c; - virtual MxDSAction* Clone() override; // vtable+2c; + virtual MxU32 GetSizeOnDisk() override; // vtable+18; + virtual void Deserialize(char** p_source, MxS16 p_unk0x24) override; // vtable+1c; + virtual MxDSAction* Clone() override; // vtable+2c; inline MxS32 GetVolume() const { return m_volume; } diff --git a/LEGO1/mxdssource.h b/LEGO1/mxdssource.h index 2a0847e9..724efca5 100644 --- a/LEGO1/mxdssource.h +++ b/LEGO1/mxdssource.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x100c0020 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSSource::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxDSSource::ClassName()) || MxCore::IsA(p_name); } virtual MxLong Open(MxULong) = 0; diff --git a/LEGO1/mxdsstill.h b/LEGO1/mxdsstill.h index 2da2602e..846f8293 100644 --- a/LEGO1/mxdsstill.h +++ b/LEGO1/mxdsstill.h @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x100c9940 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSStill::ClassName()) || MxDSMediaAction::IsA(name); + return !strcmp(p_name, MxDSStill::ClassName()) || MxDSMediaAction::IsA(p_name); } virtual MxDSAction* Clone() override; // vtable+2c; diff --git a/LEGO1/mxdsstreamingaction.cpp b/LEGO1/mxdsstreamingaction.cpp index 1117cdf4..e8eb4dc1 100644 --- a/LEGO1/mxdsstreamingaction.cpp +++ b/LEGO1/mxdsstreamingaction.cpp @@ -10,7 +10,7 @@ MxDSStreamingAction::MxDSStreamingAction(MxDSAction& p_dsAction, MxU32 p_offset) Init(); *this = p_dsAction; - this->m_unk94 = p_offset; + this->m_unk0x94 = p_offset; this->m_bufferOffset = p_offset; } @@ -32,10 +32,10 @@ MxDSStreamingAction::MxDSStreamingAction(MxDSStreamingAction& p_dsStreamingActio // FUNCTION: LEGO1 0x100cd150 MxDSStreamingAction::~MxDSStreamingAction() { - if (this->m_unka0) - delete this->m_unka0; - if (this->m_unka4) - delete this->m_unka4; + if (this->m_unk0xa0) + delete this->m_unk0xa0; + if (this->m_unk0xa4) + delete this->m_unk0xa4; if (this->m_internalAction) delete this->m_internalAction; } @@ -43,13 +43,13 @@ MxDSStreamingAction::~MxDSStreamingAction() // FUNCTION: LEGO1 0x100cd1e0 MxResult MxDSStreamingAction::Init() { - this->m_unk94 = 0; + this->m_unk0x94 = 0; this->m_bufferOffset = 0; - this->m_unk9c = 0; - this->m_unka0 = NULL; - this->m_unka4 = NULL; - this->m_unka8 = 0; - this->m_unkac = 2; + this->m_unk0x9c = 0; + this->m_unk0xa0 = NULL; + this->m_unk0xa4 = NULL; + this->m_unk0xa8 = 0; + this->m_unk0xac = 2; this->m_internalAction = NULL; return SUCCESS; } @@ -58,13 +58,13 @@ MxResult MxDSStreamingAction::Init() MxDSStreamingAction* MxDSStreamingAction::CopyFrom(MxDSStreamingAction& p_dsStreamingAction) { *this = p_dsStreamingAction; - this->m_unk94 = p_dsStreamingAction.m_unk94; + this->m_unk0x94 = p_dsStreamingAction.m_unk0x94; this->m_bufferOffset = p_dsStreamingAction.m_bufferOffset; - this->m_unk9c = p_dsStreamingAction.m_unk9c; - this->m_unka0 = NULL; - this->m_unka4 = NULL; - this->m_unkac = p_dsStreamingAction.m_unkac; - this->m_unka8 = p_dsStreamingAction.m_unka8; + this->m_unk0x9c = p_dsStreamingAction.m_unk0x9c; + this->m_unk0xa0 = NULL; + this->m_unk0xa4 = NULL; + this->m_unk0xac = p_dsStreamingAction.m_unk0xac; + this->m_unk0xa8 = p_dsStreamingAction.m_unk0xa8; SetInternalAction(p_dsStreamingAction.m_internalAction ? p_dsStreamingAction.m_internalAction->Clone() : NULL); return this; @@ -79,7 +79,7 @@ void MxDSStreamingAction::SetInternalAction(MxDSAction* p_dsAction) } // FUNCTION: LEGO1 0x100cd2d0 -void MxDSStreamingAction::FUN_100CD2D0() +void MxDSStreamingAction::FUN_100cd2d0() { if (this->m_duration == -1) return; @@ -88,5 +88,5 @@ void MxDSStreamingAction::FUN_100CD2D0() this->m_loopCount--; this->m_duration -= duration; - this->m_unka8 += duration; + this->m_unk0xa8 += duration; } diff --git a/LEGO1/mxdsstreamingaction.h b/LEGO1/mxdsstreamingaction.h index b5a1e6c1..63c22b8d 100644 --- a/LEGO1/mxdsstreamingaction.h +++ b/LEGO1/mxdsstreamingaction.h @@ -29,16 +29,16 @@ public: MxResult Init(); void SetInternalAction(MxDSAction* p_dsAction); - void FUN_100CD2D0(); + void FUN_100cd2d0(); private: - MxU32 m_unk94; + MxU32 m_unk0x94; MxU32 m_bufferOffset; - MxS32 m_unk9c; - MxDSBuffer* m_unka0; - MxDSBuffer* m_unka4; - MxLong m_unka8; - undefined2 m_unkac; + MxS32 m_unk0x9c; + MxDSBuffer* m_unk0xa0; + MxDSBuffer* m_unk0xa4; + MxLong m_unk0xa8; + undefined2 m_unk0xac; MxDSAction* m_internalAction; }; diff --git a/LEGO1/mxdssubscriber.h b/LEGO1/mxdssubscriber.h index 112a38e1..2cba7416 100644 --- a/LEGO1/mxdssubscriber.h +++ b/LEGO1/mxdssubscriber.h @@ -23,9 +23,9 @@ public: } // FUNCTION: LEGO1 0x100b7d60 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxDSSubscriber::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxDSSubscriber::ClassName()) || MxCore::IsA(p_name); } MxResult FUN_100b7ed0(MxStreamController*, MxU32, MxS16); diff --git a/LEGO1/mxentity.h b/LEGO1/mxentity.h index 7950bca5..a83462cd 100644 --- a/LEGO1/mxentity.h +++ b/LEGO1/mxentity.h @@ -22,9 +22,9 @@ public: } // FUNCTION: LEGO1 0x1000c190 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxEntity::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxEntity::ClassName()) || MxCore::IsA(p_name); } virtual MxResult Create(MxS32 p_id, const MxAtomId& p_atom); // vtable+0x14 diff --git a/LEGO1/mxeventpresenter.h b/LEGO1/mxeventpresenter.h index 6010c894..d022f609 100644 --- a/LEGO1/mxeventpresenter.h +++ b/LEGO1/mxeventpresenter.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x100c2c40 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxEventPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, MxEventPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 diff --git a/LEGO1/mxflcpresenter.h b/LEGO1/mxflcpresenter.h index 5790999d..393e2810 100644 --- a/LEGO1/mxflcpresenter.h +++ b/LEGO1/mxflcpresenter.h @@ -14,9 +14,9 @@ public: virtual ~MxFlcPresenter() override; // FUNCTION: LEGO1 0x1004e200 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxFlcPresenter::ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, MxFlcPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } // FUNCTION: LEGO1 0x100b33f0 diff --git a/LEGO1/mxhashtable.h b/LEGO1/mxhashtable.h index b09bf28c..8d6be0cf 100644 --- a/LEGO1/mxhashtable.h +++ b/LEGO1/mxhashtable.h @@ -57,7 +57,7 @@ public: friend class MxHashTableCursor<T>; protected: - void _NodeInsert(MxHashTableNode<T>*); + void NodeInsert(MxHashTableNode<T>*); MxHashTableNode<T>** m_slots; // 0x10 MxU32 m_numSlots; // 0x14 @@ -173,8 +173,8 @@ inline void MxHashTable<T>::Resize() { // Save a reference to the current table // so we can walk nodes and re-insert - MxU32 old_size = m_numSlots; - MxHashTableNode<T>** old_table = m_slots; + MxU32 oldSize = m_numSlots; + MxHashTableNode<T>** oldTable = m_slots; switch (m_resizeOption) { case HashTableOpt_ExpandAdd: @@ -185,26 +185,26 @@ inline void MxHashTable<T>::Resize() break; } - MxHashTableNode<T>** new_table = new MxHashTableNode<T>*[m_numSlots]; - m_slots = new_table; + MxHashTableNode<T>** newTable = new MxHashTableNode<T>*[m_numSlots]; + m_slots = newTable; memset(m_slots, 0, sizeof(MxHashTableNode<T>*) * m_numSlots); this->m_count = 0; - for (MxS32 i = 0; i != old_size; i++) { - MxHashTableNode<T>* t = old_table[i]; + for (MxS32 i = 0; i != oldSize; i++) { + MxHashTableNode<T>* t = oldTable[i]; while (t) { MxHashTableNode<T>* next = t->m_next; - _NodeInsert(t); + NodeInsert(t); t = next; } } - delete[] old_table; + delete[] oldTable; } template <class T> -inline void MxHashTable<T>::_NodeInsert(MxHashTableNode<T>* p_node) +inline void MxHashTable<T>::NodeInsert(MxHashTableNode<T>* p_node) { MxS32 bucket = p_node->m_hash % m_numSlots; @@ -226,7 +226,7 @@ inline void MxHashTable<T>::Add(T p_newobj) MxU32 hash = Hash(p_newobj); MxHashTableNode<T>* node = new MxHashTableNode<T>(p_newobj, hash); - MxHashTable<T>::_NodeInsert(node); + MxHashTable<T>::NodeInsert(node); } #undef HASH_TABLE_INIT_SIZE diff --git a/LEGO1/mxioinfo.cpp b/LEGO1/mxioinfo.cpp index 3468fb63..9951c174 100644 --- a/LEGO1/mxioinfo.cpp +++ b/LEGO1/mxioinfo.cpp @@ -22,14 +22,14 @@ MXIOINFO::~MXIOINFO() // FUNCTION: LEGO1 0x100cc830 MxU16 MXIOINFO::Open(const char* p_filename, MxULong p_flags) { - OFSTRUCT _unused; + OFSTRUCT unused; MxU16 result = 0; m_info.lBufOffset = 0; m_info.lDiskOffset = 0; // DECOMP: Cast of p_flags to u16 forces the `movzx` instruction - m_info.hmmio = (HMMIO) OpenFile(p_filename, &_unused, (MxU16) p_flags); + m_info.hmmio = (HMMIO) OpenFile(p_filename, &unused, (MxU16) p_flags); if ((HFILE) m_info.hmmio != HFILE_ERROR) { m_info.dwFlags = p_flags; @@ -87,45 +87,45 @@ MxU16 MXIOINFO::Close(MxLong p_unused) // FUNCTION: LEGO1 0x100cc930 MxLong MXIOINFO::Read(void* p_buf, MxLong p_len) { - MxLong bytes_read = 0; + MxLong bytesRead = 0; if (m_info.pchBuffer) { - MxLong bytes_left = m_info.pchEndRead - m_info.pchNext; + MxLong bytesLeft = m_info.pchEndRead - m_info.pchNext; while (p_len > 0) { - if (bytes_left > 0) { - if (p_len < bytes_left) - bytes_left = p_len; + if (bytesLeft > 0) { + if (p_len < bytesLeft) + bytesLeft = p_len; - memcpy(p_buf, m_info.pchNext, bytes_left); - p_len -= bytes_left; + memcpy(p_buf, m_info.pchNext, bytesLeft); + p_len -= bytesLeft; - m_info.pchNext += bytes_left; - bytes_read += bytes_left; + m_info.pchNext += bytesLeft; + bytesRead += bytesLeft; } if (p_len <= 0 || Advance(0)) break; - bytes_left = m_info.pchEndRead - m_info.pchNext; - if (bytes_left <= 0) + bytesLeft = m_info.pchEndRead - m_info.pchNext; + if (bytesLeft <= 0) break; } } else if (m_info.hmmio && p_len > 0) { - bytes_read = _hread((HFILE) m_info.hmmio, p_buf, p_len); + bytesRead = _hread((HFILE) m_info.hmmio, p_buf, p_len); - if (bytes_read == -1) { - bytes_read = 0; + if (bytesRead == -1) { + bytesRead = 0; m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); } else { - m_info.lDiskOffset += bytes_read; + m_info.lDiskOffset += bytesRead; } } - return bytes_read; + return bytesRead; } // FUNCTION: LEGO1 0x100cca00 @@ -171,13 +171,13 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin) else { // align offset to buffer size - MxLong new_offset = p_offset - (p_offset % m_info.cchBuffer); - m_info.lBufOffset = new_offset; + MxLong newOffset = p_offset - (p_offset % m_info.cchBuffer); + m_info.lBufOffset = newOffset; // do we need to seek again? // (i.e. are we already aligned to buffer size?) - if (p_offset != new_offset) { - m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, new_offset, SEEK_SET); + if (p_offset != newOffset) { + m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, newOffset, SEEK_SET); if (m_info.lDiskOffset == -1) { m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); @@ -194,15 +194,15 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin) } else { // We can read from the file. Fill the buffer. - MxLong bytes_read = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, m_info.cchBuffer); + MxLong bytesRead = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, m_info.cchBuffer); - if (bytes_read == -1) { + if (bytesRead == -1) { m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); } else { - m_info.lDiskOffset += bytes_read; + m_info.lDiskOffset += bytesRead; m_info.pchNext = p_offset - m_info.lBufOffset + m_info.pchBuffer; - m_info.pchEndRead = m_info.pchBuffer + bytes_read; + m_info.pchEndRead = m_info.pchBuffer + bytesRead; if (m_info.pchNext < m_info.pchEndRead) { result = p_offset; @@ -278,10 +278,10 @@ MxU16 MXIOINFO::Flush(MxU16 p_unused) m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); } else { - MxLong bytes_written = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cchBuffer); + MxLong bytesWritten = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cchBuffer); - if (bytes_written != -1 && bytes_written == cchBuffer) { - m_info.lDiskOffset += bytes_written; + if (bytesWritten != -1 && bytesWritten == cchBuffer) { + m_info.lDiskOffset += bytesWritten; m_info.pchNext = m_info.pchBuffer; m_info.dwFlags &= ~MMIO_DIRTY; } @@ -327,10 +327,10 @@ MxU16 MXIOINFO::Advance(MxU16 p_option) result = MMIOERR_CANNOTSEEK; } else { - MxLong bytes_written = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cch); + MxLong bytesWritten = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cch); - if (bytes_written != -1 && bytes_written == cch) { - m_info.lDiskOffset += bytes_written; + if (bytesWritten != -1 && bytesWritten == cch) { + m_info.lDiskOffset += bytesWritten; m_info.pchNext = m_info.pchBuffer; m_info.pchEndRead = m_info.pchBuffer; m_info.dwFlags &= ~MMIO_DIRTY; @@ -355,16 +355,16 @@ MxU16 MXIOINFO::Advance(MxU16 p_option) m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); } else { - MxLong bytes_read = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, cch); + MxLong bytesRead = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, cch); - if (bytes_read == -1) { + if (bytesRead == -1) { result = MMIOERR_CANNOTREAD; m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR); } else { - m_info.lDiskOffset += bytes_read; + m_info.lDiskOffset += bytesRead; m_info.pchNext = m_info.pchBuffer; - m_info.pchEndRead = m_info.pchBuffer + bytes_read; + m_info.pchEndRead = m_info.pchBuffer + bytesRead; } } } @@ -410,18 +410,18 @@ MxU16 MXIOINFO::Descend(MMCKINFO* p_chunkInfo, const MMCKINFO* p_parentInfo, MxU ofs = p_parentInfo->cksize + p_parentInfo->dwDataOffset; BOOL running = TRUE; - BOOL read_ok = FALSE; + BOOL readOk = FALSE; MMCKINFO tmp; tmp.dwFlags = 0; while (running) { if (Read(&tmp, 8) != 8) { // If the first read fails, report read error. Else EOF. - result = read_ok ? MMIOERR_CHUNKNOTFOUND : MMIOERR_CANNOTREAD; + result = readOk ? MMIOERR_CHUNKNOTFOUND : MMIOERR_CANNOTREAD; running = FALSE; } else { - read_ok = TRUE; + readOk = TRUE; if (m_info.pchBuffer) { tmp.dwDataOffset = m_info.pchNext - m_info.pchBuffer + m_info.lBufOffset; } diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index 83b465b9..d88b6f64 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -59,7 +59,7 @@ public: virtual ~MxList() override; - void Append(T p_obj) { _InsertEntry(p_obj, this->m_last, NULL); }; + void Append(T p_obj) { InsertEntry(p_obj, this->m_last, NULL); }; void DeleteAll(MxBool p_destroy = TRUE); MxU32 GetCount() { return this->m_count; } void SetDestroy(void (*p_customDestructor)(T)) { this->m_customDestructor = p_customDestructor; } @@ -70,8 +70,8 @@ protected: MxListEntry<T>* m_first; // 0x10 MxListEntry<T>* m_last; // 0x14 - void _DeleteEntry(MxListEntry<T>* match); - MxListEntry<T>* _InsertEntry(T, MxListEntry<T>*, MxListEntry<T>*); + void DeleteEntry(MxListEntry<T>*); + MxListEntry<T>* InsertEntry(T, MxListEntry<T>*, MxListEntry<T>*); }; template <class T> @@ -141,7 +141,7 @@ inline void MxList<T>::DeleteAll(MxBool p_destroy) } template <class T> -inline MxListEntry<T>* MxList<T>::_InsertEntry(T p_newobj, MxListEntry<T>* p_prev, MxListEntry<T>* p_next) +inline MxListEntry<T>* MxList<T>::InsertEntry(T p_newobj, MxListEntry<T>* p_prev, MxListEntry<T>* p_next) { MxListEntry<T>* newEntry = new MxListEntry<T>(p_newobj, p_prev, p_next); @@ -160,19 +160,19 @@ inline MxListEntry<T>* MxList<T>::_InsertEntry(T p_newobj, MxListEntry<T>* p_pre } template <class T> -inline void MxList<T>::_DeleteEntry(MxListEntry<T>* match) +inline void MxList<T>::DeleteEntry(MxListEntry<T>* p_match) { - if (match->GetPrev()) - match->GetPrev()->SetNext(match->GetNext()); + if (p_match->GetPrev()) + p_match->GetPrev()->SetNext(p_match->GetNext()); else - m_first = match->GetNext(); + m_first = p_match->GetNext(); - if (match->GetNext()) - match->GetNext()->SetPrev(match->GetPrev()); + if (p_match->GetNext()) + p_match->GetNext()->SetPrev(p_match->GetPrev()); else - m_last = match->GetPrev(); + m_last = p_match->GetPrev(); - delete match; + delete p_match; this->m_count--; } @@ -189,7 +189,7 @@ inline MxBool MxListCursor<T>::Find(T p_obj) template <class T> inline void MxListCursor<T>::Detach() { - m_list->_DeleteEntry(m_match); + m_list->DeleteEntry(m_match); m_match = NULL; } @@ -247,7 +247,7 @@ template <class T> inline void MxListCursor<T>::Prepend(T p_newobj) { if (m_match) - m_list->_InsertEntry(p_newobj, m_match->GetPrev(), m_match); + m_list->InsertEntry(p_newobj, m_match->GetPrev(), m_match); } #endif // MXLIST_H diff --git a/LEGO1/mxloopingflcpresenter.cpp b/LEGO1/mxloopingflcpresenter.cpp index c06c8f42..4a8b3ff1 100644 --- a/LEGO1/mxloopingflcpresenter.cpp +++ b/LEGO1/mxloopingflcpresenter.cpp @@ -19,7 +19,7 @@ MxLoopingFlcPresenter::~MxLoopingFlcPresenter() // FUNCTION: LEGO1 0x100b4410 void MxLoopingFlcPresenter::Init() { - this->m_unk68 = 0; + this->m_unk0x68 = 0; this->m_flags &= 0xfd; this->m_flags &= 0xfb; } @@ -42,7 +42,7 @@ void MxLoopingFlcPresenter::NextFrame() else { LoadFrame(chunk); AppendChunk(chunk); - m_unk68 += m_flicHeader->speed; + m_unk0x68 += m_flicHeader->speed; } m_subscriber->FUN_100b8390(chunk); diff --git a/LEGO1/mxloopingflcpresenter.h b/LEGO1/mxloopingflcpresenter.h index d7c18546..e4f781c9 100644 --- a/LEGO1/mxloopingflcpresenter.h +++ b/LEGO1/mxloopingflcpresenter.h @@ -24,7 +24,7 @@ private: void Init(); void Destroy(MxBool p_fromDestructor); - undefined4 m_unk68; + undefined4 m_unk0x68; }; #endif // MXLOOPINGFLCPRESENTER_H diff --git a/LEGO1/mxloopingmidipresenter.h b/LEGO1/mxloopingmidipresenter.h index a8fe2664..49df30f4 100644 --- a/LEGO1/mxloopingmidipresenter.h +++ b/LEGO1/mxloopingmidipresenter.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x100b1840 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxLoopingMIDIPresenter::ClassName()) || MxMIDIPresenter::IsA(name); + return !strcmp(p_name, MxLoopingMIDIPresenter::ClassName()) || MxMIDIPresenter::IsA(p_name); } virtual void StreamingTickle() override; // vtable+0x20 diff --git a/LEGO1/mxloopingsmkpresenter.cpp b/LEGO1/mxloopingsmkpresenter.cpp index ce4f41c2..26cf3d43 100644 --- a/LEGO1/mxloopingsmkpresenter.cpp +++ b/LEGO1/mxloopingsmkpresenter.cpp @@ -19,7 +19,7 @@ MxLoopingSmkPresenter::~MxLoopingSmkPresenter() // FUNCTION: LEGO1 0x100b49b0 void MxLoopingSmkPresenter::Init() { - this->m_unk720 = 0; + this->m_unk0x720 = 0; this->m_flags &= 0xfd; this->m_flags &= 0xfb; } diff --git a/LEGO1/mxloopingsmkpresenter.h b/LEGO1/mxloopingsmkpresenter.h index 16061cee..b2eba1ca 100644 --- a/LEGO1/mxloopingsmkpresenter.h +++ b/LEGO1/mxloopingsmkpresenter.h @@ -22,7 +22,7 @@ private: void Init(); void Destroy(MxBool p_fromDestructor); - undefined4 m_unk720; + undefined4 m_unk0x720; }; #endif // MXLOOPINGSMKPRESENTER_H diff --git a/LEGO1/mxmediapresenter.cpp b/LEGO1/mxmediapresenter.cpp index b1b064cc..2826781c 100644 --- a/LEGO1/mxmediapresenter.cpp +++ b/LEGO1/mxmediapresenter.cpp @@ -255,7 +255,7 @@ void MxMediaPresenter::Enable(MxBool p_enable) if (p_enable) { MxLong time = Timer()->GetTime(); - m_action->SetUnkTimingField(time); + m_action->SetUnknown90(time); SetTickleState(TickleState_Repeating); } else { diff --git a/LEGO1/mxmediapresenter.h b/LEGO1/mxmediapresenter.h index 8807bcd2..6e75000f 100644 --- a/LEGO1/mxmediapresenter.h +++ b/LEGO1/mxmediapresenter.h @@ -23,9 +23,9 @@ public: } // FUNCTION: LEGO1 0x1000c5d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxMediaPresenter::ClassName()) || MxPresenter::IsA(name); + return !strcmp(p_name, MxMediaPresenter::ClassName()) || MxPresenter::IsA(p_name); } virtual void StreamingTickle() override; // vtable+0x20 diff --git a/LEGO1/mxmidipresenter.h b/LEGO1/mxmidipresenter.h index 7e642383..09e11dde 100644 --- a/LEGO1/mxmidipresenter.h +++ b/LEGO1/mxmidipresenter.h @@ -19,9 +19,9 @@ public: } // FUNCTION: LEGO1 0x100c2660 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxMIDIPresenter::ClassName()) || MxMusicPresenter::IsA(name); + return !strcmp(p_name, MxMIDIPresenter::ClassName()) || MxMusicPresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 diff --git a/LEGO1/mxmusicmanager.cpp b/LEGO1/mxmusicmanager.cpp index 4541cf19..244e3861 100644 --- a/LEGO1/mxmusicmanager.cpp +++ b/LEGO1/mxmusicmanager.cpp @@ -29,14 +29,14 @@ void MxMusicManager::Init() // FUNCTION: LEGO1 0x100c06a0 void MxMusicManager::InitData() { - m_MIDIStreamH = 0; - m_MIDIInitialized = FALSE; - m_unk38 = 0; - m_unk3c = 0; - m_unk40 = 0; - m_unk44 = 0; - m_unk48 = 0; - m_MIDIHdrP = NULL; + m_midiStreamH = 0; + m_midiInitialized = FALSE; + m_unk0x38 = 0; + m_unk0x3c = 0; + m_unk0x40 = 0; + m_unk0x44 = 0; + m_unk0x48 = 0; + m_midiHdrP = NULL; } // FUNCTION: LEGO1 0x100c06c0 @@ -66,7 +66,7 @@ void MxMusicManager::Destroy(MxBool p_fromDestructor) void MxMusicManager::SetMIDIVolume() { MxS32 result = (m_volume * m_multiplier) / 0x64; - HMIDISTRM streamHandle = m_MIDIStreamH; + HMIDISTRM streamHandle = m_midiStreamH; if (streamHandle) { MxS32 volume = CalculateVolume(result); @@ -148,13 +148,13 @@ void MxMusicManager::DeinitializeMIDI() { m_criticalSection.Enter(); - if (m_MIDIInitialized) { - m_MIDIInitialized = FALSE; - midiStreamStop(m_MIDIStreamH); - midiOutUnprepareHeader((HMIDIOUT) m_MIDIStreamH, m_MIDIHdrP, sizeof(MIDIHDR)); - midiOutSetVolume((HMIDIOUT) m_MIDIStreamH, m_MIDIVolume); - midiStreamClose(m_MIDIStreamH); - delete m_MIDIHdrP; + if (m_midiInitialized) { + m_midiInitialized = FALSE; + midiStreamStop(m_midiStreamH); + midiOutUnprepareHeader((HMIDIOUT) m_midiStreamH, m_midiHdrP, sizeof(MIDIHDR)); + midiOutSetVolume((HMIDIOUT) m_midiStreamH, m_midiVolume); + midiStreamClose(m_midiStreamH); + delete m_midiHdrP; InitData(); } diff --git a/LEGO1/mxmusicmanager.h b/LEGO1/mxmusicmanager.h index 7b594803..d9f6d46d 100644 --- a/LEGO1/mxmusicmanager.h +++ b/LEGO1/mxmusicmanager.h @@ -15,7 +15,7 @@ public: virtual void SetVolume(MxS32 p_volume) override; // vtable+2c virtual MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread); // vtable+30 - inline MxBool GetMIDIInitialized() { return m_MIDIInitialized; } + inline MxBool GetMIDIInitialized() { return m_midiInitialized; } void DeinitializeMIDI(); undefined4 FUN_100c09c0(MxU8* p_data, MxS32 p_loopCount); @@ -27,16 +27,16 @@ private: MxS32 CalculateVolume(MxS32 p_volume); void SetMIDIVolume(); - HMIDISTRM m_MIDIStreamH; // 0x30 - MxBool m_MIDIInitialized; // 0x34 - undefined4 m_unk38; // 0x38 - undefined4 m_unk3c; // 0x3c - undefined4 m_unk40; // 0x40 - undefined4 m_unk44; // 0x44 - undefined4 m_unk48; // 0x48 - MIDIHDR* m_MIDIHdrP; // 0x4c + HMIDISTRM m_midiStreamH; // 0x30 + MxBool m_midiInitialized; // 0x34 + undefined4 m_unk0x38; // 0x38 + undefined4 m_unk0x3c; // 0x3c + undefined4 m_unk0x40; // 0x40 + undefined4 m_unk0x44; // 0x44 + undefined4 m_unk0x48; // 0x48 + MIDIHDR* m_midiHdrP; // 0x4c MxS32 m_multiplier; // 0x50 - DWORD m_MIDIVolume; // 0x54 + DWORD m_midiVolume; // 0x54 protected: void Init(); diff --git a/LEGO1/mxmusicpresenter.h b/LEGO1/mxmusicpresenter.h index c4587786..965c38df 100644 --- a/LEGO1/mxmusicpresenter.h +++ b/LEGO1/mxmusicpresenter.h @@ -18,9 +18,9 @@ public: } // FUNCTION: LEGO1 0x100c23b0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxMusicPresenter::ClassName()) || MxAudioPresenter::IsA(name); + return !strcmp(p_name, MxMusicPresenter::ClassName()) || MxAudioPresenter::IsA(p_name); } virtual MxResult AddToManager() override; // vtable+0x34 diff --git a/LEGO1/mxnextactiondatastart.h b/LEGO1/mxnextactiondatastart.h index ecad22e4..10d2a2f2 100644 --- a/LEGO1/mxnextactiondatastart.h +++ b/LEGO1/mxnextactiondatastart.h @@ -8,10 +8,10 @@ class MxNextActionDataStart : public MxCore { public: // inlined constructor at 0x100c1847 - inline MxNextActionDataStart(MxU32 p_objectId, MxS16 p_unk24val, MxU32 p_data) + inline MxNextActionDataStart(MxU32 p_objectId, MxS16 p_unk0x24, MxU32 p_data) { m_objectId = p_objectId; - m_unk24val = p_unk24val; + m_unk0x24 = p_unk0x24; m_data = p_data; } @@ -23,17 +23,17 @@ public: } // FUNCTION: LEGO1 0x100c1910 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxNextActionDataStart::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxNextActionDataStart::ClassName()) || MxCore::IsA(p_name); } inline MxU32 GetObjectId() const { return m_objectId; } - inline MxS16 GetUnknown24() const { return m_unk24val; } + inline MxS16 GetUnknown24() const { return m_unk0x24; } private: MxU32 m_objectId; - MxS16 m_unk24val; + MxS16 m_unk0x24; MxU32 m_data; }; diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp index f7bdcd70..cc9f3930 100644 --- a/LEGO1/mxnotificationmanager.cpp +++ b/LEGO1/mxnotificationmanager.cpp @@ -27,7 +27,7 @@ MxNotification::~MxNotification() // FUNCTION: LEGO1 0x100ac250 MxNotificationManager::MxNotificationManager() : MxCore(), m_lock(), m_listenerIds() { - m_unk2c = 0; + m_unk0x2c = 0; m_queue = NULL; m_active = TRUE; m_sendList = NULL; diff --git a/LEGO1/mxnotificationmanager.h b/LEGO1/mxnotificationmanager.h index 9ab9c733..4a3d8726 100644 --- a/LEGO1/mxnotificationmanager.h +++ b/LEGO1/mxnotificationmanager.h @@ -30,7 +30,7 @@ private: MxNotificationPtrList* m_queue; // 0x8 MxNotificationPtrList* m_sendList; // 0xc MxCriticalSection m_lock; // 0x10 - MxS32 m_unk2c; // 0x2c + MxS32 m_unk0x2c; // 0x2c MxIdList m_listenerIds; // 0x30 MxBool m_active; // 0x3c diff --git a/LEGO1/mxobjectfactory.h b/LEGO1/mxobjectfactory.h index 2781852d..cfc97308 100644 --- a/LEGO1/mxobjectfactory.h +++ b/LEGO1/mxobjectfactory.h @@ -31,9 +31,9 @@ public: } // FUNCTION: LEGO1 0x10008f80 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxObjectFactory::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxObjectFactory::ClassName()) || MxCore::IsA(p_name); } virtual MxCore* Create(const char* p_name); // vtable 0x14 diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index 9e4949f5..7a7560a5 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -33,8 +33,8 @@ void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last) action.SetAtomId(*p_id); action.SetUnknown24(-2); - for (MxS32 l_first = p_first, l_last = p_last; l_first <= l_last; l_first++) { - action.SetObjectId(l_first); + for (MxS32 first = p_first, last = p_last; first <= last; first++) { + action.SetObjectId(first); DeleteObject(action); } } @@ -159,43 +159,43 @@ void MxOmni::Init() } // FUNCTION: LEGO1 0x100af0b0 -void MxOmni::SetInstance(MxOmni* instance) +void MxOmni::SetInstance(MxOmni* p_instance) { - g_instance = instance; + g_instance = p_instance; } // FUNCTION: LEGO1 0x100af0c0 -MxResult MxOmni::Create(MxOmniCreateParam& p) +MxResult MxOmni::Create(MxOmniCreateParam& p_param) { MxResult result = FAILURE; if (!(m_atomIdCounterSet = new MxAtomIdCounterSet())) goto done; - m_mediaPath = p.GetMediaPath(); - m_windowHandle = p.GetWindowHandle(); + m_mediaPath = p_param.GetMediaPath(); + m_windowHandle = p_param.GetWindowHandle(); - if (p.CreateFlags().CreateObjectFactory()) { + if (p_param.CreateFlags().CreateObjectFactory()) { if (!(m_objectFactory = new MxObjectFactory())) goto done; } - if (p.CreateFlags().CreateVariableTable()) { + if (p_param.CreateFlags().CreateVariableTable()) { if (!(m_variableTable = new MxVariableTable())) goto done; } - if (p.CreateFlags().CreateTimer()) { + if (p_param.CreateFlags().CreateTimer()) { if (!(m_timer = new MxTimer())) goto done; } - if (p.CreateFlags().CreateTickleManager()) { + if (p_param.CreateFlags().CreateTickleManager()) { if (!(m_tickleManager = new MxTickleManager())) goto done; } - if (p.CreateFlags().CreateNotificationManager()) { + if (p_param.CreateFlags().CreateNotificationManager()) { if (m_notificationManager = new MxNotificationManager()) { if (m_notificationManager->Create(100, 0) != SUCCESS) goto done; @@ -204,21 +204,21 @@ MxResult MxOmni::Create(MxOmniCreateParam& p) goto done; } - if (p.CreateFlags().CreateStreamer()) { + if (p_param.CreateFlags().CreateStreamer()) { if (!(m_streamer = new MxStreamer()) || m_streamer->Create() != SUCCESS) goto done; } - if (p.CreateFlags().CreateVideoManager()) { + if (p_param.CreateFlags().CreateVideoManager()) { if (m_videoManager = new MxVideoManager()) { - if (m_videoManager->Create(p.GetVideoParam(), 100, 0) != SUCCESS) { + if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) { delete m_videoManager; m_videoManager = NULL; } } } - if (p.CreateFlags().CreateSoundManager()) { + if (p_param.CreateFlags().CreateSoundManager()) { if (m_soundManager = new MxSoundManager()) { if (m_soundManager->Create(10, 0) != SUCCESS) { delete m_soundManager; @@ -227,7 +227,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p) } } - if (p.CreateFlags().CreateMusicManager()) { + if (p_param.CreateFlags().CreateMusicManager()) { if (m_musicManager = new MxMusicManager()) { if (m_musicManager->Create(50, 0) != SUCCESS) { delete m_musicManager; @@ -236,7 +236,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p) } } - if (p.CreateFlags().CreateEventManager()) { + if (p_param.CreateFlags().CreateEventManager()) { if (m_eventManager = new MxEventManager()) { if (m_eventManager->Create(50, 0) != SUCCESS) { delete m_eventManager; @@ -339,14 +339,14 @@ void MxOmni::DestroyInstance() } // FUNCTION: LEGO1 0x100b07f0 -MxLong MxOmni::Notify(MxParam& p) +MxLong MxOmni::Notify(MxParam& p_param) { MxAutoLocker lock(&this->m_criticalsection); - if (((MxNotificationParam&) p).GetNotification() != c_notificationEndAction) + if (((MxNotificationParam&) p_param).GetNotification() != c_notificationEndAction) return 0; - return HandleNotificationType2(p); + return HandleNotificationType2(p_param); } // STUB: LEGO1 0x100b0880 @@ -387,9 +387,9 @@ MxBool MxOmni::IsSound3D() } // FUNCTION: LEGO1 0x100b0990 -void MxOmni::SetSound3D(MxBool p_3dsound) +void MxOmni::SetSound3D(MxBool p_use3dSound) { - g_use3dSound = p_3dsound; + g_use3dSound = p_use3dSound; } // FUNCTION: LEGO1 0x100b09a0 diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 246ae2fc..2f8f1efd 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -34,14 +34,14 @@ public: __declspec(dllexport) static MxBool IsSound3D(); __declspec(dllexport) static void SetCD(const char* p_cd); __declspec(dllexport) static void SetHD(const char* p_hd); - __declspec(dllexport) static void SetSound3D(MxBool p_3dsound); + __declspec(dllexport) static void SetSound3D(MxBool p_use3dSound); MxOmni(); virtual ~MxOmni() override; - virtual MxLong Notify(MxParam& p) override; // vtable+04 + virtual MxLong Notify(MxParam& p_param) override; // vtable+04 virtual void Init(); // vtable+14 - virtual MxResult Create(MxOmniCreateParam& p); // vtable+18 + virtual MxResult Create(MxOmniCreateParam& p_param); // vtable+18 virtual void Destroy(); // vtable+1c virtual MxResult Start(MxDSAction* p_dsAction); // vtable+20 virtual MxResult DeleteObject(MxDSAction& p_dsAction); // vtable+24 @@ -52,7 +52,7 @@ public: virtual void StartTimer(); // vtable+38 virtual void StopTimer(); // vtable+3c virtual MxBool IsTimerRunning(); // vtable+40 - static void SetInstance(MxOmni* instance); + static void SetInstance(MxOmni* p_instance); HWND GetWindowHandle() const { return this->m_windowHandle; } MxObjectFactory* GetObjectFactory() const { return this->m_objectFactory; } MxNotificationManager* GetNotificationManager() const { return this->m_notificationManager; } diff --git a/LEGO1/mxomnicreateflags.h b/LEGO1/mxomnicreateflags.h index f3490a70..a94ed45a 100644 --- a/LEGO1/mxomnicreateflags.h +++ b/LEGO1/mxomnicreateflags.h @@ -35,60 +35,60 @@ public: inline const MxBool CreateTimer() const { return this->m_flags2 & Flag_CreateTimer; } inline const MxBool CreateStreamer() const { return this->m_flags2 & Flag_CreateStreamer; } - inline void CreateObjectFactory(MxBool b) + inline void CreateObjectFactory(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateObjectFactory : this->m_flags1 & ~Flag_CreateObjectFactory); + (p_enable ? this->m_flags1 | Flag_CreateObjectFactory : this->m_flags1 & ~Flag_CreateObjectFactory); } - inline void CreateVariableTable(MxBool b) + inline void CreateVariableTable(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateVariableTable : this->m_flags1 & ~Flag_CreateVariableTable); + (p_enable ? this->m_flags1 | Flag_CreateVariableTable : this->m_flags1 & ~Flag_CreateVariableTable); } - inline void CreateTickleManager(MxBool b) + inline void CreateTickleManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateTickleManager : this->m_flags1 & ~Flag_CreateTickleManager); + (p_enable ? this->m_flags1 | Flag_CreateTickleManager : this->m_flags1 & ~Flag_CreateTickleManager); } - inline void CreateNotificationManager(MxBool b) + inline void CreateNotificationManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateNotificationManager - : this->m_flags1 & ~Flag_CreateNotificationManager); + (p_enable ? this->m_flags1 | Flag_CreateNotificationManager + : this->m_flags1 & ~Flag_CreateNotificationManager); } - inline void CreateVideoManager(MxBool b) + inline void CreateVideoManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateVideoManager : this->m_flags1 & ~Flag_CreateVideoManager); + (p_enable ? this->m_flags1 | Flag_CreateVideoManager : this->m_flags1 & ~Flag_CreateVideoManager); } - inline void CreateSoundManager(MxBool b) + inline void CreateSoundManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateSoundManager : this->m_flags1 & ~Flag_CreateSoundManager); + (p_enable ? this->m_flags1 | Flag_CreateSoundManager : this->m_flags1 & ~Flag_CreateSoundManager); } - inline void CreateMusicManager(MxBool b) + inline void CreateMusicManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateMusicManager : this->m_flags1 & ~Flag_CreateMusicManager); + (p_enable ? this->m_flags1 | Flag_CreateMusicManager : this->m_flags1 & ~Flag_CreateMusicManager); } - inline void CreateEventManager(MxBool b) + inline void CreateEventManager(MxBool p_enable) { this->m_flags1 = - (b == TRUE ? this->m_flags1 | Flag_CreateEventManager : this->m_flags1 & ~Flag_CreateEventManager); + (p_enable ? this->m_flags1 | Flag_CreateEventManager : this->m_flags1 & ~Flag_CreateEventManager); } - inline void CreateTimer(MxBool b) + inline void CreateTimer(MxBool p_enable) { - this->m_flags2 = (b == TRUE ? this->m_flags2 | Flag_CreateTimer : this->m_flags2 & ~Flag_CreateTimer); + this->m_flags2 = (p_enable ? this->m_flags2 | Flag_CreateTimer : this->m_flags2 & ~Flag_CreateTimer); } - inline void CreateStreamer(MxBool b) + inline void CreateStreamer(MxBool p_enable) { - this->m_flags2 = (b == TRUE ? this->m_flags2 | Flag_CreateStreamer : this->m_flags2 & ~Flag_CreateStreamer); + this->m_flags2 = (p_enable ? this->m_flags2 | Flag_CreateStreamer : this->m_flags2 & ~Flag_CreateStreamer); } private: - unsigned char m_flags1; - unsigned char m_flags2; + MxU8 m_flags1; + MxU8 m_flags2; }; #endif // MXOMNICREATEFLAGS_H diff --git a/LEGO1/mxomnicreateparam.cpp b/LEGO1/mxomnicreateparam.cpp index bfe71635..2ffc0295 100644 --- a/LEGO1/mxomnicreateparam.cpp +++ b/LEGO1/mxomnicreateparam.cpp @@ -2,14 +2,14 @@ // FUNCTION: LEGO1 0x100b0b00 MxOmniCreateParam::MxOmniCreateParam( - const char* mediaPath, - struct HWND__* windowHandle, - MxVideoParam& vparam, - MxOmniCreateFlags flags + const char* p_mediaPath, + struct HWND__* p_windowHandle, + MxVideoParam& p_vparam, + MxOmniCreateFlags p_flags ) { - this->m_mediaPath = mediaPath; - this->m_windowHandle = (HWND) windowHandle; - this->m_videoParam = vparam; - this->m_createFlags = flags; + this->m_mediaPath = p_mediaPath; + this->m_windowHandle = (HWND) p_windowHandle; + this->m_videoParam = p_vparam; + this->m_createFlags = p_flags; } diff --git a/LEGO1/mxomnicreateparam.h b/LEGO1/mxomnicreateparam.h index a30d01df..825b5053 100644 --- a/LEGO1/mxomnicreateparam.h +++ b/LEGO1/mxomnicreateparam.h @@ -11,10 +11,10 @@ class MxOmniCreateParam : public MxParam { public: __declspec(dllexport) MxOmniCreateParam( - const char* mediaPath, - struct HWND__* windowHandle, - MxVideoParam& vparam, - MxOmniCreateFlags flags + const char* p_mediaPath, + struct HWND__* p_windowHandle, + MxVideoParam& p_vparam, + MxOmniCreateFlags p_flags ); MxOmniCreateFlags& CreateFlags() { return this->m_createFlags; } diff --git a/LEGO1/mxpalette.cpp b/LEGO1/mxpalette.cpp index bc1df5ff..6d4f0306 100644 --- a/LEGO1/mxpalette.cpp +++ b/LEGO1/mxpalette.cpp @@ -198,13 +198,13 @@ MxResult MxPalette::SetEntries(LPPALETTEENTRY p_entries) } // FUNCTION: LEGO1 0x100bf2d0 -MxResult MxPalette::SetSkyColor(LPPALETTEENTRY p_sky_color) +MxResult MxPalette::SetSkyColor(LPPALETTEENTRY p_skyColor) { MxResult status = 0; if (this->m_palette != NULL) { - this->m_entries[141].peRed = p_sky_color->peRed; - this->m_entries[141].peGreen = p_sky_color->peGreen; - this->m_entries[141].peBlue = p_sky_color->peBlue; + this->m_entries[141].peRed = p_skyColor->peRed; + this->m_entries[141].peGreen = p_skyColor->peGreen; + this->m_entries[141].peBlue = p_skyColor->peBlue; this->m_skyColor = this->m_entries[141]; if (this->m_palette->SetEntries(0, 141, 1, &this->m_skyColor)) { status = -1; @@ -220,14 +220,14 @@ void MxPalette::Detach() } // FUNCTION: LEGO1 0x100bf340 -MxBool MxPalette::operator==(MxPalette& other) +MxBool MxPalette::operator==(MxPalette& p_other) { for (MxS32 i = 0; i < 256; i++) { - if (this->m_entries[i].peRed != other.m_entries[i].peRed) + if (this->m_entries[i].peRed != p_other.m_entries[i].peRed) return FALSE; - if (this->m_entries[i].peGreen != other.m_entries[i].peGreen) + if (this->m_entries[i].peGreen != p_other.m_entries[i].peGreen) return FALSE; - if (this->m_entries[i].peBlue != other.m_entries[i].peBlue) + if (this->m_entries[i].peBlue != p_other.m_entries[i].peBlue) return FALSE; } return TRUE; diff --git a/LEGO1/mxpalette.h b/LEGO1/mxpalette.h index 9cd1f85b..d63b061c 100644 --- a/LEGO1/mxpalette.h +++ b/LEGO1/mxpalette.h @@ -10,7 +10,7 @@ // SIZE 0x414 class MxPalette : public MxCore { public: - __declspec(dllexport) MxBool operator==(MxPalette&); + __declspec(dllexport) MxBool operator==(MxPalette& p_other); __declspec(dllexport) void Detach(); MxPalette(); @@ -22,7 +22,7 @@ public: void GetDefaultPalette(LPPALETTEENTRY p_entries); MxResult GetEntries(LPPALETTEENTRY p_entries); MxResult SetEntries(LPPALETTEENTRY p_palette); - MxResult SetSkyColor(LPPALETTEENTRY p_sky_color); + MxResult SetSkyColor(LPPALETTEENTRY p_skyColor); void Reset(MxBool p_ignoreSkyColor); LPDIRECTDRAWPALETTE CreateNativePalette(); inline void SetOverrideSkyColor(MxBool p_value) { this->m_overrideSkyColor = p_value; } diff --git a/LEGO1/mxpresenter.cpp b/LEGO1/mxpresenter.cpp index 4840c489..31279513 100644 --- a/LEGO1/mxpresenter.cpp +++ b/LEGO1/mxpresenter.cpp @@ -169,15 +169,15 @@ void MxPresenter::ParseExtra() memcpy(extraCopy, extraData, len); extraCopy[len] = '\0'; - char t_worldValue[512]; - if (KeyValueStringParse(t_worldValue, g_strWORLD, extraCopy)) { - char* token = strtok(t_worldValue, g_parseExtraTokens); - char t_token[256]; - strcpy(t_token, token); + char worldValue[512]; + if (KeyValueStringParse(worldValue, g_strWORLD, extraCopy)) { + char* token = strtok(worldValue, g_parseExtraTokens); + char buf[256]; + strcpy(buf, token); token = strtok(NULL, g_parseExtraTokens); MxS32 val = token ? atoi(token) : 0; - MxEntity* result = MxOmni::GetInstance()->FindWorld(t_token, val, this); + MxEntity* result = MxOmni::GetInstance()->FindWorld(buf, val, this); m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_World); diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index 963fb652..fae7021a 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -38,9 +38,9 @@ public: } // FUNCTION: LEGO1 0x1000bff0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxPresenter::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxPresenter::ClassName()) || MxCore::IsA(p_name); } virtual void VTable0x14(); // vtable+0x14 diff --git a/LEGO1/mxqueue.h b/LEGO1/mxqueue.h index fd22cb0a..b6eaad55 100644 --- a/LEGO1/mxqueue.h +++ b/LEGO1/mxqueue.h @@ -13,13 +13,13 @@ public: MxBool Dequeue(T& p_obj) { - MxBool has_next = (m_first != NULL); + MxBool hasNext = (m_first != NULL); if (m_first) { p_obj = m_first->GetValue(); - _DeleteEntry(m_first); + DeleteEntry(m_first); } - return has_next; + return hasNext; } }; diff --git a/LEGO1/mxramstreamcontroller.cpp b/LEGO1/mxramstreamcontroller.cpp index f97486c2..887db05a 100644 --- a/LEGO1/mxramstreamcontroller.cpp +++ b/LEGO1/mxramstreamcontroller.cpp @@ -36,14 +36,14 @@ MxResult MxRAMStreamController::Open(const char* p_filename) } // STUB: LEGO1 0x100c6210 -MxResult MxRAMStreamController::vtable0x20(MxDSAction* p_action) +MxResult MxRAMStreamController::VTable0x20(MxDSAction* p_action) { // TODO STUB return FAILURE; } // FUNCTION: LEGO1 0x100c6320 -MxResult MxRAMStreamController::vtable0x24(MxDSAction* p_action) +MxResult MxRAMStreamController::VTable0x24(MxDSAction* p_action) { MxDSAction action; do { @@ -52,7 +52,7 @@ MxResult MxRAMStreamController::vtable0x24(MxDSAction* p_action) m_action0x60 = NULL; } action = *p_action; - MxStreamController::vtable0x24(&action); + MxStreamController::VTable0x24(&action); } while (m_action0x60 != NULL); return SUCCESS; } diff --git a/LEGO1/mxramstreamcontroller.h b/LEGO1/mxramstreamcontroller.h index fad2a80c..70e69d1b 100644 --- a/LEGO1/mxramstreamcontroller.h +++ b/LEGO1/mxramstreamcontroller.h @@ -18,15 +18,15 @@ public: } // FUNCTION: LEGO1 0x100b9440 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxRAMStreamController::ClassName()) || !strcmp(name, MxStreamController::ClassName()) || - MxCore::IsA(name); + return !strcmp(p_name, MxRAMStreamController::ClassName()) || + !strcmp(p_name, MxStreamController::ClassName()) || MxCore::IsA(p_name); } virtual MxResult Open(const char* p_filename) override; - virtual MxResult vtable0x20(MxDSAction* p_action) override; - virtual MxResult vtable0x24(MxDSAction* p_action) override; + virtual MxResult VTable0x20(MxDSAction* p_action) override; + virtual MxResult VTable0x24(MxDSAction* p_action) override; private: MxDSBuffer m_buffer; diff --git a/LEGO1/mxramstreamprovider.h b/LEGO1/mxramstreamprovider.h index 4e656214..70402a8f 100644 --- a/LEGO1/mxramstreamprovider.h +++ b/LEGO1/mxramstreamprovider.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x100d0980 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxRAMStreamProvider::ClassName()) || MxStreamProvider::IsA(name); + return !strcmp(p_name, MxRAMStreamProvider::ClassName()) || MxStreamProvider::IsA(p_name); } virtual MxResult SetResourceToGet(MxStreamController* p_resource) override; // vtable+0x14 diff --git a/LEGO1/mxrect32.h b/LEGO1/mxrect32.h index f7c38c69..6deb5095 100644 --- a/LEGO1/mxrect32.h +++ b/LEGO1/mxrect32.h @@ -75,8 +75,8 @@ public: inline void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; } private: - inline static MxS32 Min(MxS32 a, MxS32 b) { return a <= b ? a : b; }; - inline static MxS32 Max(MxS32 a, MxS32 b) { return a <= b ? b : a; }; + inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; }; + inline static MxS32 Max(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_b : p_a; }; MxS32 m_left; MxS32 m_top; diff --git a/LEGO1/mxregion.cpp b/LEGO1/mxregion.cpp index afd546d6..0c698413 100644 --- a/LEGO1/mxregion.cpp +++ b/LEGO1/mxregion.cpp @@ -15,7 +15,7 @@ MxRegion::MxRegion() } // FUNCTION: LEGO1 0x100c3660 -MxBool MxRegion::vtable20() +MxBool MxRegion::VTable0x20() { return m_list->GetCount() == 0; } @@ -36,7 +36,7 @@ void MxRegion::Reset() } // FUNCTION: LEGO1 0x100c3750 -void MxRegion::vtable18(MxRect32& p_rect) +void MxRegion::VTable0x18(MxRect32& p_rect) { MxRect32 rect(p_rect.GetPoint(), MxSize32(p_rect.GetRight(), p_rect.GetBottom())); MxRegionListCursor cursor(m_list); @@ -87,7 +87,7 @@ void MxRegion::vtable18(MxRect32& p_rect) } // FUNCTION: LEGO1 0x100c3e20 -MxBool MxRegion::vtable1c(MxRect32& p_rect) +MxBool MxRegion::VTable0x1c(MxRect32& p_rect) { if (!m_rect.IntersectsWith(p_rect)) return FALSE; diff --git a/LEGO1/mxregion.h b/LEGO1/mxregion.h index 84e46a41..169eb705 100644 --- a/LEGO1/mxregion.h +++ b/LEGO1/mxregion.h @@ -9,7 +9,7 @@ // SIZE 0x0c struct MxRegionTopBottom { MxRegionTopBottom(MxRect32& p_rect); - MxRegionTopBottom(MxS32 m_top, MxS32 m_bottom); + MxRegionTopBottom(MxS32 p_top, MxS32 p_bottom); MxRegionTopBottom* Clone(); void FUN_100c5280(MxS32 p_left, MxS32 p_right); @@ -58,9 +58,9 @@ public: virtual ~MxRegion() override; virtual void Reset(); - virtual void vtable18(MxRect32& p_rect); - virtual MxBool vtable1c(MxRect32& p_rect); - virtual MxBool vtable20(); + virtual void VTable0x18(MxRect32& p_rect); + virtual MxBool VTable0x1c(MxRect32& p_rect); + virtual MxBool VTable0x20(); inline MxRect32& GetRect() { return this->m_rect; } diff --git a/LEGO1/mxregionlist.h b/LEGO1/mxregionlist.h index 21bb3c23..79860475 100644 --- a/LEGO1/mxregionlist.h +++ b/LEGO1/mxregionlist.h @@ -30,7 +30,7 @@ public: // class MxListCursor<MxRegionTopBottom *> // TODO: The initialize list param type should be MxRegionList, but doing that -// drastically reduced the match percentage for MxRegion::vtable18. +// drastically reduced the match percentage for MxRegion::VTable0x18. // It also works with MxPtrList, so we'll do that until we figure this out. // VTABLE: LEGO1 0x100dcb88 @@ -141,15 +141,15 @@ public: // MxListCursor<MxRegionLeftRight *>::operator= // TEMPLATE: LEGO1 0x100c58c0 -// MxList<MxRegionLeftRight *>::_InsertEntry +// MxList<MxRegionLeftRight *>::InsertEntry // TEMPLATE: LEGO1 0x100c5970 -// MxList<MxRegionTopBottom *>::_InsertEntry +// MxList<MxRegionTopBottom *>::InsertEntry // TEMPLATE: LEGO1 0x100c5a20 // MxListEntry<MxRegionTopBottom *>::MxListEntry<MxRegionTopBottom *> // TEMPLATE: LEGO1 0x100c5a40 -// MxList<MxRegionLeftRight *>::_DeleteEntry +// MxList<MxRegionLeftRight *>::DeleteEntry #endif // MXREGIONLIST_H diff --git a/LEGO1/mxsmkpresenter.h b/LEGO1/mxsmkpresenter.h index 6ea4cc10..243a4f4e 100644 --- a/LEGO1/mxsmkpresenter.h +++ b/LEGO1/mxsmkpresenter.h @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x100b3740 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxSmkPresenter::ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, MxSmkPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } virtual void Destroy() override; // vtable+0x38 diff --git a/LEGO1/mxsoundmanager.cpp b/LEGO1/mxsoundmanager.cpp index b212f9b4..b06c5e37 100644 --- a/LEGO1/mxsoundmanager.cpp +++ b/LEGO1/mxsoundmanager.cpp @@ -168,11 +168,11 @@ MxPresenter* MxSoundManager::FUN_100aebd0(const MxAtomId& p_atomId, MxU32 p_obje } // FUNCTION: LEGO1 0x100aecf0 -MxS32 MxSoundManager::FUN_100aecf0(MxU32 p_unk) +MxS32 MxSoundManager::FUN_100aecf0(MxU32 p_undefined) { - if (!p_unk) + if (!p_undefined) return -10000; - return g_mxcoreCount[p_unk]; + return g_mxcoreCount[p_undefined]; } // FUNCTION: LEGO1 0x100aed10 diff --git a/LEGO1/mxsoundmanager.h b/LEGO1/mxsoundmanager.h index 9677e543..5131e1e2 100644 --- a/LEGO1/mxsoundmanager.h +++ b/LEGO1/mxsoundmanager.h @@ -22,7 +22,7 @@ public: inline LPDIRECTSOUND GetDirectSound() { return m_directSound; } - MxS32 FUN_100aecf0(MxU32 p_unk); + MxS32 FUN_100aecf0(MxU32 p_undefined); private: void Init(); @@ -31,7 +31,7 @@ private: LPDIRECTSOUND m_directSound; // 0x30 LPDIRECTSOUNDBUFFER m_dsBuffer; // 0x34 - undefined m_unk38[4]; + undefined m_unk0x38[4]; }; // SYNTHETIC: LEGO1 0x100ae7b0 diff --git a/LEGO1/mxsoundpresenter.h b/LEGO1/mxsoundpresenter.h index e6fa74d2..1c4051ee 100644 --- a/LEGO1/mxsoundpresenter.h +++ b/LEGO1/mxsoundpresenter.h @@ -18,9 +18,9 @@ public: }; // FUNCTION: LEGO1 0x1000d4b0 - inline virtual MxBool IsA(const char* name) const // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const // vtable+0x10 { - return !strcmp(name, MxSoundPresenter::ClassName()) || MxAudioPresenter::IsA(name); + return !strcmp(p_name, MxSoundPresenter::ClassName()) || MxAudioPresenter::IsA(p_name); }; virtual MxResult AddToManager() override; // vtable+0x34 diff --git a/LEGO1/mxstillpresenter.cpp b/LEGO1/mxstillpresenter.cpp index 1d3c248e..285e2cd4 100644 --- a/LEGO1/mxstillpresenter.cpp +++ b/LEGO1/mxstillpresenter.cpp @@ -11,7 +11,7 @@ DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); // GLOBAL: LEGO1 0x10101eb0 -const char* g_strBMP_ISMAP = "BMP_ISMAP"; +const char* g_strBmpIsmap = "BMP_ISMAP"; // FUNCTION: LEGO1 0x100435b0 void MxStillPresenter::Destroy() @@ -80,10 +80,10 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk) MVideoManager()->InvalidateRect(rect); if (m_flags & Flag_Bit2) { - undefined4 unk = 0; - m_unk58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->vtable44( + undefined4 und = 0; + m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44( m_bitmap, - &unk, + &und, (m_flags & Flag_Bit4) / 8, m_action->GetFlags() & MxDSAction::Flag_Bit4 ); @@ -94,7 +94,7 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk) delete m_bitmap; m_bitmap = NULL; - if (m_unk58 && unk) + if (m_unk0x58 && und) m_flags |= Flag_Bit3; else m_flags &= ~Flag_Bit3; @@ -157,14 +157,14 @@ void MxStillPresenter::VTable0x88(MxS32 p_x, MxS32 p_y) MxS32 height = GetHeight() - 1; MxS32 width = GetWidth() - 1; - MxRect32 rect_a(x, y, width + x, height + y); - MxRect32 rect_b(m_location.m_x, m_location.m_y, width + m_location.m_x, height + m_location.m_y); + MxRect32 rectA(x, y, width + x, height + y); + MxRect32 rectB(m_location.m_x, m_location.m_y, width + m_location.m_x, height + m_location.m_y); - MVideoManager()->InvalidateRect(rect_a); - MVideoManager()->vtable0x34(rect_a.GetLeft(), rect_a.GetTop(), rect_a.GetWidth(), rect_a.GetHeight()); + MVideoManager()->InvalidateRect(rectA); + MVideoManager()->VTable0x34(rectA.GetLeft(), rectA.GetTop(), rectA.GetWidth(), rectA.GetHeight()); - MVideoManager()->InvalidateRect(rect_b); - MVideoManager()->vtable0x34(rect_b.GetLeft(), rect_b.GetTop(), rect_b.GetWidth(), rect_b.GetHeight()); + MVideoManager()->InvalidateRect(rectB); + MVideoManager()->VTable0x34(rectB.GetLeft(), rectB.GetTop(), rectB.GetWidth(), rectB.GetHeight()); } } @@ -181,7 +181,7 @@ void MxStillPresenter::Enable(MxBool p_enable) MxRect32 rect(x, y, width + x, height + y); MVideoManager()->InvalidateRect(rect); - MVideoManager()->vtable0x34(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); + MVideoManager()->VTable0x34(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); } } @@ -211,7 +211,7 @@ void MxStillPresenter::ParseExtra() } } - if (KeyValueStringParse(output, g_strBMP_ISMAP, buf)) { + if (KeyValueStringParse(output, g_strBmpIsmap, buf)) { m_flags |= Flag_Bit5; m_flags &= ~Flag_Bit2; m_flags &= ~Flag_Bit3; diff --git a/LEGO1/mxstillpresenter.h b/LEGO1/mxstillpresenter.h index 52c4919b..e28ab84f 100644 --- a/LEGO1/mxstillpresenter.h +++ b/LEGO1/mxstillpresenter.h @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x100435d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxStillPresenter::ClassName()) || MxVideoPresenter::IsA(name); + return !strcmp(p_name, MxStillPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } virtual void StartingTickle() override; // vtable+0x1c diff --git a/LEGO1/mxstreamchunk.h b/LEGO1/mxstreamchunk.h index d06d4103..817d699f 100644 --- a/LEGO1/mxstreamchunk.h +++ b/LEGO1/mxstreamchunk.h @@ -7,7 +7,7 @@ // SIZE 0x20 class MxStreamChunk : public MxDSChunk { public: - inline MxStreamChunk() : m_unk1c(NULL) {} + inline MxStreamChunk() : m_unk0x1c(NULL) {} // FUNCTION: LEGO1 0x100b1fe0 inline virtual const char* ClassName() const override // vtable+0xc @@ -17,13 +17,13 @@ public: } // FUNCTION: LEGO1 0x100b1ff0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxStreamChunk::ClassName()) || MxDSChunk::IsA(name); + return !strcmp(p_name, MxStreamChunk::ClassName()) || MxDSChunk::IsA(p_name); } private: - void* m_unk1c; // 0x1c + void* m_unk0x1c; // 0x1c }; #endif // MXSTREAMCHUNK_H diff --git a/LEGO1/mxstreamcontroller.cpp b/LEGO1/mxstreamcontroller.cpp index 7931adc6..9357ebf6 100644 --- a/LEGO1/mxstreamcontroller.cpp +++ b/LEGO1/mxstreamcontroller.cpp @@ -9,19 +9,19 @@ DECOMP_SIZE_ASSERT(MxStreamController, 0x64) DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14) // FUNCTION: LEGO1 0x100b9400 -MxResult MxStreamController::vtable0x18(undefined4 p_unknown, undefined4 p_unknown2) +MxResult MxStreamController::VTable0x18(undefined4, undefined4) { return FAILURE; } // FUNCTION: LEGO1 0x100b9410 -MxResult MxStreamController::vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2) +MxResult MxStreamController::VTable0x1c(undefined4, undefined4) { return FAILURE; } // FUNCTION: LEGO1 0x100b9420 -MxResult MxStreamController::vtable0x28() +MxResult MxStreamController::VTable0x28() { return SUCCESS; } @@ -30,7 +30,7 @@ MxResult MxStreamController::vtable0x28() MxStreamController::MxStreamController() { m_provider = NULL; - m_unk2c = 0; // TODO: probably also NULL + m_unk0x2c = 0; // TODO: probably also NULL m_action0x60 = NULL; } @@ -47,12 +47,12 @@ MxResult MxStreamController::Open(const char* p_filename) MxAutoLocker locker(&m_criticalSection); MakeSourceName(sourceName, p_filename); - this->atom = MxAtomId(sourceName, LookupMode_LowerCase2); + this->m_atom = MxAtomId(sourceName, LookupMode_LowerCase2); return SUCCESS; } // FUNCTION: LEGO1 0x100c1690 -MxResult MxStreamController::vtable0x20(MxDSAction* p_action) +MxResult MxStreamController::VTable0x20(MxDSAction* p_action) { MxAutoLocker locker(&m_criticalSection); @@ -66,7 +66,7 @@ MxResult MxStreamController::vtable0x20(MxDSAction* p_action) offset = provider->GetBufferForDWords()[objectId]; if (offset) - result = vtable0x2c(p_action, offset); + result = VTable0x2c(p_action, offset); else result = FAILURE; @@ -74,11 +74,11 @@ MxResult MxStreamController::vtable0x20(MxDSAction* p_action) } // FUNCTION: LEGO1 0x100c1740 -MxResult MxStreamController::vtable0x24(MxDSAction* p_action) +MxResult MxStreamController::VTable0x24(MxDSAction* p_action) { MxAutoLocker locker(&m_criticalSection); - vtable0x30(p_action); - m_action0x60 = m_unkList0x54.Find(p_action, TRUE); + VTable0x30(p_action); + m_action0x60 = m_unk0x54.Find(p_action, TRUE); if (m_action0x60 == NULL) { return FAILURE; } @@ -109,7 +109,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferva } // FUNCTION: LEGO1 0x100c1c10 -MxResult MxStreamController::vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval) +MxResult MxStreamController::VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval) { MxAutoLocker locker(&m_criticalSection); if (FUN_100c1a00(p_action, p_bufferval) != SUCCESS) { @@ -119,11 +119,11 @@ MxResult MxStreamController::vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval) } // FUNCTION: LEGO1 0x100c1ce0 -MxResult MxStreamController::vtable0x30(MxDSAction* p_unknown) +MxResult MxStreamController::VTable0x30(MxDSAction* p_action) { MxAutoLocker locker(&m_criticalSection); MxResult result = FAILURE; - MxDSAction* action = m_unkList0x3c.Find(p_unknown, TRUE); + MxDSAction* action = m_unk0x3c.Find(p_action, TRUE); if (action != NULL) { MxNextActionDataStart* data = m_nextActionList.Find(action->GetObjectId(), action->GetUnknown24()); delete action; diff --git a/LEGO1/mxstreamcontroller.h b/LEGO1/mxstreamcontroller.h index 8f6ca1c2..a4d90b86 100644 --- a/LEGO1/mxstreamcontroller.h +++ b/LEGO1/mxstreamcontroller.h @@ -27,36 +27,36 @@ public: } // FUNCTION: LEGO1 0x100c0f20 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxStreamController::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxStreamController::ClassName()) || MxCore::IsA(p_name); } - virtual MxResult Open(const char* p_filename); // vtable+0x14 - virtual MxResult vtable0x18(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x18 - virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x1c - virtual MxResult vtable0x20(MxDSAction* p_action); // vtable+0x20 - virtual MxResult vtable0x24(MxDSAction* p_unknown); // vtable+0x24 - MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val); - virtual MxResult vtable0x28(); // vtable+0x28 - virtual MxResult vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c - virtual MxResult vtable0x30(MxDSAction* p_unknown); // vtable+0x30 + virtual MxResult Open(const char* p_filename); // vtable+0x14 + virtual MxResult VTable0x18(undefined4, undefined4); // vtable+0x18 + virtual MxResult VTable0x1c(undefined4, undefined4); // vtable+0x1c + virtual MxResult VTable0x20(MxDSAction* p_action); // vtable+0x20 + virtual MxResult VTable0x24(MxDSAction* p_action); // vtable+0x24 + virtual MxResult VTable0x28(); // vtable+0x28 + virtual MxResult VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c + virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30 + MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val); MxBool FUN_100c20d0(MxDSObject& p_obj); MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval); MxResult FUN_100c1f00(MxDSAction* p_action); - inline MxAtomId& GetAtom() { return atom; }; + inline MxAtomId& GetAtom() { return m_atom; }; protected: MxCriticalSection m_criticalSection; // 0x8 - MxAtomId atom; // 0x24 + MxAtomId m_atom; // 0x24 MxStreamProvider* m_provider; // 0x28 - undefined4 m_unk2c; // 0x2c + undefined4 m_unk0x2c; // 0x2c MxStreamListMxDSSubscriber m_subscriberList; // 0x30 - MxStreamListMxDSAction m_unkList0x3c; // 0x3c + MxStreamListMxDSAction m_unk0x3c; // 0x3c MxStreamListMxNextActionDataStart m_nextActionList; // 0x48 - MxStreamListMxDSAction m_unkList0x54; // 0x54 + MxStreamListMxDSAction m_unk0x54; // 0x54 MxDSAction* m_action0x60; // 0x60 }; diff --git a/LEGO1/mxstreamer.cpp b/LEGO1/mxstreamer.cpp index 32180214..8449e086 100644 --- a/LEGO1/mxstreamer.cpp +++ b/LEGO1/mxstreamer.cpp @@ -69,16 +69,15 @@ MxStreamController* MxStreamer::Open(const char* p_name, MxU16 p_lookupType) } // FUNCTION: LEGO1 0x100b9570 -MxLong MxStreamer::Close(const char* p) +MxLong MxStreamer::Close(const char* p_name) { MxDSAction ds; - ds.SetUnknown24(-2); for (list<MxStreamController*>::iterator it = m_openStreams.begin(); it != m_openStreams.end(); it++) { MxStreamController* c = *it; - if (!p || !strcmp(p, c->GetAtom().GetInternal())) { + if (!p_name || !strcmp(p_name, c->GetAtom().GetInternal())) { m_openStreams.erase(it); if (!c->FUN_100c20d0(ds)) { @@ -120,10 +119,10 @@ MxStreamController* MxStreamer::GetOpenStream(const char* p_name) } // FUNCTION: LEGO1 0x100b9930 -MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController* stream) +MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController* p_stream) { - if (find(m_openStreams.begin(), m_openStreams.end(), stream) == m_openStreams.end()) { - m_openStreams.push_back(stream); + if (find(m_openStreams.begin(), m_openStreams.end(), p_stream) == m_openStreams.end()) { + m_openStreams.push_back(p_stream); return SUCCESS; } @@ -139,7 +138,7 @@ MxResult MxStreamer::FUN_100b99b0(MxDSAction* p_action) if (controller == NULL) { return FAILURE; } - return controller->vtable0x20(p_action); + return controller->VTable0x20(p_action); } return FAILURE; } @@ -154,14 +153,14 @@ MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject) } // FUNCTION: LEGO1 0x100b9b60 -MxLong MxStreamer::Notify(MxParam& p) +MxLong MxStreamer::Notify(MxParam& p_param) { - if (((MxNotificationParam&) p).GetNotification() == MXSTREAMER_DELETE_NOTIFY) { + if (((MxNotificationParam&) p_param).GetNotification() == MXSTREAMER_DELETE_NOTIFY) { MxDSAction ds; ds.SetUnknown24(-2); - MxStreamController* c = static_cast<MxStreamerNotification&>(p).GetController(); + MxStreamController* c = static_cast<MxStreamerNotification&>(p_param).GetController(); if (!c->FUN_100c20d0(ds)) { MxStreamerNotification notif(MXSTREAMER_DELETE_NOTIFY, NULL, c); @@ -176,11 +175,11 @@ MxLong MxStreamer::Notify(MxParam& p) } // No offset, function is always inlined -MxStreamerSubClass1::MxStreamerSubClass1(undefined4 size) +MxStreamerSubClass1::MxStreamerSubClass1(undefined4 p_size) { m_buffer = NULL; - m_size = size; - undefined4* ptr = &m_unk08; + m_size = p_size; + undefined4* ptr = &m_unk0x08; for (int i = 0; i >= 0; i--) { ptr[i] = 0; } diff --git a/LEGO1/mxstreamer.h b/LEGO1/mxstreamer.h index 3b2af7e1..3ea0403d 100644 --- a/LEGO1/mxstreamer.h +++ b/LEGO1/mxstreamer.h @@ -14,7 +14,7 @@ // STL. But I haven't figured out what yet (it's definitely not a vector). class MxStreamerSubClass1 { public: - inline MxStreamerSubClass1(undefined4 size); + inline MxStreamerSubClass1(undefined4 p_size); ~MxStreamerSubClass1() { delete[] m_buffer; } @@ -22,12 +22,12 @@ public: void SetBuffer(undefined* p_buf) { m_buffer = p_buf; } inline undefined* GetBuffer() const { return m_buffer; } - inline undefined4 GetUnk08() const { return m_unk08; } + inline undefined4 GetUnk08() const { return m_unk0x08; } private: undefined* m_buffer; undefined4 m_size; - undefined4 m_unk08; + undefined4 m_unk0x08; }; class MxStreamerSubClass2 : public MxStreamerSubClass1 { @@ -73,7 +73,7 @@ public: __declspec(dllexport) MxStreamController* Open(const char* p_name, MxU16 p_openMode); __declspec(dllexport) MxLong Close(const char* p_name); - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x100b9000 inline virtual const char* ClassName() const override // vtable+0x0c diff --git a/LEGO1/mxstreamprovider.cpp b/LEGO1/mxstreamprovider.cpp index f80788dc..9d77121b 100644 --- a/LEGO1/mxstreamprovider.cpp +++ b/LEGO1/mxstreamprovider.cpp @@ -12,6 +12,6 @@ MxResult MxStreamProvider::SetResourceToGet(MxStreamController* p_resource) } // FUNCTION: LEGO1 0x100d07d0 -void MxStreamProvider::vtable0x20(undefined4 p_unknown1) +void MxStreamProvider::VTable0x20(undefined4) { } diff --git a/LEGO1/mxstreamprovider.h b/LEGO1/mxstreamprovider.h index 6851b295..d32d2ab4 100644 --- a/LEGO1/mxstreamprovider.h +++ b/LEGO1/mxstreamprovider.h @@ -20,15 +20,15 @@ public: } // FUNCTION: LEGO1 0x100d07f0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxStreamProvider::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxStreamProvider::ClassName()) || MxCore::IsA(p_name); } virtual MxResult SetResourceToGet(MxStreamController* p_resource); // vtable+0x14 virtual MxU32 GetFileSize() = 0; // vtable+0x18 virtual MxU32 GetStreamBuffersNum() = 0; // vtable+0x1c - virtual void vtable0x20(undefined4 p_unknown1); // vtable+0x20 + virtual void VTable0x20(undefined4); // vtable+0x20 virtual MxU32 GetLengthInDWords() = 0; // vtable+0x24 virtual MxU32* GetBufferForDWords() = 0; // vtable+0x28 diff --git a/LEGO1/mxstring.cpp b/LEGO1/mxstring.cpp index a48f665d..09194eb7 100644 --- a/LEGO1/mxstring.cpp +++ b/LEGO1/mxstring.cpp @@ -17,20 +17,20 @@ MxString::MxString() } // FUNCTION: LEGO1 0x100ae2a0 -MxString::MxString(const MxString& str) +MxString::MxString(const MxString& p_str) { - this->m_length = str.m_length; + this->m_length = p_str.m_length; this->m_data = new char[this->m_length + 1]; - strcpy(this->m_data, str.m_data); + strcpy(this->m_data, p_str.m_data); } // FUNCTION: LEGO1 0x100ae350 -MxString::MxString(const char* str) +MxString::MxString(const char* p_str) { - if (str) { - this->m_length = strlen(str); + if (p_str) { + this->m_length = strlen(p_str); this->m_data = new char[this->m_length + 1]; - strcpy(this->m_data, str); + strcpy(this->m_data, p_str); } else { this->m_data = new char[1]; @@ -58,26 +58,26 @@ void MxString::ToLowerCase() } // FUNCTION: LEGO1 0x100ae4b0 -MxString& MxString::operator=(const MxString& param) +MxString& MxString::operator=(const MxString& p_str) { - if (this->m_data != param.m_data) { + if (this->m_data != p_str.m_data) { delete[] this->m_data; - this->m_length = param.m_length; + this->m_length = p_str.m_length; this->m_data = new char[this->m_length + 1]; - strcpy(this->m_data, param.m_data); + strcpy(this->m_data, p_str.m_data); } return *this; } // FUNCTION: LEGO1 0x100ae510 -const MxString& MxString::operator=(const char* param) +const MxString& MxString::operator=(const char* p_data) { - if (this->m_data != param) { + if (this->m_data != p_data) { delete[] this->m_data; - this->m_length = strlen(param); + this->m_length = strlen(p_data); this->m_data = new char[this->m_length + 1]; - strcpy(this->m_data, param); + strcpy(this->m_data, p_data); } return *this; @@ -86,29 +86,29 @@ const MxString& MxString::operator=(const char* param) // Return type is intentionally just MxString, not MxString&. // This forces MSVC to add $ReturnUdt$ to the stack for 100% match. // FUNCTION: LEGO1 0x100ae580 -MxString MxString::operator+(const char* str) +MxString MxString::operator+(const char* p_str) { // MxString constructor allocates 1 byte for m_data, so free that first MxString tmp; delete[] tmp.m_data; - tmp.m_length = strlen(str) + this->m_length; + tmp.m_length = strlen(p_str) + this->m_length; tmp.m_data = new char[tmp.m_length + 1]; strcpy(tmp.m_data, this->m_data); - strcpy(tmp.m_data + this->m_length, str); + strcpy(tmp.m_data + this->m_length, p_str); return MxString(tmp); } // FUNCTION: LEGO1 0x100ae690 -MxString& MxString::operator+=(const char* str) +MxString& MxString::operator+=(const char* p_str) { - int newlen = this->m_length + strlen(str); + int newlen = this->m_length + strlen(p_str); char* tmp = new char[newlen + 1]; strcpy(tmp, this->m_data); - strcpy(tmp + this->m_length, str); + strcpy(tmp + this->m_length, p_str); delete[] this->m_data; this->m_length = newlen; diff --git a/LEGO1/mxstring.h b/LEGO1/mxstring.h index 7e22fe87..13130a70 100644 --- a/LEGO1/mxstring.h +++ b/LEGO1/mxstring.h @@ -6,17 +6,17 @@ // VTABLE: LEGO1 0x100dc110 class MxString : public MxCore { public: - __declspec(dllexport) MxString(const MxString&); + __declspec(dllexport) MxString(const MxString& p_str); __declspec(dllexport) virtual ~MxString(); - __declspec(dllexport) const MxString& operator=(const char*); + __declspec(dllexport) const MxString& operator=(const char* p_data); MxString(); MxString(const char*); void ToUpperCase(); void ToLowerCase(); - MxString& operator=(const MxString&); - MxString operator+(const char*); - MxString& operator+=(const char*); + MxString& operator=(const MxString& p_str); + MxString operator+(const char* p_str); + MxString& operator+=(const char* p_str); inline MxS8 Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); } inline const char* GetData() const { return m_data; } diff --git a/LEGO1/mxstringlist.h b/LEGO1/mxstringlist.h index 3b105d32..6e75683d 100644 --- a/LEGO1/mxstringlist.h +++ b/LEGO1/mxstringlist.h @@ -30,7 +30,7 @@ public: // MxList<MxString>::Append // TEMPLATE: LEGO1 0x100cc2d0 -// MxList<MxString>::_InsertEntry +// MxList<MxString>::InsertEntry // TEMPLATE: LEGO1 0x100cc3c0 // MxListEntry<MxString>::MxListEntry<MxString> diff --git a/LEGO1/mxthread.cpp b/LEGO1/mxthread.cpp index fa78b9b1..899e959e 100644 --- a/LEGO1/mxthread.cpp +++ b/LEGO1/mxthread.cpp @@ -7,7 +7,7 @@ #include <process.h> // FUNCTION: LEGO1 0x100b8bb0 -MxTickleThread::MxTickleThread(MxCore* p_target, int p_frequencyMS) +MxTickleThread::MxTickleThread(MxCore* p_target, MxS32 p_frequencyMS) { m_target = p_target; m_frequencyMS = p_frequencyMS; @@ -18,14 +18,15 @@ MxTickleThread::MxTickleThread(MxCore* p_target, int p_frequencyMS) MxResult MxTickleThread::Run() { MxTimer* timer = Timer(); - int lastTickled = -m_frequencyMS; + MxS32 lastTickled = -m_frequencyMS; while (IsRunning()) { - int currentTime = timer->GetTime(); + MxLong currentTime = timer->GetTime(); if (currentTime < lastTickled) { lastTickled = -m_frequencyMS; } - int timeRemainingMS = (m_frequencyMS - currentTime) + lastTickled; + + MxS32 timeRemainingMS = (m_frequencyMS - currentTime) + lastTickled; if (timeRemainingMS <= 0) { m_target->Tickle(); timeRemainingMS = 0; @@ -54,7 +55,7 @@ MxThread::~MxThread() typedef unsigned(__stdcall* ThreadFunc)(void*); // FUNCTION: LEGO1 0x100bf610 -MxResult MxThread::Start(int p_stack, int p_flag) +MxResult MxThread::Start(MxS32 p_stack, MxS32 p_flag) { MxResult result = FAILURE; if (m_semaphore.Init(0, 1) == SUCCESS) { diff --git a/LEGO1/mxthread.h b/LEGO1/mxthread.h index a9f15488..3c7faab0 100644 --- a/LEGO1/mxthread.h +++ b/LEGO1/mxthread.h @@ -13,7 +13,7 @@ public: // Note: Comes before virtual destructor virtual MxResult Run(); - MxResult Start(int p_stack, int p_flag); + MxResult Start(MxS32 p_stack, MxS32 p_flag); void Terminate(); @@ -43,7 +43,7 @@ protected: // VTABLE: LEGO1 0x100dc6d8 class MxTickleThread : public MxThread { public: - MxTickleThread(MxCore* p_target, int p_frequencyMS); + MxTickleThread(MxCore* p_target, MxS32 p_frequencyMS); // Only inlined, no offset virtual ~MxTickleThread() {} diff --git a/LEGO1/mxticklemanager.h b/LEGO1/mxticklemanager.h index 85994ef5..44694a61 100644 --- a/LEGO1/mxticklemanager.h +++ b/LEGO1/mxticklemanager.h @@ -21,7 +21,7 @@ public: inline void SetLastUpdateTime(MxTime p_lastUpdateTime) { m_lastUpdateTime = p_lastUpdateTime; } - inline void SetFlags(MxU16 flags) { m_flags = flags; } + inline void SetFlags(MxU16 p_flags) { m_flags = p_flags; } private: MxCore* m_client; // 0x0 diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp index f46d570a..0d6d00f1 100644 --- a/LEGO1/mxtimer.cpp +++ b/LEGO1/mxtimer.cpp @@ -3,10 +3,10 @@ #include <windows.h> // GLOBAL: LEGO1 0x10101414 -MxLong MxTimer::s_LastTimeCalculated = 0; +MxLong MxTimer::g_lastTimeCalculated = 0; // GLOBAL: LEGO1 0x10101418 -MxLong MxTimer::s_LastTimeTimerStarted = 0; +MxLong MxTimer::g_lastTimeTimerStarted = 0; // FUNCTION: LEGO1 0x100ae060 MxTimer::MxTimer() @@ -14,20 +14,20 @@ MxTimer::MxTimer() this->m_isRunning = FALSE; m_startTime = timeGetTime(); // yeah this is somehow what the asm is - s_LastTimeCalculated = m_startTime; + g_lastTimeCalculated = m_startTime; } // FUNCTION: LEGO1 0x100ae140 MxLong MxTimer::GetRealTime() { - MxTimer::s_LastTimeCalculated = timeGetTime(); - return MxTimer::s_LastTimeCalculated - this->m_startTime; + MxTimer::g_lastTimeCalculated = timeGetTime(); + return MxTimer::g_lastTimeCalculated - this->m_startTime; } // FUNCTION: LEGO1 0x100ae160 void MxTimer::Start() { - s_LastTimeTimerStarted = this->GetRealTime(); + g_lastTimeTimerStarted = this->GetRealTime(); this->m_isRunning = TRUE; } @@ -35,7 +35,7 @@ void MxTimer::Start() void MxTimer::Stop() { MxLong elapsed = this->GetRealTime(); - MxLong startTime = elapsed - MxTimer::s_LastTimeTimerStarted; + MxLong startTime = elapsed - MxTimer::g_lastTimeTimerStarted; this->m_isRunning = FALSE; // this feels very stupid but it's what the assembly does this->m_startTime = this->m_startTime + startTime - 5; diff --git a/LEGO1/mxtimer.h b/LEGO1/mxtimer.h index 26548433..70d52d79 100644 --- a/LEGO1/mxtimer.h +++ b/LEGO1/mxtimer.h @@ -17,16 +17,16 @@ public: inline MxLong GetTime() { if (this->m_isRunning) - return s_LastTimeTimerStarted; + return g_lastTimeTimerStarted; else - return s_LastTimeCalculated - this->m_startTime; + return g_lastTimeCalculated - this->m_startTime; } private: MxLong m_startTime; MxBool m_isRunning; - static MxLong s_LastTimeCalculated; - static MxLong s_LastTimeTimerStarted; + static MxLong g_lastTimeCalculated; + static MxLong g_lastTimeTimerStarted; }; #endif // MXTIMER_H diff --git a/LEGO1/mxtransitionmanager.cpp b/LEGO1/mxtransitionmanager.cpp index 652dd628..02366257 100644 --- a/LEGO1/mxtransitionmanager.cpp +++ b/LEGO1/mxtransitionmanager.cpp @@ -21,9 +21,9 @@ MxTransitionManager::MxTransitionManager() m_ddSurface = NULL; m_waitIndicator = NULL; m_copyBuffer = NULL; - m_copyFlags.bit0 = FALSE; - m_unk28.bit0 = FALSE; - m_unk24 = 0; + m_copyFlags.m_bit0 = FALSE; + m_unk0x28.m_bit0 = FALSE; + m_unk0x24 = 0; } // FUNCTION: LEGO1 0x1004ba00 @@ -58,22 +58,22 @@ MxResult MxTransitionManager::Tickle() switch (this->m_transitionType) { case NO_ANIMATION: - Transition_None(); + TransitionNone(); break; case DISSOLVE: - Transition_Dissolve(); + TransitionDissolve(); break; case PIXELATION: - Transition_Pixelation(); + TransitionPixelation(); break; case SCREEN_WIPE: - Transition_Wipe(); + TransitionWipe(); break; case WINDOWS: - Transition_Windows(); + TransitionWindows(); break; case BROKEN: - Transition_Broken(); + TransitionBroken(); break; } return SUCCESS; @@ -95,9 +95,9 @@ MxResult MxTransitionManager::StartTransition( this->m_transitionType = p_animationType; - m_copyFlags.bit0 = p_doCopy; + m_copyFlags.m_bit0 = p_doCopy; - if (m_copyFlags.bit0 && m_waitIndicator != NULL) { + if (m_copyFlags.m_bit0 && m_waitIndicator != NULL) { m_waitIndicator->Enable(TRUE); MxDSAction* action = m_waitIndicator->GetAction(); @@ -132,7 +132,7 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld) if (m_transitionType != NOT_TRANSITIONING) { m_transitionType = NOT_TRANSITIONING; - m_copyFlags.bit0 = FALSE; + m_copyFlags.m_bit0 = FALSE; TickleManager()->UnregisterClient(this); @@ -147,7 +147,7 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld) } // FUNCTION: LEGO1 0x1004bcf0 -void MxTransitionManager::Transition_None() +void MxTransitionManager::TransitionNone() { LegoVideoManager* videoManager = VideoManager(); videoManager->GetDisplaySurface()->FUN_100ba640(); @@ -155,7 +155,7 @@ void MxTransitionManager::Transition_None() } // FUNCTION: LEGO1 0x1004bd10 -void MxTransitionManager::Transition_Dissolve() +void MxTransitionManager::TransitionDissolve() { // If the animation is finished if (m_animationTimer == 40) { @@ -212,14 +212,14 @@ void MxTransitionManager::Transition_Dissolve() // Shift the chosen column a different amount at each scanline. // We use the same shift for that scanline each time. // By the end, every pixel gets hit. - MxS32 x_shift = (m_randomShift[row] + col) % 640; + MxS32 xShift = (m_randomShift[row] + col) % 640; // Set the chosen pixel to black if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) { - ((MxU8*) ddsd.lpSurface)[row * ddsd.lPitch + x_shift] = 0; + ((MxU8*) ddsd.lpSurface)[row * ddsd.lPitch + xShift] = 0; } else { - ((MxU16*) ddsd.lpSurface)[row * ddsd.lPitch + x_shift] = 0; + ((MxU16*) ddsd.lpSurface)[row * ddsd.lPitch + xShift] = 0; } } } @@ -227,7 +227,7 @@ void MxTransitionManager::Transition_Dissolve() SetupCopyRect(&ddsd); m_ddSurface->Unlock(ddsd.lpSurface); - if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) { + if (VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) { LPDIRECTDRAWSURFACE surf = VideoManager()->GetDisplaySurface()->GetDirectDrawSurface1(); surf->BltFast(NULL, NULL, m_ddSurface, &g_fullScreenRect, DDBLTFAST_WAIT); } @@ -237,7 +237,7 @@ void MxTransitionManager::Transition_Dissolve() } // FUNCTION: LEGO1 0x1004bed0 -void MxTransitionManager::Transition_Pixelation() +void MxTransitionManager::TransitionPixelation() { if (m_animationTimer == 16) { m_animationTimer = 0; @@ -289,20 +289,20 @@ void MxTransitionManager::Transition_Pixelation() continue; for (MxS32 row = 0; row < 48; row++) { - MxS32 x_shift = 10 * ((m_randomShift[row] + col) % 64); + MxS32 xShift = 10 * ((m_randomShift[row] + col) % 64); // To do the pixelation, we subdivide the 640x480 surface into // 10x10 pixel blocks. At the chosen block, we sample the top-leftmost // color and set the other 99 pixels to that value. // Find the pixel to sample - MxS32 sample_ofs = 10 * row * ddsd.lPitch + x_shift; + MxS32 sampleOfs = 10 * row * ddsd.lPitch + xShift; MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8; // Save this cast from void* to save time. // Seems to help accuracy doing it this way. MxU8* surface = (MxU8*) ddsd.lpSurface; - MxU8* source = surface + sample_ofs * bytesPerPixel; + MxU8* source = surface + sampleOfs * bytesPerPixel; MxU32 sample = bytesPerPixel == 1 ? *source : *(MxU16*) source; @@ -310,32 +310,32 @@ void MxTransitionManager::Transition_Pixelation() if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) { // TODO: This block and the next don't match, but they are // hopefully correct in principle. - MxU16 color_word = MAKEWORD(LOBYTE(sample), LOBYTE(sample)); - MxU32 new_color = MAKELONG(color_word, color_word); + MxU16 colorWord = MAKEWORD(LOBYTE(sample), LOBYTE(sample)); + MxU32 newColor = MAKELONG(colorWord, colorWord); - MxU8* pos = surface + k * ddsd.lPitch + x_shift; + MxU8* pos = surface + k * ddsd.lPitch + xShift; MxU32* dest = (MxU32*) pos; // Sets 10 pixels (10 bytes) - dest[0] = new_color; - dest[1] = new_color; + dest[0] = newColor; + dest[1] = newColor; MxU16* half = (MxU16*) (dest + 2); - *half = new_color; + *half = newColor; } else { - MxU32 new_color = MAKELONG(sample, sample); + MxU32 newColor = MAKELONG(sample, sample); // You might expect a cast to MxU16* instead, but lPitch is // bytes/scanline, not pixels/scanline. Therefore, we just - // need to double the x_shift to get to the right spot. - MxU8* pos = surface + k * ddsd.lPitch + 2 * x_shift; + // need to double the xShift to get to the right spot. + MxU8* pos = surface + k * ddsd.lPitch + 2 * xShift; MxU32* dest = (MxU32*) pos; // Sets 10 pixels (20 bytes) - dest[0] = new_color; - dest[1] = new_color; - dest[2] = new_color; - dest[3] = new_color; - dest[4] = new_color; + dest[0] = newColor; + dest[1] = newColor; + dest[2] = newColor; + dest[3] = newColor; + dest[4] = newColor; } } } @@ -344,7 +344,7 @@ void MxTransitionManager::Transition_Pixelation() SetupCopyRect(&ddsd); m_ddSurface->Unlock(ddsd.lpSurface); - if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) { + if (VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) { LPDIRECTDRAWSURFACE surf = VideoManager()->GetDisplaySurface()->GetDirectDrawSurface1(); surf->BltFast(NULL, NULL, m_ddSurface, &g_fullScreenRect, DDBLTFAST_WAIT); } @@ -354,7 +354,7 @@ void MxTransitionManager::Transition_Pixelation() } // FUNCTION: LEGO1 0x1004c170 -void MxTransitionManager::Transition_Wipe() +void MxTransitionManager::TransitionWipe() { // If the animation is finished if (m_animationTimer == 240) { @@ -393,7 +393,7 @@ void MxTransitionManager::Transition_Wipe() } // FUNCTION: LEGO1 0x1004c270 -void MxTransitionManager::Transition_Windows() +void MxTransitionManager::TransitionWindows() { if (m_animationTimer == 240) { m_animationTimer = 0; @@ -439,7 +439,7 @@ void MxTransitionManager::Transition_Windows() } // FUNCTION: LEGO1 0x1004c3e0 -void MxTransitionManager::Transition_Broken() +void MxTransitionManager::TransitionBroken() { // This function has no actual animation logic. // It also never calls EndTransition to @@ -487,22 +487,22 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter* p_waitIndicator) } else { // Disable copy rect - m_copyFlags.bit0 = FALSE; + m_copyFlags.m_bit0 = FALSE; } } // FUNCTION: LEGO1 0x1004c4d0 -void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc) +void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC p_ddsc) { // Check if the copy rect is setup - if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) { + if (m_copyFlags.m_bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) { return; } // Copy the copy rect onto the surface MxU8* dst; - MxU32 bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; + MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8; const MxU8* src = (const MxU8*) m_copyBuffer; @@ -510,12 +510,12 @@ void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc) copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel; MxS32 y; - dst = (MxU8*) ddsc->lpSurface + (ddsc->lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left); + dst = (MxU8*) p_ddsc->lpSurface + (p_ddsc->lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left); for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) { memcpy(dst, src, copyPitch); src += copyPitch; - dst += ddsc->lPitch; + dst += p_ddsc->lPitch; } // Free the copy buffer @@ -524,10 +524,10 @@ void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc) } // FUNCTION: LEGO1 0x1004c580 -void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) +void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC p_ddsc) { // Check if the copy rect is setup - if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL) { + if (m_copyFlags.m_bit0 == FALSE || m_waitIndicator == NULL) { return; } @@ -537,9 +537,9 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) // Check if wait indicator has started if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) { // Setup the copy rect - MxU32 copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * + MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously - MxU32 bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; + MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8; m_copyRect.left = m_waitIndicator->GetLocationX(); m_copyRect.top = m_waitIndicator->GetLocationY(); @@ -552,7 +552,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) // Allocate the copy buffer const MxU8* src = - (const MxU8*) ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left; + (const MxU8*) p_ddsc->lpSurface + m_copyRect.top * p_ddsc->lPitch + bytesPerPixel * m_copyRect.left; m_copyBuffer = new MxU8[bytesPerPixel * width * height]; if (!m_copyBuffer) @@ -563,7 +563,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++) { memcpy(dst, src, copyPitch); - src += ddsc->lPitch; + src += p_ddsc->lPitch; dst += copyPitch; } } @@ -571,9 +571,9 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) // Setup display surface if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::Flag_Bit5) != 0) { MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface(); - MxBool unkbool = FALSE; - displaySurface->vtable2c( - ddsc, + MxBool und = FALSE; + displaySurface->VTable0x2c( + p_ddsc, m_waitIndicator->GetBitmap(), 0, 0, @@ -581,13 +581,13 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) m_waitIndicator->GetLocationY(), m_waitIndicator->GetWidth(), m_waitIndicator->GetHeight(), - unkbool + und ); } else { MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface(); - displaySurface->vtable24( - ddsc, + displaySurface->VTable0x24( + p_ddsc, m_waitIndicator->GetBitmap(), 0, 0, diff --git a/LEGO1/mxtransitionmanager.h b/LEGO1/mxtransitionmanager.h index e66c2feb..e55e4804 100644 --- a/LEGO1/mxtransitionmanager.h +++ b/LEGO1/mxtransitionmanager.h @@ -24,9 +24,9 @@ public: } // FUNCTION: LEGO1 0x1004b960 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxTransitionManager::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, MxTransitionManager::ClassName()) || MxCore::IsA(p_name); } virtual MxResult GetDDrawSurfaceFromVideoManager(); // vtable+0x14 @@ -45,23 +45,23 @@ public: private: void EndTransition(MxBool p_notifyWorld); - void Transition_None(); - void Transition_Dissolve(); - void Transition_Pixelation(); - void Transition_Wipe(); - void Transition_Windows(); - void Transition_Broken(); + void TransitionNone(); + void TransitionDissolve(); + void TransitionPixelation(); + void TransitionWipe(); + void TransitionWindows(); + void TransitionBroken(); - void SubmitCopyRect(LPDDSURFACEDESC ddsc); - void SetupCopyRect(LPDDSURFACEDESC ddsc); + void SubmitCopyRect(LPDDSURFACEDESC p_ddsc); + void SetupCopyRect(LPDDSURFACEDESC p_ddsc); MxVideoPresenter* m_waitIndicator; RECT m_copyRect; MxU8* m_copyBuffer; - flag_bitfield m_copyFlags; - undefined4 m_unk24; - flag_bitfield m_unk28; + FlagBitfield m_copyFlags; + undefined4 m_unk0x24; + FlagBitfield m_unk0x28; TransitionType m_transitionType; LPDIRECTDRAWSURFACE m_ddSurface; diff --git a/LEGO1/mxtype17notificationparam.h b/LEGO1/mxtype17notificationparam.h index 061cb768..cf4e78fa 100644 --- a/LEGO1/mxtype17notificationparam.h +++ b/LEGO1/mxtype17notificationparam.h @@ -7,14 +7,14 @@ // ??? This type is handled, but seemingly never created and no VTABLE fits class MxType17NotificationParam : public MxNotificationParam { public: - inline MxU32 GetUnknown20() { return m_unk20; } - inline MxU16 GetUnknown28() { return m_unk28; } + inline MxU32 GetUnknown20() { return m_unk0x20; } + inline MxU16 GetUnknown28() { return m_unk0x28; } protected: - undefined m_unkc[0x14]; - MxU32 m_unk20; - undefined4 m_unk24; - MxU16 m_unk28; + undefined m_unk0xc[0x14]; + MxU32 m_unk0x20; + undefined4 m_unk0x24; + MxU16 m_unk0x28; }; #endif // MXTYPE17NOTIFICATIONPARAM_H diff --git a/LEGO1/mxtypes.h b/LEGO1/mxtypes.h index 153289a1..9ec63222 100644 --- a/LEGO1/mxtypes.h +++ b/LEGO1/mxtypes.h @@ -1,5 +1,5 @@ -#ifndef MXTYPE_H -#define MXTYPE_H +#ifndef MXTYPES_H +#define MXTYPES_H typedef unsigned char MxU8; typedef signed char MxS8; @@ -58,16 +58,16 @@ typedef MxU8 MxBool; // Must be union with struct for match. typedef union { struct { - MxU8 bit0 : 1; - MxU8 bit1 : 1; - MxU8 bit2 : 1; - MxU8 bit3 : 1; - MxU8 bit4 : 1; - MxU8 bit5 : 1; - MxU8 bit6 : 1; - MxU8 bit7 : 1; + MxU8 m_bit0 : 1; + MxU8 m_bit1 : 1; + MxU8 m_bit2 : 1; + MxU8 m_bit3 : 1; + MxU8 m_bit4 : 1; + MxU8 m_bit5 : 1; + MxU8 m_bit6 : 1; + MxU8 m_bit7 : 1; }; // BYTE all; // ? -} flag_bitfield; +} FlagBitfield; -#endif // MXTYPE_H +#endif // MXTYPES_H diff --git a/LEGO1/mxvariable.cpp b/LEGO1/mxvariable.cpp index 59fd0a8b..a60051fd 100644 --- a/LEGO1/mxvariable.cpp +++ b/LEGO1/mxvariable.cpp @@ -12,9 +12,9 @@ MxString* MxVariable::GetValue() } // FUNCTION: LEGO1 0x1003beb0 -void MxVariable::SetValue(const char* value) +void MxVariable::SetValue(const char* p_value) { - m_value = value; + m_value = p_value; } // FUNCTION: LEGO1 0x1003bec0 diff --git a/LEGO1/mxvariable.h b/LEGO1/mxvariable.h index d4f2e76e..d1434467 100644 --- a/LEGO1/mxvariable.h +++ b/LEGO1/mxvariable.h @@ -21,7 +21,7 @@ public: m_value = p_value; } virtual MxString* GetValue(); - virtual void SetValue(const char*); + virtual void SetValue(const char* p_value); virtual void Destroy(); inline const MxString* GetKey() const { return &m_key; } diff --git a/LEGO1/mxvariabletable.h b/LEGO1/mxvariabletable.h index b8e831c9..7821311e 100644 --- a/LEGO1/mxvariabletable.h +++ b/LEGO1/mxvariabletable.h @@ -54,6 +54,6 @@ public: // MxHashTable<MxVariable *>::Resize // TEMPLATE: LEGO1 0x100b7b80 -// MxHashTable<MxVariable *>::_NodeInsert +// MxHashTable<MxVariable *>::NodeInsert #endif // MXVARIABLETABLE_H diff --git a/LEGO1/mxvideomanager.cpp b/LEGO1/mxvideomanager.cpp index e748e9b9..bd4965b9 100644 --- a/LEGO1/mxvideomanager.cpp +++ b/LEGO1/mxvideomanager.cpp @@ -14,7 +14,7 @@ MxVideoManager::MxVideoManager() } // FUNCTION: LEGO1 0x100be270 -void MxVideoManager::vtable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) +void MxVideoManager::VTable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) { } @@ -32,7 +32,7 @@ MxResult MxVideoManager::Init() this->m_displaySurface = NULL; this->m_region = NULL; this->m_videoParam.SetPalette(NULL); - this->m_unk60 = FALSE; + this->m_unk0x60 = FALSE; return SUCCESS; } @@ -57,7 +57,7 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor) if (m_videoParam.GetPalette()) delete m_videoParam.GetPalette(); - if (m_unk60) { + if (m_unk0x60) { if (m_pDirectDraw) m_pDirectDraw->Release(); if (m_pDDSurface) @@ -74,7 +74,7 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor) // FUNCTION: LEGO1 0x100be3e0 void MxVideoManager::UpdateRegion() { - if (m_region->vtable20() == FALSE) { + if (m_region->VTable0x20() == FALSE) { MxRect32 rect(m_region->GetRect(), m_videoParam.GetRect()); m_displaySurface ->Display(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); @@ -99,14 +99,14 @@ void MxVideoManager::SortPresenterList() finished = TRUE; for (MxU32 i = count; i != 0; i--) { - MxPresenter *p_a, *p_b; + MxPresenter *presenterA, *presenterB; - a.Next(p_a); - b.Next(p_b); + a.Next(presenterA); + b.Next(presenterB); - if (p_a->GetDisplayZ() < p_b->GetDisplayZ()) { - a.SetValue(p_b); - b.SetValue(p_a); + if (presenterA->GetDisplayZ() < presenterB->GetDisplayZ()) { + a.SetValue(presenterB); + b.SetValue(presenterA); finished = FALSE; } } @@ -115,7 +115,7 @@ void MxVideoManager::SortPresenterList() } // FUNCTION: LEGO1 0x100be600 -MxResult MxVideoManager::vtable0x28( +MxResult MxVideoManager::VTable0x28( MxVideoParam& p_videoParam, LPDIRECTDRAW p_pDirectDraw, LPDIRECTDRAWSURFACE p_pDDSurface, @@ -129,7 +129,7 @@ MxResult MxVideoManager::vtable0x28( MxBool locked = FALSE; MxResult status = FAILURE; - m_unk60 = FALSE; + m_unk0x60 = FALSE; if (MxMediaManager::InitPresenters() != SUCCESS) goto done; @@ -194,7 +194,7 @@ MxResult MxVideoManager::Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool locked = FALSE; MxResult status = FAILURE; - m_unk60 = TRUE; + m_unk0x60 = TRUE; if (MxMediaManager::InitPresenters() != SUCCESS) goto done; @@ -268,7 +268,7 @@ void MxVideoManager::InvalidateRect(MxRect32& p_rect) m_criticalSection.Enter(); if (m_region) - m_region->vtable18(p_rect); + m_region->VTable0x18(p_rect); m_criticalSection.Leave(); } diff --git a/LEGO1/mxvideomanager.h b/LEGO1/mxvideomanager.h index 05cfd99b..6d03d84e 100644 --- a/LEGO1/mxvideomanager.h +++ b/LEGO1/mxvideomanager.h @@ -16,7 +16,7 @@ public: virtual MxResult Tickle() override; // vtable+0x8 virtual void Destroy() override; // vtable+0x18 - virtual MxResult vtable0x28( + virtual MxResult VTable0x28( MxVideoParam& p_videoParam, LPDIRECTDRAW p_pDirectDraw, LPDIRECTDRAWSURFACE p_pDDSurface, @@ -30,7 +30,7 @@ public: __declspec(dllexport) void InvalidateRect(MxRect32&); __declspec(dllexport) virtual MxResult RealizePalette(MxPalette*); // vtable+0x30 - virtual void vtable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34 + virtual void VTable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34 MxResult Init(); void Destroy(MxBool p_fromDestructor); @@ -47,7 +47,7 @@ protected: LPDIRECTDRAWSURFACE m_pDDSurface; // 0x54 MxDisplaySurface* m_displaySurface; // 0x58 MxRegion* m_region; // 0x5c - MxBool m_unk60; // 0x60 + MxBool m_unk0x60; // 0x60 }; #endif // MXVIDEOMANAGER_H diff --git a/LEGO1/mxvideoparam.cpp b/LEGO1/mxvideoparam.cpp index 5d037c0c..c34e832c 100644 --- a/LEGO1/mxvideoparam.cpp +++ b/LEGO1/mxvideoparam.cpp @@ -16,23 +16,23 @@ MxVideoParam::MxVideoParam() this->m_rect.SetTop(0); this->m_palette = NULL; this->m_backBuffers = 0; - this->m_unk1c = 0; + this->m_unk0x1c = 0; this->m_deviceId = NULL; } // FUNCTION: LEGO1 0x100beca0 MxVideoParam::MxVideoParam( COMPAT_CONST MxRect32& p_rect, - MxPalette* p_pal, + MxPalette* p_palette, MxULong p_backBuffers, COMPAT_CONST MxVideoParamFlags& p_flags ) { this->m_rect = p_rect; - this->m_palette = p_pal; + this->m_palette = p_palette; this->m_backBuffers = p_backBuffers; this->m_flags = p_flags; - this->m_unk1c = 0; + this->m_unk0x1c = 0; this->m_deviceId = NULL; } @@ -43,7 +43,7 @@ MxVideoParam::MxVideoParam(MxVideoParam& p_videoParam) this->m_palette = p_videoParam.m_palette; this->m_backBuffers = p_videoParam.m_backBuffers; this->m_flags = p_videoParam.m_flags; - this->m_unk1c = p_videoParam.m_unk1c; + this->m_unk0x1c = p_videoParam.m_unk0x1c; this->m_deviceId = NULL; SetDeviceName(p_videoParam.m_deviceId); } @@ -56,16 +56,16 @@ MxVideoParam::~MxVideoParam() } // FUNCTION: LEGO1 0x100bed70 -void MxVideoParam::SetDeviceName(char* id) +void MxVideoParam::SetDeviceName(char* p_deviceId) { if (this->m_deviceId != NULL) delete[] this->m_deviceId; - if (id != 0) { - this->m_deviceId = new char[strlen(id) + 1]; + if (p_deviceId != NULL) { + this->m_deviceId = new char[strlen(p_deviceId) + 1]; if (this->m_deviceId != NULL) { - strcpy(this->m_deviceId, id); + strcpy(this->m_deviceId, p_deviceId); } } else { @@ -80,7 +80,7 @@ MxVideoParam& MxVideoParam::operator=(const MxVideoParam& p_videoParam) this->m_palette = p_videoParam.m_palette; this->m_backBuffers = p_videoParam.m_backBuffers; this->m_flags = p_videoParam.m_flags; - this->m_unk1c = p_videoParam.m_unk1c; + this->m_unk0x1c = p_videoParam.m_unk0x1c; SetDeviceName(p_videoParam.m_deviceId); return *this; diff --git a/LEGO1/mxvideoparam.h b/LEGO1/mxvideoparam.h index f44bce88..977c0b48 100644 --- a/LEGO1/mxvideoparam.h +++ b/LEGO1/mxvideoparam.h @@ -14,15 +14,19 @@ class MxVideoParam { public: __declspec(dllexport) MxVideoParam(); - __declspec(dllexport) MxVideoParam(MxVideoParam&); - __declspec(dllexport) - MxVideoParam(COMPAT_CONST MxRect32& rect, MxPalette* pal, MxULong p3, COMPAT_CONST MxVideoParamFlags& flags); - __declspec(dllexport) MxVideoParam& operator=(const MxVideoParam&); + __declspec(dllexport) MxVideoParam(MxVideoParam& p_videoParam); + __declspec(dllexport) MxVideoParam( + COMPAT_CONST MxRect32& p_rect, + MxPalette* p_palette, + MxULong p_backBuffers, + COMPAT_CONST MxVideoParamFlags& p_flags + ); + __declspec(dllexport) MxVideoParam& operator=(const MxVideoParam& p_videoParam); __declspec(dllexport) ~MxVideoParam(); - __declspec(dllexport) void SetDeviceName(char* id); + __declspec(dllexport) void SetDeviceName(char* p_deviceId); - inline MxVideoParamFlags& flags() { return m_flags; } + inline MxVideoParamFlags& Flags() { return m_flags; } inline void SetPalette(MxPalette* p_palette) { this->m_palette = p_palette; } inline void SetBackBuffers(MxU32 p_backBuffers) { this->m_backBuffers = p_backBuffers; } @@ -36,7 +40,7 @@ private: MxPalette* m_palette; // 0x10 MxU32 m_backBuffers; // 0x14 MxVideoParamFlags m_flags; // 0x18 - int m_unk1c; // 0x1c + int m_unk0x1c; // 0x1c char* m_deviceId; // 0x20 }; diff --git a/LEGO1/mxvideoparamflags.cpp b/LEGO1/mxvideoparamflags.cpp index 30305c3d..967ec824 100644 --- a/LEGO1/mxvideoparamflags.cpp +++ b/LEGO1/mxvideoparamflags.cpp @@ -6,10 +6,10 @@ MxVideoParamFlags::MxVideoParamFlags() this->SetFullScreen(0); this->SetFlipSurfaces(0); this->SetBackBuffers(0); - this->Set_f1bit3(0); - this->Set_f1bit4(0); + this->SetF1bit3(0); + this->SetF1bit4(0); this->Set16Bit(0); this->SetWideViewAngle(1); - this->Set_f1bit7(1); - this->Set_f2bit1(1); + this->SetF1bit7(1); + this->SetF2bit1(1); } diff --git a/LEGO1/mxvideoparamflags.h b/LEGO1/mxvideoparamflags.h index 6598dba3..551a6c0a 100644 --- a/LEGO1/mxvideoparamflags.h +++ b/LEGO1/mxvideoparamflags.h @@ -9,43 +9,43 @@ class MxVideoParamFlags { public: __declspec(dllexport) MxVideoParamFlags(); - inline void SetFullScreen(BOOL e) { m_flags1.bit0 = e; } - inline void SetFlipSurfaces(BOOL e) { m_flags1.bit1 = e; } - inline void SetBackBuffers(BOOL e) { m_flags1.bit2 = e; } - inline void Set_f1bit3(BOOL e) { m_flags1.bit3 = e; } - inline void Set_f1bit4(BOOL e) { m_flags1.bit4 = e; } - inline void Set16Bit(BYTE e) { m_flags1.bit5 = e; } - inline void SetWideViewAngle(BOOL e) { m_flags1.bit6 = e; } - inline void Set_f1bit7(BOOL e) { m_flags1.bit7 = e; } - inline void Set_f2bit0(BOOL e) { m_flags2.bit0 = e; } - inline void Set_f2bit1(BOOL e) { m_flags2.bit1 = e; } - inline void Set_f2bit2(BOOL e) { m_flags2.bit2 = e; } - inline void Set_f2bit3(BOOL e) { m_flags2.bit3 = e; } - inline void Set_f2bit4(BOOL e) { m_flags2.bit4 = e; } - inline void Set_f2bit5(BOOL e) { m_flags2.bit5 = e; } - inline void Set_f2bit6(BOOL e) { m_flags2.bit6 = e; } - inline void Set_f2bit7(BOOL e) { m_flags2.bit7 = e; } + inline void SetFullScreen(BOOL p_e) { m_flags1.m_bit0 = p_e; } + inline void SetFlipSurfaces(BOOL p_e) { m_flags1.m_bit1 = p_e; } + inline void SetBackBuffers(BOOL p_e) { m_flags1.m_bit2 = p_e; } + inline void SetF1bit3(BOOL p_e) { m_flags1.m_bit3 = p_e; } + inline void SetF1bit4(BOOL p_e) { m_flags1.m_bit4 = p_e; } + inline void Set16Bit(BYTE p_e) { m_flags1.m_bit5 = p_e; } + inline void SetWideViewAngle(BOOL p_e) { m_flags1.m_bit6 = p_e; } + inline void SetF1bit7(BOOL p_e) { m_flags1.m_bit7 = p_e; } + inline void SetF2bit0(BOOL p_e) { m_flags2.m_bit0 = p_e; } + inline void SetF2bit1(BOOL p_e) { m_flags2.m_bit1 = p_e; } + inline void SetF2bit2(BOOL p_e) { m_flags2.m_bit2 = p_e; } + inline void SetF2bit3(BOOL p_e) { m_flags2.m_bit3 = p_e; } + inline void SetF2bit4(BOOL p_e) { m_flags2.m_bit4 = p_e; } + inline void SetF2bit5(BOOL p_e) { m_flags2.m_bit5 = p_e; } + inline void SetF2bit6(BOOL p_e) { m_flags2.m_bit6 = p_e; } + inline void SetF2bit7(BOOL p_e) { m_flags2.m_bit7 = p_e; } - inline BYTE GetFullScreen() { return m_flags1.bit0; } - inline BYTE GetFlipSurfaces() { return m_flags1.bit1; } - inline BYTE GetBackBuffers() { return m_flags1.bit2; } - inline BYTE Get_f1bit3() { return m_flags1.bit3; } - inline BYTE Get_f1bit4() { return m_flags1.bit4; } - inline BYTE Get16Bit() { return m_flags1.bit5; } - inline BYTE GetWideViewAngle() { return m_flags1.bit6; } - inline BYTE Get_f1bit7() { return m_flags1.bit7; } - inline BYTE Get_f2bit0() { return m_flags2.bit0; } - inline BYTE Get_f2bit1() { return m_flags2.bit1; } - inline BYTE Get_f2bit2() { return m_flags2.bit2; } - inline BYTE Get_f2bit3() { return m_flags2.bit3; } - inline BYTE Get_f2bit4() { return m_flags2.bit4; } - inline BYTE Get_f2bit5() { return m_flags2.bit5; } - inline BYTE Get_f2bit6() { return m_flags2.bit6; } - inline BYTE Get_f2bit7() { return m_flags2.bit7; } + inline BYTE GetFullScreen() { return m_flags1.m_bit0; } + inline BYTE GetFlipSurfaces() { return m_flags1.m_bit1; } + inline BYTE GetBackBuffers() { return m_flags1.m_bit2; } + inline BYTE GetF1bit3() { return m_flags1.m_bit3; } + inline BYTE GetF1bit4() { return m_flags1.m_bit4; } + inline BYTE Get16Bit() { return m_flags1.m_bit5; } + inline BYTE GetWideViewAngle() { return m_flags1.m_bit6; } + inline BYTE GetF1bit7() { return m_flags1.m_bit7; } + inline BYTE GetF2bit0() { return m_flags2.m_bit0; } + inline BYTE GetF2bit1() { return m_flags2.m_bit1; } + inline BYTE GetF2bit2() { return m_flags2.m_bit2; } + inline BYTE GetF2bit3() { return m_flags2.m_bit3; } + inline BYTE GetF2bit4() { return m_flags2.m_bit4; } + inline BYTE GetF2bit5() { return m_flags2.m_bit5; } + inline BYTE GetF2bit6() { return m_flags2.m_bit6; } + inline BYTE GetF2bit7() { return m_flags2.m_bit7; } private: - flag_bitfield m_flags1; - flag_bitfield m_flags2; + FlagBitfield m_flags1; + FlagBitfield m_flags2; }; #endif // MXVIDEOPARAMFLAGS_H diff --git a/LEGO1/mxvideopresenter.cpp b/LEGO1/mxvideopresenter.cpp index a8673b48..186c5016 100644 --- a/LEGO1/mxvideopresenter.cpp +++ b/LEGO1/mxvideopresenter.cpp @@ -46,7 +46,7 @@ void MxVideoPresenter::Destroy() // FUNCTION: LEGO1 0x1000c7b0 LPDIRECTDRAWSURFACE MxVideoPresenter::VTable0x78() { - return m_unk58; + return m_unk0x58; } // FUNCTION: LEGO1 0x1000c7c0 @@ -72,16 +72,16 @@ MxVideoPresenter::AlphaMask::AlphaMask(const MxBitmap& p_bitmap) { m_width = p_bitmap.GetBmiWidth(); // DECOMP: ECX becomes word-sized if these are not two separate actions. - MxLong _height = p_bitmap.GetBmiHeightAbs(); - m_height = _height; + MxLong height = p_bitmap.GetBmiHeightAbs(); + m_height = height; MxS32 size = ((m_width * m_height) / 8) + 1; m_bitmask = new MxU8[size]; memset(m_bitmask, 0, size); MxU32 biCompression = p_bitmap.GetBmiHeader()->biCompression; - MxU32 rows_before_top; - MxU8* bitmap_src_ptr; + MxU32 rowsBeforeTop; + MxU8* bitmapSrcPtr; // The goal here is to enable us to walk through the bitmap's rows // in order, regardless of the orientation. We want to end up at the @@ -95,11 +95,11 @@ MxVideoPresenter::AlphaMask::AlphaMask(const MxBitmap& p_bitmap) // DECOMP: I think this must be an OR. If not, the check for // biCompression == 16 gets optimized away. if (biCompression == BI_RGB_TOPDOWN || p_bitmap.GetBmiHeight() < 0) { - rows_before_top = 0; + rowsBeforeTop = 0; } else { - rows_before_top = p_bitmap.GetBmiHeightAbs(); - rows_before_top--; + rowsBeforeTop = p_bitmap.GetBmiHeightAbs(); + rowsBeforeTop--; } goto seek_to_last_row; @@ -107,48 +107,48 @@ MxVideoPresenter::AlphaMask::AlphaMask(const MxBitmap& p_bitmap) else if (biCompression == BI_RGB_TOPDOWN) { // DECOMP: This is the only condition where we skip the // calculation below. - bitmap_src_ptr = p_bitmap.GetBitmapData(); + bitmapSrcPtr = p_bitmap.GetBitmapData(); } else { if (p_bitmap.GetBmiHeight() < 0) { - rows_before_top = 0; + rowsBeforeTop = 0; } else { - rows_before_top = p_bitmap.GetBmiHeightAbs(); - rows_before_top--; + rowsBeforeTop = p_bitmap.GetBmiHeightAbs(); + rowsBeforeTop--; } // TODO: would prefer not to use goto if we can figure this structure out seek_to_last_row: - bitmap_src_ptr = p_bitmap.GetBmiStride() * rows_before_top + p_bitmap.GetBitmapData(); + bitmapSrcPtr = p_bitmap.GetBmiStride() * rowsBeforeTop + p_bitmap.GetBitmapData(); } // How many bytes are there for each row of the bitmap? // (i.e. the image stride) // If this is a bottom-up DIB, we will walk it in reverse. // TODO: Same rounding trick as in MxBitmap - MxS32 row_seek = ((m_width + 3) & -4); + MxS32 rowSeek = ((m_width + 3) & -4); if (p_bitmap.GetBmiHeight() < 0) - row_seek = -row_seek; + rowSeek = -rowSeek; // The actual offset into the m_bitmask array. The two for-loops // are just for counting the pixels. MxS32 offset = 0; - MxU8* t_ptr = bitmap_src_ptr; + MxU8* tPtr = bitmapSrcPtr; for (MxS32 j = 0; j < m_height; j++) { for (MxS32 i = 0; i < m_width; i++) { - if (*t_ptr) { + if (*tPtr) { // TODO: Second CDQ instruction for abs() should not be there. MxU32 shift = abs(offset) & 7; m_bitmask[offset / 8] |= (1 << abs((MxS32) shift)); } - t_ptr++; + tPtr++; offset++; } // Seek to the start of the next row - bitmap_src_ptr += row_seek; - t_ptr = bitmap_src_ptr; + bitmapSrcPtr += rowSeek; + tPtr = bitmapSrcPtr; } } @@ -185,9 +185,9 @@ void MxVideoPresenter::Init() { m_bitmap = NULL; m_alpha = NULL; - m_unk5c = 1; - m_unk58 = NULL; - m_unk60 = -1; + m_unk0x5c = 1; + m_unk0x58 = NULL; + m_unk0x60 = -1; m_flags = m_flags & 0xfe; if (MVideoManager() != NULL) { @@ -206,9 +206,9 @@ void MxVideoPresenter::Destroy(MxBool p_fromDestructor) if (MVideoManager() != NULL) MVideoManager()->RemovePresenter(*this); - if (m_unk58) { - m_unk58->Release(); - m_unk58 = NULL; + if (m_unk0x58) { + m_unk0x58->Release(); + m_unk0x58 = NULL; m_flags = m_flags & 0xfd; m_flags = m_flags & 0xfb; } @@ -222,7 +222,7 @@ void MxVideoPresenter::Destroy(MxBool p_fromDestructor) MxRect32 rect(x, y, x + width, y + height); MVideoManager()->InvalidateRect(rect); - MVideoManager()->vtable0x34(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); + MVideoManager()->VTable0x34(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); } delete m_bitmap; @@ -263,20 +263,20 @@ MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y) MxLong heightAbs = m_bitmap->GetBmiHeightAbs(); - MxLong min_x = GetLocationX(); - MxLong min_y = GetLocationY(); + MxLong minX = GetLocationX(); + MxLong minY = GetLocationY(); - MxLong max_y = min_y + heightAbs; - MxLong max_x = min_x + m_bitmap->GetBmiWidth(); + MxLong maxY = minY + heightAbs; + MxLong maxX = minX + m_bitmap->GetBmiWidth(); - if (p_x < min_x || p_x >= max_x || p_y < min_y || p_y >= max_y) + if (p_x < minX || p_x >= maxX || p_y < minY || p_y >= maxY) return FALSE; MxU8* pixel; MxLong biCompression = m_bitmap->GetBmiHeader()->biCompression; MxLong height = m_bitmap->GetBmiHeight(); - MxLong seek_row; + MxLong seekRow; // DECOMP: Same basic layout as AlphaMask constructor // The idea here is to again seek to the correct place in the bitmap's @@ -285,13 +285,13 @@ MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y) // the MxPresenter location x and y coordinates. if (biCompression == BI_RGB) { if (biCompression == BI_RGB_TOPDOWN || height < 0) { - seek_row = p_y - GetLocationY(); + seekRow = p_y - GetLocationY(); } else { height = height > 0 ? height : -height; - seek_row = height - p_y - 1 + GetLocationY(); + seekRow = height - p_y - 1 + GetLocationY(); } - pixel = m_bitmap->GetBmiStride() * seek_row + m_bitmap->GetBitmapData() - GetLocationX() + p_x; + pixel = m_bitmap->GetBmiStride() * seekRow + m_bitmap->GetBitmapData() - GetLocationX() + p_x; } else if (biCompression == BI_RGB_TOPDOWN) { pixel = m_bitmap->GetBitmapData(); @@ -357,7 +357,7 @@ void MxVideoPresenter::StreamingTickle() } } else { - for (MxS16 i = 0; i < m_unk5c; i++) { + for (MxS16 i = 0; i < m_unk0x5c; i++) { if (!m_currentChunk) { MxMediaPresenter::StreamingTickle(); @@ -378,7 +378,7 @@ void MxVideoPresenter::StreamingTickle() } if (m_flags & Flag_Bit1) - m_unk5c = 5; + m_unk0x5c = 5; } } @@ -396,7 +396,7 @@ void MxVideoPresenter::RepeatingTickle() } } else { - for (MxS16 i = 0; i < m_unk5c; i++) { + for (MxS16 i = 0; i < m_unk0x5c; i++) { if (!m_currentChunk) { MxMediaPresenter::RepeatingTickle(); @@ -416,7 +416,7 @@ void MxVideoPresenter::RepeatingTickle() } if (m_flags & Flag_Bit1) - m_unk5c = 5; + m_unk0x5c = 5; } } } @@ -428,10 +428,10 @@ void MxVideoPresenter::Unk5Tickle() if (sustainTime != -1) { if (sustainTime) { - if (m_unk60 == -1) - m_unk60 = m_action->GetElapsedTime(); + if (m_unk0x60 == -1) + m_unk0x60 = m_action->GetElapsedTime(); - if (m_action->GetElapsedTime() >= m_unk60 + ((MxDSMediaAction*) m_action)->GetSustainTime()) { + if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime()) { m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Done; } diff --git a/LEGO1/mxvideopresenter.h b/LEGO1/mxvideopresenter.h index a3e688fa..d25ecb2b 100644 --- a/LEGO1/mxvideopresenter.h +++ b/LEGO1/mxvideopresenter.h @@ -28,9 +28,9 @@ public: } // FUNCTION: LEGO1 0x1000c830 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxVideoPresenter::ClassName()) || MxMediaPresenter::IsA(name); + return !strcmp(p_name, MxVideoPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 @@ -76,12 +76,12 @@ private: protected: void Destroy(MxBool p_fromDestructor); - MxBitmap* m_bitmap; // 0x50 - AlphaMask* m_alpha; // 0x54 - LPDIRECTDRAWSURFACE m_unk58; // 0x58 - MxS16 m_unk5c; // 0x5c - MxU8 m_flags; // 0x5e - MxLong m_unk60; // 0x60 + MxBitmap* m_bitmap; // 0x50 + AlphaMask* m_alpha; // 0x54 + LPDIRECTDRAWSURFACE m_unk0x58; // 0x58 + MxS16 m_unk0x5c; // 0x5c + MxU8 m_flags; // 0x5e + MxLong m_unk0x60; // 0x60 }; #endif // MXVIDEOPRESENTER_H diff --git a/LEGO1/mxwavepresenter.cpp b/LEGO1/mxwavepresenter.cpp index 3468b538..80096f73 100644 --- a/LEGO1/mxwavepresenter.cpp +++ b/LEGO1/mxwavepresenter.cpp @@ -38,7 +38,7 @@ void MxWavePresenter::Init() m_lockSize = 0; m_writtenChunks = 0; m_started = FALSE; - m_unk66 = FALSE; + m_unk0x66 = FALSE; m_paused = FALSE; } @@ -170,7 +170,7 @@ void MxWavePresenter::StartingTickle() memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); - if (m_unk66) + if (m_unk0x66) desc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRL3D | DSBCAPS_CTRLVOLUME; else desc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME; @@ -335,9 +335,9 @@ void MxWavePresenter::ParseExtra() memcpy(extraCopy, extraData, len); extraCopy[len] = '\0'; - char t_soundValue[512]; - if (KeyValueStringParse(t_soundValue, g_strSOUND, extraCopy)) { - if (!strcmpi(t_soundValue, "FALSE")) + char soundValue[512]; + if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) { + if (!strcmpi(soundValue, "FALSE")) Enable(FALSE); } } diff --git a/LEGO1/mxwavepresenter.h b/LEGO1/mxwavepresenter.h index 97308dba..ddb2b480 100644 --- a/LEGO1/mxwavepresenter.h +++ b/LEGO1/mxwavepresenter.h @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x1000d6d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, MxWavePresenter::ClassName()) || MxSoundPresenter::IsA(name); + return !strcmp(p_name, MxWavePresenter::ClassName()) || MxSoundPresenter::IsA(p_name); } virtual void ReadyTickle() override; // vtable+0x18 @@ -63,7 +63,7 @@ private: MxU32 m_lockSize; // 0x60 MxU8 m_writtenChunks; // 0x64 MxBool m_started; // 0x65 - MxBool m_unk66; // 0x66 + MxBool m_unk0x66; // 0x66 MxS8 m_silenceData; // 0x67 MxBool m_paused; // 0x68 }; diff --git a/LEGO1/pizza.cpp b/LEGO1/pizza.cpp index 1a07d27a..3b0201f6 100644 --- a/LEGO1/pizza.cpp +++ b/LEGO1/pizza.cpp @@ -5,13 +5,13 @@ DECOMP_SIZE_ASSERT(Pizza, 0x9c); // FUNCTION: LEGO1 0x10037ef0 Pizza::Pizza() { - this->m_unk7c = 0; - this->m_unk80 = 0; - this->m_unk84 = 0; - this->m_unk88 = 0; - this->m_unk8c = -1; - this->m_unk98 = 0; - this->m_unk90 = 0x80000000; + this->m_unk0x7c = 0; + this->m_unk0x80 = 0; + this->m_unk0x84 = 0; + this->m_unk0x88 = 0; + this->m_unk0x8c = -1; + this->m_unk0x98 = 0; + this->m_unk0x90 = 0x80000000; } // FUNCTION: LEGO1 0x10038100 diff --git a/LEGO1/pizza.h b/LEGO1/pizza.h index b92f21ac..f1ac9f45 100644 --- a/LEGO1/pizza.h +++ b/LEGO1/pizza.h @@ -25,21 +25,21 @@ public: } // FUNCTION: LEGO1 0x10037fa0 - inline MxBool IsA(const char* name) const override // vtable+10 + inline MxBool IsA(const char* p_name) const override // vtable+10 { - return !strcmp(name, Pizza::ClassName()) || IsleActor::IsA(name); + return !strcmp(p_name, Pizza::ClassName()) || IsleActor::IsA(p_name); } private: - undefined4 m_unk78; - undefined4 m_unk7c; - undefined4 m_unk80; - undefined4 m_unk84; - undefined4 m_unk88; - undefined4 m_unk8c; - undefined4 m_unk90; - undefined4 m_unk94; - undefined m_unk98; + undefined4 m_unk0x78; + undefined4 m_unk0x7c; + undefined4 m_unk0x80; + undefined4 m_unk0x84; + undefined4 m_unk0x88; + undefined4 m_unk0x8c; + undefined4 m_unk0x90; + undefined4 m_unk0x94; + undefined m_unk0x98; }; #endif // PIZZA_H diff --git a/LEGO1/pizzamissionstate.cpp b/LEGO1/pizzamissionstate.cpp index 7b2c3628..a7aa59b4 100644 --- a/LEGO1/pizzamissionstate.cpp +++ b/LEGO1/pizzamissionstate.cpp @@ -4,10 +4,10 @@ DECOMP_SIZE_ASSERT(PizzaMissionStateEntry, 0x20) DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb0) // FUNCTION: LEGO1 0x10039510 -PizzaMissionStateEntry* PizzaMissionState::GetState(MxU8 id) +PizzaMissionStateEntry* PizzaMissionState::GetState(MxU8 p_id) { for (MxS16 i = 0; i < 5; i++) - if (m_state[i].m_id == id) + if (m_state[i].m_id == p_id) return m_state + i; return NULL; } diff --git a/LEGO1/pizzamissionstate.h b/LEGO1/pizzamissionstate.h index 50db4af1..a9231c81 100644 --- a/LEGO1/pizzamissionstate.h +++ b/LEGO1/pizzamissionstate.h @@ -5,11 +5,11 @@ struct PizzaMissionStateEntry { public: - undefined2 m_unk0; + undefined2 m_unk0x0; MxU8 m_id; - undefined m_unk3[0x15]; + undefined m_unk0x3[0x15]; MxU16 m_color; - undefined m_unk18[6]; + undefined m_unk0x18[6]; }; // VTABLE: LEGO1 0x100d7408 @@ -23,19 +23,19 @@ public: } // FUNCTION: LEGO1 0x100392a0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, PizzaMissionState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, PizzaMissionState::ClassName()) || LegoState::IsA(p_name); } - inline MxU16 GetColor(MxU8 id) { return GetState(id)->m_color; } + inline MxU16 GetColor(MxU8 p_id) { return GetState(p_id)->m_color; } private: - PizzaMissionStateEntry* GetState(MxU8 id); + PizzaMissionStateEntry* GetState(MxU8 p_id); protected: - undefined4 m_unk8; - undefined4 m_unkc; + undefined4 m_unk0x8; + undefined4 m_unk0xc; PizzaMissionStateEntry m_state[5]; }; diff --git a/LEGO1/pizzeria.h b/LEGO1/pizzeria.h index f656716c..65a3b195 100644 --- a/LEGO1/pizzeria.h +++ b/LEGO1/pizzeria.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000e790 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Pizzeria::ClassName()) || IsleActor::IsA(name); + return !strcmp(p_name, Pizzeria::ClassName()) || IsleActor::IsA(p_name); } }; diff --git a/LEGO1/pizzeriastate.h b/LEGO1/pizzeriastate.h index d8256b78..53f4ddd5 100644 --- a/LEGO1/pizzeriastate.h +++ b/LEGO1/pizzeriastate.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x10017c30 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, PizzeriaState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, PizzeriaState::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/police.cpp b/LEGO1/police.cpp index a8b409f3..67577ecc 100644 --- a/LEGO1/police.cpp +++ b/LEGO1/police.cpp @@ -13,7 +13,7 @@ Police::~Police() } // STUB: LEGO1 0x1005e480 -MxLong Police::Notify(MxParam& p) +MxLong Police::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/police.h b/LEGO1/police.h index a6b32852..0da58828 100644 --- a/LEGO1/police.h +++ b/LEGO1/police.h @@ -11,7 +11,7 @@ public: Police(); virtual ~Police() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x1005e1e0 inline virtual const char* ClassName() const override // vtable+0xc @@ -21,9 +21,9 @@ public: } // FUNCTION: LEGO1 0x1005e1f0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Police::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Police::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/policeentity.h b/LEGO1/policeentity.h index 49e7e492..e2314dd3 100644 --- a/LEGO1/policeentity.h +++ b/LEGO1/policeentity.h @@ -15,9 +15,9 @@ public: } // FUNCTION: LEGO1 0x1000ed70 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, PoliceEntity::ClassName()) || BuildingEntity::IsA(name); + return !strcmp(p_name, PoliceEntity::ClassName()) || BuildingEntity::IsA(p_name); } }; diff --git a/LEGO1/policestate.h b/LEGO1/policestate.h index 603a4f6c..b3a732c9 100644 --- a/LEGO1/policestate.h +++ b/LEGO1/policestate.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1005e870 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, PoliceState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, PoliceState::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/racecar.cpp b/LEGO1/racecar.cpp index 207c02c9..0fbc97b9 100644 --- a/LEGO1/racecar.cpp +++ b/LEGO1/racecar.cpp @@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(RaceCar, 0x164); // FUNCTION: LEGO1 0x10028200 RaceCar::RaceCar() { - this->m_unk13c = 40.0; + this->m_unk0x13c = 40.0; } // STUB: LEGO1 0x10028420 diff --git a/LEGO1/racecar.h b/LEGO1/racecar.h index 01ca89c5..b0db77c5 100644 --- a/LEGO1/racecar.h +++ b/LEGO1/racecar.h @@ -19,14 +19,14 @@ public: } // FUNCTION: LEGO1 0x10028280 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, RaceCar::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, RaceCar::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: RaceCar fields - undefined m_unk160[4]; + undefined m_unk0x160[4]; }; #endif // RACECAR_H diff --git a/LEGO1/racestate.cpp b/LEGO1/racestate.cpp index 61511536..4776f97c 100644 --- a/LEGO1/racestate.cpp +++ b/LEGO1/racestate.cpp @@ -12,12 +12,12 @@ RaceState::RaceState() } // FUNCTION: LEGO1 0x10016280 -RaceStateEntry* RaceState::GetState(MxU8 id) +RaceStateEntry* RaceState::GetState(MxU8 p_id) { for (MxS16 i = 0;; i++) { if (i >= 5) return NULL; - if (m_state[i].m_id == id) + if (m_state[i].m_id == p_id) return m_state + i; } } diff --git a/LEGO1/racestate.h b/LEGO1/racestate.h index 3ed0c429..63a775d4 100644 --- a/LEGO1/racestate.h +++ b/LEGO1/racestate.h @@ -6,8 +6,8 @@ struct RaceStateEntry { public: MxU8 m_id; - undefined m_unk1[1]; - MxU16 m_unk2; + undefined m_unk0x1[1]; + MxU16 m_unk0x2; MxU16 m_color; }; @@ -25,20 +25,20 @@ public: } // FUNCTION: LEGO1 0x10016020 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, RaceState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, RaceState::ClassName()) || LegoState::IsA(p_name); } - inline MxU16 GetColor(MxU8 id) { return GetState(id)->m_color; } + inline MxU16 GetColor(MxU8 p_id) { return GetState(p_id)->m_color; } private: - RaceStateEntry* GetState(MxU8 id); + RaceStateEntry* GetState(MxU8 p_id); protected: RaceStateEntry m_state[5]; - undefined2 m_unk26[2]; - undefined4 m_unk28; + undefined2 m_unk0x26[2]; + undefined4 m_unk0x28; }; #endif // RACESTATE_H diff --git a/LEGO1/radio.h b/LEGO1/radio.h index 1c4ae4de..3476d89b 100644 --- a/LEGO1/radio.h +++ b/LEGO1/radio.h @@ -16,9 +16,9 @@ public: } // FUNCTION: LEGO1 0x1002c8f0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Radio::ClassName()) || MxCore::IsA(name); + return !strcmp(p_name, Radio::ClassName()) || MxCore::IsA(p_name); } }; diff --git a/LEGO1/radiostate.h b/LEGO1/radiostate.h index 20ae9ac6..dc2c8b8f 100644 --- a/LEGO1/radiostate.h +++ b/LEGO1/radiostate.h @@ -17,9 +17,9 @@ public: } // FUNCTION: LEGO1 0x1002cf70 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, RadioState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, RadioState::ClassName()) || LegoState::IsA(p_name); } }; diff --git a/LEGO1/realtime/orientableroi.h b/LEGO1/realtime/orientableroi.h index bb14815b..ddc93103 100644 --- a/LEGO1/realtime/orientableroi.h +++ b/LEGO1/realtime/orientableroi.h @@ -37,13 +37,13 @@ public: virtual void UpdateWorldVelocity(); protected: - char m_unkc; + char m_unk0xc; Matrix4Data m_local2world; // 0x10 BoundingBox m_world_bounding_box; // 0x58 BoundingSphere m_world_bounding_sphere; // 0xa8 Vector3Data m_world_velocity; // 0xc0 - unsigned int m_unkd4; - unsigned int m_unkd8; + unsigned int m_unk0xd4; + unsigned int m_unk0xd8; }; #endif // ORIENTABLEROI_H diff --git a/LEGO1/realtime/roi.h b/LEGO1/realtime/roi.h index 40cff140..223d5326 100644 --- a/LEGO1/realtime/roi.h +++ b/LEGO1/realtime/roi.h @@ -22,8 +22,8 @@ public: private: Vector3Data min; Vector3Data max; - Vector3Data m_unk28; - Vector3Data m_unk3c; + Vector3Data m_unk0x28; + Vector3Data m_unk0x3c; }; /* diff --git a/LEGO1/registrationbook.cpp b/LEGO1/registrationbook.cpp index fc7cf39b..eb7e099a 100644 --- a/LEGO1/registrationbook.cpp +++ b/LEGO1/registrationbook.cpp @@ -13,7 +13,7 @@ RegistrationBook::~RegistrationBook() } // STUB: LEGO1 0x100770e0 -MxLong RegistrationBook::Notify(MxParam& p) +MxLong RegistrationBook::Notify(MxParam& p_param) { // TODO diff --git a/LEGO1/registrationbook.h b/LEGO1/registrationbook.h index d0eeafa9..4f19a8dc 100644 --- a/LEGO1/registrationbook.h +++ b/LEGO1/registrationbook.h @@ -10,7 +10,7 @@ public: RegistrationBook(); virtual ~RegistrationBook() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x10076e10 inline virtual const char* ClassName() const override // vtable+0x0c @@ -20,9 +20,9 @@ public: } // FUNCTION: LEGO1 0x10076e20 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, RegistrationBook::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, RegistrationBook::ClassName()) || LegoWorld::IsA(p_name); } }; diff --git a/LEGO1/score.cpp b/LEGO1/score.cpp index 62502e60..9f22fd0d 100644 --- a/LEGO1/score.cpp +++ b/LEGO1/score.cpp @@ -18,7 +18,7 @@ DECOMP_SIZE_ASSERT(Score, 0x104) // FUNCTION: LEGO1 0x10001000 Score::Score() { - m_unkf8 = 0; + m_unk0xf8 = 0; NotificationManager()->Register(this); } @@ -72,31 +72,31 @@ void Score::DeleteScript() } // FUNCTION: LEGO1 0x10001410 -MxLong Score::Notify(MxParam& p) +MxLong Score::Notify(MxParam& p_param) { MxLong ret = 0; - LegoWorld::Notify(p); - if (m_unkf6) { - switch (((MxNotificationParam&) p).GetNotification()) { + LegoWorld::Notify(p_param); + if (m_unk0xf6) { + switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationStartAction: ret = 1; Paint(); break; case c_notificationEndAction: - ret = FUN_10001510((MxEndActionNotificationParam&) p); + ret = FUN_10001510((MxEndActionNotificationParam&) p_param); break; case c_notificationKeyPress: - if (((LegoEventNotificationParam&) p).GetKey() == 0x20) + if (((LegoEventNotificationParam&) p_param).GetKey() == 0x20) DeleteScript(); // Shutting down ret = 1; break; case TYPE17: - ret = FUN_100016d0((MxType17NotificationParam&) p); + ret = FUN_100016d0((MxType17NotificationParam&) p_param); break; case MXTRANSITIONMANAGER_TRANSITIONENDED: DeleteObjects(g_infoscorScript, 7, 9); - if (m_unkf8) - GameState()->HandleAction(m_unkf8); + if (m_unk0xf8) + GameState()->HandleAction(m_unk0xf8); ret = 1; break; default: @@ -107,15 +107,15 @@ MxLong Score::Notify(MxParam& p) } // FUNCTION: LEGO1 0x10001510 -MxLong Score::FUN_10001510(MxEndActionNotificationParam& p) +MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param) { - MxDSAction* action = p.GetAction(); + MxDSAction* action = p_param.GetAction(); if (m_atom == action->GetAtomId()) { MxU32 id = action->GetObjectId(); switch (action->GetObjectId()) { case 10: - m_unkf8 = 0x38; + m_unk0xf8 = 0x38; TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); break; case 0x1f5: @@ -151,19 +151,19 @@ void Score::Stop() } // FUNCTION: LEGO1 0x100016d0 -MxLong Score::FUN_100016d0(MxType17NotificationParam& p) +MxLong Score::FUN_100016d0(MxType17NotificationParam& p_param) { - MxS16 l = p.GetUnknown28(); + MxS16 l = p_param.GetUnknown28(); - if (l == 1 || p.GetUnknown20() == 4) { - switch (p.GetUnknown20()) { + if (l == 1 || p_param.GetUnknown20() == 4) { + switch (p_param.GetUnknown20()) { case 1: - m_unkf8 = 2; + m_unk0xf8 = 2; DeleteScript(); TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); break; case 2: - m_unkf8 = 3; + m_unk0xf8 = 3; DeleteScript(); TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); break; @@ -320,6 +320,6 @@ void Score::FillArea(MxU32 p_x, MxU32 p_y, MxS16 p_color) MxBool Score::VTable0x64() { DeleteScript(); - m_unkf8 = 2; + m_unk0xf8 = 2; return TRUE; } diff --git a/LEGO1/score.h b/LEGO1/score.h index 3b4e99de..03a20a0a 100644 --- a/LEGO1/score.h +++ b/LEGO1/score.h @@ -12,8 +12,8 @@ class Score : public LegoWorld { public: Score(); - virtual ~Score() override; // vtable+0x0 - virtual MxLong Notify(MxParam& p) override; // vtable+0x4 + virtual ~Score() override; // vtable+0x0 + virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 // FUNCTION: LEGO1 0x100010c0 inline virtual const char* ClassName() const override // vtable+0x0c @@ -23,9 +23,9 @@ public: } // FUNCTION: LEGO1 0x100010d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, Score::ClassName()) || LegoWorld::IsA(name); + return !strcmp(p_name, Score::ClassName()) || LegoWorld::IsA(p_name); } // SYNTHETIC: LEGO1 0x100011e0 @@ -38,12 +38,12 @@ public: virtual void VTable0x68(MxBool p_add) override; // vtable+68 void Paint(); - MxLong FUN_10001510(MxEndActionNotificationParam& p); - MxLong FUN_100016d0(MxType17NotificationParam& p); + MxLong FUN_10001510(MxEndActionNotificationParam& p_param); + MxLong FUN_100016d0(MxType17NotificationParam& p_param); void FillArea(MxU32 p_x, MxU32 p_y, MxS16 p_color); protected: - undefined4 m_unkf8; + undefined4 m_unk0xf8; ScoreState* m_state; MxU8* m_surface; diff --git a/LEGO1/scorestate.h b/LEGO1/scorestate.h index d02f3179..2797ad34 100644 --- a/LEGO1/scorestate.h +++ b/LEGO1/scorestate.h @@ -15,9 +15,9 @@ public: }; // FUNCTION: LEGO1 0x1000de50 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, ScoreState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, ScoreState::ClassName()) || LegoState::IsA(p_name); }; virtual MxBool VTable0x14() override; // vtable+0x14 diff --git a/LEGO1/skateboard.cpp b/LEGO1/skateboard.cpp index 19dfd02b..96a26bcd 100644 --- a/LEGO1/skateboard.cpp +++ b/LEGO1/skateboard.cpp @@ -9,10 +9,10 @@ DECOMP_SIZE_ASSERT(SkateBoard, 0x168); // FUNCTION: LEGO1 0x1000fd40 SkateBoard::SkateBoard() { - this->m_unk160 = 0; - this->m_unk13c = 15.0; - this->m_unk150 = 3.5; - this->m_unk148 = 1; + this->m_unk0x160 = 0; + this->m_unk0x13c = 15.0; + this->m_unk0x150 = 3.5; + this->m_unk0x148 = 1; NotificationManager()->Register(this); } diff --git a/LEGO1/skateboard.h b/LEGO1/skateboard.h index c02eaed3..671c7f86 100644 --- a/LEGO1/skateboard.h +++ b/LEGO1/skateboard.h @@ -18,15 +18,15 @@ public: } // FUNCTION: LEGO1 0x1000fde0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, SkateBoard::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, SkateBoard::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: SkateBoard types - undefined m_unk160; - undefined m_unk161[0x7]; + undefined m_unk0x160; + undefined m_unk0x161[0x7]; }; #endif // SKATEBOARD_H diff --git a/LEGO1/towtrack.cpp b/LEGO1/towtrack.cpp index 9117d88b..3fd0d84d 100644 --- a/LEGO1/towtrack.cpp +++ b/LEGO1/towtrack.cpp @@ -5,13 +5,13 @@ DECOMP_SIZE_ASSERT(TowTrack, 0x180); // FUNCTION: LEGO1 0x1004c720 TowTrack::TowTrack() { - this->m_unk168 = 0; - this->m_unk16a = -1; - this->m_unk164 = 0; - this->m_unk16c = 0; - this->m_unk170 = -1; - this->m_unk16e = 0; - this->m_unk174 = -1; - this->m_unk13c = 40.0; - this->m_unk178 = 1.0; + this->m_unk0x168 = 0; + this->m_unk0x16a = -1; + this->m_unk0x164 = 0; + this->m_unk0x16c = 0; + this->m_unk0x170 = -1; + this->m_unk0x16e = 0; + this->m_unk0x174 = -1; + this->m_unk0x13c = 40.0; + this->m_unk0x178 = 1.0; } diff --git a/LEGO1/towtrack.h b/LEGO1/towtrack.h index 07eeeba4..2243f9a2 100644 --- a/LEGO1/towtrack.h +++ b/LEGO1/towtrack.h @@ -18,23 +18,23 @@ public: } // FUNCTION: LEGO1 0x1004c7d0 - inline virtual MxBool IsA(const char* name) const override // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 { - return !strcmp(name, TowTrack::ClassName()) || IslePathActor::IsA(name); + return !strcmp(p_name, TowTrack::ClassName()) || IslePathActor::IsA(p_name); } private: // TODO: TowTrack field types - undefined m_unk154[4]; - MxS32 m_unk164; - MxS16 m_unk168; - MxS16 m_unk16a; - MxS16 m_unk16c; - MxS16 m_unk16e; - MxS32 m_unk170; - MxS32 m_unk174; - MxFloat m_unk178; - undefined4 m_unk17c; + undefined m_unk0x154[4]; + MxS32 m_unk0x164; + MxS16 m_unk0x168; + MxS16 m_unk0x16a; + MxS16 m_unk0x16c; + MxS16 m_unk0x16e; + MxS32 m_unk0x170; + MxS32 m_unk0x174; + MxFloat m_unk0x178; + undefined4 m_unk0x17c; }; #endif // TOWTRACK_H diff --git a/LEGO1/towtrackmissionstate.h b/LEGO1/towtrackmissionstate.h index 81d3f83d..7537cb94 100644 --- a/LEGO1/towtrackmissionstate.h +++ b/LEGO1/towtrackmissionstate.h @@ -17,14 +17,14 @@ public: } // FUNCTION: LEGO1 0x1004dfb0 - inline virtual MxBool IsA(const char* name) const // vtable+0x10 + inline virtual MxBool IsA(const char* p_name) const // vtable+0x10 { - return !strcmp(name, TowTrackMissionState::ClassName()) || LegoState::IsA(name); + return !strcmp(p_name, TowTrackMissionState::ClassName()) || LegoState::IsA(p_name); } - inline MxU16 GetColor(MxU8 id) + inline MxU16 GetColor(MxU8 p_id) { - switch (id) { + switch (p_id) { case 1: return m_color1; case 2: @@ -41,7 +41,7 @@ public: } protected: - undefined m_unk8[0x14]; + undefined m_unk0x8[0x14]; MxU16 m_color1; MxU16 m_color2; MxU16 m_color3; diff --git a/tools/README.md b/tools/README.md index 661df560..da23d84c 100644 --- a/tools/README.md +++ b/tools/README.md @@ -106,10 +106,10 @@ Member variables should be annotated with their relative offsets. ``` class MxDSObject : public MxCore { private: - MxU32 m_sizeOnDisk; // 0x8 - MxU16 m_type; // 0xc - char* m_sourceName; // 0x10 - undefined4 m_unk14; // 0x14 + MxU32 m_sizeOnDisk; // 0x8 + MxU16 m_type; // 0xc + char* m_sourceName; // 0x10 + undefined4 m_unk0x14; // 0x14 ``` ## Global variables (**WIP**) @@ -135,9 +135,11 @@ Use `pip` to install the required packages to be able to use the Python tools fo pip install -r tools/requirements.txt ``` +* [`patch_c2.py`](/tools/patch_c2.py): Patches `C2.EXE` (part of MSVC 4.20), to get rid of a bugged warning * [`reccmp`](/tools/reccmp): Compares the original EXE or DLL with a recompiled EXE or DLL, provided a PDB file -* [`verexp`](/tools/checkorder): Verifies exports by comparing the exports of the original DLL and the recompiled DLL -* [`checkorder`](/tools/checkorder): Checks function declarations, ensuring they appear in ascending order within a unit +* [`verexp`](/tools/verexp): Verifies exports by comparing the exports of the original DLL and the recompiled DLL +* [`decomplint`](/tools/decomplint): Checks the decompilation annotations (see above) +* [`ncc`](/tools/ncc): Checks naming conventions based on a set of rules * [`isledecomp`](/tools/isledecomp): A library that implements a parser to identify the "decompilation" annotations (see above) ## Testing diff --git a/tools/ncc/ncc.py b/tools/ncc/ncc.py new file mode 100644 index 00000000..89ad5dbc --- /dev/null +++ b/tools/ncc/ncc.py @@ -0,0 +1,661 @@ +#!/usr/bin/env python + +# MIT License +# +# Copyright (c) 2018 Nithin Nellikunnu (nithin.nn@gmail.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import logging +import argparse +import yaml +import re +import sys +import difflib +import os +import fnmatch +from clang.cindex import Index +from clang.cindex import CursorKind +from clang.cindex import StorageClass +from clang.cindex import TypeKind +from clang.cindex import Config + + +# Clang cursor kind to ncc Defined cursor map +default_rules_db = {} +clang_to_user_map = {} +special_kind = {CursorKind.STRUCT_DECL: 1, CursorKind.CLASS_DECL: 1} +file_extensions = [".c", ".cpp", ".h", ".hpp"] + + +class Rule(object): + def __init__(self, name, clang_kind, parent_kind=None, pattern_str='^.*$'): + self.name = name + self.clang_kind = clang_kind + self.parent_kind = parent_kind + self.pattern_str = pattern_str + self.pattern = re.compile(pattern_str) + self.includes = [] + self.excludes = [] + + def evaluate(self, node, scope=None): + if not self.pattern.match(node.spelling): + fmt = '{}:{}:{}: "{}" does not match "{}" associated with {}\n' + msg = fmt.format(node.location.file.name, node.location.line, node.location.column, + node.displayname, self.pattern_str, self.name) + sys.stderr.write(msg) + return False + return True + + +class ScopePrefixRule(object): + def __init__(self, pattern_obj): + self.name = "ScopePrefixRule" + self.rule_names = ["Global", "Static", "ClassMember", "StructMember"] + self.global_prefix = "" + self.static_prefix = "" + self.class_member_prefix = "" + self.struct_member_prefix = "" + + try: + for key, value in pattern_obj.items(): + if key == "Global": + self.global_prefix = value + elif key == "Static": + self.static_prefix = value + elif key == "ClassMember": + self.class_member_prefix = value + elif key == "StructMember": + self.struct_member_prefix = value + else: + raise ValueError(key) + except ValueError as e: + sys.stderr.write('{} is not a valid rule name\n'.format(e.message)) + fixit = difflib.get_close_matches(e.message, self.rule_names, n=1, cutoff=0.8) + if fixit: + sys.stderr.write('Did you mean rule name: {} ?\n'.format(fixit[0])) + sys.exit(1) + + +class DataTypePrefixRule(object): + def __init__(self, pattern_obj): + self.name = "DataTypePrefix" + self.rule_names = ["String", "Integer", "Bool", "Pointer"] + self.string_prefix = "" + + try: + for key, value in pattern_obj.items(): + if key == "String": + self.string_prefix = value + elif key == "Integer": + self.integer_prefix = value + elif key == "Bool": + self.bool_prefix = value + elif key == "Pointer": + self.pointer_prefix = value + else: + raise ValueError(key) + except ValueError as e: + sys.stderr.write('{} is not a valid rule name\n'.format(e.message)) + fixit = difflib.get_close_matches(e.message, self.rule_names, n=1, cutoff=0.8) + if fixit: + sys.stderr.write('Did you mean rule name: {} ?\n'.format(fixit[0])) + sys.exit(1) + + +class VariableNameRule(object): + def __init__(self, pattern_obj=None): + self.name = "VariableName" + self.pattern_str = "^.*$" + self.rule_names = ["ScopePrefix", "DataTypePrefix", "Pattern"] + self.scope_prefix_rule = None + self.datatype_prefix_rule = None + + try: + for key, value in pattern_obj.items(): + if key == "ScopePrefix": + self.scope_prefix_rule = ScopePrefixRule(value) + elif key == "DataTypePrefix": + self.datatype_prefix_rule = DataTypePrefixRule(value) + elif key == "Pattern": + self.pattern_str = value + else: + raise ValueError(key) + except ValueError as e: + sys.stderr.write('{} is not a valid rule name\n'.format(e.message)) + fixit = difflib.get_close_matches(e.message, self.rule_names, n=1, cutoff=0.8) + if fixit: + sys.stderr.write('Did you mean rule name: {} ?\n'.format(fixit[0])) + sys.exit(1) + except re.error as e: + sys.stderr.write('{} is not a valid pattern \n'.format(e.message)) + sys.exit(1) + + def get_scope_prefix(self, node, scope=None): + if node.storage_class == StorageClass.STATIC: + return self.scope_prefix_rule.static_prefix + elif (scope is None) and (node.storage_class == StorageClass.EXTERN or + node.storage_class == StorageClass.NONE): + return self.scope_prefix_rule.global_prefix + elif (scope is CursorKind.CLASS_DECL) or (scope is CursorKind.CLASS_TEMPLATE): + return self.scope_prefix_rule.class_member_prefix + elif (scope is CursorKind.STRUCT_DECL): + return self.scope_prefix_rule.struct_member_prefix + return "" + + def get_datatype_prefix(self, node): + if node.type.kind is TypeKind.ELABORATED: + if node.type.spelling.startswith('std::string'): + return self.datatype_prefix_rule.string_prefix + elif (node.type.spelling.startswith('std::unique_ptr') or + node.type.spelling.startswith("std::shared_ptr")): + return self.datatype_prefix_rule.pointer_prefix + elif node.type.kind is TypeKind.POINTER: + return self.datatype_prefix_rule.pointer_prefix + else: + if node.type.spelling == "int": + return self.datatype_prefix_rule.integer_prefix + elif node.type.spelling.startswith('bool'): + return self.datatype_prefix_rule.bool_prefix + return "" + + def evaluate(self, node, scope=None): + pattern_str = self.pattern_str + scope_prefix = self.get_scope_prefix(node, scope) + datatype_prefix = self.get_datatype_prefix(node) + + pattern_str = pattern_str[0] + scope_prefix + datatype_prefix + pattern_str[1:] + + pattern = re.compile(pattern_str) + if not pattern.match(node.spelling): + fmt = '{}:{}:{}: "{}" does not have the pattern {} associated with Variable name\n' + msg = fmt.format(node.location.file.name, node.location.line, node.location.column, + node.displayname, pattern_str) + sys.stderr.write(msg) + return False + + return True + + +# All supported rules +default_rules_db["StructName"] = Rule("StructName", CursorKind.STRUCT_DECL) +default_rules_db["UnionName"] = Rule("UnionName", CursorKind.UNION_DECL) +default_rules_db["ClassName"] = Rule("ClassName", CursorKind.CLASS_DECL) +default_rules_db["EnumName"] = Rule("EnumName", CursorKind.ENUM_DECL) +default_rules_db["EnumConstantName"] = Rule("EnumConstantName", CursorKind.ENUM_CONSTANT_DECL) +default_rules_db["FunctionName"] = Rule("FunctionName", CursorKind.FUNCTION_DECL) +default_rules_db["ParameterName"] = Rule("ParameterName", CursorKind.PARM_DECL) +default_rules_db["TypedefName"] = Rule("TypedefName", CursorKind.TYPEDEF_DECL) +default_rules_db["CppMethod"] = Rule("CppMethod", CursorKind.CXX_METHOD) +default_rules_db["Namespace"] = Rule("Namespace", CursorKind.NAMESPACE) +default_rules_db["ConversionFunction"] = Rule("ConversionFunction", CursorKind.CONVERSION_FUNCTION) +default_rules_db["TemplateTypeParameter"] = Rule( + "TemplateTypeParameter", CursorKind.TEMPLATE_TYPE_PARAMETER) +default_rules_db["TemplateNonTypeParameter"] = Rule( + "TemplateNonTypeParameter", CursorKind.TEMPLATE_NON_TYPE_PARAMETER) +default_rules_db["TemplateTemplateParameter"] = Rule( + "TemplateTemplateParameter", CursorKind.TEMPLATE_TEMPLATE_PARAMETER) +default_rules_db["FunctionTemplate"] = Rule("FunctionTemplate", CursorKind.FUNCTION_TEMPLATE) +default_rules_db["ClassTemplate"] = Rule("ClassTemplate", CursorKind.CLASS_TEMPLATE) +default_rules_db["ClassTemplatePartialSpecialization"] = Rule( + "ClassTemplatePartialSpecialization", CursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION) +default_rules_db["NamespaceAlias"] = Rule("NamespaceAlias", CursorKind.NAMESPACE_ALIAS) +default_rules_db["UsingDirective"] = Rule("UsingDirective", CursorKind.USING_DIRECTIVE) +default_rules_db["UsingDeclaration"] = Rule("UsingDeclaration", CursorKind.USING_DECLARATION) +default_rules_db["TypeAliasName"] = Rule("TypeAliasName", CursorKind.TYPE_ALIAS_DECL) +default_rules_db["ClassAccessSpecifier"] = Rule( + "ClassAccessSpecifier", CursorKind.CXX_ACCESS_SPEC_DECL) +default_rules_db["TypeReference"] = Rule("TypeReference", CursorKind.TYPE_REF) +default_rules_db["CxxBaseSpecifier"] = Rule("CxxBaseSpecifier", CursorKind.CXX_BASE_SPECIFIER) +default_rules_db["TemplateReference"] = Rule("TemplateReference", CursorKind.TEMPLATE_REF) +default_rules_db["NamespaceReference"] = Rule("NamespaceReference", CursorKind.NAMESPACE_REF) +default_rules_db["MemberReference"] = Rule("MemberReference", CursorKind.MEMBER_REF) +default_rules_db["LabelReference"] = Rule("LabelReference", CursorKind.LABEL_REF) +default_rules_db["OverloadedDeclarationReference"] = Rule( + "OverloadedDeclarationReference", CursorKind.OVERLOADED_DECL_REF) +default_rules_db["VariableReference"] = Rule("VariableReference", CursorKind.VARIABLE_REF) +default_rules_db["InvalidFile"] = Rule("InvalidFile", CursorKind.INVALID_FILE) +default_rules_db["NoDeclarationFound"] = Rule("NoDeclarationFound", CursorKind.NO_DECL_FOUND) +default_rules_db["NotImplemented"] = Rule("NotImplemented", CursorKind.NOT_IMPLEMENTED) +default_rules_db["InvalidCode"] = Rule("InvalidCode", CursorKind.INVALID_CODE) +default_rules_db["UnexposedExpression"] = Rule("UnexposedExpression", CursorKind.UNEXPOSED_EXPR) +default_rules_db["DeclarationReferenceExpression"] = Rule( + "DeclarationReferenceExpression", CursorKind.DECL_REF_EXPR) +default_rules_db["MemberReferenceExpression"] = Rule( + "MemberReferenceExpression", CursorKind.MEMBER_REF_EXPR) +default_rules_db["CallExpression"] = Rule("CallExpression", CursorKind.CALL_EXPR) +default_rules_db["BlockExpression"] = Rule("BlockExpression", CursorKind.BLOCK_EXPR) +default_rules_db["IntegerLiteral"] = Rule("IntegerLiteral", CursorKind.INTEGER_LITERAL) +default_rules_db["FloatingLiteral"] = Rule("FloatingLiteral", CursorKind.FLOATING_LITERAL) +default_rules_db["ImaginaryLiteral"] = Rule("ImaginaryLiteral", CursorKind.IMAGINARY_LITERAL) +default_rules_db["StringLiteral"] = Rule("StringLiteral", CursorKind.STRING_LITERAL) +default_rules_db["CharacterLiteral"] = Rule("CharacterLiteral", CursorKind.CHARACTER_LITERAL) +default_rules_db["ParenExpression"] = Rule("ParenExpression", CursorKind.PAREN_EXPR) +default_rules_db["UnaryOperator"] = Rule("UnaryOperator", CursorKind.UNARY_OPERATOR) +default_rules_db["ArraySubscriptExpression"] = Rule( + "ArraySubscriptExpression", CursorKind.ARRAY_SUBSCRIPT_EXPR) +default_rules_db["BinaryOperator"] = Rule("BinaryOperator", CursorKind.BINARY_OPERATOR) +default_rules_db["CompoundAssignmentOperator"] = Rule( + "CompoundAssignmentOperator", CursorKind.COMPOUND_ASSIGNMENT_OPERATOR) +default_rules_db["ConditionalOperator"] = Rule( + "ConditionalOperator", CursorKind.CONDITIONAL_OPERATOR) +default_rules_db["CstyleCastExpression"] = Rule( + "CstyleCastExpression", CursorKind.CSTYLE_CAST_EXPR) +default_rules_db["CompoundLiteralExpression"] = Rule( + "CompoundLiteralExpression", CursorKind.COMPOUND_LITERAL_EXPR) +default_rules_db["InitListExpression"] = Rule("InitListExpression", CursorKind.INIT_LIST_EXPR) +default_rules_db["AddrLabelExpression"] = Rule("AddrLabelExpression", CursorKind.ADDR_LABEL_EXPR) +default_rules_db["StatementExpression"] = Rule("StatementExpression", CursorKind.StmtExpr) +default_rules_db["GenericSelectionExpression"] = Rule( + "GenericSelectionExpression", CursorKind.GENERIC_SELECTION_EXPR) +default_rules_db["GnuNullExpression"] = Rule("GnuNullExpression", CursorKind.GNU_NULL_EXPR) +default_rules_db["CxxStaticCastExpression"] = Rule( + "CxxStaticCastExpression", CursorKind.CXX_STATIC_CAST_EXPR) +default_rules_db["CxxDynamicCastExpression"] = Rule( + "CxxDynamicCastExpression", CursorKind.CXX_DYNAMIC_CAST_EXPR) +default_rules_db["CxxReinterpretCastExpression"] = Rule( + "CxxReinterpretCastExpression", CursorKind.CXX_REINTERPRET_CAST_EXPR) +default_rules_db["CxxConstCastExpression"] = Rule( + "CxxConstCastExpression", CursorKind.CXX_CONST_CAST_EXPR) +default_rules_db["CxxFunctionalCastExpression"] = Rule( + "CxxFunctionalCastExpression", CursorKind.CXX_FUNCTIONAL_CAST_EXPR) +default_rules_db["CxxTypeidExpression"] = Rule("CxxTypeidExpression", CursorKind.CXX_TYPEID_EXPR) +default_rules_db["CxxBoolLiteralExpression"] = Rule( + "CxxBoolLiteralExpression", CursorKind.CXX_BOOL_LITERAL_EXPR) +default_rules_db["CxxNullPointerLiteralExpression"] = Rule( + "CxxNullPointerLiteralExpression", CursorKind.CXX_NULL_PTR_LITERAL_EXPR) +default_rules_db["CxxThisExpression"] = Rule("CxxThisExpression", CursorKind.CXX_THIS_EXPR) +default_rules_db["CxxThrowExpression"] = Rule("CxxThrowExpression", CursorKind.CXX_THROW_EXPR) +default_rules_db["CxxNewExpression"] = Rule("CxxNewExpression", CursorKind.CXX_NEW_EXPR) +default_rules_db["CxxDeleteExpression"] = Rule("CxxDeleteExpression", CursorKind.CXX_DELETE_EXPR) +default_rules_db["CxxUnaryExpression"] = Rule("CxxUnaryExpression", CursorKind.CXX_UNARY_EXPR) +default_rules_db["PackExpansionExpression"] = Rule( + "PackExpansionExpression", CursorKind.PACK_EXPANSION_EXPR) +default_rules_db["SizeOfPackExpression"] = Rule( + "SizeOfPackExpression", CursorKind.SIZE_OF_PACK_EXPR) +default_rules_db["LambdaExpression"] = Rule("LambdaExpression", CursorKind.LAMBDA_EXPR) +default_rules_db["ObjectBoolLiteralExpression"] = Rule( + "ObjectBoolLiteralExpression", CursorKind.OBJ_BOOL_LITERAL_EXPR) +default_rules_db["ObjectSelfExpression"] = Rule("ObjectSelfExpression", CursorKind.OBJ_SELF_EXPR) +default_rules_db["UnexposedStatement"] = Rule("UnexposedStatement", CursorKind.UNEXPOSED_STMT) +default_rules_db["LabelStatement"] = Rule("LabelStatement", CursorKind.LABEL_STMT) +default_rules_db["CompoundStatement"] = Rule("CompoundStatement", CursorKind.COMPOUND_STMT) +default_rules_db["CaseStatement"] = Rule("CaseStatement", CursorKind.CASE_STMT) +default_rules_db["DefaultStatement"] = Rule("DefaultStatement", CursorKind.DEFAULT_STMT) +default_rules_db["IfStatement"] = Rule("IfStatement", CursorKind.IF_STMT) +default_rules_db["SwitchStatement"] = Rule("SwitchStatement", CursorKind.SWITCH_STMT) +default_rules_db["WhileStatement"] = Rule("WhileStatement", CursorKind.WHILE_STMT) +default_rules_db["DoStatement"] = Rule("DoStatement", CursorKind.DO_STMT) +default_rules_db["ForStatement"] = Rule("ForStatement", CursorKind.FOR_STMT) +default_rules_db["GotoStatement"] = Rule("GotoStatement", CursorKind.GOTO_STMT) +default_rules_db["IndirectGotoStatement"] = Rule( + "IndirectGotoStatement", CursorKind.INDIRECT_GOTO_STMT) +default_rules_db["ContinueStatement"] = Rule("ContinueStatement", CursorKind.CONTINUE_STMT) +default_rules_db["BreakStatement"] = Rule("BreakStatement", CursorKind.BREAK_STMT) +default_rules_db["ReturnStatement"] = Rule("ReturnStatement", CursorKind.RETURN_STMT) +default_rules_db["AsmStatement"] = Rule("AsmStatement", CursorKind.ASM_STMT) +default_rules_db["CxxCatchStatement"] = Rule("CxxCatchStatement", CursorKind.CXX_CATCH_STMT) +default_rules_db["CxxTryStatement"] = Rule("CxxTryStatement", CursorKind.CXX_TRY_STMT) +default_rules_db["CxxForRangeStatement"] = Rule( + "CxxForRangeStatement", CursorKind.CXX_FOR_RANGE_STMT) +default_rules_db["MsAsmStatement"] = Rule("MsAsmStatement", CursorKind.MS_ASM_STMT) +default_rules_db["NullStatement"] = Rule("NullStatement", CursorKind.NULL_STMT) +default_rules_db["DeclarationStatement"] = Rule("DeclarationStatement", CursorKind.DECL_STMT) +default_rules_db["TranslationUnit"] = Rule("TranslationUnit", CursorKind.TRANSLATION_UNIT) +default_rules_db["UnexposedAttribute"] = Rule("UnexposedAttribute", CursorKind.UNEXPOSED_ATTR) +default_rules_db["CxxFinalAttribute"] = Rule("CxxFinalAttribute", CursorKind.CXX_FINAL_ATTR) +default_rules_db["CxxOverrideAttribute"] = Rule( + "CxxOverrideAttribute", CursorKind.CXX_OVERRIDE_ATTR) +default_rules_db["AnnotateAttribute"] = Rule("AnnotateAttribute", CursorKind.ANNOTATE_ATTR) +default_rules_db["AsmLabelAttribute"] = Rule("AsmLabelAttribute", CursorKind.ASM_LABEL_ATTR) +default_rules_db["PackedAttribute"] = Rule("PackedAttribute", CursorKind.PACKED_ATTR) +default_rules_db["PureAttribute"] = Rule("PureAttribute", CursorKind.PURE_ATTR) +default_rules_db["ConstAttribute"] = Rule("ConstAttribute", CursorKind.CONST_ATTR) +default_rules_db["NoduplicateAttribute"] = Rule( + "NoduplicateAttribute", CursorKind.NODUPLICATE_ATTR) +default_rules_db["PreprocessingDirective"] = Rule( + "PreprocessingDirective", CursorKind.PREPROCESSING_DIRECTIVE) +default_rules_db["MacroDefinition"] = Rule("MacroDefinition", CursorKind.MACRO_DEFINITION) +default_rules_db["MacroInstantiation"] = Rule("MacroInstantiation", CursorKind.MACRO_INSTANTIATION) +default_rules_db["InclusionDirective"] = Rule("InclusionDirective", CursorKind.INCLUSION_DIRECTIVE) +default_rules_db["TypeAliasTeplateDeclaration"] = Rule( + "TypeAliasTeplateDeclaration", CursorKind.TYPE_ALIAS_TEMPLATE_DECL) + +# Reverse lookup map. The parse identifies Clang cursor kinds, which must be mapped +# to user defined types +for key, value in default_rules_db.items(): + clang_to_user_map[value.clang_kind] = key +default_rules_db["VariableName"] = Rule("VariableName", CursorKind.VAR_DECL) +clang_to_user_map[CursorKind.FIELD_DECL] = "VariableName" +clang_to_user_map[CursorKind.VAR_DECL] = "VariableName" + + +class AstNodeStack(object): + def __init__(self): + self.stack = [] + + def pop(self): + return self.stack.pop() + + def push(self, kind): + self.stack.append(kind) + + def peek(self): + if len(self.stack) > 0: + return self.stack[-1] + return None + + +class Options: + def __init__(self): + self.args = None + self._style_file = None + self.file_exclusions = None + self._skip_file = None + + self.parser = argparse.ArgumentParser( + prog="ncc.py", + description="ncc is a development tool to help programmers " + "write C/C++ code that adheres to adhere some naming conventions. It automates the " + "process of checking C code to spare humans of this boring " + "(but important) task. This makes it ideal for projects that want " + "to enforce a coding standard.") + + self.parser.add_argument('--recurse', action='store_true', dest="recurse", + help="Read all files under each directory, recursively") + + self.parser.add_argument('--style', dest="style_file", + help="Read rules from the specified file. If the user does not" + "provide a style file ncc will use all style rules. To print" + "all style rules use --dump option") + + self.parser.add_argument('--include', dest='include', nargs="+", help="User defined " + "header file path, this is same as -I argument to the compiler") + + self.parser.add_argument('--definition', dest='definition', nargs="+", help="User specified " + "definitions, this is same as -D argument to the compiler") + + self.parser.add_argument('--dump', dest='dump', action='store_true', + help="Dump all available options") + + self.parser.add_argument('--output', dest='output', help="output file name where" + "naming convenction vialoations will be stored") + + self.parser.add_argument('--filetype', dest='filetype', help="File extentions type" + "that are applicable for naming convection validation") + + self.parser.add_argument('--clang-lib', dest='clang_lib', + help="Custom location of clang library") + + self.parser.add_argument('--exclude', dest='exclude', nargs="+", help="Skip files " + "matching the pattern specified from recursive searches. It " + "matches a specified pattern according to the rules used by " + "the Unix shell") + + self.parser.add_argument('--skip', '-s', dest="skip_file", + help="Read list of items to ignore during the check. " + "User can use the skip file to specify character sequences that should " + "be ignored by ncc") + + # self.parser.add_argument('--exclude-dir', dest='exclude_dir', help="Skip the directories" + # "matching the pattern specified") + + self.parser.add_argument('--path', dest='path', nargs="+", + help="Path of file or directory") + + def parse_cmd_line(self): + self.args = self.parser.parse_args() + + if self.args.dump: + self.dump_all_rules() + + if self.args.style_file: + self._style_file = self.args.style_file + if not os.path.exists(self._style_file): + sys.stderr.write("Style file '{}' not found!\n".format(self._style_file)) + sys.exit(1) + + if self.args.skip_file: + self._skip_file = self.args.skip_file + if not os.path.exists(self._skip_file): + sys.stderr.write("Skip file '{}' not found!\n".format(self._skip_file)) + + def dump_all_rules(self): + print("----------------------------------------------------------") + print("{:<35} | {}".format("Rule Name", "Pattern")) + print("----------------------------------------------------------") + for (key, value) in default_rules_db.items(): + print("{:<35} : {}".format(key, value.pattern_str)) + +class SkipDb(object): + def __init__(self, skip_file=None): + self.__skip_db = {} + + if skip_file: + self.build_skip_db(skip_file) + + def build_skip_db(self, skip_file): + with open(skip_file) as stylefile: + style_rules = yaml.safe_load(stylefile) + for (skip_string, skip_comment) in style_rules.items(): + self.__skip_db[skip_string] = skip_comment + + def check_skip_db(self, input_query): + if input_query in self.__skip_db.keys(): + return 1 + else: + return 0 + +class RulesDb(object): + def __init__(self, style_file=None): + self.__rule_db = {} + self.__clang_db = {} + + if style_file: + self.build_rules_db(style_file) + else: + self.__rule_db = default_rules_db + self.__clang_db = clang_to_user_map + + def build_rules_db(self, style_file): + with open(style_file) as stylefile: + style_rules = yaml.safe_load(stylefile) + + for (rule_name, pattern_str) in style_rules.items(): + try: + clang_kind = default_rules_db[rule_name].clang_kind + if clang_kind: + if rule_name == "VariableName": + self.__rule_db[rule_name] = VariableNameRule(pattern_str) + self.__clang_db[CursorKind.FIELD_DECL] = rule_name + self.__clang_db[CursorKind.VAR_DECL] = rule_name + else: + self.__rule_db[rule_name] = default_rules_db[rule_name] + self.__rule_db[rule_name].pattern_str = pattern_str + self.__rule_db[rule_name].pattern = re.compile(pattern_str) + self.__clang_db[clang_kind] = rule_name + + except KeyError as e: + sys.stderr.write('{} is not a valid C/C++ construct name\n'.format(e.message)) + fixit = difflib.get_close_matches(e.message, default_rules_db.keys(), + n=1, cutoff=0.8) + if fixit: + sys.stderr.write('Did you mean rule name: {} ?\n'.format(fixit[0])) + sys.exit(1) + except re.error as e: + sys.stderr.write('"{}" pattern {} has {} \n'. + format(rule_name, pattern_str, e.message)) + sys.exit(1) + + def is_rule_enabled(self, kind): + if self.__clang_db.get(kind): + return True + return False + + def get_rule_names(self, kind): + """ + Multiple user defined rules can be configured against one type of ClangKind + For e.g. ClassMemberVariable, StructMemberVariable are types of FIELD_DECL + """ + return self.__clang_db.get(kind) + + def get_rule(self, rule_name): + return self.__rule_db.get(rule_name) + + +class Validator(object): + def __init__(self, rule_db, filename, options, skip_db=None): + self.filename = filename + self.rule_db = rule_db + self.skip_db = skip_db + self.options = options + self.node_stack = AstNodeStack() + + index = Index.create() + args = [] + args.append('-x') + args.append('c++') + args.append('-D_GLIBCXX_USE_CXX11_ABI=0') + if self.options.args.definition: + for item in self.options.args.definition: + defintion = r'-D' + item + args.append(defintion) + if self.options.args.include: + for item in self.options.args.include: + inc = r'-I' + item + args.append(inc) + self.cursor = index.parse(filename, args).cursor + + def validate(self): + return self.check(self.cursor) + + def check(self, node): + """ + Recursively visit all nodes of the AST and match against the patter provided by + the user. Return the total number of errors caught in the file + """ + errors = 0 + for child in node.get_children(): + if self.is_local(child, self.filename): + + # This is the case when typedef of struct is causing double reporting of error + # TODO: Find a better way to handle it + parent = self.node_stack.peek() + if (parent and parent == CursorKind.TYPEDEF_DECL and + child.kind == CursorKind.STRUCT_DECL): + return 0 + + errors += self.evaluate(child) + + # Members struct, class, and unions must be treated differently. + # So parent ast node information is pushed in to the stack. + # Once all its children are validated pop it out of the stack + self.node_stack.push(child.kind) + errors += self.check(child) + self.node_stack.pop() + + return errors + + def evaluate(self, node): + """ + get the node's rule and match the pattern. Report and error if pattern + matching fails + """ + if not self.rule_db.is_rule_enabled(node.kind): + return 0 + + # If the pattern is in the skip list, ignore it + if self.skip_db.check_skip_db(node.displayname): + return 0 + + rule_name = self.rule_db.get_rule_names(node.kind) + rule = self.rule_db.get_rule(rule_name) + if rule.evaluate(node, self.node_stack.peek()) is False: + return 1 + return 0 + + def is_local(self, node, filename): + """ Returns True is node belongs to the file being validated and not an include file """ + if node.location.file and node.location.file.name in filename: + return True + return False + + +def do_validate(options, filename): + """ + Returns true if the file should be validated + - Check if its a c/c++ file + - Check if the file is not excluded + """ + path, extension = os.path.splitext(filename) + if extension not in file_extensions: + return False + + if options.args.exclude: + for item in options.args.exclude: + if fnmatch.fnmatch(filename, item): + return False + + return True + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', + filename='log.txt', filemode='w') + + """ Parse all command line arguments and validate """ + op = Options() + op.parse_cmd_line() + + if op.args.path is None: + sys.exit(1) + + if op.args.clang_lib: + Config.set_library_file(op.args.clang_lib) + + """ Creating the rules database """ + rules_db = RulesDb(op._style_file) + + """ Creating the skip database """ + skip_db = SkipDb(op._skip_file) + + """ Check the source code against the configured rules """ + errors = 0 + for path in op.args.path: + if os.path.isfile(path): + if do_validate(op, path): + v = Validator(rules_db, path, op, skip_db) + errors += v.validate() + elif os.path.isdir(path): + for (root, subdirs, files) in os.walk(path): + for filename in files: + path = root + '/' + filename + if do_validate(op, path): + v = Validator(rules_db, path, op, skip_db) + errors += v.validate() + + if not op.args.recurse: + break + else: + sys.stderr.write("File '{}' not found!\n".format(path)) + sys.exit(1) + + if errors: + print("Total number of errors = {}".format(errors)) + sys.exit(1) diff --git a/tools/ncc/ncc.style b/tools/ncc/ncc.style new file mode 100644 index 00000000..57bc8dd7 --- /dev/null +++ b/tools/ncc/ncc.style @@ -0,0 +1,21 @@ +ClassName: '^[A-Z][a-zA-Z0-9]+$' +CppMethod: '^operator|^FUN_[a-f0-9]{8}$|^VTable0x[a-f0-9]{1,8}$|^(?!VTable)[A-Z][a-zA-Z0-9]+$' +# EnumConstantName +EnumName: '^\(unnamed|^[A-Z][a-zA-Z0-9]+$' +FunctionName: '^operator|^FUN_[a-f0-9]{8}$|^VTable0x[a-f0-9]{1,8}$|^(?!VTable)[A-Z][a-zA-Z0-9]+$' +ParameterName: '^p_(unk0x[a-f0-9]{1,8}$|(?!unk)[a-z][a-zA-Z0-9]*)$|^$' +StructName: '^\(anon|^\(unnamed|^[A-Z][a-zA-Z0-9]+$' +TypedefName: '^[A-Z][a-zA-Z0-9]+$' +UnionName: '^\(anon|^[A-Z][a-zA-Z0-9]+$' +VariableName: + ScopePrefix: + Global: 'g_' + Static: 'g_' + ClassMember: 'm_' + StructMember: 'm_' + DataTypePrefix: + String: '' + Integer: '' + Bool: '' + Pointer: '' + Pattern: '^(unk0x[a-f0-9]{1,8}$|(?!unk)[a-z][a-zA-Z0-9]*)$' diff --git a/tools/ncc/skip.yml b/tools/ncc/skip.yml new file mode 100644 index 00000000..75a186ca --- /dev/null +++ b/tools/ncc/skip.yml @@ -0,0 +1,13 @@ +configureLegoAnimationManager(MxS32): 'DLL exported function' +configureLegoBuildingManager(MxS32): 'DLL exported function' +configureLegoModelPresenter(MxS32): 'DLL exported function' +configureLegoPartPresenter(MxS32, MxS32): 'DLL exported function' +configureLegoROI(MxS32): 'DLL exported function' +configureLegoWorldPresenter(MxS32): 'DLL exported function' +GetNoCD_SourceName(): 'DLL exported function' +m_3dView: 'Allow this variable name' +m_3dManager: 'Allow this variable name' +m_16bitPal: 'Allow this variable name' +p_milliseconds: 'Probably a bug with function call' +m_increaseAmount: "Can't currently detect member in union" +m_increaseFactor: "Can't currently detect member in union" diff --git a/tools/requirements.txt b/tools/requirements.txt index 06c0bed3..5875ae35 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,5 +1,7 @@ tools/isledecomp capstone +clang==16.* colorama isledecomp pystache +pyyaml