Merge branch 'master' into order-tool

This commit is contained in:
MS 2023-10-29 18:16:35 -04:00 committed by GitHub
commit a9300dd605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
419 changed files with 15074 additions and 11956 deletions

26
.clang-format Normal file
View File

@ -0,0 +1,26 @@
BasedOnStyle: Microsoft
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BracedInitializerIndentWidth: 4
BraceWrapping:
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterStruct: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IncludeBlocks: Regroup
IndentAccessModifiers: false
IndentWidth: 4
InsertNewlineAtEOF: true
PointerAlignment: Left
SpaceAfterCStyleCast: true
TabWidth: 4
UseTab: ForContinuationAndIndentation

View File

@ -1,7 +1,13 @@
root = true root = true
[*.{cpp,h,py,txt,editorconfig}]
[*.{py,txt,editorconfig}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.{cpp,h}]
indent_style = tab
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true

20
.github/workflows/format.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Format
on: [push, pull_request]
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format
run: |
pipx run "clang-format>=17,<18" \
--Werror \
--dry-run \
--style=file \
ISLE/*.cpp ISLE/*.h \
LEGO1/*.cpp LEGO1/*.h \
LEGO1/realtime/*.cpp LEGO1/realtime/*.h

12
.gitignore vendored
View File

@ -2,8 +2,20 @@ Debug/
Release/ Release/
*.ncb *.ncb
/.vs /.vs
/.vscode
/.idea
.env
.venv
env/
venv/
ENV/
VENV/
env.bak/
venv.bak/
ISLE.EXE ISLE.EXE
LEGO1.DLL LEGO1.DLL
build/ build/
*.swp *.swp
LEGO1PROGRESS.HTML
LEGO1PROGRESS.SVG
*.pyc *.pyc

54
3rdparty/smk/smk.h vendored Normal file
View File

@ -0,0 +1,54 @@
#ifndef SMK_H
#define SMK_H
struct SmackSum {
unsigned long m_totalTime;
unsigned long m_ms100PerFrame;
unsigned long m_totalOpenTime;
unsigned long m_totalFrames;
unsigned long m_skippedFrames;
unsigned long m_totalBlitTime;
unsigned long m_totalReadTime;
unsigned long m_totalDecompressTime;
unsigned long m_totalBackReadTime;
unsigned long m_totalReadSpeed;
unsigned long m_slowestFrameTime;
unsigned long m_slowestTwoFrameTime;
unsigned long m_slowestFrameNum;
unsigned long m_slowestTwoFrameNum;
unsigned long m_averageFrameSize;
unsigned long m_highestOneSecRate;
unsigned long m_highestOneSecFrame;
unsigned long m_highestMemAmount;
unsigned long m_totalExtraMemory;
unsigned long m_highestExtraUsed;
};
struct Smack {
unsigned long m_version;
unsigned long m_width;
unsigned long m_height;
unsigned long m_frames;
unsigned long m_msInAFrame;
unsigned long m_smkType;
unsigned long m_audioTrackSize[7];
unsigned long m_treeSize;
unsigned long m_codeSize;
unsigned long m_abSize;
unsigned long m_detailSize;
unsigned long m_typeSize;
unsigned long m_trackType[7];
unsigned long m_extra;
unsigned long m_newPalette;
unsigned char m_palette[772];
unsigned long m_frameNum;
unsigned long m_lastRectX;
unsigned long m_lastRectY;
unsigned long m_lastRectW;
unsigned long m_lastRectH;
unsigned long m_openFlags;
unsigned long m_leftOfs;
unsigned long m_topOfs;
};
#endif // SMK_H

1085
3rdparty/vec/vec.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@ add_library(lego1 SHARED
LEGO1/gasstation.cpp LEGO1/gasstation.cpp
LEGO1/gasstationentity.cpp LEGO1/gasstationentity.cpp
LEGO1/gasstationstate.cpp LEGO1/gasstationstate.cpp
LEGO1/gifmanager.cpp
LEGO1/helicopter.cpp LEGO1/helicopter.cpp
LEGO1/helicopterstate.cpp LEGO1/helicopterstate.cpp
LEGO1/historybook.cpp LEGO1/historybook.cpp
@ -64,6 +65,7 @@ add_library(lego1 SHARED
LEGO1/legocontrolmanager.cpp LEGO1/legocontrolmanager.cpp
LEGO1/legoentity.cpp LEGO1/legoentity.cpp
LEGO1/legoentitypresenter.cpp LEGO1/legoentitypresenter.cpp
LEGO1/legoeventnotificationparam.cpp
LEGO1/legoflctexturepresenter.cpp LEGO1/legoflctexturepresenter.cpp
LEGO1/legofullscreenmovie.cpp LEGO1/legofullscreenmovie.cpp
LEGO1/legogamestate.cpp LEGO1/legogamestate.cpp
@ -176,6 +178,7 @@ add_library(lego1 SHARED
LEGO1/mxticklemanager.cpp LEGO1/mxticklemanager.cpp
LEGO1/mxtimer.cpp LEGO1/mxtimer.cpp
LEGO1/mxtransitionmanager.cpp LEGO1/mxtransitionmanager.cpp
LEGO1/mxtype17notificationparam.cpp
LEGO1/mxvariable.cpp LEGO1/mxvariable.cpp
LEGO1/mxvariabletable.cpp LEGO1/mxvariabletable.cpp
LEGO1/mxvector.cpp LEGO1/mxvector.cpp
@ -196,7 +199,8 @@ add_library(lego1 SHARED
LEGO1/racestate.cpp LEGO1/racestate.cpp
LEGO1/radio.cpp LEGO1/radio.cpp
LEGO1/radiostate.cpp LEGO1/radiostate.cpp
LEGO1/realtimeview.cpp LEGO1/realtime/realtime.cpp
LEGO1/realtime/realtimeview.cpp
LEGO1/registrationbook.cpp LEGO1/registrationbook.cpp
LEGO1/score.cpp LEGO1/score.cpp
LEGO1/scorestate.cpp LEGO1/scorestate.cpp
@ -205,6 +209,13 @@ add_library(lego1 SHARED
LEGO1/towtrackmissionstate.cpp LEGO1/towtrackmissionstate.cpp
LEGO1/viewmanager.cpp LEGO1/viewmanager.cpp
) )
if (MINGW)
target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500)
endif()
# Additional include directories
include_directories("${CMAKE_SOURCE_DIR}/3rdparty/vec")
include_directories("${CMAKE_SOURCE_DIR}/3rdparty/smk")
if (ISLE_USE_SMARTHEAP) if (ISLE_USE_SMARTHEAP)
add_library(SmartHeap::SmartHeap STATIC IMPORTED) add_library(SmartHeap::SmartHeap STATIC IMPORTED)

View File

@ -25,7 +25,12 @@ This repository currently has only one goal: accuracy to the original executable
In general, we're not exhaustively strict about coding style, but there are some preferable guidelines to follow that have been adopted from what we know about the original codebase: In general, we're not exhaustively strict about coding style, but there are some preferable guidelines to follow that have been adopted from what we know about the original codebase:
- Indent: 2 spaces ### Formatting
We are currently using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) with a configuration file that aims to replicate the code formatting employed by the original developers. There are [integrations](https://clang.llvm.org/docs/ClangFormat.html#vim-integration) available for most editors and IDEs. The required `clang-format` version is `17.x`.
### Naming conventions
- `PascalCase` for classes, function names, and enumerations. - `PascalCase` for classes, function names, and enumerations.
- `m_camelCase` for member variables. - `m_camelCase` for member variables.
- `g_camelCase` for global variables. - `g_camelCase` for global variables.

View File

@ -1,8 +1,6 @@
#include "isleapp.h" #include "isleapp.h"
#include "define.h" #include "define.h"
#include <dsound.h>
#include "legoanimationmanager.h" #include "legoanimationmanager.h"
#include "legobuildingmanager.h" #include "legobuildingmanager.h"
#include "legogamestate.h" #include "legogamestate.h"
@ -22,9 +20,10 @@
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include "mxtimer.h" #include "mxtimer.h"
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "res/resource.h" #include "res/resource.h"
#include <dsound.h>
// OFFSET: ISLE 0x401000 // OFFSET: ISLE 0x401000
IsleApp::IsleApp() IsleApp::IsleApp()
{ {
@ -129,7 +128,9 @@ BOOL IsleApp::SetupLegoOmni()
char mediaPath[256]; char mediaPath[256];
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath)); GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
BOOL failure = Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags())) == FAILURE; BOOL failure =
Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__*) m_windowHandle, m_videoParam, MxOmniCreateFlags())
) == FAILURE;
if (!failure) { if (!failure) {
VariableTable()->SetVariable("ACTOR_01", ""); VariableTable()->SetVariable("ACTOR_01", "");
TickleManager()->SetClientTickleInterval(VideoManager(), 10); TickleManager()->SetClientTickleInterval(VideoManager(), 10);
@ -140,9 +141,17 @@ BOOL IsleApp::SetupLegoOmni()
} }
// OFFSET: ISLE 0x401560 // OFFSET: ISLE 0x401560
void IsleApp::SetupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, void IsleApp::SetupVideoFlags(
BOOL using8bit, BOOL using16bit, BOOL param_6, BOOL param_7, BOOL fullScreen,
BOOL wideViewAngle, char *deviceId) BOOL flipSurfaces,
BOOL backBuffers,
BOOL using8bit,
BOOL using16bit,
BOOL param_6,
BOOL param_7,
BOOL wideViewAngle,
char* deviceId
)
{ {
m_videoParam.flags().SetFullScreen(fullScreen); m_videoParam.flags().SetFullScreen(fullScreen);
m_videoParam.flags().SetFlipSurfaces(flipSurfaces); m_videoParam.flags().SetFlipSurfaces(flipSurfaces);
@ -183,8 +192,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Throw error if sound unavailable // Throw error if sound unavailable
if (!soundReady) { if (!soundReady) {
MessageBoxA(NULL, "\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other applications and try again.", MessageBoxA(
"Lego Island Error", MB_OK); NULL,
"\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other "
"applications and try again.",
"Lego Island Error",
MB_OK
);
return 0; return 0;
} }
@ -193,7 +207,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Create window // Create window
if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) { if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) {
MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK); MessageBoxA(
NULL,
"\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.",
"LEGO\xAE Island Error",
MB_OK
);
return 0; return 0;
} }
@ -203,12 +222,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
window = g_isle->m_windowHandle; window = g_isle->m_windowHandle;
} }
// Load accelerators (this call actually achieves nothing - there is no "AppAccel" resource in the original - but we'll keep this for authenticity) // Load accelerators (this call actually achieves nothing - there is no "AppAccel" resource in the original - but
// This line may actually be here because it's in DFVIEW, an example project that ships with // we'll keep this for authenticity) This line may actually be here because it's in DFVIEW, an example project that
// MSVC420, and was such a clean example of a Win32 app, that it was later adapted // ships with MSVC420, and was such a clean example of a Win32 app, that it was later adapted into an "ExeSkeleton"
// into an "ExeSkeleton" sample for MSVC600. It's quite possible Mindscape derived // sample for MSVC600. It's quite possible Mindscape derived this app from that example since they no longer had the
// this app from that example since they no longer had the luxury of the // luxury of the MFC AppWizard which we know they used for the frontend used during development (ISLEMFC.EXE,
// MFC AppWizard which we know they used for the frontend used during development (ISLEMFC.EXE, MAIN.EXE, et al.) // MAIN.EXE, et al.)
LoadAcceleratorsA(hInstance, "AppAccel"); LoadAcceleratorsA(hInstance, "AppAccel");
MSG msg; MSG msg;
@ -230,11 +249,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
} }
MSG nextMsg; MSG nextMsg;
if (!g_isle if (!g_isle || !g_isle->m_windowHandle || msg.message != WM_MOUSEMOVE ||
|| !g_isle->m_windowHandle !PeekMessageA(&nextMsg, NULL, 0, 0, PM_NOREMOVE) || nextMsg.message != WM_MOUSEMOVE) {
|| msg.message != WM_MOUSEMOVE
|| !PeekMessageA(&nextMsg, NULL, 0, 0, PM_NOREMOVE)
|| nextMsg.message != WM_MOUSEMOVE) {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessageA(&msg); DispatchMessageA(&msg);
} }
@ -309,9 +325,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
if (g_isle) { if (g_isle) {
if ((wParam != 0) && (g_isle->m_fullScreen)) { if ((wParam != 0) && (g_isle->m_fullScreen)) {
MoveWindow(hWnd, g_windowRect.left, g_windowRect.top, MoveWindow(
hWnd,
g_windowRect.left,
g_windowRect.top,
(g_windowRect.right - g_windowRect.left) + 1, (g_windowRect.right - g_windowRect.left) + 1,
(g_windowRect.bottom - g_windowRect.top) + 1, TRUE); (g_windowRect.bottom - g_windowRect.top) + 1,
TRUE
);
} }
g_isle->m_windowActive = wParam; g_isle->m_windowActive = wParam;
} }
@ -346,7 +367,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PostMessageA(g_isle->m_windowHandle, WM_CLOSE, 0, 0); PostMessageA(g_isle->m_windowHandle, WM_CLOSE, 0, 0);
return 0; return 0;
} }
} else if (g_isle && g_isle->m_fullScreen && (wParam == SC_MOVE || wParam == SC_KEYMENU)) { }
else if (g_isle && g_isle->m_fullScreen && (wParam == SC_MOVE || wParam == SC_KEYMENU)) {
return 0; return 0;
} }
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
@ -364,7 +386,8 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:
if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D() && VideoManager()->GetDirect3D()->GetDeviceModeFinder()) { if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D() &&
VideoManager()->GetDirect3D()->GetDeviceModeFinder()) {
int targetWidth = LOWORD(lParam); int targetWidth = LOWORD(lParam);
int targetHeight = HIWORD(lParam); int targetHeight = HIWORD(lParam);
int targetDepth = wParam; int targetDepth = wParam;
@ -463,8 +486,17 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
LoadConfig(); LoadConfig();
SetupVideoFlags(m_fullScreen, m_flipSurfaces, m_backBuffersInVram, m_using8bit, SetupVideoFlags(
m_using16bit, m_unk24, FALSE, m_wideViewAngle, m_deviceId); m_fullScreen,
m_flipSurfaces,
m_backBuffersInVram,
m_using8bit,
m_using16bit,
m_unk24,
FALSE,
m_wideViewAngle,
m_deviceId
);
MxOmni::SetSound3D(m_use3dSound); MxOmni::SetSound3D(m_use3dSound);
@ -501,9 +533,13 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
g_windowRect.top, g_windowRect.top,
g_windowRect.right - g_windowRect.left + 1, g_windowRect.right - g_windowRect.left + 1,
g_windowRect.bottom - g_windowRect.top + 1, g_windowRect.bottom - g_windowRect.top + 1,
NULL, NULL, hInstance, NULL NULL,
NULL,
hInstance,
NULL
); );
} else { }
else {
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW); AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
m_windowHandle = CreateWindowExA( m_windowHandle = CreateWindowExA(
@ -515,7 +551,10 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
CW_USEDEFAULT, CW_USEDEFAULT,
g_windowRect.right - g_windowRect.left + 1, g_windowRect.right - g_windowRect.left + 1,
g_windowRect.bottom - g_windowRect.top + 1, g_windowRect.bottom - g_windowRect.top + 1,
NULL, NULL, hInstance, NULL NULL,
NULL,
hInstance,
NULL
); );
} }
@ -524,7 +563,14 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
} }
if (m_fullScreen) { if (m_fullScreen) {
MoveWindow(m_windowHandle, g_windowRect.left, g_windowRect.top, (g_windowRect.right - g_windowRect.left) + 1, (g_windowRect.bottom - g_windowRect.top) + 1, TRUE); MoveWindow(
m_windowHandle,
g_windowRect.left,
g_windowRect.top,
(g_windowRect.right - g_windowRect.left) + 1,
(g_windowRect.bottom - g_windowRect.top) + 1,
TRUE
);
} }
ShowWindow(m_windowHandle, SW_SHOWNORMAL); ShowWindow(m_windowHandle, SW_SHOWNORMAL);
@ -563,7 +609,14 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
} }
} }
if (m_fullScreen) { if (m_fullScreen) {
MoveWindow(m_windowHandle, g_windowRect.left, g_windowRect.top, (g_windowRect.right - g_windowRect.left) + 1, (g_windowRect.bottom - g_windowRect.top) + 1, TRUE); MoveWindow(
m_windowHandle,
g_windowRect.left,
g_windowRect.top,
(g_windowRect.right - g_windowRect.left) + 1,
(g_windowRect.bottom - g_windowRect.top) + 1,
TRUE
);
} }
ShowWindow(m_windowHandle, SW_SHOWNORMAL); ShowWindow(m_windowHandle, SW_SHOWNORMAL);
UpdateWindow(m_windowHandle); UpdateWindow(m_windowHandle);
@ -664,7 +717,8 @@ void IsleApp::LoadConfig()
if (ReadRegInt("Display Bit Depth", &bitDepth)) { if (ReadRegInt("Display Bit Depth", &bitDepth)) {
if (bitDepth == 8) { if (bitDepth == 8) {
m_using8bit = TRUE; m_using8bit = TRUE;
} else if (bitDepth == 16) { }
else if (bitDepth == 16) {
m_using16bit = TRUE; m_using16bit = TRUE;
} }
} }
@ -698,9 +752,12 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
return; return;
} }
if (!Lego()) return; if (!Lego())
if (!TickleManager()) return; return;
if (!Timer()) return; if (!TickleManager())
return;
if (!Timer())
return;
MxLong currentTime = Timer()->GetRealTime(); MxLong currentTime = Timer()->GetRealTime();
if (currentTime < g_lastFrameTime) { if (currentTime < g_lastFrameTime) {
@ -742,7 +799,8 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
if (Start(&ds) != SUCCESS) { if (Start(&ds) != SUCCESS) {
return; return;
} }
} else { }
else {
ds.SetAtomId(stream->GetAtom()); ds.SetAtomId(stream->GetAtom());
ds.SetUnknown24(-1); ds.SetUnknown24(-1);
ds.SetObjectId(0); ds.SetObjectId(0);

View File

@ -1,13 +1,12 @@
#ifndef ISLEAPP_H #ifndef ISLEAPP_H
#define ISLEAPP_H #define ISLEAPP_H
#include <windows.h>
#include "mxtypes.h" #include "mxtypes.h"
#include "mxvideoparam.h" #include "mxvideoparam.h"
class IsleApp #include <windows.h>
{
class IsleApp {
public: public:
IsleApp(); IsleApp();
~IsleApp(); ~IsleApp();
@ -15,9 +14,17 @@ class IsleApp
void Close(); void Close();
BOOL SetupLegoOmni(); BOOL SetupLegoOmni();
void SetupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, void SetupVideoFlags(
BOOL using8bit, BOOL using16bit, BOOL param_6, BOOL param_7, BOOL fullScreen,
BOOL wideViewAngle, char *deviceId); BOOL flipSurfaces,
BOOL backBuffers,
BOOL using8bit,
BOOL using16bit,
BOOL param_6,
BOOL param_7,
BOOL wideViewAngle,
char* deviceId
);
MxResult SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine); MxResult SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine);
BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize); BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize);

View File

@ -5,4 +5,3 @@ Act1State::Act1State()
{ {
// TODO // TODO
} }

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d7028 // VTABLE 0x100d7028
// SIZE 0x26c // SIZE 0x26c
class Act1State : public LegoState class Act1State : public LegoState {
{
public: public:
Act1State(); Act1State();

View File

@ -25,5 +25,5 @@ MxResult Act2Brick::Tickle()
{ {
// TODO // TODO
return 0; return SUCCESS;
} }

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d9b60 // VTABLE 0x100d9b60
// SIZE 0x194 // SIZE 0x194
class Act2Brick : public LegoPathActor class Act2Brick : public LegoPathActor {
{
public: public:
Act2Brick(); Act2Brick();
virtual ~Act2Brick() override; // vtable+0x0 virtual ~Act2Brick() override; // vtable+0x0
@ -26,7 +25,6 @@ class Act2Brick : public LegoPathActor
{ {
return !strcmp(Act2Brick::ClassName(), name) || LegoEntity::IsA(name); return !strcmp(Act2Brick::ClassName(), name) || LegoEntity::IsA(name);
} }
}; };
#endif // ACT2BRICK_H #endif // ACT2BRICK_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d53a8 // VTABLE 0x100d53a8
// SIZE 0x68 // SIZE 0x68
class Act2PoliceStation : public LegoEntity class Act2PoliceStation : public LegoEntity {
{
public: public:
virtual MxLong Notify(MxParam& p) override; // vtable+0x4 virtual MxLong Notify(MxParam& p) override; // vtable+0x4

View File

@ -1,5 +1,7 @@
#include "act3.h" #include "act3.h"
DECOMP_SIZE_ASSERT(Act3, 0x4274)
// OFFSET: LEGO1 0x10072270 STUB // OFFSET: LEGO1 0x10072270 STUB
Act3::Act3() Act3::Act3()
{ {

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d9628 // VTABLE 0x100d9628
// SIZE 0x4274 // SIZE 0x4274
class Act3 : public LegoWorld class Act3 : public LegoWorld {
{
public: public:
Act3(); Act3();
@ -25,7 +24,12 @@ class Act3 : public LegoWorld
return !strcmp(name, Act3::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, Act3::ClassName()) || LegoWorld::IsA(name);
} }
inline void SetUnkown420c(MxEntity* p_entity) { m_unk420c = p_entity; }
protected:
undefined m_unkf8[0x4114];
MxEntity* m_unk420c;
undefined m_unk4210[0x64];
}; };
#endif // ACT3_H #endif // ACT3_H

View File

@ -3,8 +3,7 @@
// FIXME: Uncertain location. There are three vtables which eventually call this // FIXME: Uncertain location. There are three vtables which eventually call this
// class' ClassName() function, but none of them call it directly. // class' ClassName() function, but none of them call it directly.
class Act3Actor class Act3Actor {
{
public: public:
// OFFSET: LEGO1 0x100431b0 // OFFSET: LEGO1 0x100431b0
inline virtual const char* ClassName() override inline virtual const char* ClassName() override
@ -12,7 +11,6 @@ class Act3Actor
// 0x100f03ac // 0x100f03ac
return "Act3Actor"; return "Act3Actor";
} }
}; };
#endif // ACT3ACTOR_H #endif // ACT3ACTOR_H

View File

@ -4,8 +4,7 @@
#include "legoanimactor.h" #include "legoanimactor.h"
// VTABLE 0x100d7920 // VTABLE 0x100d7920
class Act3Shark : public LegoAnimActor class Act3Shark : public LegoAnimActor {
{
public: public:
// OFFSET: LEGO1 0x100430c0 // OFFSET: LEGO1 0x100430c0
inline virtual const char* ClassName() const override inline virtual const char* ClassName() const override

View File

@ -5,13 +5,9 @@
// VTABLE 0x100d4fc8 // VTABLE 0x100d4fc8
// SIZE 0xc // SIZE 0xc
class Act3State : public LegoState class Act3State : public LegoState {
{
public: public:
inline Act3State() inline Act3State() { m_unk08 = 0; }
{
m_unk08 = 0;
}
// OFFSET: LEGO1 0x1000e300 // OFFSET: LEGO1 0x1000e300
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -31,7 +27,6 @@ class Act3State : public LegoState
private: private:
// FIXME: May be part of LegoState? Uncertain... // FIXME: May be part of LegoState? Uncertain...
MxU32 m_unk08; MxU32 m_unk08;
}; };
#endif // ACT3STATE_H #endif // ACT3STATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d71a8 // VTABLE 0x100d71a8
// SIZE 0x184 // SIZE 0x184
class Ambulance : public IslePathActor class Ambulance : public IslePathActor {
{
public: public:
Ambulance(); Ambulance();
@ -22,6 +21,7 @@ class Ambulance : public IslePathActor
{ {
return !strcmp(name, Ambulance::ClassName()) || IslePathActor::IsA(name); return !strcmp(name, Ambulance::ClassName()) || IslePathActor::IsA(name);
} }
private: private:
// TODO: Ambulance fields // TODO: Ambulance fields
undefined m_unk160[4]; undefined m_unk160[4];

View File

@ -1,5 +1,7 @@
#include "ambulancemissionstate.h" #include "ambulancemissionstate.h"
DECOMP_SIZE_ASSERT(AmbulanceMissionState, 0x24);
// OFFSET: LEGO1 0x100373a0 STUB // OFFSET: LEGO1 0x100373a0 STUB
AmbulanceMissionState::AmbulanceMissionState() AmbulanceMissionState::AmbulanceMissionState()
{ {

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d72a0 // VTABLE 0x100d72a0
// SIZE 0x24 // SIZE 0x24
class AmbulanceMissionState : public LegoState class AmbulanceMissionState : public LegoState {
{
public: public:
AmbulanceMissionState(); AmbulanceMissionState();
@ -23,7 +22,31 @@ class AmbulanceMissionState : public LegoState
return !strcmp(name, AmbulanceMissionState::ClassName()) || LegoState::IsA(name); return !strcmp(name, AmbulanceMissionState::ClassName()) || LegoState::IsA(name);
} }
inline MxU16 GetColor(MxU8 id)
{
switch (id) {
case 1:
return m_color1;
case 2:
return m_color2;
case 3:
return m_color3;
case 4:
return m_color4;
case 5:
return m_color5;
default:
return 0;
}
}
protected:
undefined m_unk8[0x12];
MxU16 m_color1;
MxU16 m_color2;
MxU16 m_color3;
MxU16 m_color4;
MxU16 m_color5;
}; };
#endif // AMBULANCEMISSIONSTATE_H #endif // AMBULANCEMISSIONSTATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d8d80 // VTABLE 0x100d8d80
// SIZE 0x1c // SIZE 0x1c
class AnimState : public LegoState class AnimState : public LegoState {
{
public: public:
AnimState(); AnimState();
virtual ~AnimState() override; // vtable+0x0 virtual ~AnimState() override; // vtable+0x0
@ -23,7 +22,6 @@ class AnimState : public LegoState
{ {
return !strcmp(name, AnimState::ClassName()) || LegoState::IsA(name); return !strcmp(name, AnimState::ClassName()) || LegoState::IsA(name);
} }
}; };
#endif // ANIMSTATE_H #endif // ANIMSTATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4a18 // VTABLE 0x100d4a18
// SIZE 0x68 // SIZE 0x68
class BeachHouseEntity : public BuildingEntity class BeachHouseEntity : public BuildingEntity {
{
public: public:
virtual MxLong Notify(MxParam& p) override; // vtable+04 virtual MxLong Notify(MxParam& p) override; // vtable+04

View File

@ -9,4 +9,3 @@ Bike::Bike()
this->m_unk150 = 3.0; this->m_unk150 = 3.0;
this->m_unk148 = 1; this->m_unk148 = 1;
} }

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d9808 // VTABLE 0x100d9808
// SIZE 0x164 // SIZE 0x164
class Bike : public IslePathActor class Bike : public IslePathActor {
{
public: public:
Bike(); Bike();
@ -23,10 +22,10 @@ class Bike : public IslePathActor
{ {
return !strcmp(name, Bike::ClassName()) || IslePathActor::IsA(name); return !strcmp(name, Bike::ClassName()) || IslePathActor::IsA(name);
} }
private: private:
// TODO: Bike fields // TODO: Bike fields
undefined m_unk160[4]; undefined m_unk160[4];
}; };
#endif // BIKE_H #endif // BIKE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5c88 // VTABLE 0x100d5c88
// SIZE <= 0x68, hard to tell because it's always constructed as a derivative // SIZE <= 0x68, hard to tell because it's always constructed as a derivative
class BuildingEntity : public LegoEntity class BuildingEntity : public LegoEntity {
{
public: public:
BuildingEntity(); BuildingEntity();
virtual ~BuildingEntity() override; // vtable+0x0 virtual ~BuildingEntity() override; // vtable+0x0

View File

@ -5,8 +5,7 @@
#include "mxtypes.h" #include "mxtypes.h"
// VTABLE 0x100d6790 // VTABLE 0x100d6790
class BumpBouy : public LegoAnimActor class BumpBouy : public LegoAnimActor {
{
public: public:
// OFFSET: LEGO1 0x100274e0 // OFFSET: LEGO1 0x100274e0
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5e50 // VTABLE 0x100d5e50
// SIZE 0x154 // SIZE 0x154
class CarRace : public LegoRace class CarRace : public LegoRace {
{
public: public:
CarRace(); CarRace();

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4b70 // VTABLE 0x100d4b70
// SIZE 0x2c // SIZE 0x2c
class CarRaceState : public RaceState class CarRaceState : public RaceState {
{
public: public:
// OFFSET: LEGO1 0x1000dd30 // OFFSET: LEGO1 0x1000dd30
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -20,7 +20,10 @@
#pragma warning(disable : 4786) #pragma warning(disable : 4786)
// To really remove *all* of the warnings, we have to employ the following, // To really remove *all* of the warnings, we have to employ the following,
// obscure workaround from https://www.earthli.com/news/view_article.php?id=376 // obscure workaround from https://www.earthli.com/news/view_article.php?id=376
static class msVC6_4786WorkAround { public: msVC6_4786WorkAround() {} } msVC6_4786WorkAround; static class msVC6_4786WorkAround {
public:
msVC6_4786WorkAround() {}
} msVC6_4786WorkAround;
#define MSVC420_VERSION 1020 #define MSVC420_VERSION 1020
@ -31,7 +34,8 @@ static class msVC6_4786WorkAround { public: msVC6_4786WorkAround() {} } msVC6_47
#include <algorithm> #include <algorithm>
#include <list> #include <list>
#include <set> #include <set>
using namespace std; using std::list;
using std::set;
#endif #endif
// We use `override` so newer compilers can tell us our vtables are valid, // We use `override` so newer compilers can tell us our vtables are valid,

View File

@ -1,8 +1,17 @@
#ifndef DECOMP_H #ifndef DECOMP_H
#define DECOMP_H #define DECOMP_H
#define DECOMP_STATIC_ASSERT(V) namespace { typedef int foo[(V)?1:-1]; } #if defined(_MSC_VER)
#define DECOMP_STATIC_ASSERT(V) \
namespace \
{ \
typedef int foo[(V) ? 1 : -1]; \
}
#define DECOMP_SIZE_ASSERT(T, S) DECOMP_STATIC_ASSERT(sizeof(T) == S) #define DECOMP_SIZE_ASSERT(T, S) DECOMP_STATIC_ASSERT(sizeof(T) == S)
#else
#define DECOMP_STATIC_ASSERT(V)
#define DECOMP_SIZE_ASSERT(T, S)
#endif
#ifndef _countof #ifndef _countof
#define _countof(arr) sizeof(arr) / sizeof(arr[0]) #define _countof(arr) sizeof(arr) / sizeof(arr[0])

View File

@ -8,3 +8,6 @@ const char *g_strWORLD = "WORLD";
// 0x10102040 // 0x10102040
const char* g_strACTION = "ACTION"; const char* g_strACTION = "ACTION";
// 0x101020cc
const char* g_strVISIBILITY = "VISIBILITY";

View File

@ -4,5 +4,6 @@
extern const char* g_parseExtraTokens; extern const char* g_parseExtraTokens;
extern const char* g_strWORLD; extern const char* g_strWORLD;
extern const char* g_strACTION; extern const char* g_strACTION;
extern const char* g_strVISIBILITY;
#endif // DEFINE_H #endif // DEFINE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4788 // VTABLE 0x100d4788
// SIZE 0x1f8 // SIZE 0x1f8
class Doors : public LegoPathActor class Doors : public LegoPathActor {
{
public: public:
// OFFSET: LEGO1 0x1000e430 // OFFSET: LEGO1 0x1000e430
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -22,5 +21,4 @@ class Doors : public LegoPathActor
} }
}; };
#endif // DOORS_H #endif // DOORS_H

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d8f98 // VTABLE 0x100d8f98
// SIZE 0x16c // SIZE 0x16c
class DuneBuggy : public IslePathActor class DuneBuggy : public IslePathActor {
{
public: public:
DuneBuggy(); DuneBuggy();
@ -23,6 +22,7 @@ class DuneBuggy : public IslePathActor
{ {
return !strcmp(name, DuneBuggy::ClassName()) || IslePathActor::IsA(name); return !strcmp(name, DuneBuggy::ClassName()) || IslePathActor::IsA(name);
} }
private: private:
// TODO: Double check DuneBuggy field types // TODO: Double check DuneBuggy field types
undefined4 m_unk160; undefined4 m_unk160;

View File

@ -4,8 +4,7 @@
#include "legoworld.h" #include "legoworld.h"
// VTABLE 0x100d5f20 // VTABLE 0x100d5f20
class ElevatorBottom : public LegoWorld class ElevatorBottom : public LegoWorld {
{
public: public:
ElevatorBottom(); ElevatorBottom();
virtual ~ElevatorBottom() override; // vtable+0x0 virtual ~ElevatorBottom() override; // vtable+0x0
@ -24,7 +23,6 @@ class ElevatorBottom : public LegoWorld
{ {
return !strcmp(name, ElevatorBottom::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, ElevatorBottom::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // ELEVATORBOTTOM_H #endif // ELEVATORBOTTOM_H

View File

@ -3,8 +3,7 @@
// Items related to the Extra string of key-value pairs found in MxOb // Items related to the Extra string of key-value pairs found in MxOb
enum ExtraActionType enum ExtraActionType {
{
ExtraActionType_opendisk = 1, ExtraActionType_opendisk = 1,
ExtraActionType_openram = 2, ExtraActionType_openram = 2,
ExtraActionType_close = 3, ExtraActionType_close = 3,

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d4650 // VTABLE 0x100d4650
// SIZE 0x128 // SIZE 0x128
// Radio variable at 0x46, in constructor // Radio variable at 0x46, in constructor
class GasStation : public LegoWorld class GasStation : public LegoWorld {
{
public: public:
GasStation(); GasStation();
virtual ~GasStation() override; // vtable+0x0 virtual ~GasStation() override; // vtable+0x0
@ -27,7 +26,6 @@ class GasStation : public LegoWorld
{ {
return !strcmp(name, GasStation::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, GasStation::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // GASSTATION_H #endif // GASSTATION_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5258 // VTABLE 0x100d5258
// SIZE 0x68 // SIZE 0x68
class GasStationEntity : public BuildingEntity class GasStationEntity : public BuildingEntity {
{
public: public:
// OFFSET: LEGO1 0x1000eb20 // OFFSET: LEGO1 0x1000eb20
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d46e0 // VTABLE 0x100d46e0
// SIZE 0x24 // SIZE 0x24
class GasStationState : public LegoState class GasStationState : public LegoState {
{
public: public:
GasStationState(); GasStationState();

25
LEGO1/gifmanager.cpp Normal file
View File

@ -0,0 +1,25 @@
#include "gifmanager.h"
DECOMP_SIZE_ASSERT(GifData, 0x14);
DECOMP_SIZE_ASSERT(GifMapEntry, 0x14);
DECOMP_SIZE_ASSERT(GifMap, 0x08);
DECOMP_SIZE_ASSERT(GifManagerBase, 0x14);
DECOMP_SIZE_ASSERT(GifManager, 0x30);
GifMapEntry* DAT_100f0100;
// OFFSET: LEGO1 0x10001cc0
GifMapEntry* GifMap::FindNode(const char*& string)
{
GifMapEntry* ret = m_unk4;
GifMapEntry* current = ret->m_parent;
while (current != DAT_100f0100) {
if (strcmp(current->m_key, string) <= 0) {
ret = current;
current = current->m_right;
}
else
current = current->m_left;
}
return ret;
}

69
LEGO1/gifmanager.h Normal file
View File

@ -0,0 +1,69 @@
#ifndef GIFMANAGER_H
#define GIFMANAGER_H
#include "decomp.h"
#include "mxtypes.h"
#include <d3drmobj.h>
#include <ddraw.h>
struct GifData {
public:
const char* m_name;
LPDIRECTDRAWSURFACE m_surface;
LPDIRECTDRAWPALETTE m_palette;
LPDIRECT3DRMTEXTURE2 m_texture;
MxU8* m_data;
};
struct GifMapEntry {
public:
GifMapEntry* m_right;
GifMapEntry* m_parent;
GifMapEntry* m_left;
const char* m_key;
GifData* m_value;
};
class GifMap {
public:
GifMapEntry* FindNode(const char*& string);
inline GifData* Get(const char* string)
{
GifData* ret = NULL;
GifMapEntry* entry = FindNode(string);
if (((m_unk4 == entry || strcmp(string, entry->m_key) > 0) ? m_unk4 : entry) != entry)
ret = entry->m_value;
return ret;
}
undefined4 m_unk0;
GifMapEntry* m_unk4;
};
// VTABLE 0x100d86d4
class GifManagerBase {
public:
// OFFSET: LEGO1 0x1005a310 STUB
virtual ~GifManagerBase() {} // vtable+00
inline GifData* Get(const char* name) { return m_unk8.Get(name); }
protected:
undefined4 m_unk0;
undefined4 m_unk4;
GifMap m_unk8;
};
// VTABLE 0x100d86fc
class GifManager : public GifManagerBase {
public:
// OFFSET: LEGO1 0x1005a580 STUB
virtual ~GifManager() {} // vtable+00
protected:
undefined m_unk[0x1c];
};
#endif // GIFMANAGER_H

View File

@ -1,13 +1,78 @@
#include "helicopter.h" #include "helicopter.h"
// OFFSET: LEGO1 0x10001e60 STUB #include "act3.h"
#include "legoanimationmanager.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoomni.h"
#include "legoutil.h"
#include "legoworld.h"
DECOMP_SIZE_ASSERT(Helicopter, 0x230)
// OFFSET: LEGO1 0x10001e60
Helicopter::Helicopter() Helicopter::Helicopter()
{ {
// TODO m_unk13c = 60;
} }
// OFFSET: LEGO1 0x10003230 STUB // OFFSET: LEGO1 0x10003230
Helicopter::~Helicopter() Helicopter::~Helicopter()
{ {
// TODO ControlManager()->Unregister(this);
IslePathActor::Destroy(TRUE);
}
// OFFSET: LEGO1 0x100032c0
MxResult Helicopter::InitFromMxDSObject(MxDSObject& p_dsObject)
{
MxResult result = IslePathActor::InitFromMxDSObject(p_dsObject);
LegoWorld* world = GetCurrentWorld();
SetWorld(world);
if (world->IsA("Act3")) {
((Act3*) GetWorld())->SetUnkown420c(this);
}
world = GetWorld();
if (world)
world->VTable0x58(this);
GetState();
return result;
}
// OFFSET: LEGO1 0x10003320
void Helicopter::GetState()
{
m_state = (HelicopterState*) GameState()->GetState("HelicopterState");
if (!m_state)
m_state = (HelicopterState*) GameState()->CreateState("HelicopterState");
}
// OFFSET: LEGO1 0x10003360
void Helicopter::VTable0xe4()
{
if (!GameState()->GetUnknown10()) {
VTable0xe8(0x28, TRUE, 7);
}
IslePathActor::VTable0xe4();
if (!GameState()->GetUnknown10()) {
GameState()->SetUnknown424(0x3c);
if (GetCurrentVehicle()) {
if (GetCurrentVehicle()->IsA("IslePathActor")) {
((IslePathActor*) GetCurrentVehicle())->VTable0xe8(0x37, TRUE, 7);
}
}
}
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);
AnimationManager()->FUN_1005f6d0(TRUE);
ControlManager()->Unregister(this);
} }

View File

@ -1,15 +1,15 @@
#ifndef HELICOPTER_H #ifndef HELICOPTER_H
#define HELICOPTER_H #define HELICOPTER_H
#include "helicopterstate.h"
#include "islepathactor.h" #include "islepathactor.h"
#include "mxmatrix.h"
// VTABLE 0x100d40f8 // VTABLE 0x100d40f8
// SIZE 0x230 // SIZE 0x230
class Helicopter : public IslePathActor class Helicopter : public IslePathActor {
{
public: public:
Helicopter(); Helicopter();
virtual ~Helicopter(); // vtable+0x0
// OFFSET: LEGO1 0x10003070 // OFFSET: LEGO1 0x10003070
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -24,6 +24,25 @@ class Helicopter : public IslePathActor
return !strcmp(name, Helicopter::ClassName()) || IslePathActor::IsA(name); return !strcmp(name, Helicopter::ClassName()) || IslePathActor::IsA(name);
} }
virtual MxResult InitFromMxDSObject(MxDSObject& p_dsObject) override; // vtable+0x18
virtual void VTable0xe4() override;
// OFFSET: LEGO1 0x10003210 TEMPLATE
// Helicopter::`scalar deleting destructor'
virtual ~Helicopter() override; // vtable+0x0
protected:
MxMatrixData m_unk160;
MxMatrixData m_unk1a8;
undefined4 m_unk1f0;
MxVector4Data m_unk1f4;
MxVector4Data m_unk20c;
undefined4 m_unk224;
HelicopterState* m_state;
MxAtomId m_unk22c;
private:
void GetState();
}; };
#endif // HELICOPTER_H #endif // HELICOPTER_H

View File

@ -1,12 +1,12 @@
#ifndef HELICOPTERSTATE_H #ifndef HELICOPTERSTATE_H
#define HELICOPTERSTATE_H #define HELICOPTERSTATE_H
#include "decomp.h"
#include "legostate.h" #include "legostate.h"
// VTABLE 0x100d5418 // VTABLE 0x100d5418
// SIZE 0xc // SIZE 0xc
class HelicopterState : public LegoState class HelicopterState : public LegoState {
{
public: public:
// OFFSET: LEGO1 0x1000e0d0 // OFFSET: LEGO1 0x1000e0d0
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,6 +20,11 @@ class HelicopterState : public LegoState
{ {
return !strcmp(name, HelicopterState::ClassName()) || LegoState::IsA(name); return !strcmp(name, HelicopterState::ClassName()) || LegoState::IsA(name);
} }
inline void SetUnknown8(undefined4 p_unk8) { m_unk8 = p_unk8; }
protected:
undefined4 m_unk8;
}; };
#endif // HELICOPTERSTATE_H #endif // HELICOPTERSTATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100da328 // VTABLE 0x100da328
// SIZE 0x3e4 // SIZE 0x3e4
class HistoryBook : public LegoWorld class HistoryBook : public LegoWorld {
{
public: public:
HistoryBook(); HistoryBook();
virtual ~HistoryBook() override; // vtable+0x0 virtual ~HistoryBook() override; // vtable+0x0

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d9730 // VTABLE 0x100d9730
// SIZE 0x12c // SIZE 0x12c
class Hospital : public LegoWorld class Hospital : public LegoWorld {
{
public: public:
Hospital(); Hospital();
virtual ~Hospital() override; // vtable+0x0 virtual ~Hospital() override; // vtable+0x0
@ -25,7 +24,6 @@ class Hospital : public LegoWorld
{ {
return !strcmp(name, Hospital::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, Hospital::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // HOSPITAL_H #endif // HOSPITAL_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5068 // VTABLE 0x100d5068
// SIZE 0x68 // SIZE 0x68
class HospitalEntity : public BuildingEntity class HospitalEntity : public BuildingEntity {
{
public: public:
// OFFSET: LEGO1 0x1000ec40 // OFFSET: LEGO1 0x1000ec40
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,7 +19,6 @@ class HospitalEntity : public BuildingEntity
{ {
return !strcmp(name, HospitalEntity::ClassName()) || BuildingEntity::IsA(name); return !strcmp(name, HospitalEntity::ClassName()) || BuildingEntity::IsA(name);
} }
}; };
#endif // HOSPITALENTITY_H #endif // HOSPITALENTITY_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d97a0 // VTABLE 0x100d97a0
// SIZE 0x18 // SIZE 0x18
class HospitalState : public LegoState class HospitalState : public LegoState {
{
public: public:
HospitalState(); HospitalState();
@ -22,7 +21,6 @@ class HospitalState : public LegoState
{ {
return !strcmp(name, HospitalState::ClassName()) || LegoState::IsA(name); return !strcmp(name, HospitalState::ClassName()) || LegoState::IsA(name);
} }
}; };
#endif // HOSPITALSTATE_H #endif // HOSPITALSTATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d9338 // VTABLE 0x100d9338
// SIZE 0x1d8 // SIZE 0x1d8
class Infocenter : public LegoWorld class Infocenter : public LegoWorld {
{
public: public:
Infocenter(); Infocenter();
virtual ~Infocenter() override; virtual ~Infocenter() override;
@ -26,7 +25,6 @@ class Infocenter : public LegoWorld
{ {
return !strcmp(name, Infocenter::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, Infocenter::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // INFOCENTER_H #endif // INFOCENTER_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d72d8 // VTABLE 0x100d72d8
// SIZE 0xfc // SIZE 0xfc
class InfocenterDoor : public LegoWorld class InfocenterDoor : public LegoWorld {
{
public: public:
InfocenterDoor(); InfocenterDoor();
virtual ~InfocenterDoor(); // vtable+0x0 virtual ~InfocenterDoor(); // vtable+0x0
@ -25,7 +24,6 @@ class InfocenterDoor : public LegoWorld
{ {
return !strcmp(name, InfocenterDoor::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, InfocenterDoor::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // INFOCENTERDOOR_H #endif // INFOCENTERDOOR_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4b90 // VTABLE 0x100d4b90
// SIZE 0x68 // SIZE 0x68
class InfoCenterEntity : public BuildingEntity class InfoCenterEntity : public BuildingEntity {
{
public: public:
// OFFSET: LEGO1 0x1000ea00 // OFFSET: LEGO1 0x1000ea00
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,7 +19,6 @@ class InfoCenterEntity : public BuildingEntity
{ {
return !strcmp(name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(name); return !strcmp(name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(name);
} }
}; };
#endif // INFOCENTERENTITY_H #endif // INFOCENTERENTITY_H

View File

@ -13,4 +13,3 @@ InfocenterState::~InfocenterState()
{ {
// TODO // TODO
} }

View File

@ -1,14 +1,12 @@
#ifndef INFOCENTERSTATE_H #ifndef INFOCENTERSTATE_H
#define INFOCENTERSTATE_H #define INFOCENTERSTATE_H
#include "legostate.h"
#include "decomp.h" #include "decomp.h"
#include "legostate.h"
// VTABLE 0x100d93a8 // VTABLE 0x100d93a8
// SIZE 0x94 // SIZE 0x94
class InfocenterState : public LegoState class InfocenterState : public LegoState {
{
public: public:
InfocenterState(); InfocenterState();
virtual ~InfocenterState(); virtual ~InfocenterState();

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d6fb8 // VTABLE 0x100d6fb8
// SIZE 0x140 // SIZE 0x140
// Radio at 0x12c // Radio at 0x12c
class Isle : public LegoWorld class Isle : public LegoWorld {
{
public: public:
Isle(); Isle();

View File

@ -4,8 +4,7 @@
#include "legoactor.h" #include "legoactor.h"
// VTABLE 0x100d5178 // VTABLE 0x100d5178
class IsleActor : public LegoActor class IsleActor : public LegoActor {
{
public: public:
// OFFSET: LEGO1 0x1000e660 // OFFSET: LEGO1 0x1000e660
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -2,6 +2,38 @@
DECOMP_SIZE_ASSERT(IslePathActor, 0x160) DECOMP_SIZE_ASSERT(IslePathActor, 0x160)
// Probably in header
// OFFSET: LEGO1 0x10002df0 STUB
void IslePathActor::VTable0xd0()
{
// TODO
}
// OFFSET: LEGO1 0x10002e00 STUB
void IslePathActor::VTable0xdc()
{
// TODO
}
// OFFSET: LEGO1 0x10002e70 STUB
void IslePathActor::VTable0xcc()
{
// TODO
}
// OFFSET: LEGO1 0x10002e80 STUB
void IslePathActor::VTable0xd4()
{
// TODO
}
// OFFSET: LEGO1 0x10002e90 STUB
void IslePathActor::VTable0xd8()
{
// TODO
}
// End header
// OFFSET: LEGO1 0x1001a200 // OFFSET: LEGO1 0x1001a200
IslePathActor::IslePathActor() IslePathActor::IslePathActor()
{ {
@ -11,7 +43,32 @@ IslePathActor::IslePathActor()
this->m_unk158 = 0; this->m_unk158 = 0;
} }
// OFFSET: LEGO1 0x10002e10 // OFFSET: LEGO1 0x1001a280
IslePathActor::~IslePathActor() MxResult IslePathActor::InitFromMxDSObject(MxDSObject& p_dsObject)
{ {
return MxEntity::InitFromMxDSObject(p_dsObject);
}
// OFFSET: LEGO1 0x1001a350 STUB
void IslePathActor::VTable0xe0()
{
// TODO
}
// OFFSET: LEGO1 0x1001a3f0 STUB
void IslePathActor::VTable0xe4()
{
// TODO
}
// OFFSET: LEGO1 0x1001b2a0 STUB
void IslePathActor::VTable0xe8(MxU32 p_1, MxBool p_2, MxU8 p_3)
{
// TODO
}
// OFFSET: LEGO1 0x1001b5b0 STUB
void IslePathActor::VTable0xec()
{
// TODO
} }

View File

@ -7,11 +7,9 @@
// VTABLE 0x100d4398 // VTABLE 0x100d4398
// SIZE 0x160 // SIZE 0x160
class IslePathActor : public LegoPathActor class IslePathActor : public LegoPathActor {
{
public: public:
IslePathActor(); IslePathActor();
~IslePathActor();
// OFFSET: LEGO1 0x10002ea0 // OFFSET: LEGO1 0x10002ea0
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -26,6 +24,24 @@ class IslePathActor : public LegoPathActor
return !strcmp(name, IslePathActor::ClassName()) || LegoPathActor::IsA(name); return !strcmp(name, IslePathActor::ClassName()) || LegoPathActor::IsA(name);
} }
// OFFSET: LEGO1 0x10002ff0 TEMPLATE
// IslePathActor::`scalar deleting destructor'
inline virtual ~IslePathActor() override { IslePathActor::Destroy(TRUE); }
virtual MxResult InitFromMxDSObject(MxDSObject& p_dsObject) override; // vtable+0x18
virtual void VTable0xcc(); // vtable+0xcc
virtual void VTable0xd0(); // vtable+0xd0
virtual void VTable0xd4(); // vtable+0xd4
virtual void VTable0xd8(); // vtable+0xd8
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 VTable0xec(); // vtable+0xec
inline void SetWorld(LegoWorld* p_world) { m_pLegoWorld = p_world; }
inline LegoWorld* GetWorld() { return m_pLegoWorld; }
private: private:
LegoWorld* m_pLegoWorld; // 0x154 LegoWorld* m_pLegoWorld; // 0x154
MxFloat m_unk158; MxFloat m_unk158;

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d9ec8 // VTABLE 0x100d9ec8
// SIZE 0x164 // SIZE 0x164
class Jetski : public IslePathActor class Jetski : public IslePathActor {
{
public: public:
Jetski(); Jetski();
@ -23,10 +22,10 @@ class Jetski : public IslePathActor
{ {
return !strcmp(name, Jetski::ClassName()) || IslePathActor::IsA(name); return !strcmp(name, Jetski::ClassName()) || IslePathActor::IsA(name);
} }
private: private:
// TODO: Jetski fields // TODO: Jetski fields
undefined m_unk160[4]; undefined m_unk160[4];
}; };
#endif // JETSKI_H #endif // JETSKI_H

View File

@ -5,10 +5,8 @@
// VTABLE 0x100d4fe8 // VTABLE 0x100d4fe8
// SIZE 0x144 // SIZE 0x144
class JetskiRace : public LegoRace class JetskiRace : public LegoRace {
{
public: public:
// OFFSET: LEGO1 0x1000daf0 // OFFSET: LEGO1 0x1000daf0
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
{ {

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4fa8 // VTABLE 0x100d4fa8
// SIZE 0x2c // SIZE 0x2c
class JetskiRaceState : public RaceState class JetskiRaceState : public RaceState {
{
public: public:
// OFFSET: LEGO1 0x1000dc40 // OFFSET: LEGO1 0x1000dc40
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,7 +19,6 @@ class JetskiRaceState : public RaceState
{ {
return !strcmp(name, JetskiRaceState::ClassName()) || RaceState::IsA(name); return !strcmp(name, JetskiRaceState::ClassName()) || RaceState::IsA(name);
} }
}; };
#endif // JETSKIRACESTATE_H #endif // JETSKIRACESTATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d8958 // VTABLE 0x100d8958
// SIZE 0x104 // SIZE 0x104
class JukeBox : public LegoWorld class JukeBox : public LegoWorld {
{
public: public:
JukeBox(); JukeBox();
@ -22,7 +21,6 @@ class JukeBox : public LegoWorld
{ {
return !strcmp(name, JukeBox::ClassName()) || LegoWorld::IsA(name); return !strcmp(name, JukeBox::ClassName()) || LegoWorld::IsA(name);
} }
}; };
#endif // JUKEBOX_H #endif // JUKEBOX_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100da8a0 // VTABLE 0x100da8a0
// SIZE 0x6c // SIZE 0x6c
class JukeBoxEntity : public LegoEntity class JukeBoxEntity : public LegoEntity {
{
public: public:
JukeBoxEntity(); JukeBoxEntity();
virtual ~JukeBoxEntity() override; // vtable+0x0 virtual ~JukeBoxEntity() override; // vtable+0x0
@ -23,7 +22,6 @@ class JukeBoxEntity : public LegoEntity
{ {
return !strcmp(name, JukeBoxEntity::ClassName()) || LegoEntity::IsA(name); return !strcmp(name, JukeBoxEntity::ClassName()) || LegoEntity::IsA(name);
} }
}; };
#endif // JUKEBOXENTITY_H #endif // JUKEBOXENTITY_H

View File

@ -1 +1,7 @@
#include "jukeboxstate.h" #include "jukeboxstate.h"
// OFFSET: LEGO1 0x1000f300
MxBool JukeBoxState::VTable0x14()
{
return FALSE;
}

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4a90 // VTABLE 0x100d4a90
// SIZE 0x10 // SIZE 0x10
class JukeBoxState : public LegoState class JukeBoxState : public LegoState {
{
public: public:
// OFFSET: LEGO1 0x1000f310 // OFFSET: LEGO1 0x1000f310
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -21,6 +20,7 @@ class JukeBoxState : public LegoState
return !strcmp(name, JukeBoxState::ClassName()) || LegoState::IsA(name); return !strcmp(name, JukeBoxState::ClassName()) || LegoState::IsA(name);
} }
virtual MxBool VTable0x14() override; // vtable+0x14
}; };
#endif // JUKEBOXSTATE_H #endif // JUKEBOXSTATE_H

View File

@ -3,8 +3,7 @@
#include "lego3dview.h" #include "lego3dview.h"
class Lego3DManager class Lego3DManager {
{
public: public:
inline Lego3DView* GetLego3DView() { return this->m_3dView; } inline Lego3DView* GetLego3DView() { return this->m_3dView; }

View File

@ -3,8 +3,7 @@
#include "viewmanager.h" #include "viewmanager.h"
class Lego3DView class Lego3DView {
{
public: public:
inline ViewManager* GetViewManager() { return this->m_viewManager; } inline ViewManager* GetViewManager() { return this->m_viewManager; }

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d52b0 // VTABLE 0x100d52b0
// SIZE 0xa0 // SIZE 0xa0
class Lego3DWavePresenter : public LegoWavePresenter class Lego3DWavePresenter : public LegoWavePresenter {
{
public: public:
// OFFSET: LEGO1 0x1000d890 // OFFSET: LEGO1 0x1000d890
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4a70 // VTABLE 0x100d4a70
// SIZE 0x10 // SIZE 0x10
class LegoAct2State : public LegoState class LegoAct2State : public LegoState {
{
public: public:
// OFFSET: LEGO1 0x1000df80 // OFFSET: LEGO1 0x1000df80
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,7 +19,6 @@ class LegoAct2State : public LegoState
{ {
return !strcmp(name, LegoAct2State::ClassName()) || LegoState::IsA(name); return !strcmp(name, LegoAct2State::ClassName()) || LegoState::IsA(name);
} }
}; };
#endif // LEGOACT2STATE_H #endif // LEGOACT2STATE_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5118 // VTABLE 0x100d5118
// SIZE 0x68 // SIZE 0x68
class LegoActionControlPresenter : public MxMediaPresenter class LegoActionControlPresenter : public MxMediaPresenter {
{
public: public:
// OFFSET: LEGO1 0x1000d0e0 // OFFSET: LEGO1 0x1000d0e0
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -2,7 +2,44 @@
DECOMP_SIZE_ASSERT(LegoActor, 0x78) DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// OFFSET: LEGO1 0x1002d110 STUB // Probably in header
// OFFSET: LEGO1 0x10002cc0 STUB
void LegoActor::VTable0x50()
{
// TODO
}
// OFFSET: LEGO1 0x10002cd0 STUB
void LegoActor::VTable0x54()
{
// TODO
}
// OFFSET: LEGO1 0x10002ce0 STUB
void LegoActor::VTable0x58()
{
// TODO
}
// OFFSET: LEGO1 0x10002cf0 STUB
void LegoActor::VTable0x5c()
{
// TODO
}
// OFFSET: LEGO1 0x10002d00 STUB
void LegoActor::VTable0x60()
{
// TODO
}
// OFFSET: LEGO1 0x10002d10 STUB
void LegoActor::VTable0x64()
{
// TODO
}
// End header
LegoActor::LegoActor() LegoActor::LegoActor()
{ {
} }

View File

@ -6,8 +6,7 @@
// VTABLE 0x100d6d68 // VTABLE 0x100d6d68
// SIZE 0x78 // SIZE 0x78
class LegoActor : public LegoEntity class LegoActor : public LegoEntity {
{
public: public:
LegoActor(); LegoActor();
@ -24,9 +23,15 @@ class LegoActor : public LegoEntity
return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name); return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name);
} }
virtual void VTable0x50(); // vtable+0x50
virtual void VTable0x54(); // vtable+0x54
virtual void VTable0x58(); // vtable+0x58
virtual void VTable0x5c(); // vtable+0x5c
virtual void VTable0x60(); // vtable+0x60
virtual void VTable0x64(); // vtable+0x64
private: private:
undefined unk68[0x10]; undefined unk68[0x10];
}; };
#endif // LEGOACTOR_H #endif // LEGOACTOR_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d5320 // VTABLE 0x100d5320
// SIZE 0x50 // SIZE 0x50
class LegoActorPresenter : public LegoEntityPresenter class LegoActorPresenter : public LegoEntityPresenter {
{
public: public:
// OFFSET: LEGO1 0x1000cb10 // OFFSET: LEGO1 0x1000cb10
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -3,8 +3,7 @@
#include "legopathactor.h" #include "legopathactor.h"
class LegoAnimActor : public LegoPathActor class LegoAnimActor : public LegoPathActor {
{
public: public:
}; };

View File

@ -3,9 +3,16 @@
// 0x100f74f8 // 0x100f74f8
int g_legoAnimationManagerConfig = 1; int g_legoAnimationManagerConfig = 1;
// OFFSET: LEGO1 0x1005eb50
void LegoAnimationManager::configureLegoAnimationManager(int param_1)
{
g_legoAnimationManagerConfig = param_1;
}
// OFFSET: LEGO1 0x1005eb60 STUB // OFFSET: LEGO1 0x1005eb60 STUB
LegoAnimationManager::LegoAnimationManager() LegoAnimationManager::LegoAnimationManager()
{ {
// TODO
} }
// OFFSET: LEGO1 0x1005ed30 STUB // OFFSET: LEGO1 0x1005ed30 STUB
@ -14,6 +21,18 @@ LegoAnimationManager::~LegoAnimationManager()
// TODO // TODO
} }
// OFFSET: LEGO1 0x1005f130 STUB
void LegoAnimationManager::Init()
{
// TODO
}
// OFFSET: LEGO1 0x1005f6d0 STUB
void LegoAnimationManager::FUN_1005f6d0(MxBool p)
{
// TODO
}
// OFFSET: LEGO1 0x100619f0 STUB // OFFSET: LEGO1 0x100619f0 STUB
MxLong LegoAnimationManager::Notify(MxParam& p) MxLong LegoAnimationManager::Notify(MxParam& p)
{ {
@ -27,17 +46,5 @@ MxResult LegoAnimationManager::Tickle()
{ {
// TODO // TODO
return 0; return SUCCESS;
}
// OFFSET: LEGO1 0x1005f130 STUB
void LegoAnimationManager::Init()
{
// TODO
}
// OFFSET: LEGO1 0x1005eb50
void LegoAnimationManager::configureLegoAnimationManager(int param_1)
{
g_legoAnimationManagerConfig = param_1;
} }

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d8c18 // VTABLE 0x100d8c18
// SIZE 0x500 // SIZE 0x500
class LegoAnimationManager : public MxCore class LegoAnimationManager : public MxCore {
{
public: public:
LegoAnimationManager(); LegoAnimationManager();
virtual ~LegoAnimationManager() override; // vtable+0x0 virtual ~LegoAnimationManager() override; // vtable+0x0
@ -27,11 +26,12 @@ class LegoAnimationManager : public MxCore
return !strcmp(name, ClassName()) || MxCore::IsA(name); return !strcmp(name, ClassName()) || MxCore::IsA(name);
} }
void FUN_1005f6d0(MxBool p);
__declspec(dllexport) static void configureLegoAnimationManager(int param_1); __declspec(dllexport) static void configureLegoAnimationManager(int param_1);
private: private:
void Init(); void Init();
}; };
#endif // LEGOANIMATIONMANAGER_H #endif // LEGOANIMATIONMANAGER_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d7de8 // VTABLE 0x100d7de8
// SIZE 0x74 // SIZE 0x74
class LegoAnimMMPresenter : public MxCompositePresenter class LegoAnimMMPresenter : public MxCompositePresenter {
{
public: public:
LegoAnimMMPresenter(); LegoAnimMMPresenter();
@ -22,7 +21,6 @@ class LegoAnimMMPresenter : public MxCompositePresenter
{ {
return !strcmp(name, LegoAnimMMPresenter::ClassName()) || MxCompositePresenter::IsA(name); return !strcmp(name, LegoAnimMMPresenter::ClassName()) || MxCompositePresenter::IsA(name);
} }
}; };
#endif // LEGOANIMMMPRESENTER_H #endif // LEGOANIMMMPRESENTER_H

View File

@ -4,8 +4,7 @@
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
// VTABLE 0x100d90c8 // VTABLE 0x100d90c8
class LegoAnimPresenter : public MxVideoPresenter class LegoAnimPresenter : public MxVideoPresenter {
{
public: public:
LegoAnimPresenter(); LegoAnimPresenter();
@ -24,7 +23,6 @@ class LegoAnimPresenter : public MxVideoPresenter
private: private:
void Init(); void Init();
}; };
#endif // LEGOANIMPRESENTER_H #endif // LEGOANIMPRESENTER_H

View File

@ -1,9 +1,9 @@
#include "legobackgroundcolor.h" #include "legobackgroundcolor.h"
#include "decomp.h"
#include "legoomni.h" #include "legoomni.h"
#include "legoutil.h" #include "legoutil.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(LegoBackgroundColor, 0x30) DECOMP_SIZE_ASSERT(LegoBackgroundColor, 0x30)

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d74a8 // VTABLE 0x100d74a8
// SIZE 0x30 // SIZE 0x30
class LegoBackgroundColor : public MxVariable class LegoBackgroundColor : public MxVariable {
{
public: public:
__declspec(dllexport) LegoBackgroundColor(const char* p_key, const char* p_value); __declspec(dllexport) LegoBackgroundColor(const char* p_key, const char* p_value);
virtual void SetValue(const char* p_colorString) override; virtual void SetValue(const char* p_colorString) override;

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d6f50 // VTABLE 0x100d6f50
// SIZE 0x30 // SIZE 0x30
class LegoBuildingManager : public MxCore class LegoBuildingManager : public MxCore {
{
public: public:
LegoBuildingManager(); LegoBuildingManager();
virtual ~LegoBuildingManager() override; virtual ~LegoBuildingManager() override;
@ -22,7 +21,6 @@ class LegoBuildingManager : public MxCore
private: private:
void Init(); void Init();
}; };
#endif // LEGOBUILDINGMANAGER_H #endif // LEGOBUILDINGMANAGER_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d4718 // VTABLE 0x100d4718
// SIZE 0x88 // SIZE 0x88
class LegoCacheSound : public MxCore class LegoCacheSound : public MxCore {
{
public: public:
LegoCacheSound(); LegoCacheSound();
virtual ~LegoCacheSound() override; // vtable+0x0 virtual ~LegoCacheSound() override; // vtable+0x0

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d57b0 // VTABLE 0x100d57b0
// SIZE 0xc8 // SIZE 0xc8
class LegoCameraController : public MxCore class LegoCameraController : public MxCore {
{
public: public:
LegoCameraController(); LegoCameraController();
virtual ~LegoCameraController() override; // vtable+0x0 virtual ~LegoCameraController() override; // vtable+0x0
@ -23,7 +22,6 @@ class LegoCameraController : public MxCore
{ {
return !strcmp(name, ClassName()) || MxCore::IsA(name); return !strcmp(name, ClassName()) || MxCore::IsA(name);
} }
}; };
#endif // LEGOCAMERACONTROLLER_H #endif // LEGOCAMERACONTROLLER_H

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d6658 // VTABLE 0x100d6658
// SIZE 0x34c // SIZE 0x34c
class LegoCarBuild : public LegoWorld class LegoCarBuild : public LegoWorld {
{
public: public:
LegoCarBuild(); LegoCarBuild();
virtual ~LegoCarBuild() override; virtual ~LegoCarBuild() override;

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d99e0 // VTABLE 0x100d99e0
// SIZE 0x150 // SIZE 0x150
class LegoCarBuildAnimPresenter : public LegoAnimPresenter class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
{
public: public:
LegoCarBuildAnimPresenter(); LegoCarBuildAnimPresenter();
virtual ~LegoCarBuildAnimPresenter() override; // vtable+0x0 virtual ~LegoCarBuildAnimPresenter() override; // vtable+0x0

View File

@ -4,8 +4,7 @@
#include "legoraceactor.h" #include "legoraceactor.h"
// VTABLE 0x100da0d8 // VTABLE 0x100da0d8
class LegoCarRaceActor : public LegoRaceActor class LegoCarRaceActor : public LegoRaceActor {
{
public: public:
// OFFSET: LEGO1 0x10081650 // OFFSET: LEGO1 0x10081650
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c

View File

@ -19,3 +19,15 @@ MxResult LegoControlManager::Tickle()
return 0; return 0;
} }
// OFFSET: LEGO1 0x10028e10 STUB
void LegoControlManager::Register(MxCore* p_listener)
{
// TODO
}
// OFFSET: LEGO1 0x10028ea0 STUB
void LegoControlManager::Unregister(MxCore* p_listener)
{
// TODO
}

View File

@ -4,8 +4,7 @@
#include "mxcore.h" #include "mxcore.h"
// VTABLE 0x100d6a80 // VTABLE 0x100d6a80
class LegoControlManager : public MxCore class LegoControlManager : public MxCore {
{
public: public:
LegoControlManager(); LegoControlManager();
virtual ~LegoControlManager() override; // vtable+0x0 virtual ~LegoControlManager() override; // vtable+0x0
@ -25,6 +24,8 @@ class LegoControlManager : public MxCore
return !strcmp(name, LegoControlManager::ClassName()) || MxCore::IsA(name); return !strcmp(name, LegoControlManager::ClassName()) || MxCore::IsA(name);
} }
void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener);
}; };
#endif // LEGOCONTROLMANAGER_H #endif // LEGOCONTROLMANAGER_H

View File

@ -1,8 +1,8 @@
#include "legoentity.h" #include "legoentity.h"
#include "define.h"
#include "legoomni.h" #include "legoomni.h"
#include "legoutil.h" #include "legoutil.h"
#include "define.h"
DECOMP_SIZE_ASSERT(LegoEntity, 0x68) DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
@ -12,22 +12,14 @@ LegoEntity::~LegoEntity()
Destroy(TRUE); Destroy(TRUE);
} }
// OFFSET: LEGO1 0x100114f0 STUB
MxLong LegoEntity::Notify(MxParam &p)
{
// TODO
return 0;
}
// OFFSET: LEGO1 0x100105f0 // OFFSET: LEGO1 0x100105f0
void LegoEntity::Reset() void LegoEntity::Init()
{ {
m_vec1.Fill(0); m_worldLocation.Fill(0);
m_vec2.Fill(0); m_worldDirection.Fill(0);
m_unk50 = 0; m_worldSpeed = 0;
m_unk54 = 0; m_roi = NULL;
m_unk58 = 0; m_cameraFlag = 0;
m_actionArgString = NULL; m_actionArgString = NULL;
m_unk10 = 0; m_unk10 = 0;
m_unk11 = 0; m_unk11 = 0;
@ -36,36 +28,53 @@ void LegoEntity::Reset()
m_unk59 = 4; m_unk59 = 4;
} }
// OFFSET: LEGO1 0x100107e0 // OFFSET: LEGO1 0x10010650 STUB
MxResult LegoEntity::InitFromMxDSObject(MxDSObject& p_object) void LegoEntity::ResetWorldTransform(MxBool p_inVehicle)
{ {
m_mxEntityId = p_object.GetObjectId(); // TODO
m_atom = p_object.GetAtomId(); }
AddToCurrentWorld();
// OFFSET: LEGO1 0x10010790 STUB
void LegoEntity::SetWorldTransform(MxVector3& p_loc, MxVector3& p_dir, MxVector3& p_up)
{
// TODO
}
// OFFSET: LEGO1 0x100107e0
MxResult LegoEntity::InitFromMxDSObject(MxDSObject& p_dsObject)
{
m_mxEntityId = p_dsObject.GetObjectId();
m_atom = p_dsObject.GetAtomId();
Init();
return SUCCESS; return SUCCESS;
} }
// OFFSET: LEGO1 0x10010810 STUB // OFFSET: LEGO1 0x10010810 STUB
void LegoEntity::Destroy(MxBool p_fromDestructor) void LegoEntity::Destroy(MxBool p_fromDestructor)
{ {
if (m_unk54) { if (m_roi) {
// TODO // TODO
} }
delete[] m_actionArgString; delete[] m_actionArgString;
Reset(); Init();
} }
// OFFSET: LEGO1 0x10010880 STUB // OFFSET: LEGO1 0x10010880 STUB
void LegoEntity::AddToCurrentWorld() void LegoEntity::SetWorld()
{ {
LegoWorld* world = GetCurrentWorld(); LegoWorld* world = GetCurrentWorld();
if (world != NULL && world != (LegoWorld*)this) if (world != NULL && world != (LegoWorld*) this) {
{ // TODO: world->AddEntity(this);
// TODO: world->vtable58(this);
} }
} }
// OFFSET: LEGO1 0x100108a0 STUB
void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
{
// TODO
}
// OFFSET: LEGO1 0x10010e10 // OFFSET: LEGO1 0x10010e10
void LegoEntity::ParseAction(char* p_extra) void LegoEntity::ParseAction(char* p_extra)
{ {
@ -88,3 +97,53 @@ void LegoEntity::ParseAction(char *p_extra)
} }
} }
} }
// OFFSET: LEGO1 0x10010f10 STUB
void LegoEntity::VTable0x34()
{
// TODO
}
// OFFSET: LEGO1 0x10011070 STUB
void LegoEntity::VTable0x38()
{
// TODO
}
// OFFSET: LEGO1 0x10011300 STUB
void LegoEntity::VTable0x3c()
{
// TODO
}
// OFFSET: LEGO1 0x10011360 STUB
void LegoEntity::VTable0x40()
{
// TODO
}
// OFFSET: LEGO1 0x100113c0 STUB
void LegoEntity::VTable0x44()
{
// TODO
}
// OFFSET: LEGO1 0x10011420 STUB
void LegoEntity::VTable0x48()
{
// TODO
}
// OFFSET: LEGO1 0x10011470 STUB
void LegoEntity::VTable0x4c()
{
// TODO
}
// OFFSET: LEGO1 0x100114f0 STUB
MxLong LegoEntity::Notify(MxParam& p)
{
// TODO
return 0;
}

View File

@ -1,16 +1,16 @@
#ifndef LEGOENTITY_H #ifndef LEGOENTITY_H
#define LEGOENTITY_H #define LEGOENTITY_H
#include "decomp.h"
#include "extra.h"
#include "legoroi.h"
#include "mxdsobject.h"
#include "mxentity.h" #include "mxentity.h"
#include "mxvector.h" #include "mxvector.h"
#include "extra.h"
#include "decomp.h"
#include "mxdsobject.h"
// VTABLE 0x100d4858 // VTABLE 0x100d4858
// SIZE 0x68 (probably) // SIZE 0x68 (probably)
class LegoEntity : public MxEntity class LegoEntity : public MxEntity {
{
public: public:
// Inlined at 0x100853f7 // Inlined at 0x100853f7
inline LegoEntity() inline LegoEntity()
@ -35,29 +35,40 @@ class LegoEntity : public MxEntity
return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name); return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name);
} }
virtual MxResult InitFromMxDSObject(MxDSObject& p_object); // vtable+0x18 virtual MxResult InitFromMxDSObject(MxDSObject& p_dsObject); // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c
virtual void ParseAction(char*); // vtable+0x20 virtual void ParseAction(char*); // vtable+0x20
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2); // vtable+0x24
virtual void SetWorldTransform(MxVector3& p_loc, MxVector3& p_dir, MxVector3& p_up); // vtable+0x28
virtual void ResetWorldTransform(MxBool p_inVehicle); // vtable+0x2c
// OFFSET: LEGO1 0x10001090
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
virtual void VTable0x34(); // vtable+0x34
virtual void VTable0x38(); // vtable+0x38
virtual void VTable0x3c(); // vtable+0x3c
virtual void VTable0x40(); // vtable+0x40
virtual void VTable0x44(); // vtable+0x44
virtual void VTable0x48(); // vtable+0x48
virtual void VTable0x4c(); // vtable+0x4c
protected: protected:
void Reset(); void Init();
void AddToCurrentWorld(); void SetWorld();
undefined m_unk10; undefined m_unk10;
undefined m_unk11; undefined m_unk11;
MxVector3Data m_vec1; // 0x14 MxVector3Data m_worldLocation; // 0x14
MxVector3Data m_vec2; // 0x28 MxVector3Data m_worldDirection; // 0x28
MxVector3Data m_vec3; // 0x3c MxVector3Data m_worldUp; // 0x3c
undefined4 m_unk50; MxFloat m_worldSpeed; // 0x50
undefined4 m_unk54; LegoROI* m_roi; // 0x54
undefined m_unk58; MxBool m_cameraFlag; // 0x58
undefined m_unk59; undefined m_unk59;
// For tokens from the extra string that look like this: // For tokens from the extra string that look like this:
// "Action:openram;\lego\scripts\Race\CarRaceR;0" // "Action:openram;\lego\scripts\Race\CarRaceR;0"
ExtraActionType m_actionType; // 0x5c ExtraActionType m_actionType; // 0x5c
char* m_actionArgString; // 0x60 char* m_actionArgString; // 0x60
MxS32 m_actionArgNumber; // 0x64 MxS32 m_actionArgNumber; // 0x64
}; };
#endif // LEGOENTITY_H #endif // LEGOENTITY_H

View File

@ -12,7 +12,7 @@ LegoEntityPresenter::~LegoEntityPresenter()
// TODO // TODO
} }
// OFFSET: LEG01 0x100535c0 STUB // OFFSET: LEGO1 0x100535c0 STUB
void LegoEntityPresenter::Init() void LegoEntityPresenter::Init()
{ {
// TODO // TODO

View File

@ -4,8 +4,7 @@
#include "mxcompositepresenter.h" #include "mxcompositepresenter.h"
// VTABLE 0x100d8398 // VTABLE 0x100d8398
class LegoEntityPresenter : public MxCompositePresenter class LegoEntityPresenter : public MxCompositePresenter {
{
public: public:
LegoEntityPresenter(); LegoEntityPresenter();
virtual ~LegoEntityPresenter() override; // vtable+0x0 virtual ~LegoEntityPresenter() override; // vtable+0x0
@ -25,8 +24,6 @@ class LegoEntityPresenter : public MxCompositePresenter
private: private:
void Init(); void Init();
}; };
#endif // LEGOENTITYPRESENTER_H #endif // LEGOENTITYPRESENTER_H

View File

@ -0,0 +1,5 @@
#include "legoeventnotificationparam.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(LegoEventNotificationParam, 0x1c);

View File

@ -0,0 +1,22 @@
#ifndef LEGOEVENTNOTIFICATIONPARAM_H
#define LEGOEVENTNOTIFICATIONPARAM_H
#include "mxnotificationparam.h"
#include "mxtypes.h"
// VTABLE 0x100d6aa0
class LegoEventNotificationParam : public MxNotificationParam {
public:
inline LegoEventNotificationParam() : MxNotificationParam((MxParamType) 0, NULL) {}
virtual ~LegoEventNotificationParam() override {} // vtable+0x0 (scalar deleting destructor)
inline MxU8 GetKey() { return m_key; }
protected:
MxU8 m_modifier; // 0x0c
MxS32 m_x; // 0x10
MxS32 m_y; // 0x14
MxU8 m_key; // 0x18
};
#endif // LEGOEVENTNOTIFICATIONPARAM_H

View File

@ -4,8 +4,7 @@
#include "legoanimactor.h" #include "legoanimactor.h"
// VTABLE 0x100d6c10 // VTABLE 0x100d6c10
class LegoExtraActor : public LegoAnimActor class LegoExtraActor : public LegoAnimActor {
{
public: public:
// OFFSET: LEGO1 0x1002b7a0 // OFFSET: LEGO1 0x1002b7a0
inline const char* ClassName() const override // vtable+0xc inline const char* ClassName() const override // vtable+0xc

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d89e0 // VTABLE 0x100d89e0
// SIZE 0x70 // SIZE 0x70
class LegoFlcTexturePresenter : public MxFlcPresenter class LegoFlcTexturePresenter : public MxFlcPresenter {
{
public: public:
LegoFlcTexturePresenter(); LegoFlcTexturePresenter();
@ -16,7 +15,6 @@ class LegoFlcTexturePresenter : public MxFlcPresenter
// 0x100f0634 // 0x100f0634
return "LegoFlcTexturePresenter"; return "LegoFlcTexturePresenter";
} }
}; };
#endif // LEGOFLCTEXTUREPRESENTER_H #endif // LEGOFLCTEXTUREPRESENTER_H

View File

@ -1,9 +1,9 @@
#include "legofullscreenmovie.h" #include "legofullscreenmovie.h"
#include "decomp.h"
#include "legoomni.h" #include "legoomni.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24) DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24)

View File

@ -5,8 +5,7 @@
// VTABLE 0x100d74b8 // VTABLE 0x100d74b8
// SIZE 0x24 // SIZE 0x24
class LegoFullScreenMovie : public MxVariable class LegoFullScreenMovie : public MxVariable {
{
public: public:
LegoFullScreenMovie(const char* p_key, const char* p_value); LegoFullScreenMovie(const char* p_key, const char* p_value);
virtual void SetValue(const char* p_option) override; virtual void SetValue(const char* p_option) override;

Some files were not shown because too many files have changed in this diff Show More