Compare commits

..

No commits in common. "master" and "continuous-accuracy" have entirely different histories.

384 changed files with 9886 additions and 15623 deletions

View File

@ -100,43 +100,6 @@ jobs:
build/LEGO1.DLL
build/LEGO1.PDB
build-beta:
name: 'MSVC 4.20 (BETA10)'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: itsmattkc/msvc420
path: msvc420
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
# Use minimum supported version
cmake-version: '3.15.x'
- name: Patch MSVC 4.2
run: |
tools/patch_c2.py msvc420/bin/C2.EXE
- name: Build
shell: cmd
run: |
call .\msvc420\bin\VCVARS32.BAT x86
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DISLE_INCLUDE_ENTROPY=OFF -DISLE_BUILD_BETA10=ON -DISLE_BUILD_LEGO1=OFF -DISLE_BUILD_APP=OFF -DISLE_BUILD_CONFIG=OFF -G "NMake Makefiles"
cmake --build build
- name: Upload Artifact
uses: actions/upload-artifact@main
with:
name: Win32-beta
path: |
build/BETA10.DLL
build/BETA10.PDB
verify:
name: Verify decomp
needs: [build, fetch-deps]

View File

@ -5,13 +5,6 @@ on:
branches:
- master
workflow_dispatch:
inputs:
builds_per_job:
description: 'How many builds to run in parallel on each job.'
default: 4
required: true
type: choice
options: [1, 2, 4, 8, 16, 32, 64]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@ -22,40 +15,14 @@ jobs:
name: Download original binaries
uses: ./.github/workflows/legobin.yml
reccmp:
name: Setup python environment
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# The typical cache key would include a hash on requirements.txt.
# We currently run reccmp from latest so we would have to manually purge it.
# The goal is simply to restore the cache across entropy build jobs.
- name: Cache venv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
- name: Install python packages
run: |
python -m venv .venv
.venv\Scripts\Activate
pip install -r tools/requirements.txt
build:
name: 'MSVC 4.20'
needs: [fetch-deps, reccmp]
needs: [fetch-deps]
runs-on: windows-latest
strategy:
matrix:
job: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
builds:
- ${{ inputs.builds_per_job && inputs.builds_per_job || 16 }}
high: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
low: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
steps:
- uses: actions/checkout@v4
@ -79,6 +46,26 @@ jobs:
run: |
tools/patch_c2.py msvc420/bin/C2.EXE
- name: Generate Entropy
shell: bash
run: |
# Calculate instance number based on matrix inputs
INSTANCE=$((${{ matrix.high }} << 4 | ${{ matrix.low }}))
# Get the first 8 characters of the SHA (enough for a decent seed)
SHA_PREFIX=$(echo "${{ github.sha }}" | cut -c 1-8)
ENTROPY_SEED=$((16#$SHA_PREFIX + $INSTANCE))
echo "Using seed: $ENTROPY_SEED (instance $INSTANCE)"
python3 tools/entropy.py $ENTROPY_SEED > entropy.h
- name: Build
shell: cmd
run: |
call .\msvc420\bin\VCVARS32.BAT x86
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DISLE_INCLUDE_ENTROPY=ON -G "NMake Makefiles"
cmake --build build
- name: Restore cached original binaries
id: cache-original-binaries
uses: actions/cache/restore@v4
@ -86,47 +73,32 @@ jobs:
enableCrossOsArchive: true
path: legobin
key: legobin
- name: Install python packages
shell: bash
run: |
python -m venv .venv
.venv\Scripts\Activate
echo ($env:VIRTUAL_ENV + "\Scripts") >> $env:GITHUB_PATH
echo ("VIRTUAL_ENV=" + $env:VIRTUAL_ENV) >> $env:GITHUB_ENV
- name: Restore cached virtualenv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
pip install -r tools/requirements.txt
- name: Prepare builds
shell: pwsh
- name: Detect binaries
run: |
cmd /c "call `".\msvc420\bin\VCVARS32.BAT`" x86 && set > %temp%\vcvars32.txt"
Get-Content "$env:temp\vcvars32.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
.\tools\multi-prepare.ps1 ${{ matrix.job }} ${{ matrix.builds }}
reccmp-project detect --what original --search-path legobin
reccmp-project detect --what recompiled --search-path build
- name: Run builds
shell: pwsh
- name: Summarize Accuracy
shell: bash
run: |
cmd /c "call `".\msvc420\bin\VCVARS32.BAT`" x86 && set > %temp%\vcvars32.txt"
Get-Content "$env:temp\vcvars32.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
.\tools\multi-build.ps1 ${{ matrix.builds }}
- name: Analyze builds
shell: pwsh
run: |
.\tools\multi-analyze.ps1 ${{ matrix.builds }}
reccmp-reccmp --target CONFIG --json CONFIGPROGRESS.json
reccmp-reccmp --target ISLE --json ISLEPROGRESS.json
reccmp-reccmp --target LEGO1 --json LEGO1PROGRESS.json
- name: Upload Artifact
uses: actions/upload-artifact@main
with:
name: Win32-Entropy-${{ matrix.job }}
name: Win32-Entropy-${{ matrix.high }}-${{ matrix.low }}
path: |
CONFIGPROGRESS*
ISLEPROGRESS*
LEGO1PROGRESS*
CONFIGPROGRESS.json
ISLEPROGRESS.json
LEGO1PROGRESS.json
merge-artifacts:
name: 'Merge entropy artifacts'
@ -157,27 +129,16 @@ jobs:
path: build-entropy
- name: Install python packages
shell: bash
run: |
python -m venv .venv
.venv\Scripts\Activate
echo ($env:VIRTUAL_ENV + "\Scripts") >> $env:GITHUB_PATH
echo ("VIRTUAL_ENV=" + $env:VIRTUAL_ENV) >> $env:GITHUB_ENV
- name: Restore cached virtualenv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
pip install -r tools/requirements.txt
- name: Aggregate Accuracy
shell: bash
run: |
find build-entropy -type f -name "CONFIGPROGRESS*.json" > configsamples.txt
find build-entropy -type f -name "ISLEPROGRESS*.json" > islesamples.txt
find build-entropy -type f -name "LEGO1PROGRESS*.json" > lego1samples.txt
reccmp-aggregate --samples @configsamples.txt --output CONFIGPROGRESS-agg.json --html CONFIGPROGRESS-agg.html
reccmp-aggregate --samples @islesamples.txt --output ISLEPROGRESS-agg.json --html ISLEPROGRESS-agg.html
reccmp-aggregate --samples @lego1samples.txt --output LEGO1PROGRESS-agg.json --html LEGO1PROGRESS-agg.html
reccmp-aggregate --samples $(find build-entropy -type f -name "CONFIGPROGRESS.json") --output CONFIGPROGRESS-agg.json --html CONFIGPROGRESS-agg.html
reccmp-aggregate --samples $(find build-entropy -type f -name "ISLEPROGRESS.json") --output ISLEPROGRESS-agg.json --html ISLEPROGRESS-agg.html
reccmp-aggregate --samples $(find build-entropy -type f -name "LEGO1PROGRESS.json") --output LEGO1PROGRESS-agg.json --html LEGO1PROGRESS-agg.html
- name: Compare Aggregate Accuracy With Current Master
shell: bash

2
.gitignore vendored
View File

@ -27,5 +27,3 @@ tools/ghidra_scripts/import.log
# These entries are kept for now since that convention has not always been around.
ISLE.EXE
LEGO1.DLL
.DS_Store

View File

@ -67,7 +67,6 @@ cmake_dependent_option(ISLE_USE_DX5_LIBS "Build with internal DirectX 5 SDK Libr
option(ISLE_BUILD_LEGO1 "Build LEGO1.DLL library" ON)
option(ISLE_BUILD_BETA10 "Build BETA10.DLL library" OFF)
option(ISLE_INCLUDE_ENTROPY "Build with entropy.h" OFF)
option(ISLE_ENTROPY_FILENAME "Entropy header filename" "entropy.h")
if(NOT (ISLE_BUILD_LEGO1 OR ISLE_BUILD_BETA10))
message(FATAL_ERROR "ISLE_BUILD_LEGO1 AND ISLE_BUILD_BETA10 cannot be both disabled")
@ -160,7 +159,7 @@ function(add_lego_libraries NAME)
add_library(geom${ARG_SUFFIX} STATIC
LEGO1/lego/sources/geom/legoedge.cpp
LEGO1/lego/sources/geom/legoweedge.cpp
LEGO1/lego/sources/geom/legoorientededge.cpp
LEGO1/lego/sources/geom/legounkown100db7f4.cpp
LEGO1/lego/sources/geom/legowegedge.cpp
)
list(APPEND list_targets geom${ARG_SUFFIX})
@ -189,11 +188,11 @@ function(add_lego_libraries NAME)
add_library(misc${ARG_SUFFIX} STATIC
LEGO1/lego/sources/misc/legotexture.cpp
LEGO1/lego/sources/misc/legospline.cpp
LEGO1/lego/sources/misc/legostorage.cpp
LEGO1/lego/sources/misc/legoimage.cpp
LEGO1/lego/sources/misc/legocontainer.cpp
LEGO1/lego/sources/misc/legotree.cpp
LEGO1/lego/sources/misc/legounknown.cpp
)
list(APPEND list_targets misc${ARG_SUFFIX})
set_property(TARGET misc${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
@ -221,7 +220,7 @@ function(add_lego_libraries NAME)
LEGO1/omni/src/common/mxcore.cpp
LEGO1/omni/src/common/mxstring.cpp
LEGO1/omni/src/audio/mxsoundmanager.cpp
LEGO1/omni/src/main/mxmain.cpp
LEGO1/omni/src/main/mxomni.cpp
LEGO1/omni/src/notify/mxactionnotificationparam.cpp
LEGO1/omni/src/main/mxomnicreateflags.cpp
LEGO1/omni/src/main/mxomnicreateparam.cpp
@ -240,7 +239,7 @@ function(add_lego_libraries NAME)
LEGO1/omni/src/common/mxutilities.cpp
LEGO1/omni/src/common/mxvariabletable.cpp
LEGO1/omni/src/stream/mxdssubscriber.cpp
LEGO1/omni/src/common/mxpresentationmanager.cpp
LEGO1/omni/src/common/mxmediamanager.cpp
LEGO1/omni/src/system/mxticklethread.cpp
LEGO1/omni/src/audio/mxaudiomanager.cpp
LEGO1/omni/src/system/mxautolock.cpp
@ -376,6 +375,9 @@ function(add_lego_libraries NAME)
LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp
LEGO1/lego/legoomni/src/actors/dunebuggy.cpp
LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp
LEGO1/lego/legoomni/src/video/legoloopinganimpresenter.cpp
LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp
LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp
LEGO1/lego/legoomni/src/worlds/infocenter.cpp
LEGO1/lego/legoomni/src/race/raceskel.cpp
LEGO1/lego/legoomni/src/worlds/act3.cpp
@ -424,7 +426,6 @@ function(add_lego_libraries NAME)
# Link libraries
target_link_libraries(${NAME} PRIVATE
${ARG_LINK_LIBRARIES}
dinput
misc${ARG_SUFFIX}
geom${ARG_SUFFIX}
@ -457,7 +458,7 @@ endfunction()
set(lego1_link_libraries )
if (ISLE_USE_SMARTHEAP)
list(APPEND lego1_link_libraries SmartHeap::SmartHeap libcmt)
list(APPEND lego1_link_libraries SmartHeap::SmartHeap)
endif()
if(ISLE_BUILD_LEGO1)
@ -480,12 +481,7 @@ if(ISLE_BUILD_BETA10)
OUT_TARGETS beta10_targets
)
reccmp_add_target(beta10 ID BETA10)
# Enable `#ifdef BETA10` conditions
target_compile_definitions(beta10 PRIVATE BETA10)
foreach(tgt IN LISTS beta10_targets)
target_compile_definitions(${tgt} PRIVATE BETA10)
endforeach()
endif()
if (ISLE_BUILD_APP)
@ -589,31 +585,22 @@ if (MSVC_FOR_DECOMP)
set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
if (ISLE_BUILD_CONFIG)
target_link_options(config PRIVATE "/OPT:REF")
target_link_libraries(config PRIVATE mfc42)
endif()
if (ISLE_INCLUDE_ENTROPY)
message(STATUS "Using entropy file: ${ISLE_ENTROPY_FILENAME}")
foreach(tgt IN LISTS lego1_targets beta10_targets)
target_compile_options(${tgt} PRIVATE /FI${PROJECT_SOURCE_DIR}/${ISLE_ENTROPY_FILENAME})
target_compile_options(${tgt} PRIVATE /FI${PROJECT_SOURCE_DIR}/entropy.h)
endforeach()
if (TARGET isle)
target_compile_options(isle PRIVATE /FI${PROJECT_SOURCE_DIR}/${ISLE_ENTROPY_FILENAME})
target_compile_options(isle PRIVATE /FI${PROJECT_SOURCE_DIR}/entropy.h)
endif()
if (TARGET config)
target_compile_options(config PRIVATE /FI${PROJECT_SOURCE_DIR}/${ISLE_ENTROPY_FILENAME})
target_compile_options(config PRIVATE /FI${PROJECT_SOURCE_DIR}/entropy.h)
endif()
endif()
# Setting the MSVC_RUNTIME_LIBRARY for all libraries as well as `lego1` produces the results
# that are most consistent with the LEGO1.DLL and BETA10.DLL originals we have.
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
set_property(TARGET ${lego1_targets} ${beta10_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(TARGET lego1)
target_link_options(lego1 PRIVATE "/OPT:REF")
set_property(TARGET lego1 PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
set_property(TARGET lego1 ${lego1_targets} ${beta10_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")

View File

@ -6,16 +6,13 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)
// FUNCTION: CONFIG 0x00403c20
// FUNCTION: CONFIGD 0x00408630
CAboutDialog::CAboutDialog() : CDialog(IDD)
{
}
// FUNCTION: CONFIG 0x00403d20
// FUNCTION: CONFIGD 0x004086a3
void CAboutDialog::DoDataExchange(CDataExchange* pDX)
{
CWnd::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)

View File

@ -6,7 +6,6 @@
#include "res/resource.h"
// VTABLE: CONFIG 0x00406308
// VTABLE: CONFIGD 0x0040c3f8
// SIZE 0x60
class CAboutDialog : public CDialog {
public:
@ -23,27 +22,18 @@ class CAboutDialog : public CDialog {
};
// SYNTHETIC: CONFIG 0x00403cb0
// SYNTHETIC: CONFIGD 0x00409840
// CAboutDialog::`scalar deleting destructor'
// SYNTHETIC: CONFIG 0x00404100
// SYNTHETIC: CONFIGD 0x00409890
// CAboutDialog::~CAboutDialog
// FUNCTION: CONFIG 0x00403d30
// FUNCTION: CONFIGD 0x004086c7
// CAboutDialog::_GetBaseMessageMap
// FUNCTION: CONFIG 0x00403d40
// FUNCTION: CONFIGD 0x004086dc
// CAboutDialog::GetMessageMap
// GLOBAL: CONFIG 0x00406100
// GLOBAL: CONFIGD 0x0040c188
// CAboutDialog::messageMap
// GLOBAL: CONFIG 0x00406108
// GLOBAL: CONFIGD 0x0040c190
// CAboutDialog::_messageEntries
#endif // !defined(AFX_ABOUTDLG_H)

View File

@ -6,24 +6,16 @@ DECOMP_SIZE_ASSERT(CCommandLineInfo, 0x24)
DECOMP_SIZE_ASSERT(CConfigCommandLineInfo, 0x24)
// FUNCTION: CONFIG 0x00403b10
// FUNCTION: CONFIGD 0x00407caa
CConfigCommandLineInfo::CConfigCommandLineInfo()
{
currentConfigApp->m_run_config_dialog = FALSE;
}
// FUNCTION: CONFIG 0x00403ba0
// FUNCTION: CONFIGD 0x00407d2e
CConfigCommandLineInfo::~CConfigCommandLineInfo()
{
}
// FUNCTION: CONFIG 0x00403bf0
// FUNCTION: CONFIGD 0x00407d96
void CConfigCommandLineInfo::ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast)
{
if (bFlag) {
if (lstrcmpi(pszParam, "config") == 0) {
if (lstrcmpiA(pszParam, "config") == 0) {
currentConfigApp->m_run_config_dialog = TRUE;
}
}

View File

@ -7,18 +7,15 @@
#include "decomp.h"
// VTABLE: CONFIG 0x004060e8
// VTABLE: CONFIGD 0x0040c168
// SIZE 0x24
class CConfigCommandLineInfo : public CCommandLineInfo {
public:
CConfigCommandLineInfo();
~CConfigCommandLineInfo() override;
void ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast) override;
};
// SYNTHETIC: CONFIG 0x00403b80
// SYNTHETIC: CONFIGD 0x004085e0
// CConfigCommandLineInfo::`scalar deleting destructor'
#endif // !defined(AFX_CONFIGCOMMANDLINEINFO_H)

View File

@ -4,24 +4,21 @@
#include "config.h"
#include "res/resource.h"
#include <assert.h>
#include <mxdirectx/legodxinfo.h>
DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CMainDialog, 0x70)
// FUNCTION: CONFIG 0x00403d50
// FUNCTION: CONFIGD 0x004086f7
CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent)
{
m_icon = currentConfigApp->LoadIcon(IDI_CONFIG);
afxCurrentWinApp;
m_icon = LoadIconA(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG));
}
// FUNCTION: CONFIG 0x00403e50
// FUNCTION: CONFIGD 0x00408785
void CMainDialog::DoDataExchange(CDataExchange* pDX)
{
CWnd::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CMainDialog, CDialog)
@ -47,64 +44,53 @@ ON_COMMAND(IDC_CHK_MUSIC, OnCheckboxMusic)
END_MESSAGE_MAP()
// FUNCTION: CONFIG 0x00403e80
// FUNCTION: CONFIGD 0x004087d9
BOOL CMainDialog::OnInitDialog()
{
CDialog::OnInitDialog();
SwitchToAdvanced(FALSE);
CMenu* system_menu = CWnd::GetSystemMenu(FALSE);
CMenu* system_menu = CMenu::FromHandle(::GetSystemMenu(m_hWnd, FALSE));
CString about_text;
about_text.LoadString(IDS_ABOUT);
if (!about_text.IsEmpty()) {
system_menu->AppendMenu(MF_SEPARATOR, 0, (LPCTSTR) NULL);
system_menu->AppendMenu(MF_STRING, 16, (LPCTSTR) about_text);
if (system_menu) {
AppendMenuA(system_menu->m_hMenu, MF_SEPARATOR, 0, NULL);
AppendMenuA(system_menu->m_hMenu, MF_STRING, 16, (LPCTSTR) about_text);
}
CWnd::SetIcon(m_icon, TRUE);
CWnd::SetIcon(m_icon, FALSE);
LegoDeviceEnumerate* info = currentConfigApp->m_dxInfo;
assert(info);
info->FUN_1009d210();
SendMessage(WM_SETICON, ICON_BIG, (LPARAM) m_icon);
SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) m_icon);
LegoDeviceEnumerate* enumerator = currentConfigApp->m_device_enumerator;
enumerator->FUN_1009d210();
m_modified = currentConfigApp->ReadRegisterSettings();
CListBox* list_3d_devices = (CListBox*) GetDlgItem(IDC_LIST_3DDEVICES);
CWnd* list_3d_devices = GetDlgItem(IDC_LIST_3DDEVICES);
int driver_i = 0;
int device_i = 0;
int selected = 0;
for (list<MxDriver>::iterator it_driver = info->m_ddInfo.begin(); it_driver != info->m_ddInfo.end();
it_driver++, driver_i++) {
char device_name[256];
const list<MxDriver>& driver_list = enumerator->GetDriverList();
for (list<MxDriver>::const_iterator it_driver = driver_list.begin(); it_driver != driver_list.end(); it_driver++) {
const MxDriver& driver = *it_driver;
for (list<Direct3DDeviceInfo>::const_iterator it_device = driver.m_devices.begin();
it_device != driver.m_devices.end();
it_device++) {
if (&(*it_device) == currentConfigApp->m_d3dInfo) {
const Direct3DDeviceInfo& device = *it_device;
if (&device == currentConfigApp->m_device) {
selected = device_i;
}
char device_name[256];
if (driver_i == 0) {
sprintf(device_name, "%s ( Primary Device )", (*it_device).m_deviceName);
}
else {
sprintf(device_name, "%s ( Secondary Device )", (*it_device).m_deviceName);
}
list_3d_devices->AddString(device_name);
device_i += 1;
sprintf(
device_name,
driver_i == 0 ? "%s ( Primary Device )" : "%s ( Secondary Device )",
device.m_deviceName
);
::SendMessage(list_3d_devices->m_hWnd, LB_ADDSTRING, 0, (LPARAM) device_name);
}
driver_i += 1;
}
list_3d_devices->SetCurSel(selected);
::SendMessage(list_3d_devices->m_hWnd, LB_SETCURSEL, selected, 0);
UpdateInterface();
return TRUE;
}
// FUNCTION: CONFIG 0x00404080
// FUNCTION: CONFIGD 0x00408ab7
void CMainDialog::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xfff0) == 0x10) {
@ -112,109 +98,86 @@ void CMainDialog::OnSysCommand(UINT nID, LPARAM lParam)
about_dialog.DoModal();
}
else {
CWnd::OnSysCommand(nID, lParam);
Default();
}
}
// FUNCTION: CONFIG 0x00404150
// FUNCTION: CONFIGD 0x00408b49
void CMainDialog::OnPaint()
{
if (IsIconic()) {
CPaintDC painter(this);
CWnd::SendMessage(WM_ICONERASEBKGND, (WPARAM) painter.GetSafeHdc(), 0);
int iconWidth = GetSystemMetrics(SM_CXICON);
int iconHeight = GetSystemMetrics(SM_CYICON);
CRect dim;
::SendMessage(m_hWnd, WM_ICONERASEBKGND, (WPARAM) painter.m_hDC, 0);
RECT dim;
GetClientRect(&dim);
int x = (dim.Width() - iconWidth + 1) / 2;
int y = (dim.Height() - iconHeight + 1) / 2;
painter.DrawIcon(x, y, m_icon);
DrawIcon(
painter.m_hDC,
(dim.right - dim.left - GetSystemMetrics(SM_CXICON) + 1) / 2,
(dim.bottom - dim.top - GetSystemMetrics(SM_CYICON) + 1) / 2,
m_icon
);
}
else {
CWnd::OnPaint();
Default();
}
}
// FUNCTION: CONFIG 0x00404230
// FUNCTION: CONFIGD 0x00408c61
HCURSOR CMainDialog::OnQueryDragIcon()
{
return m_icon;
}
// FUNCTION: CONFIG 0x00404240
// FUNCTION: CONFIGD 0x00408c7d
void CMainDialog::OnList3DevicesSelectionChanged()
{
CConfigApp* app = currentConfigApp;
assert(app);
LegoDeviceEnumerate* device_enumerator = app->m_dxInfo;
assert(device_enumerator);
CListBox* listbox = (CListBox*) GetDlgItem(IDC_LIST_3DDEVICES);
int selected = listbox->GetCurSel();
int r = device_enumerator->GetDevice(selected, app->m_ddInfo, app->m_d3dInfo);
assert(r == 0);
if (!currentConfigApp->GetHardwareDeviceColorModel()) {
LegoDeviceEnumerate* device_enumerator = currentConfigApp->m_device_enumerator;
int selected = ::SendMessage(GetDlgItem(IDC_LIST_3DDEVICES)->m_hWnd, LB_GETCURSEL, 0, 0);
device_enumerator->GetDevice(selected, currentConfigApp->m_driver, currentConfigApp->m_device);
if (currentConfigApp->GetHardwareDeviceColorModel()) {
GetDlgItem(IDC_CHK_DRAW_CURSOR)->EnableWindow(TRUE);
}
else {
currentConfigApp->m_3d_video_ram = FALSE;
currentConfigApp->m_flip_surfaces = FALSE;
CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram);
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces);
}
else {
GetDlgItem(IDC_CHK_DRAW_CURSOR)->EnableWindow(TRUE);
}
m_modified = TRUE;
UpdateInterface();
}
// FUNCTION: CONFIG 0x00404320
// FUNCTION: CONFIGD 0x00408d79
void CMainDialog::OnCancel()
{
CDialog::OnCancel();
}
// FUNCTION: CONFIG 0x00404330
// FUNCTION: CONFIGD 0x00408de5
void CMainDialog::OnDestroy()
{
CWnd::OnDestroy();
CDialog::Default();
}
// FUNCTION: CONFIG 0x00404340
// FUNCTION: CONFIGD 0x00408e03
void CMainDialog::OnButtonCancel()
{
if (m_modified) {
currentConfigApp->WriteRegisterSettings();
}
CDialog::OnCancel();
OnCancel();
}
// FUNCTION: CONFIG 0x00404360
// FUNCTION: CONFIGD 0x00408e2f
void CMainDialog::UpdateInterface()
{
currentConfigApp->ValidateSettings();
BOOL flip_surfaces = currentConfigApp->m_flip_surfaces;
BOOL enable3d = !flip_surfaces && !currentConfigApp->GetHardwareDeviceColorModel();
GetDlgItem(IDC_CHK_3D_VIDEO_MEMORY)->EnableWindow(enable3d);
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, flip_surfaces);
GetDlgItem(IDC_CHK_3D_VIDEO_MEMORY)
->EnableWindow(!currentConfigApp->m_flip_surfaces && !currentConfigApp->GetHardwareDeviceColorModel());
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces);
CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram);
BOOL full_screen = currentConfigApp->m_full_screen;
currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus();
if (currentConfigApp->GetHardwareDeviceColorModel()) {
CheckDlgButton(IDC_CHK_DRAW_CURSOR, TRUE);
}
@ -223,32 +186,24 @@ void CMainDialog::UpdateInterface()
currentConfigApp->m_draw_cursor = FALSE;
GetDlgItem(IDC_CHK_DRAW_CURSOR)->EnableWindow(FALSE);
}
if (full_screen) {
if (currentConfigApp->m_display_bit_depth == 8) {
CheckRadioButton(IDC_RAD_PALETTE_256, IDC_RAD_PALETTE_16BIT, IDC_RAD_PALETTE_256);
}
else {
CheckRadioButton(IDC_RAD_PALETTE_256, IDC_RAD_PALETTE_16BIT, IDC_RAD_PALETTE_16BIT);
}
CheckRadioButton(
IDC_RAD_PALETTE_256,
IDC_RAD_PALETTE_16BIT,
currentConfigApp->m_display_bit_depth == 8 ? IDC_RAD_PALETTE_256 : IDC_RAD_PALETTE_16BIT
);
}
else {
CheckDlgButton(IDC_RAD_PALETTE_256, 0);
CheckDlgButton(IDC_RAD_PALETTE_16BIT, 0);
currentConfigApp->m_display_bit_depth = 0;
}
BOOL enable256 = full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth() != 0;
GetDlgItem(IDC_RAD_PALETTE_256)->EnableWindow(enable256);
BOOL enable16 = full_screen && currentConfigApp->GetDeviceRenderBitStatus() != 0;
GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(enable16);
GetDlgItem(IDC_RAD_PALETTE_256)
->EnableWindow(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth());
GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->GetDeviceRenderBitStatus());
CheckDlgButton(IDC_CHK_3DSOUND, currentConfigApp->m_3d_sound);
CheckDlgButton(IDC_CHK_DRAW_CURSOR, currentConfigApp->m_draw_cursor);
switch (currentConfigApp->m_model_quality) {
// DECOMP: case 0 removed for retail.
case 1:
CheckRadioButton(IDC_RAD_MODEL_QUALITY_LOW, IDC_RAD_MODEL_QUALITY_HIGH, IDC_RAD_MODEL_QUALITY_LOW);
break;
@ -256,29 +211,16 @@ void CMainDialog::UpdateInterface()
CheckRadioButton(IDC_RAD_MODEL_QUALITY_LOW, IDC_RAD_MODEL_QUALITY_HIGH, IDC_RAD_MODEL_QUALITY_HIGH);
break;
}
if (currentConfigApp->m_texture_quality == 0) {
CheckRadioButton(IDC_RAD_TEXTURE_QUALITY_LOW, IDC_RAD_TEXTURE_QUALITY_HIGH, IDC_RAD_TEXTURE_QUALITY_LOW);
}
else {
CheckRadioButton(IDC_RAD_TEXTURE_QUALITY_LOW, IDC_RAD_TEXTURE_QUALITY_HIGH, IDC_RAD_TEXTURE_QUALITY_HIGH);
}
CheckRadioButton(
IDC_RAD_TEXTURE_QUALITY_LOW,
IDC_RAD_TEXTURE_QUALITY_HIGH,
currentConfigApp->m_texture_quality == 0 ? IDC_RAD_TEXTURE_QUALITY_LOW : IDC_RAD_TEXTURE_QUALITY_HIGH
);
CheckDlgButton(IDC_CHK_JOYSTICK, currentConfigApp->m_use_joystick);
CheckDlgButton(IDC_CHK_MUSIC, currentConfigApp->m_music);
}
// STUB: CONFIGD 0x00409152
void CMainDialog::OnCheckboxWideAngle()
{
// DECOMP: m_wide_angle member removed for retail.
// currentConfigApp->m_wide_angle = IsDlgButtonChecked(IDC_CHK_WIDE_ANGLE);
// m_modified = TRUE;
// UpdateInterface();
}
// FUNCTION: CONFIG 0x004045e0
// FUNCTION: CONFIGD 0x00409198
void CMainDialog::OnCheckbox3DSound()
{
currentConfigApp->m_3d_sound = IsDlgButtonChecked(IDC_CHK_3DSOUND);
@ -287,7 +229,6 @@ void CMainDialog::OnCheckbox3DSound()
}
// FUNCTION: CONFIG 0x00404610
// FUNCTION: CONFIGD 0x004091de
void CMainDialog::OnCheckbox3DVideoMemory()
{
currentConfigApp->m_3d_video_ram = IsDlgButtonChecked(IDC_CHK_3D_VIDEO_MEMORY);
@ -296,7 +237,6 @@ void CMainDialog::OnCheckbox3DVideoMemory()
}
// FUNCTION: CONFIG 0x00404640
// FUNCTION: CONFIGD 0x00409224
void CMainDialog::OnRadiobuttonPalette16bit()
{
currentConfigApp->m_display_bit_depth = 16;
@ -305,7 +245,6 @@ void CMainDialog::OnRadiobuttonPalette16bit()
}
// FUNCTION: CONFIG 0x00404670
// FUNCTION: CONFIGD 0x00409261
void CMainDialog::OnRadiobuttonPalette256()
{
currentConfigApp->m_display_bit_depth = 8;
@ -314,7 +253,6 @@ void CMainDialog::OnRadiobuttonPalette256()
}
// FUNCTION: CONFIG 0x004046a0
// FUNCTION: CONFIGD 0x0040929e
void CMainDialog::OnCheckboxFlipVideoMemPages()
{
currentConfigApp->m_flip_surfaces = IsDlgButtonChecked(IDC_CHK_FLIP_VIDEO_MEM_PAGES);
@ -322,24 +260,7 @@ void CMainDialog::OnCheckboxFlipVideoMemPages()
UpdateInterface();
}
// FUNCTION: CONFIGD 0x004092e4
void CMainDialog::OnCheckboxFullScreen()
{
currentConfigApp->m_full_screen = IsDlgButtonChecked(IDC_CHK_FULL_SCREEN);
m_modified = TRUE;
UpdateInterface();
}
// FUNCTION: CONFIGD 0x0040932a
void CMainDialog::OnRadiobuttonModelLowestQuality()
{
currentConfigApp->m_model_quality = 0;
m_modified = TRUE;
UpdateInterface();
}
// FUNCTION: CONFIG 0x004046d0
// FUNCTION: CONFIGD 0x00409367
void CMainDialog::OnRadiobuttonModelLowQuality()
{
currentConfigApp->m_model_quality = 1;
@ -348,7 +269,6 @@ void CMainDialog::OnRadiobuttonModelLowQuality()
}
// FUNCTION: CONFIG 0x00404700
// FUNCTION: CONFIGD 0x004093a4
void CMainDialog::OnRadiobuttonModelHighQuality()
{
currentConfigApp->m_model_quality = 2;
@ -357,7 +277,6 @@ void CMainDialog::OnRadiobuttonModelHighQuality()
}
// FUNCTION: CONFIG 0x00404730
// FUNCTION: CONFIGD 0x004093e1
void CMainDialog::OnRadiobuttonTextureLowQuality()
{
currentConfigApp->m_texture_quality = 0;
@ -366,7 +285,6 @@ void CMainDialog::OnRadiobuttonTextureLowQuality()
}
// FUNCTION: CONFIG 0x00404760
// FUNCTION: CONFIGD 0x0040941e
void CMainDialog::OnRadiobuttonTextureHighQuality()
{
currentConfigApp->m_texture_quality = 1;
@ -375,7 +293,6 @@ void CMainDialog::OnRadiobuttonTextureHighQuality()
}
// FUNCTION: CONFIG 0x00404790
// FUNCTION: CONFIGD 0x0040945b
void CMainDialog::OnCheckboxJoystick()
{
currentConfigApp->m_use_joystick = IsDlgButtonChecked(IDC_CHK_JOYSTICK);
@ -394,8 +311,8 @@ void CMainDialog::SwitchToAdvanced(BOOL p_advanced)
{
RECT dialog_rect;
RECT grp_advanced_rect;
CWnd::GetWindowRect(&dialog_rect);
GetDlgItem(IDC_GRP_ADVANCED)->GetWindowRect(&grp_advanced_rect);
::GetWindowRect(m_hWnd, &dialog_rect);
::GetWindowRect(GetDlgItem(IDC_GRP_ADVANCED)->m_hWnd, &grp_advanced_rect);
CWnd* button_advanced = GetDlgItem(IDC_BTN_ADVANCED);
m_advanced = p_advanced;
int height;

View File

@ -7,7 +7,6 @@
#include "res/resource.h"
// VTABLE: CONFIG 0x004063e0
// VTABLE: CONFIGD 0x0040c500
// SIZE 0x70
class CMainDialog : public CDialog {
public:
@ -36,14 +35,11 @@ class CMainDialog : public CDialog {
void OnCancel();
void OnDestroy();
void OnButtonCancel();
void OnCheckboxWideAngle();
void OnCheckbox3DSound();
void OnCheckbox3DVideoMemory();
void OnRadiobuttonPalette16bit();
void OnRadiobuttonPalette256();
void OnCheckboxFlipVideoMemPages();
void OnCheckboxFullScreen();
void OnRadiobuttonModelLowestQuality();
void OnRadiobuttonModelLowQuality();
void OnRadiobuttonModelHighQuality();
void OnRadiobuttonTextureLowQuality();
@ -56,28 +52,19 @@ class CMainDialog : public CDialog {
DECLARE_MESSAGE_MAP()
};
// SYNTHETIC: CONFIG 0x00403160
// SYNTHETIC: CONFIGD 0x00408490
// CMainDialog::~CMainDialog
// SYNTHETIC: CONFIG 0x00403de0
// SYNTHETIC: CONFIGD 0x00409910
// CMainDialog::`scalar deleting destructor'
// FUNCTION: CONFIG 0x00403e60
// FUNCTION: CONFIGD 0x004087a9
// CMainDialog::_GetBaseMessageMap
// FUNCTION: CONFIG 0x00403e70
// FUNCTION: CONFIGD 0x004087be
// CMainDialog::GetMessageMap
// GLOBAL: CONFIG 0x00406120
// GLOBAL: CONFIGD 0x0040c1a8
// CMainDialog::messageMap
// GLOBAL: CONFIG 0x00406128
// GLOBAL: CONFIGD 0x0040c1b0
// CMainDialog::_messageEntries
#endif // !defined(AFX_MAINDLG_H)

View File

@ -4,7 +4,6 @@
#include "MainDlg.h"
#include "detectdx5.h"
#include <assert.h>
#include <direct.h> // _chdir
#include <mxdirectx/legodxinfo.h>
#include <mxdirectx/mxdirect3d.h>
@ -20,7 +19,6 @@ ON_COMMAND(ID_HELP, OnHelp)
END_MESSAGE_MAP()
// FUNCTION: CONFIG 0x00402c40
// FUNCTION: CONFIGD 0x00406900
CConfigApp::CConfigApp()
{
}
@ -28,13 +26,11 @@ CConfigApp::CConfigApp()
#define MiB (1024 * 1024)
// FUNCTION: CONFIG 0x00402dc0
// FUNCTION: CONFIGD 0x004069dc
BOOL CConfigApp::InitInstance()
{
if (!IsLegoNotRunning()) {
return FALSE;
}
if (!DetectDirectX5()) {
AfxMessageBox(
"\"LEGO\xae Island\" is not detecting DirectX 5 or later. Please quit all other applications and try "
@ -42,27 +38,22 @@ BOOL CConfigApp::InitInstance()
);
return FALSE;
}
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
CConfigCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (_stricmp(afxCurrentAppName, "config") == 0) {
m_run_config_dialog = TRUE;
}
m_dxInfo = new LegoDeviceEnumerate;
if (m_dxInfo->DoEnumerate()) {
assert("Could not build device list." == NULL);
m_device_enumerator = new LegoDeviceEnumerate;
if (m_device_enumerator->DoEnumerate()) {
return FALSE;
}
m_ddInfo = NULL;
m_d3dInfo = NULL;
m_driver = NULL;
m_device = NULL;
m_full_screen = TRUE;
m_wide_view_angle = TRUE;
m_use_joystick = FALSE;
@ -85,43 +76,37 @@ BOOL CConfigApp::InitInstance()
m_texture_quality = 1;
}
else {
m_3d_sound = TRUE;
m_model_quality = 2;
m_3d_sound = TRUE;
m_texture_quality = 1;
}
if (m_run_config_dialog) {
CMainDialog main_dialog(NULL);
m_pMainWnd = &main_dialog;
main_dialog.DoModal();
}
else {
if (!m_run_config_dialog) {
ReadRegisterSettings();
ValidateSettings();
WriteRegisterSettings();
delete m_dxInfo;
m_dxInfo = NULL;
m_ddInfo = NULL;
m_d3dInfo = NULL;
delete m_device_enumerator;
m_device_enumerator = NULL;
m_driver = NULL;
m_device = NULL;
char password[256];
BOOL read = ReadReg("password", password, sizeof(password));
ReadReg("password", password, sizeof(password));
const char* exe = _stricmp("ogel", password) == 0 ? "isled.exe" : "isle.exe";
char diskpath[1024];
read = ReadReg("diskpath", diskpath, sizeof(diskpath));
if (read) {
if (ReadReg("diskpath", diskpath, sizeof(diskpath))) {
_chdir(diskpath);
}
_spawnl(_P_NOWAIT, exe, exe, "/diskstream", "/script", "\\lego\\scripts\\isle\\isle.si", NULL);
return FALSE;
}
CMainDialog main_dialog(NULL);
main_dialog.DoModal();
return FALSE;
}
// FUNCTION: CONFIG 0x00403100
BOOL CConfigApp::IsLegoNotRunning()
{
HWND hWnd = FindWindow("Lego Island MainNoM App", "LEGO\xae");
HWND hWnd = FindWindowA("Lego Island MainNoM App", "LEGO\xae");
if (_stricmp(afxCurrentAppName, "config") == 0 || !hWnd) {
return TRUE;
}
@ -132,40 +117,35 @@ BOOL CConfigApp::IsLegoNotRunning()
}
// FUNCTION: CONFIG 0x004031b0
// FUNCTION: CONFIGD 0x00406dc3
BOOL CConfigApp::WriteReg(const char* p_key, const char* p_value) const
{
HKEY hKey;
DWORD pos;
BOOL success = FALSE;
BOOL created = RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\Mindscape\\LEGO Island",
0,
"string",
0,
KEY_READ | KEY_WRITE,
NULL,
&hKey,
&pos
);
if (created == ERROR_SUCCESS) {
if (RegSetValueEx(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value) + 1) == ERROR_SUCCESS) {
if (RegCreateKeyExA(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\Mindscape\\LEGO Island",
0,
"string",
0,
KEY_READ | KEY_WRITE,
NULL,
&hKey,
&pos
) == ERROR_SUCCESS) {
if (RegSetValueExA(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value)) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
success = TRUE;
return TRUE;
}
}
else {
RegCloseKey(hKey);
}
}
return success;
return FALSE;
}
// FUNCTION: CONFIG 0x00403240
// FUNCTION: CONFIGD 0x00406e6e
BOOL CConfigApp::ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
{
HKEY hKey;
@ -173,8 +153,8 @@ BOOL CConfigApp::ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
BOOL out = FALSE;
DWORD size = p_size;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, p_key, NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) {
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, p_key, NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
out = TRUE;
}
@ -184,30 +164,28 @@ BOOL CConfigApp::ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
}
// FUNCTION: CONFIG 0x004032b0
// FUNCTION: CONFIGD 0x00406ef6
BOOL CConfigApp::ReadRegBool(LPCSTR p_key, BOOL* p_bool) const
{
char buffer[256];
BOOL read = TRUE;
read = ReadReg(p_key, buffer, sizeof(buffer));
BOOL read = ReadReg(p_key, buffer, sizeof(buffer));
if (read) {
if (strcmp("YES", buffer) == 0) {
*p_bool = TRUE;
return read;
}
else if (strcmp("NO", buffer) == 0) {
*p_bool = FALSE;
}
else {
read = FALSE;
}
}
if (strcmp("NO", buffer) == 0) {
*p_bool = FALSE;
return read;
}
read = FALSE;
}
return read;
}
// FUNCTION: CONFIG 0x00403380
// FUNCTION: CONFIGD 0x00406fa1
BOOL CConfigApp::ReadRegInt(LPCSTR p_key, int* p_value) const
{
char buffer[256];
@ -221,63 +199,46 @@ BOOL CConfigApp::ReadRegInt(LPCSTR p_key, int* p_value) const
}
// FUNCTION: CONFIG 0x004033d0
// FUNCTION: CONFIGD 0x00407080
BOOL CConfigApp::IsDeviceInBasicRGBMode() const
{
/*
* BUG: should be:
* return !GetHardwareDeviceColorModel() && (m_d3dInfo->m_HELDesc.dcmColorModel & D3DCOLOR_RGB);
* return !GetHardwareDeviceColorModel() && (m_device->m_HELDesc.dcmColorModel & D3DCOLOR_RGB);
*/
assert(m_d3dInfo);
return !GetHardwareDeviceColorModel() && m_d3dInfo->m_HELDesc.dcmColorModel == D3DCOLOR_RGB;
return !GetHardwareDeviceColorModel() && m_device->m_HELDesc.dcmColorModel == D3DCOLOR_RGB;
}
// FUNCTION: CONFIG 0x00403400
// FUNCTION: CONFIGD 0x004070fa
D3DCOLORMODEL CConfigApp::GetHardwareDeviceColorModel() const
{
assert(m_d3dInfo);
return m_d3dInfo->m_HWDesc.dcmColorModel;
return m_device->m_HWDesc.dcmColorModel;
}
// FUNCTION: CONFIG 0x00403410
// FUNCTION: CONFIGD 0x0040714e
BOOL CConfigApp::IsPrimaryDriver() const
{
assert(m_ddInfo && m_dxInfo);
return m_ddInfo == &m_dxInfo->m_ddInfo.front();
return m_driver == &m_device_enumerator->GetDriverList().front();
}
// FUNCTION: CONFIG 0x00403430
// FUNCTION: CONFIGD 0x004071d2
BOOL CConfigApp::ReadRegisterSettings()
{
char buffer[256];
BOOL is_modified = FALSE;
int tmp = -1;
BOOL read = ReadReg("3D Device ID", buffer, sizeof(buffer));
int r = -1;
if (read) {
r = m_dxInfo->ParseDeviceName(buffer);
if (r >= 0) {
r = m_dxInfo->GetDevice(r, m_ddInfo, m_d3dInfo);
if (r) {
r = -1;
}
if (ReadReg("3D Device ID", buffer, sizeof(buffer))) {
tmp = m_device_enumerator->ParseDeviceName(buffer);
if (tmp >= 0) {
tmp = m_device_enumerator->GetDevice(tmp, m_driver, m_device);
}
}
if (r < 0) {
m_dxInfo->FUN_1009d210();
r = m_dxInfo->GetBestDevice();
if (tmp != 0) {
is_modified = TRUE;
assert(r >= 0);
r = m_dxInfo->GetDevice(r, m_ddInfo, m_d3dInfo);
m_device_enumerator->FUN_1009d210();
tmp = m_device_enumerator->FUN_1009d0d0();
m_device_enumerator->GetDevice(tmp, m_driver, m_device);
}
assert(r == 0 && m_ddInfo && m_d3dInfo);
if (!ReadRegInt("Display Bit Depth", &m_display_bit_depth)) {
is_modified = TRUE;
}
@ -318,7 +279,6 @@ BOOL CConfigApp::ReadRegisterSettings()
}
// FUNCTION: CONFIG 0x00403630
// FUNCTION: CONFIGD 0x00407547
BOOL CConfigApp::ValidateSettings()
{
BOOL is_modified = FALSE;
@ -341,7 +301,11 @@ BOOL CConfigApp::ValidateSettings()
is_modified = TRUE;
}
}
if (GetHardwareDeviceColorModel()) {
if (!GetHardwareDeviceColorModel()) {
m_draw_cursor = FALSE;
is_modified = TRUE;
}
else {
if (!m_3d_video_ram) {
m_3d_video_ram = TRUE;
is_modified = TRUE;
@ -351,10 +315,6 @@ BOOL CConfigApp::ValidateSettings()
is_modified = TRUE;
}
}
else {
m_draw_cursor = FALSE;
is_modified = TRUE;
}
if (m_flip_surfaces) {
if (!m_3d_video_ram) {
m_3d_video_ram = TRUE;
@ -381,34 +341,29 @@ BOOL CConfigApp::ValidateSettings()
}
// FUNCTION: CONFIG 0x004037a0
// FUNCTION: CONFIGD 0x00407793
DWORD CConfigApp::GetConditionalDeviceRenderBitDepth() const
{
assert(m_d3dInfo);
if (IsDeviceInBasicRGBMode()) {
return 0;
}
if (GetHardwareDeviceColorModel()) {
return 0;
}
return m_d3dInfo->m_HELDesc.dwDeviceRenderBitDepth & DDBD_8;
return m_device->m_HELDesc.dwDeviceRenderBitDepth & 0x800;
}
// FUNCTION: CONFIG 0x004037e0
// FUNCTION: CONFIGD 0x00407822
DWORD CConfigApp::GetDeviceRenderBitStatus() const
{
assert(m_d3dInfo);
if (GetHardwareDeviceColorModel()) {
return m_d3dInfo->m_HWDesc.dwDeviceRenderBitDepth & DDBD_16;
return m_device->m_HWDesc.dwDeviceRenderBitDepth & 0x400;
}
else {
return m_d3dInfo->m_HELDesc.dwDeviceRenderBitDepth & DDBD_16;
return m_device->m_HELDesc.dwDeviceRenderBitDepth & 0x400;
}
}
// FUNCTION: CONFIG 0x00403810
// FUNCTION: CONFIGD 0x004078ac
BOOL CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
{
if (m_display_bit_depth == 8) {
@ -433,8 +388,7 @@ BOOL CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
return TRUE;
}
// FUNCTION: CONFIG 0x00403890
// FUNCTION: CONFIGD 0x00407966
// FUNCTION: CONFIG 00403890
void CConfigApp::WriteRegisterSettings() const
{
@ -447,10 +401,9 @@ void CConfigApp::WriteRegisterSettings() const
WriteReg(NAME, buffer); \
} while (0)
assert(m_dxInfo && m_ddInfo && m_d3dInfo);
m_dxInfo->FormatDeviceName(buffer, m_ddInfo, m_d3dInfo);
m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device);
WriteReg("3D Device ID", buffer);
WriteReg("3D Device Name", m_d3dInfo->m_deviceName);
WriteReg("3D Device Name", m_device->m_deviceName);
WriteRegInt("Display Bit Depth", m_display_bit_depth);
WriteRegBool("Flip Surfaces", m_flip_surfaces);
WriteRegBool("Full Screen", m_full_screen);
@ -469,12 +422,11 @@ void CConfigApp::WriteRegisterSettings() const
}
// FUNCTION: CONFIG 0x00403a90
// FUNCTION: CONFIGD 0x00407c44
int CConfigApp::ExitInstance()
{
if (m_dxInfo) {
delete m_dxInfo;
m_dxInfo = NULL;
if (m_device_enumerator) {
delete m_device_enumerator;
m_device_enumerator = NULL;
}
return CWinApp::ExitInstance();
}

View File

@ -11,10 +11,9 @@ class LegoDeviceEnumerate;
struct Direct3DDeviceInfo;
struct MxDriver;
#define currentConfigApp ((CConfigApp*) AfxGetApp())
#define currentConfigApp ((CConfigApp*) afxCurrentWinApp)
// VTABLE: CONFIG 0x00406040
// VTABLE: CONFIGD 0x0040c0a0
// SIZE 0x108
class CConfigApp : public CWinApp {
public:
@ -43,7 +42,7 @@ class CConfigApp : public CWinApp {
DWORD GetConditionalDeviceRenderBitDepth() const;
DWORD GetDeviceRenderBitStatus() const;
BOOL AdjustDisplayBitDepthBasedOnRenderStatus();
void WriteRegisterSettings() const;
void CConfigApp::WriteRegisterSettings() const;
//{{AFX_MSG(CConfigApp)
// NOTE - the ClassWizard will add and remove member functions here.
@ -55,43 +54,38 @@ class CConfigApp : public CWinApp {
BOOL IsLegoNotRunning();
public:
LegoDeviceEnumerate* m_dxInfo; // 0x0c4
MxDriver* m_ddInfo; // 0x0c8
Direct3DDeviceInfo* m_d3dInfo; // 0x0cc
int m_display_bit_depth; // 0x0d0
BOOL m_flip_surfaces; // 0x0d4
BOOL m_full_screen; // 0x0d8
BOOL m_3d_video_ram; // 0x0dc
BOOL m_wide_view_angle; // 0x0e0
BOOL m_3d_sound; // 0x0e4
BOOL m_draw_cursor; // 0x0e8
BOOL m_use_joystick; // 0x0ec
int m_joystick_index; // 0x0f0
BOOL m_run_config_dialog; // 0x0f4
int m_model_quality; // 0x0f8
int m_texture_quality; // 0x0fc
undefined m_unk0x100[4]; // 0x100
BOOL m_music; // 0x104
LegoDeviceEnumerate* m_device_enumerator; // 0x0c4
MxDriver* m_driver; // 0x0c8
Direct3DDeviceInfo* m_device; // 0x0cc
int m_display_bit_depth; // 0x0d0
BOOL m_flip_surfaces; // 0x0d4
BOOL m_full_screen; // 0x0d8
BOOL m_3d_video_ram; // 0x0dc
BOOL m_wide_view_angle; // 0x0e0
BOOL m_3d_sound; // 0x0e4
BOOL m_draw_cursor; // 0x0e8
BOOL m_use_joystick; // 0x0ec
int m_joystick_index; // 0x0f0
BOOL m_run_config_dialog; // 0x0f4
int m_model_quality; // 0x0f8
int m_texture_quality; // 0x0fc
undefined m_unk0x100[4]; // 0x100
BOOL m_music; // 0x104
};
// SYNTHETIC: CONFIG 0x00402cd0
// SYNTHETIC: CONFIGD 0x00408330
// CConfigApp::`scalar deleting destructor'
// FUNCTION: CONFIG 0x402c20
// FUNCTION: CONFIGD 0x4068d0
// CConfigApp::_GetBaseMessageMap
// FUNCTION: CONFIG 0x402c30
// FUNCTION: CONFIGD 0x4068e5
// CConfigApp::GetMessageMap
// GLOBAL: CONFIG 0x406008
// GLOBAL: CONFIGD 0x40c058
// CConfigApp::messageMap
// GLOBAL: CONFIG 0x406010
// GLOBAL: CONFIGD 0x40c060
// CConfigApp::_messageEntries
#endif // !defined(AFX_CONFIG_H)

View File

@ -3,255 +3,140 @@
#include <ddraw.h>
#include <dinput.h>
typedef HRESULT(WINAPI* DIRECTDRAWCREATE)(GUID*, LPDIRECTDRAW*, IUnknown*);
typedef HRESULT(WINAPI* DIRECTINPUTCREATE)(HINSTANCE, DWORD, LPDIRECTINPUT*, IUnknown*);
typedef HRESULT WINAPI DirectDrawCreate_fn(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnknown FAR* pUnkOuter);
typedef HRESULT WINAPI
DirectInputCreateA_fn(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA* ppDI, LPUNKNOWN punkOuter);
// FUNCTION: CONFIG 0x004048f0
BOOL DetectDirectX5()
{
DWORD version;
DWORD platform;
GetDXVersion(&version, &platform);
unsigned int version;
BOOL found;
DetectDirectX(&version, &found);
return version >= 0x500;
}
// FUNCTION: CONFIG 0x00404920
void GetDXVersion(LPDWORD pdwDXVersion, LPDWORD pdwDXPlatform)
void DetectDirectX(unsigned int* p_version, BOOL* p_found)
{
// From GetDXVer.cpp
HRESULT hr;
HINSTANCE DDHinst = 0;
HINSTANCE DIHinst = 0;
LPDIRECTDRAW pDDraw = 0;
LPDIRECTDRAW2 pDDraw2 = 0;
DIRECTDRAWCREATE DirectDrawCreate = 0;
DIRECTINPUTCREATE DirectInputCreate = 0;
OSVERSIONINFO osVer;
LPDIRECTDRAWSURFACE pSurf = 0;
LPDIRECTDRAWSURFACE3 pSurf3 = 0;
OSVERSIONINFOA os_version;
/*
* First get the windows platform
*/
osVer.dwOSVersionInfoSize = sizeof(osVer);
if (!GetVersionEx(&osVer)) {
*pdwDXVersion = 0;
*pdwDXPlatform = 0;
os_version.dwOSVersionInfoSize = sizeof(os_version);
if (!GetVersionExA(&os_version)) {
*p_version = 0;
*p_found = 0;
return;
}
if (osVer.dwPlatformId == VER_PLATFORM_WIN32_NT) {
*pdwDXPlatform = VER_PLATFORM_WIN32_NT;
/*
* NT is easy... NT 4.0 is DX2, 4.0 SP3 is DX3, 5.0 is DX5
* and no DX on earlier versions.
*/
if (osVer.dwMajorVersion < 4) {
*pdwDXPlatform = 0; // No DX on NT3.51 or earlier
if (os_version.dwPlatformId == 2) {
*p_found = 2;
if (os_version.dwMajorVersion < 4) {
*p_found = 0;
return;
}
if (osVer.dwMajorVersion == 4) {
/*
* NT4 up to SP2 is DX2, and SP3 onwards is DX3, so we are at least DX2
*/
*pdwDXVersion = 0x200;
/*
* We're not supposed to be able to tell which SP we're on, so check for dinput
*/
DIHinst = LoadLibrary("DINPUT.DLL");
if (DIHinst == 0) {
/*
* No DInput... must be DX2 on NT 4 pre-SP3
*/
OutputDebugString("Couldn't LoadLibrary DInput\r\n");
return;
}
DirectInputCreate = (DIRECTINPUTCREATE) GetProcAddress(DIHinst, "DirectInputCreateA");
FreeLibrary(DIHinst);
if (DirectInputCreate == 0) {
/*
* No DInput... must be pre-SP3 DX2
*/
OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
return;
}
/*
* It must be NT4, DX2
*/
*pdwDXVersion = 0x300; // DX3 on NT4 SP3 or higher
if (os_version.dwMajorVersion != 4) {
*p_version = 0x501;
return;
}
/*
* Else it's NT5 or higher, and it's DX5a or higher:
*/
*pdwDXVersion = 0x501; // DX5a on NT5
*p_version = 0x200;
HMODULE dinput_module = LoadLibraryA("DINPUT.DLL");
if (!dinput_module) {
OutputDebugStringA("Couldn't LoadLibrary DInput\r\n");
return;
}
DirectInputCreateA_fn* func_DirectInputCreateA =
(DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA");
FreeLibrary(dinput_module);
if (!func_DirectInputCreateA) {
OutputDebugStringA("Couldn't GetProcAddress DInputCreate\r\n");
return;
}
*p_version = 0x300;
return;
}
/*
* Not NT... must be Win9x
*/
*pdwDXPlatform = VER_PLATFORM_WIN32_WINDOWS;
/*
* If we are on Memphis or higher, then we are at least DX5a
*/
if ((osVer.dwBuildNumber & 0xffff) > 1353) // Check for higher than developer release
{
*pdwDXVersion = 0x501; // DX5a on Memphis or higher
*p_found = 1;
if (LOWORD(os_version.dwBuildNumber) >= 0x550) {
*p_version = 0x501;
return;
}
/*
* Now we know we are in Windows 9x (or maybe 3.1), so anything's possible.
* First see if DDRAW.DLL even exists.
*/
DDHinst = LoadLibrary("DDRAW.DLL");
if (DDHinst == 0) {
*pdwDXVersion = 0;
*pdwDXPlatform = 0;
FreeLibrary(DDHinst);
HMODULE ddraw_module = LoadLibraryA("DDRAW.DLL");
if (!ddraw_module) {
*p_version = 0;
*p_found = 0;
FreeLibrary(ddraw_module);
return;
}
/*
* See if we can create the DirectDraw object.
*/
DirectDrawCreate = (DIRECTDRAWCREATE) GetProcAddress(DDHinst, "DirectDrawCreate");
if (DirectDrawCreate == 0) {
*pdwDXVersion = 0;
*pdwDXPlatform = 0;
FreeLibrary(DDHinst);
OutputDebugString("Couldn't LoadLibrary DDraw\r\n");
DirectDrawCreate_fn* func_DirectDrawCreate =
(DirectDrawCreate_fn*) GetProcAddress(ddraw_module, "DirectDrawCreate");
if (!func_DirectDrawCreate) {
*p_version = 0;
*p_found = 0;
FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't LoadLibrary DDraw\r\n");
return;
}
hr = DirectDrawCreate(NULL, &pDDraw, NULL);
if (FAILED(hr)) {
*pdwDXVersion = 0;
*pdwDXPlatform = 0;
FreeLibrary(DDHinst);
OutputDebugString("Couldn't create DDraw\r\n");
LPDIRECTDRAW ddraw;
if (FAILED(func_DirectDrawCreate(NULL, &ddraw, NULL))) {
*p_version = 0;
*p_found = 0;
FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't create DDraw\r\n");
return;
}
/*
* So DirectDraw exists. We are at least DX1.
*/
*pdwDXVersion = 0x100;
/*
* Let's see if IID_IDirectDraw2 exists.
*/
hr = pDDraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &pDDraw2);
if (FAILED(hr)) {
/*
* No IDirectDraw2 exists... must be DX1
*/
pDDraw->Release();
FreeLibrary(DDHinst);
OutputDebugString("Couldn't QI DDraw2\r\n");
*p_version = 0x100;
LPDIRECTDRAW2 ddraw2;
if (FAILED(ddraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &ddraw2))) {
ddraw->Release();
FreeLibrary(ddraw_module);
OutputDebugStringA("Couldn't QI DDraw2\r\n");
return;
}
/*
* IDirectDraw2 exists. We must be at least DX2
*/
pDDraw2->Release();
*pdwDXVersion = 0x200;
/*
* See if we can create the DirectInput object.
*/
DIHinst = LoadLibrary("DINPUT.DLL");
if (DIHinst == 0) {
/*
* No DInput... must be DX2
*/
OutputDebugString("Couldn't LoadLibrary DInput\r\n");
pDDraw->Release();
FreeLibrary(DDHinst);
ddraw->Release();
*p_version = 0x200;
HMODULE dinput_module = LoadLibraryA("DINPUT.DLL");
if (!dinput_module) {
OutputDebugStringA("Couldn't LoadLibrary DInput\r\n");
ddraw2->Release();
FreeLibrary(ddraw_module);
return;
}
DirectInputCreate = (DIRECTINPUTCREATE) GetProcAddress(DIHinst, "DirectInputCreateA");
FreeLibrary(DIHinst);
if (DirectInputCreate == 0) {
/*
* No DInput... must be DX2
*/
FreeLibrary(DDHinst);
pDDraw->Release();
OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
DirectInputCreateA_fn* func_DirectInputCreateA =
(DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA");
FreeLibrary(dinput_module);
if (!func_DirectInputCreateA) {
FreeLibrary(ddraw_module);
ddraw2->Release();
OutputDebugStringA("Couldn't GetProcAddress DInputCreate\r\n");
return;
}
/*
* DirectInputCreate exists. That's enough to tell us that we are at least DX3
*/
*pdwDXVersion = 0x300;
/*
* Checks for 3a vs 3b?
*/
/*
* We can tell if DX5 is present by checking for the existence of IDirectDrawSurface3.
* First we need a surface to QI off of.
*/
DDSURFACEDESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.dwSize = sizeof(desc);
desc.dwFlags = DDSD_CAPS;
desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = pDDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL);
if (FAILED(hr)) {
/*
* Failure. This means DDraw isn't properly installed.
*/
pDDraw->Release();
FreeLibrary(DDHinst);
*pdwDXVersion = 0;
OutputDebugString("Couldn't Set coop level\r\n");
*p_version = 0x300;
DDSURFACEDESC surface_desc;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
surface_desc.ddsCaps.dwCaps = DDCAPS2_NONLOCALVIDMEM;
if (FAILED(ddraw2->SetCooperativeLevel(NULL, DISCL_BACKGROUND))) {
ddraw2->Release();
FreeLibrary(ddraw_module);
*p_version = 0;
OutputDebugStringA("Couldn't Set coop level\r\n");
return;
}
hr = pDDraw->CreateSurface(&desc, &pSurf, NULL);
if (FAILED(hr)) {
/*
* Failure. This means DDraw isn't properly installed.
*/
pDDraw->Release();
FreeLibrary(DDHinst);
*pdwDXVersion = 0;
OutputDebugString("Couldn't CreateSurface\r\n");
LPDIRECTDRAWSURFACE surface;
if (FAILED(ddraw2->CreateSurface(&surface_desc, &surface, NULL))) {
ddraw2->Release();
FreeLibrary(ddraw_module);
*p_version = 0;
OutputDebugStringA("Couldn't CreateSurface\r\n");
return;
}
/*
* Try for the IDirectDrawSurface3 interface. If it works, we're on DX5 at least
*/
if (FAILED(pSurf->QueryInterface(IID_IDirectDrawSurface3, (LPVOID*) &pSurf3))) {
pDDraw->Release();
FreeLibrary(DDHinst);
LPDIRECTDRAWSURFACE3 surface3;
if (FAILED(surface->QueryInterface(IID_IDirectDrawSurface3, (LPVOID*) &surface3))) {
ddraw2->Release();
FreeLibrary(ddraw_module);
return;
}
/*
* QI for IDirectDrawSurface3 succeeded. We must be at least DX5
*/
*pdwDXVersion = 0x500;
pSurf->Release();
pDDraw->Release();
FreeLibrary(DDHinst);
return;
*p_version = 0x500;
surface3->Release();
ddraw2->Release();
FreeLibrary(ddraw_module);
}

View File

@ -5,6 +5,6 @@
extern BOOL DetectDirectX5();
extern void GetDXVersion(LPDWORD pdwDXVersion, LPDWORD pdwDXPlatform);
extern void DetectDirectX(unsigned int* p_version, BOOL* p_found);
#endif // !defined(AFX_DETECTDX5_H)

View File

@ -7,12 +7,10 @@
#define IDC_LIST_3DDEVICES 1000
#define IDC_CHK_FLIP_VIDEO_MEM_PAGES 1001
#define IDC_CHK_FULL_SCREEN 1002 // beta only
#define IDC_CHK_3D_VIDEO_MEMORY 1003
#define IDC_RAD_PALETTE_256 1004
#define IDC_RAD_PALETTE_16BIT 1005
#define IDC_CHK_3DSOUND 1006
#define IDC_CHK_WIDE_ANGLE 1007 // beta only
#define IDC_CHK_DRAW_CURSOR 1008
#define IDC_RAD_MODEL_QUALITY_LOW 1010
#define IDC_RAD_MODEL_QUALITY_HIGH 1011

View File

@ -15,6 +15,8 @@ To access the Ghidra repository, use the following details:
- Address: `server.mattkc.com`
- Port: `13100`
**Please note that at the time of writing, much of the information found on the Ghidra server is severely outdated**. Generally, the source code found in this repository represents the latest "source of truth" and should be referenced whenever possible.
## General Guidelines
If you feel fit to contribute, feel free to create a pull request! Someone will review and merge it (or provide feedback) as soon as possible.

View File

@ -87,7 +87,7 @@ IsleApp::IsleApp()
m_backBuffersInVram = TRUE;
m_using8bit = FALSE;
m_using16bit = TRUE;
m_hasLightSupport = FALSE;
m_unk0x24 = 0;
m_drawCursor = FALSE;
m_use3dSound = TRUE;
m_useMusic = TRUE;
@ -179,7 +179,7 @@ BOOL IsleApp::SetupLegoOmni()
{
BOOL result = FALSE;
char mediaPath[256];
GetProfileString("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
#ifdef COMPAT_MODE
BOOL failure;
@ -209,7 +209,7 @@ void IsleApp::SetupVideoFlags(
BOOL backBuffers,
BOOL using8bit,
BOOL using16bit,
BOOL hasLightSupport,
BOOL param_6,
BOOL param_7,
BOOL wideViewAngle,
char* deviceId
@ -218,10 +218,10 @@ void IsleApp::SetupVideoFlags(
m_videoParam.Flags().SetFullScreen(fullScreen);
m_videoParam.Flags().SetFlipSurfaces(flipSurfaces);
m_videoParam.Flags().SetBackBuffers(!backBuffers);
m_videoParam.Flags().SetLacksLightSupport(!hasLightSupport);
m_videoParam.Flags().SetF2bit0(!param_6);
m_videoParam.Flags().SetF1bit7(param_7);
m_videoParam.Flags().SetWideViewAngle(wideViewAngle);
m_videoParam.Flags().SetEnabled(TRUE);
m_videoParam.Flags().SetF2bit1(1);
m_videoParam.SetDeviceName(deviceId);
if (using8bit) {
m_videoParam.Flags().Set16Bit(0);
@ -251,7 +251,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Throw error if sound unavailable
if (!soundReady) {
MessageBox(
MessageBoxA(
NULL,
"\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other "
"applications and try again.",
@ -266,7 +266,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Create window
if (g_isle->SetupWindow(hInstance, lpCmdLine) != SUCCESS) {
MessageBox(
MessageBoxA(
NULL,
"\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.",
"LEGO\xAE Island Error",
@ -287,12 +287,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// sample for MSVC600. It's quite possible Mindscape derived this app from that example since they no longer had the
// luxury of the MFC AppWizard which we know they used for the frontend used during development (ISLEMFC.EXE,
// MAIN.EXE, et al.)
LoadAccelerators(hInstance, "AppAccel");
LoadAcceleratorsA(hInstance, "AppAccel");
MSG msg;
while (!g_closed) {
while (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)) {
if (g_isle) {
g_isle->Tick(1);
}
@ -303,15 +303,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
}
while (!g_closed) {
if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (!PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) {
break;
}
MSG nextMsg;
if (!g_isle || !g_isle->GetWindowHandle() || msg.message != WM_MOUSEMOVE ||
!PeekMessage(&nextMsg, NULL, 0, 0, PM_NOREMOVE) || nextMsg.message != WM_MOUSEMOVE) {
!PeekMessageA(&nextMsg, NULL, 0, 0, PM_NOREMOVE) || nextMsg.message != WM_MOUSEMOVE) {
TranslateMessage(&msg);
DispatchMessage(&msg);
DispatchMessageA(&msg);
}
if (g_reqEnableRMDevice) {
@ -343,7 +343,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// FUNCTION: ISLE 0x401ca0
BOOL FindExistingInstance()
{
HWND hWnd = FindWindow(WNDCLASS_NAME, WINDOW_TITLE);
HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE);
if (hWnd) {
if (SetForegroundWindow(hWnd)) {
ShowWindow(hWnd, SW_RESTORE);
@ -373,14 +373,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned char keyCode = 0;
if (!g_isle) {
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
switch (uMsg) {
case WM_PAINT:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_ACTIVATE:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_ACTIVATEAPP:
if (g_isle) {
if ((wParam != 0) && (g_isle->GetFullScreen())) {
@ -395,7 +395,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
g_isle->SetWindowActive(wParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_CLOSE:
if (!g_closed && g_isle) {
delete g_isle;
@ -403,7 +403,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
g_closed = TRUE;
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_GETMINMAXINFO:
((MINMAXINFO*) lParam)->ptMaxTrackSize.x = (g_windowRect.right - g_windowRect.left) + 1;
((MINMAXINFO*) lParam)->ptMaxTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
@ -411,7 +411,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
((MINMAXINFO*) lParam)->ptMinTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
return 0;
case WM_ENTERMENULOOP:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_SYSCOMMAND:
if (wParam == SC_SCREENSAVE) {
return 0;
@ -421,27 +421,27 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (g_rmDisabled) {
ShowWindow(g_isle->GetWindowHandle(), SW_RESTORE);
}
PostMessage(g_isle->GetWindowHandle(), WM_CLOSE, 0, 0);
PostMessageA(g_isle->GetWindowHandle(), WM_CLOSE, 0, 0);
return 0;
}
}
else if (g_isle && g_isle->GetFullScreen() && (wParam == SC_MOVE || wParam == SC_KEYMENU)) {
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_EXITMENULOOP:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_MOVING:
if (g_isle && g_isle->GetFullScreen()) {
GetWindowRect(hWnd, (LPRECT) lParam);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_NCPAINT:
if (g_isle && g_isle->GetFullScreen()) {
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_DISPLAYCHANGE:
if (g_isle && VideoManager() && g_isle->GetFullScreen() && VideoManager()->GetDirect3D()) {
if (VideoManager()->GetDirect3D()->AssignedDevice()) {
@ -474,12 +474,12 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
}
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_KEYDOWN:
// While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems
// to be what the assembly is actually doing
if (lParam & (KF_REPEAT << 16)) {
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
type = c_notificationKeyPress;
keyCode = wParam;
@ -513,7 +513,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
if (g_isle) {
@ -550,7 +550,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
m_backBuffersInVram,
m_using8bit,
m_using16bit,
m_hasLightSupport,
m_unk0x24,
FALSE,
m_wideViewAngle,
m_deviceId
@ -559,7 +559,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
MxOmni::SetSound3D(m_use3dSound);
srand(timeGetTime() / 1000);
SystemParametersInfo(SPI_SETMOUSETRAILS, 0, NULL, 0);
SystemParametersInfoA(SPI_SETMOUSETRAILS, 0, NULL, 0);
ZeroMemory(&wndclass, sizeof(WNDCLASSA));
@ -567,22 +567,22 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbWndExtra = 0;
wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(APP_ICON));
wndclass.hCursor = m_cursorArrow = m_cursorCurrent = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_ARROW));
m_cursorBusy = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_BUSY));
m_cursorNo = LoadCursor(hInstance, MAKEINTRESOURCE(ISLE_NO));
wndclass.hIcon = LoadIconA(hInstance, MAKEINTRESOURCEA(APP_ICON));
wndclass.hCursor = m_cursorArrow = m_cursorCurrent = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_ARROW));
m_cursorBusy = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_BUSY));
m_cursorNo = LoadCursorA(hInstance, MAKEINTRESOURCEA(ISLE_NO));
wndclass.hInstance = hInstance;
wndclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
wndclass.lpszClassName = WNDCLASS_NAME;
if (!RegisterClass(&wndclass)) {
if (!RegisterClassA(&wndclass)) {
return FAILURE;
}
if (m_fullScreen) {
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
m_windowHandle = CreateWindowEx(
m_windowHandle = CreateWindowExA(
WS_EX_APPWINDOW,
WNDCLASS_NAME,
WINDOW_TITLE,
@ -600,7 +600,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
else {
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
m_windowHandle = CreateWindowEx(
m_windowHandle = CreateWindowExA(
WS_EX_APPWINDOW,
WNDCLASS_NAME,
WINDOW_TITLE,
@ -690,8 +690,8 @@ BOOL IsleApp::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
BOOL out = FALSE;
DWORD size = outSize;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) {
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
out = TRUE;
}

View File

@ -56,7 +56,7 @@ class IsleApp {
BOOL m_backBuffersInVram; // 0x18
BOOL m_using8bit; // 0x1c
BOOL m_using16bit; // 0x20
BOOL m_hasLightSupport; // 0x24
int m_unk0x24; // 0x24
BOOL m_use3dSound; // 0x28
BOOL m_useMusic; // 0x2c
BOOL m_useJoystick; // 0x30

View File

@ -324,6 +324,9 @@
// GLOBAL: ISLE 0x411850
// __cflush
// XGLOBAL ISLE 0x4125f8
// ?_pnhHeap@@3P6AHI@ZA
// GLOBAL: ISLE 0x412888
// ___setlc_active

View File

@ -10,7 +10,6 @@ const char* g_strANIMATION = "ANIMATION";
// GLOBAL: LEGO1 0x10102050
// STRING: LEGO1 0x10102024
// GLOBAL: BETA10 0x102028b4
const char* g_strATTACH_CAMERA = "ATTACH_CAMERA";
// GLOBAL: LEGO1 0x10102054
@ -139,7 +138,6 @@ const char* g_strBMP_ISMAP = "BMP_ISMAP";
// GLOBAL: LEGO1 0x101020e4
// STRING: LEGO1 0x10101eac
// GLOBAL: BETA10 0x10202948
const char* g_parseExtraTokens = ":;";
// GLOBAL: LEGO1 0x100f0c14

View File

@ -14,24 +14,18 @@ class Act2Actor : public LegoAnimActor {
MxFloat m_position[3]; // 0x00
MxFloat m_direction[3]; // 0x0c
const char* m_boundary; // 0x18
MxBool m_cleared; // 0x1c
};
enum VoiceOver {
e_head = 0,
e_behind = 1,
e_interrupt = 2,
MxBool m_unk0x1c; // 0x1c
};
Act2Actor();
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform) override; // vtable+0x24
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
// FUNCTION: LEGO1 0x1001a180
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override
{
if (m_animatingHit) {
if (m_unk0x1f) {
return 0;
}
@ -41,16 +35,16 @@ class Act2Actor : public LegoAnimActor {
void Animate(float p_time) override; // vtable+0x70
MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94
MxResult VTable0x9c() override; // vtable+0x9c
MxS32 NextTargetLocation() override; // vtable+0xa0
MxS32 VTable0xa0() override; // vtable+0xa0
void InitializeNextShot();
void SetWorldSpeed(MxFloat p_speed, MxFloat p_resetWorldSpeedAt);
void GoingToHide();
void Hide();
MxU32 UpdateShot(MxFloat p_time);
void PlayNextVoiceOver(MxS8 p_voiceOverType);
void FindPath(MxU32 p_location);
LegoEntity* GetNextEntity(MxBool* p_isBuilding);
void FUN_10018980();
void FUN_10019250(MxFloat p_speed, MxFloat p_param2);
void FUN_10019520();
void FUN_10019560();
MxU32 FUN_10019700(MxFloat p_param);
void FUN_100199f0(MxS8 p_param);
void FUN_100192a0(undefined4 p_location);
LegoEntity* FUN_10019b90(MxBool* p_param);
// SYNTHETIC: LEGO1 0x1001a0a0
// Act2Actor::`scalar deleting destructor'
@ -60,31 +54,22 @@ class Act2Actor : public LegoAnimActor {
// `vbtable'
private:
enum {
e_readyToShoot = 0,
e_endShot = 1,
e_roaming = 2,
e_createdBrick = 3,
e_goingToHide = 4,
e_hiding = 5,
};
MxBool m_skipAnimation; // 0x1c
MxS8 m_targetLocation; // 0x1d
MxU8 m_state; // 0x1e
MxBool m_animatingHit; // 0x1f
MxFloat m_animationDuration; // 0x20
MxFloat m_createBrickTime; // 0x24
MxS8 m_baseWorldSpeed; // 0x28
MxFloat m_shootAnimEnd; // 0x2c
MxFloat m_entityAnimationTime; // 0x30
LegoAnimActorStruct* m_shootAnim; // 0x34
LegoCacheSound* m_cachedShootSound; // 0x38
undefined4 m_unk0x3c; // 0x3c
MxBool m_initializing; // 0x40
MxFloat m_resetWorldSpeedAt; // 0x44
MxS8 m_visitedLocations; // 0x48
LegoEntity* m_nextEntity; // 0x4c
undefined m_unk0x1c; // 0x1c
MxS8 m_unk0x1d; // 0x1d
undefined m_unk0x1e; // 0x1e
MxBool m_unk0x1f; // 0x1f
MxFloat m_unk0x20; // 0x20
MxFloat m_unk0x24; // 0x24
MxS8 m_unk0x28; // 0x28
MxFloat m_unk0x2c; // 0x2c
MxFloat m_unk0x30; // 0x30
LegoAnimActorStruct* m_shootAnim; // 0x34
LegoCacheSound* m_unk0x38; // 0x38
undefined4 m_unk0x3c; // 0x3c
undefined m_unk0x40; // 0x40
MxFloat m_unk0x44; // 0x44
MxS8 m_unk0x48; // 0x48
LegoEntity* m_unk0x4c; // 0x4c
};
// TEMPLATE: LEGO1 0x100194f0

View File

@ -8,13 +8,6 @@
// SIZE 0x194
class Act2Brick : public LegoPathActor {
public:
enum {
e_removed = 0,
e_created = 1,
e_placed = 2,
e_atRest = 3,
};
Act2Brick();
~Act2Brick() override; // vtable+0x00
@ -42,7 +35,7 @@ class Act2Brick : public LegoPathActor {
MxResult Create(MxS32 p_index);
void Remove();
void Place(MxMatrix& p_localToWorld, MxMatrix& p_endLocalToWorld, LegoPathBoundary* p_boundary);
void FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBoundary* p_boundary);
void PlayWhistleSound();
void StopWhistleSound();
void Mute(MxBool p_muted);
@ -51,12 +44,12 @@ class Act2Brick : public LegoPathActor {
static const LegoChar* g_lodNames[];
static MxLong g_lastHitActorTime;
LegoCacheSound* m_whistleSound; // 0x154
undefined m_unk0x158[0x0c]; // 0x158
MxU32 m_state; // 0x164
Mx3DPointFloat m_localToWorldMovementStep; // 0x168
Mx3DPointFloat m_endLocalToWorld; // 0x17c
MxS32 m_step; // 0x190
LegoCacheSound* m_whistleSound; // 0x154
undefined m_unk0x158[0x0c]; // 0x158
undefined4 m_unk0x164; // 0x164
Mx3DPointFloat m_unk0x168; // 0x168
Mx3DPointFloat m_unk0x17c; // 0x17c
MxS32 m_unk0x190; // 0x190
};
#endif // ACT2BRICK_H

View File

@ -18,20 +18,14 @@ class MxQuaternionTransformer;
// SIZE 0x0c
struct Act3ListElement {
enum InsertMode {
e_replaceAction = 1,
e_queueAction = 2,
e_onlyIfEmpty = 3
};
MxU32 m_objectId; // 0x00
InsertMode m_insertMode; // 0x04
MxBool m_hasStarted; // 0x08
MxU32 m_objectId; // 0x00
undefined4 m_unk0x04; // 0x04
undefined m_unk0x08; // 0x08
Act3ListElement() {}
Act3ListElement(MxU32 p_objectId, InsertMode p_insertMode, MxBool p_hasStarted)
: m_objectId(p_objectId), m_insertMode(p_insertMode), m_hasStarted(p_hasStarted)
Act3ListElement(MxU32 p_objectId, undefined4 p_unk0x04, undefined p_unk0x08)
: m_objectId(p_objectId), m_unk0x04(p_unk0x04), m_unk0x08(p_unk0x08)
{
}
@ -42,15 +36,15 @@ struct Act3ListElement {
// SIZE 0x10
class Act3List : private list<Act3ListElement> {
public:
Act3List() { m_cleared = FALSE; }
Act3List() { m_unk0x0c = 0; }
void Insert(MxS32 p_objectId, Act3ListElement::InsertMode p_option);
void DeleteActionWrapper();
void Insert(MxS32 p_objectId, MxS32 p_option);
void FUN_10071fa0();
void Clear();
void RemoveByObjectIdOrFirst(MxU32 p_objectId);
void FUN_100720d0(MxU32 p_objectId);
private:
MxU32 m_cleared; // 0x0c
undefined4 m_unk0x0c; // 0x0c
};
// VTABLE: LEGO1 0x100d4fc8
@ -58,14 +52,7 @@ class Act3List : private list<Act3ListElement> {
// SIZE 0x0c
class Act3State : public LegoState {
public:
enum {
e_initial = 0,
e_ready = 1,
e_goodEnding = 2,
e_badEnding = 3,
};
Act3State() { m_state = Act3State::e_initial; }
Act3State() { m_unk0x08 = 0; }
// FUNCTION: LEGO1 0x1000e2f0
MxBool IsSerializable() override { return FALSE; }
@ -87,11 +74,11 @@ class Act3State : public LegoState {
// SYNTHETIC: LEGO1 0x1000e3c0
// Act3State::`scalar deleting destructor'
MxU32 GetState() { return m_state; }
undefined4 GetUnknown0x08() { return m_unk0x08; }
// TODO: Most likely getters/setters are not used according to BETA.
MxU32 m_state; // 0x08
undefined4 m_unk0x08; // 0x08
};
// VTABLE: LEGO1 0x100d9628
@ -106,7 +93,7 @@ class Act3 : public LegoWorld {
MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x10072500
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x10072510
// FUNCTION: BETA10 0x10017550
@ -142,7 +129,7 @@ class Act3 : public LegoWorld {
void RemoveDonut(Act3Ammo& p_p);
MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
void TriggerHitSound(undefined4 p_param1);
void FUN_10072ad0(undefined4 p_param1);
MxResult FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2);
MxResult FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2);
void SetBrickster(Act3Brickster* p_brickster);
@ -181,12 +168,12 @@ class Act3 : public LegoWorld {
Helicopter* m_copter; // 0x420c
Act3Shark* m_shark; // 0x4210
MxFloat m_time; // 0x4214
MxU8 m_pizzaHitSound; // 0x4218
MxU8 m_pizzaMissSound; // 0x4219
MxU8 m_copDonutSound; // 0x421a
MxU8 m_donutMissSound; // 0x421b
MxU8 m_islanderSound; // 0x421c
MxU8 m_bricksterDonutSound; // 0x421d
MxU8 m_unk0x4218; // 0x4218
MxU8 m_unk0x4219; // 0x4219
MxU8 m_unk0x421a; // 0x421a
MxU8 m_unk0x421b; // 0x421b
MxU8 m_unk0x421c; // 0x421c
MxU8 m_unk0x421d; // 0x421d
undefined m_unk0x421e; // 0x421e
Act3List m_unk0x4220; // 0x4220
MxPresenter* m_helicopterDots[15]; // 0x4230

View File

@ -140,7 +140,7 @@ class Act3Brickster : public Act3Actor {
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary(
LegoPathBoundary*& p_boundary,
LegoOrientedEdge*& p_edge,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
) override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c

View File

@ -14,7 +14,7 @@ class Act3Ammo : public LegoPathActor {
c_pizza = 0x01,
c_donut = 0x02,
c_valid = 0x04,
c_withoutBoundary = 0x08,
c_bit4 = 0x08,
c_sharkFood = 0x10
};
@ -28,10 +28,10 @@ class Act3Ammo : public LegoPathActor {
MxU32 IsValid() { return m_ammoFlag & c_valid; }
// FUNCTION: BETA10 0x100177b0
Mx3DPointFloat* GetCoefficients() { return m_coefficients; }
Mx3DPointFloat* GetUnknown0x160() { return m_eq; }
// FUNCTION: BETA10 0x100177e0
MxFloat* GetApexParameter() { return &m_apexParameter; }
MxFloat* GetUnknown0x19c() { return &m_unk0x19c; }
// FUNCTION: BETA10 0x1001fbd0
void SetValid(MxBool p_valid)
@ -51,18 +51,18 @@ class Act3Ammo : public LegoPathActor {
MxU32 IsDonut() { return m_ammoFlag & c_donut; }
// FUNCTION: BETA10 0x1001fcb0
void SetShootWithoutBoundary(MxBool p_withoutBoundary)
void SetBit4(MxBool p_bit4)
{
if (p_withoutBoundary) {
m_ammoFlag |= c_withoutBoundary;
if (p_bit4) {
m_ammoFlag |= c_bit4;
}
else {
m_ammoFlag &= ~c_withoutBoundary;
m_ammoFlag &= ~c_bit4;
}
}
// FUNCTION: BETA10 0x10021d90
MxU32 IsShootWithoutBoundary() { return m_ammoFlag & c_withoutBoundary; }
MxU32 IsBit4() { return m_ammoFlag & c_bit4; }
void SetSharkFood(MxBool p_sharkFood)
{
@ -76,29 +76,29 @@ class Act3Ammo : public LegoPathActor {
MxU32 IsSharkFood() { return m_ammoFlag & c_sharkFood; }
MxFloat GetRotateTimeout() { return m_rotateTimeout; }
MxFloat GetUnknown0x158() { return m_unk0x158; }
void SetRotateTimeout(MxFloat p_rotateTimeout) { m_rotateTimeout = p_rotateTimeout; }
void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; }
MxResult Remove();
MxResult Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index);
MxResult CalculateArc(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp);
MxResult Shoot(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_apexParameter);
MxResult Shoot(LegoPathController* p_p, MxFloat p_apexParameter);
MxResult FUN_10053b40(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp);
MxResult FUN_10053cb0(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_unk0x19c);
MxResult FUN_10053d30(LegoPathController* p_p, MxFloat p_unk0x19c);
// SYNTHETIC: LEGO1 0x10053880
// Act3Ammo::`scalar deleting destructor'
private:
MxResult CalculateTransform(float p_curveParameter, Matrix4& p_transform);
MxResult FUN_10053db0(float p_param1, const Matrix4& p_param2);
static Mx3DPointFloat g_hitTranslation;
static Mx3DPointFloat g_unk0x10104f08;
MxU16 m_ammoFlag; // 0x154
MxFloat m_rotateTimeout; // 0x158
Act3* m_world; // 0x15c
Mx3DPointFloat m_coefficients[3]; // 0x160
MxFloat m_apexParameter; // 0x19c
MxU16 m_ammoFlag; // 0x154
MxFloat m_unk0x158; // 0x158
Act3* m_world; // 0x15c
Mx3DPointFloat m_eq[3]; // 0x160
MxFloat m_unk0x19c; // 0x19c
};
#endif // ACT3AMMO_H

View File

@ -11,12 +11,6 @@ class MxEndActionNotificationParam;
// SIZE 0x24
class AmbulanceMissionState : public LegoState {
public:
enum {
e_ready = 0,
e_enteredAmbulance = 1,
e_prepareAmbulance = 2,
};
AmbulanceMissionState();
// FUNCTION: LEGO1 0x10037440
@ -131,18 +125,18 @@ class AmbulanceMissionState : public LegoState {
// SYNTHETIC: LEGO1 0x100376c0
// AmbulanceMissionState::`scalar deleting destructor'
MxU32 m_state; // 0x08
MxLong m_startTime; // 0x0c
MxS16 m_peScore; // 0x10
MxS16 m_maScore; // 0x12
MxS16 m_paScore; // 0x14
MxS16 m_niScore; // 0x16
MxS16 m_laScore; // 0x18
MxS16 m_peHighScore; // 0x1a
MxS16 m_maHighScore; // 0x1c
MxS16 m_paHighScore; // 0x1e
MxS16 m_niHighScore; // 0x20
MxS16 m_laHighScore; // 0x22
undefined4 m_unk0x08; // 0x08
MxLong m_startTime; // 0x0c
MxS16 m_peScore; // 0x10
MxS16 m_maScore; // 0x12
MxS16 m_paScore; // 0x14
MxS16 m_niScore; // 0x16
MxS16 m_laScore; // 0x18
MxS16 m_peHighScore; // 0x1a
MxS16 m_maHighScore; // 0x1c
MxS16 m_paHighScore; // 0x1e
MxS16 m_niHighScore; // 0x20
MxS16 m_laHighScore; // 0x22
};
// VTABLE: LEGO1 0x100d71a8
@ -183,21 +177,15 @@ class Ambulance : public IslePathActor {
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
void CreateState();
void Init();
void FUN_10036e60();
void ActivateSceneActions();
void StopActions();
void Reset();
void FUN_10037250();
// SYNTHETIC: LEGO1 0x10036130
// Ambulance::`scalar deleting destructor'
private:
enum {
e_none = 0,
e_waiting = 1,
e_finished = 3,
};
void PlayAnimation(IsleScript::Script p_objectId);
void PlayFinalAnimation(IsleScript::Script p_objectId);
void StopAction(IsleScript::Script p_objectId);
@ -208,10 +196,10 @@ class Ambulance : public IslePathActor {
AmbulanceMissionState* m_state; // 0x164
MxS16 m_unk0x168; // 0x168
MxS16 m_actorId; // 0x16a
MxS16 m_atPoliceTask; // 0x16c
MxS16 m_atBeachTask; // 0x16e
MxS16 m_taskState; // 0x170
MxS16 m_enableRandomAudio; // 0x172
MxS16 m_unk0x16c; // 0x16c
MxS16 m_unk0x16e; // 0x16e
MxS16 m_unk0x170; // 0x170
MxS16 m_unk0x172; // 0x172
IsleScript::Script m_lastAction; // 0x174
IsleScript::Script m_lastAnimation; // 0x178
MxFloat m_fuel; // 0x17c

View File

@ -52,13 +52,13 @@ class CarRace : public LegoRace {
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
// FUNCTION: BETA10 0x100cd060
RaceSkel* GetSkeleton() { return m_skeleton; }
@ -66,22 +66,22 @@ class CarRace : public LegoRace {
// FUNCTION: BETA10 0x100f16f0
void SetSkeleton(RaceSkel* p_skeleton) { m_skeleton = p_skeleton; }
void SetProgressPosition(MxS32 p_actorId, MxS16 p_progress);
void FUN_10017820(MxS32 p_param1, MxS16 p_param2);
// SYNTHETIC: LEGO1 0x10016c70
// CarRace::`scalar deleting destructor'
private:
static MxS32 g_introAnimations[];
static MxS32 g_studsWinsAnimations[];
static MxS32 g_studsLoosesAnimation[];
static MxS32 g_rhodaWinsAnimations[];
static MxS32 g_rhodaLoosesAnimation[];
static MxS32 g_unk0x100d5d10[];
static MxS32 g_unk0x100d5d30[];
static MxS32 g_unk0x100d5d40[];
static MxS32 g_unk0x100d5d50[];
static MxS32 g_unk0x100d5d60[];
MxS32 m_introAnimation; // 0x144
MxS32 m_firstFinishAnimation; // 0x148
MxS32 m_secondFinishAnimation; // 0x14c
RaceSkel* m_skeleton; // 0x150
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
MxS32 m_unk0x14c; // 0x14c
RaceSkel* m_skeleton; // 0x150
};
#endif // CARRACE_H

View File

@ -10,7 +10,7 @@ class LegoROI;
// SIZE 0x1f8
class Doors : public LegoPathActor {
public:
Doors() : m_state(0), m_ltDoor(NULL), m_rtDoor(NULL), m_angle(0) {}
Doors() : m_unk0x154(0), m_ltDoor(NULL), m_rtDoor(NULL), m_unk0x1f4(0) {}
// FUNCTION: LEGO1 0x1000e430
// FUNCTION: BETA10 0x100a7f20
@ -29,25 +29,19 @@ class Doors : public LegoPathActor {
void ParseAction(char* p_extra) override; // vtable+0x20
void Animate(float p_time) override; // vtable+0x70
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
virtual MxFloat CalculateAngle(float p_time); // vtable+0xcc
virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc
// SYNTHETIC: LEGO1 0x1000e580
// Doors::`scalar deleting destructor'
private:
enum {
e_none = 0,
e_closed = 1,
e_cycling = 2,
};
undefined4 m_state; // 0x154
MxFloat m_hitTime; // 0x158
LegoROI* m_ltDoor; // 0x15c
LegoROI* m_rtDoor; // 0x160
MxMatrix m_ltDoorOriginalLocal; // 0x164
MxMatrix m_rtDoorOriginalLocal; // 0x1ac
MxFloat m_angle; // 0x1f4
undefined4 m_unk0x154; // 0x154
MxFloat m_unk0x158; // 0x158
LegoROI* m_ltDoor; // 0x15c
LegoROI* m_rtDoor; // 0x160
MxMatrix m_ltDoorLocal; // 0x164
MxMatrix m_rtDoorLocal; // 0x1ac
MxFloat m_unk0x1f4; // 0x1f4
};
#endif // DOORS_H

View File

@ -18,7 +18,7 @@ class ElevatorBottom : public LegoWorld {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x10017f10
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x10017f20
// FUNCTION: BETA10 0x10028130

View File

@ -14,19 +14,6 @@ class MxStillPresenter;
// SIZE 0x24
class GasStationState : public LegoState {
public:
enum {
e_unknown0 = 0,
e_newState = 1,
e_beforeExitingForQuest = 2,
e_unknown3 = 3,
e_unknown4 = 4,
e_introduction = 5,
e_explainQuest = 6,
e_waitAcceptingQuest = 7,
e_afterAcceptingQuest = 8,
e_cancelQuest = 9,
};
GasStationState();
// FUNCTION: LEGO1 0x100061d0
@ -55,7 +42,7 @@ class GasStationState : public LegoState {
// TODO: Most likely getters/setters are not used according to BETA.
GarageScript::Script m_actions[3]; // 0x08
MxS32 m_state; // 0x14
undefined4 m_unk0x14; // 0x14
MxS16 m_pepperAction; // 0x18
MxS16 m_mamaAction; // 0x1a
MxS16 m_papaAction; // 0x1c
@ -75,7 +62,7 @@ class GasStation : public LegoWorld {
MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x10004770
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x10004780
// FUNCTION: BETA10 0x10029d40
@ -101,13 +88,6 @@ class GasStation : public LegoWorld {
// GasStation::`scalar deleting destructor'
private:
enum {
e_finished = 0,
e_start = 1,
e_started = 2,
e_canceled = 3,
};
inline void PlayAction(GarageScript::Script p_objectId);
inline void StopAction(GarageScript::Script p_objectId);
@ -119,13 +99,13 @@ class GasStation : public LegoWorld {
undefined2 m_unk0xfa; // 0xfa
LegoGameState::Area m_destLocation; // 0xfc
GasStationState* m_state; // 0x100
MxS16 m_waitingState; // 0x104
MxS16 m_setWithCurrentAction; // 0x106
undefined2 m_unk0x104; // 0x104
undefined2 m_unk0x106; // 0x106
MxStillPresenter* m_trackLedBitmap; // 0x108
MxLong m_lastIdleAnimation; // 0x10c
MxLong m_unk0x10c; // 0x10c
MxLong m_trackLedTimer; // 0x110
MxBool m_waiting; // 0x114
MxBool m_flashingLeds; // 0x115
MxBool m_unk0x114; // 0x114
MxBool m_unk0x115; // 0x115
Radio m_radio; // 0x118
};

View File

@ -16,24 +16,6 @@ class MxStillPresenter;
// SIZE 0x18
class HospitalState : public LegoState {
public:
enum {
e_exitToClose = 0,
e_newState = 1,
e_unknown3 = 3,
e_unknown4 = 4,
e_introduction = 5,
e_explainQuestShort = 6,
e_explainQuest = 7,
e_waitAcceptingQuest = 8,
e_beforeEnteringAmbulance = 9,
e_unknown10 = 10, // Can never be reached
e_unknown11 = 11, // Can only be reached via e_unknown10
e_afterAcceptingQuest = 12,
e_exitImmediately = 13,
e_exitToInfocenter = 14,
e_exitToFront = 15,
};
HospitalState();
~HospitalState() override {}
@ -58,13 +40,13 @@ class HospitalState : public LegoState {
// TODO: Most likely getters/setters are not used according to BETA.
MxS32 m_state; // 0x08
MxS16 m_stateActor; // 0x0c
MxS16 m_statePepper; // 0x0e
MxS16 m_stateMama; // 0x10
MxS16 m_statePapa; // 0x12
MxS16 m_stateNick; // 0x14
MxS16 m_stateLaura; // 0x16
undefined4 m_unk0x08; // 0x08
MxS16 m_unk0x0c; // 0x0c
MxS16 m_unk0x0e; // 0x0e
MxS16 m_unk0x10; // 0x10
MxS16 m_unk0x12; // 0x12
MxS16 m_unk0x14; // 0x14
MxS16 m_unk0x16; // 0x16
};
// VTABLE: LEGO1 0x100d9730
@ -79,7 +61,7 @@ class Hospital : public LegoWorld {
MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x100746a0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x100746b0
// FUNCTION: BETA10 0x1002e1a0
@ -113,17 +95,17 @@ class Hospital : public LegoWorld {
MxS16 m_currentActorId; // 0xf8
LegoGameState::Area m_destLocation; // 0xfc
MxU16 m_interactionMode; // 0x100
undefined2 m_unk0x100; // 0x100
HospitalState* m_hospitalState; // 0x104
MxU16 m_setWithCurrentAction; // 0x108
undefined2 m_unk0x108; // 0x108
HospitalScript::Script m_currentAction; // 0x10c
MxStillPresenter* m_copLedBitmap; // 0x110
MxStillPresenter* m_pizzaLedBitmap; // 0x114
MxBool m_flashingLeds; // 0x118
undefined m_unk0x118; // 0x118
MxLong m_copLedAnimTimer; // 0x11c
MxLong m_pizzaLedAnimTimer; // 0x120
MxLong m_time; // 0x124
MxBool m_exited; // 0x128
undefined m_unk0x128; // 0x128
};
#endif // HOSPITAL_H

View File

@ -6,7 +6,7 @@
#include "legostate.h"
#include "legoworld.h"
#include "misc.h"
#include "mxgeometry.h"
#include "mxrect32.h"
#include "radio.h"
class MxNotificationParam;
@ -18,25 +18,6 @@ class LegoControlManagerNotificationParam;
// SIZE 0x94
class InfocenterState : public LegoState {
public:
enum {
e_playCutscene = 0,
e_introCancelled = 1,
e_notRegistered = 2,
e_newState = 3,
e_selectedSave = 4,
e_selectedCharacterAndDestination = 5,
// e_6 = 6,
// e_7 = 7,
e_exitQueried = 8,
// e_9 = 9,
// e_10 = 10,
e_welcomeAnimation = 11,
e_exiting = 12,
e_playCredits = 13,
e_exitingToIsland = 14,
e_backToInfoAct1 = 15,
};
InfocenterState();
~InfocenterState() override;
@ -91,27 +72,17 @@ class InfocenterState : public LegoState {
Playlist m_returnDialogue[3]; // 0x20
Playlist m_leaveDialogue[3]; // 0x44
Playlist m_bricksterDialogue; // 0x68
MxU32 m_state; // 0x74
MxU32 m_unk0x74; // 0x74
MxStillPresenter* m_letters[7]; // 0x78
};
// SIZE 0x18
struct InfocenterMapEntry {
enum {
e_infocenter = 3,
e_jetrace = 10,
e_carrace = 11,
e_pizzeria = 12,
e_garage = 13,
e_hospital = 14,
e_police = 15,
};
InfocenterMapEntry();
MxStillPresenter* m_destCtl; // 0x00
MxU32 m_target; // 0x04
MxRect<MxS32> m_area; // 0x08
undefined4 m_unk0x04; // 0x04
MxRect32 m_area; // 0x08
};
// VTABLE: LEGO1 0x100d9338
@ -119,6 +90,25 @@ struct InfocenterMapEntry {
// SIZE 0x1d8
class Infocenter : public LegoWorld {
public:
enum Cutscene {
e_noIntro = -1,
e_legoMovie,
e_mindscapeMovie,
e_introMovie,
e_outroMovie,
e_badEndMovie,
e_goodEndMovie
};
enum Character {
e_noCharacter = 0,
e_pepper,
e_mama,
e_papa,
e_nick,
e_laura
};
Infocenter();
~Infocenter() override;
@ -141,7 +131,7 @@ class Infocenter : public LegoWorld {
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool WaitForTransition() override; // vtable+0x5c
MxBool VTable0x5c() override; // vtable+0x5c
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
@ -161,10 +151,10 @@ class Infocenter : public LegoWorld {
void UpdateFrameHot(MxBool p_display);
void Reset();
void PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale);
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void StopCutscene();
void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y);
void FUN_10070d10(MxS32 p_x, MxS32 p_y);
void StartCredits();
void StopCredits();
@ -179,16 +169,16 @@ class Infocenter : public LegoWorld {
MxS16 m_selectedCharacter; // 0xfc
InfocenterState* m_infocenterState; // 0x100
LegoGameState::Area m_destLocation; // 0x104
IntroScript::Script m_currentCutscene; // 0x108
Cutscene m_currentCutscene; // 0x108
Radio m_radio; // 0x10c
MxStillPresenter* m_dragPresenter; // 0x11c
InfocenterMapEntry m_glowInfo[7]; // 0x120
MxS16 m_enabledGlowControl; // 0x1c8
MxS16 m_unk0x1c8; // 0x1c8
MxStillPresenter* m_frame; // 0x1cc
MxS16 m_infoManDialogueTimer; // 0x1d0
MxS16 m_bookAnimationTimer; // 0x1d2
MxU16 m_playingMovieCounter; // 0x1d4
MxS16 m_bigInfoBlinkTimer; // 0x1d6
MxU16 m_unk0x1d4; // 0x1d4
MxS16 m_unk0x1d6; // 0x1d6
};
#endif // INFOCENTER_H

View File

@ -17,7 +17,7 @@ class InfocenterDoor : public LegoWorld {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x100377a0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x100377b0
// FUNCTION: BETA10 0x10032790

View File

@ -34,21 +34,6 @@ class Act1State : public LegoState {
c_floor3
};
enum {
e_none = 0,
e_initial = 1,
e_elevator = 2,
e_pizza = 3,
e_helicopter = 4,
e_transitionToJetski = 5,
e_transitionToRacecar = 6,
e_transitionToTowtrack = 7,
e_towtrack = 8,
e_transitionToAmbulance = 9,
e_ambulance = 10,
e_jukebox = 11,
};
Act1State();
// FUNCTION: LEGO1 0x100338a0
@ -73,13 +58,13 @@ class Act1State : public LegoState {
void RemoveActors();
void PlaceActors();
MxU32 GetState() { return m_state; }
MxU32 GetUnknown18() { return m_unk0x018; }
ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; }
MxBool IsSpawnInInfocenter() { return m_spawnInInfocenter; }
MxU8 GetUnknown21() { return m_unk0x021; }
void SetState(MxU32 p_state) { m_state = p_state; }
void SetUnknown18(MxU32 p_unk0x18) { m_unk0x018 = p_unk0x18; }
void SetElevatorFloor(ElevatorFloor p_elevFloor) { m_elevFloor = p_elevFloor; }
void SetSpawnInInfocenter(MxBool p_spawnInInfocenter) { m_spawnInInfocenter = p_spawnInInfocenter; }
void SetUnknown21(MxU8 p_unk0x21) { m_unk0x021 = p_unk0x21; }
// SYNTHETIC: LEGO1 0x10033960
// Act1State::`scalar deleting destructor'
@ -88,13 +73,13 @@ class Act1State : public LegoState {
Playlist m_cptClickDialogue; // 0x008
IsleScript::Script m_currentCptClickDialogue; // 0x014
MxU32 m_state; // 0x018
MxU32 m_unk0x018; // 0x018
MxS16 m_elevFloor; // 0x01c
MxBool m_playingFloor2Animation; // 0x01e
MxBool m_switchedToArea; // 0x01f
MxBool m_unk0x01e; // 0x01e
MxBool m_unk0x01f; // 0x01f
MxBool m_planeActive; // 0x020
MxBool m_spawnInInfocenter; // 0x021
MxBool m_playedExitExplanation; // 0x022
undefined m_unk0x021; // 0x021
MxBool m_unk0x022; // 0x022
undefined m_unk0x023; // 0x023
LegoNamedPlane m_motocyclePlane; // 0x024
LegoNamedPlane m_bikePlane; // 0x070
@ -134,7 +119,7 @@ class Isle : public LegoWorld {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x10030900
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x10030910
// FUNCTION: BETA10 0x10035d70
@ -150,18 +135,18 @@ class Isle : public LegoWorld {
return !strcmp(p_name, Isle::ClassName()) || LegoWorld::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
void Add(MxCore* p_object) override; // vtable+0x58
void VTable0x60() override; // vtable+0x60
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual void RemoveVehicle(LegoPathActor* p_actor); // vtable+0x6c
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
void Add(MxCore* p_object) override; // vtable+0x58
void VTable0x60() override; // vtable+0x60
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual void VTable0x6c(LegoPathActor* p_actor); // vtable+0x6c
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
MxBool HasHelicopter() { return m_helicopter != NULL; }
void SwitchToInfocenter();
void FUN_10033350();
friend class Act1State;
@ -175,13 +160,13 @@ class Isle : public LegoWorld {
MxLong HandleTransitionEnd();
void HandleElevatorEndAction();
void UpdateGlobe();
void CheckAreaExiting();
void FUN_10032620();
void CreateState();
void TransitionToOverlay(
void FUN_10032d30(
IsleScript::Script p_script,
JukeboxScript::Script p_music,
const char* p_cameraLocation,
MxBool p_setCamera
MxBool p_und
);
Act1State* m_act1state; // 0xf8

View File

@ -35,7 +35,7 @@ class Jetski : public IslePathActor {
void ActivateSceneActions();
MxS16 GetJetskiDashboardStreamId() { return m_jetskiDashboardStreamId; }
MxS16 GetUnknown0x160() { return m_jetskiDashboardStreamId; }
// SYNTHETIC: LEGO1 0x1007e5c0
// Jetski::`scalar deleting destructor'

View File

@ -29,17 +29,17 @@ class JetskiRace : public LegoRace {
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
void SetProgressPosition(MxS32 p_actorId, MxS16 p_progress);
void FUN_10016930(MxS32 p_param1, MxS16 p_param2);
private:
static MxS32 g_lapsCount;
static MxS32 g_unk0x100f0c78;
};
// VTABLE: LEGO1 0x100d4fa8

View File

@ -60,7 +60,7 @@ class JukeBox : public LegoWorld {
MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x1005d6e0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x1005d6f0
// FUNCTION: BETA10 0x100388d0

View File

@ -15,13 +15,9 @@ class MxEndActionNotificationParam;
// SIZE 0x10
class LegoAct2State : public LegoState {
public:
enum {
c_badEnding = 104
};
LegoAct2State()
{
m_state = 0;
m_unk0x08 = 0;
m_enabled = FALSE;
}
~LegoAct2State() override {}
@ -47,14 +43,14 @@ class LegoAct2State : public LegoState {
// LegoAct2State::`scalar deleting destructor'
// FUNCTION: BETA10 0x100151b0
void SetState(MxU32 p_state) { m_state = p_state; }
void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; }
MxU32 GetState() { return m_state; }
undefined4 GetUnknown0x08() { return m_unk0x08; }
// TODO: Most likely getters/setters are not used according to BETA. (?)
MxU32 m_state; // 0x08
MxBool m_enabled; // 0x0c
undefined4 m_unk0x08; // 0x08
MxBool m_enabled; // 0x0c
};
// VTABLE: LEGO1 0x100d82e0
@ -71,7 +67,7 @@ class LegoAct2 : public LegoWorld {
void ReadyWorld() override; // vtable+0x50
// FUNCTION: LEGO1 0x1004fe10
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
void VTable0x60() override; // vtable+0x60
MxBool Escape() override; // vtable+0x64
@ -80,10 +76,10 @@ class LegoAct2 : public LegoWorld {
void SetUnknown0x1138(Act2Actor* p_unk0x1138) { m_unk0x1138 = p_unk0x1138; }
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
MxResult CreateBrick();
MxResult FUN_100516b0();
void FUN_100517b0();
MxResult BadEnding();
MxResult StartAction(
MxResult FUN_10052560(
Act2mainScript::Script p_objectId,
MxBool p_param2,
MxBool p_param3,
@ -96,65 +92,48 @@ class LegoAct2 : public LegoWorld {
// LegoAct2::`scalar deleting destructor'
private:
enum {
e_initial = 0,
e_startSpeech = 1,
e_holdingSpeech = 2,
e_startDescription = 3,
e_explaining = 4,
e_goingToResidentialArea = 5,
e_atResidentialArea = 6,
e_chase = 7,
e_droppingBrick = 9,
e_goingToHide = 10,
e_hidden = 11,
e_distributeRemainingBricks = 12,
e_brickHunt = 13,
e_allPiecesCollected = 14,
};
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleTransitionEnd();
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param);
void PlayMusic(JukeboxScript::Script p_objectId);
void FUN_10051900();
void HideMaPaInfo();
void FUN_10051960();
void InitBricks();
void UninitBricks();
void SpawnBricks();
void CheckBricksterDestroying(MxS32 p_pathData);
void CheckBricksterIsLoose(MxS32 p_pathData);
MxResult InitializeShooting();
void FUN_10051fa0(MxS32 p_param1);
void FUN_100521f0(MxS32 p_param1);
MxResult FUN_10052800();
Act2Brick m_bricks[10]; // 0x00f8
MxU8 m_nextBrick; // 0x10c0
MxU8 m_removedBricks; // 0x10c1
undefined m_unk0x10c1; // 0x10c1
MxBool m_ready; // 0x10c2
undefined4 m_state; // 0x10c4
undefined4 m_unk0x10c4; // 0x10c4
JukeboxScript::Script m_music; // 0x10c8
LegoAct2State* m_gameState; // 0x10cc
MxS32 m_timeSinceLastStage; // 0x10d0
MxS32 m_unk0x10d0; // 0x10d0
// variable name verified by BETA10 0x10014633
const char* m_siFile; // 0x10d4
LegoROI* m_pepper; // 0x10d8
MxMatrix m_transformOnDisable; // 0x10dc
LegoPathBoundary* m_boundaryOnDisable; // 0x1124
LegoROI* m_ambulance; // 0x1128
undefined4 m_unk0x112c; // 0x112c
undefined4 m_unk0x1130; // 0x1130
undefined4 m_unk0x1134; // 0x1134
Act2Actor* m_unk0x1138; // 0x1138
undefined m_unk0x113c; // 0x113c
Act2mainScript::Script m_currentAction; // 0x1140
Act2mainScript::Script m_infomanDirecting; // 0x1144
undefined4 m_unk0x1148; // 0x1148
undefined m_firstBrick; // 0x114c
undefined m_secondBrick; // 0x114d
undefined m_thirdBrick; // 0x114e
undefined m_fourthBrick; // 0x114e
LegoGameState::Area m_destLocation; // 0x1150
LegoROI* m_pepper; // 0x10d8
MxMatrix m_unk0x10dc; // 0x10dc
LegoPathBoundary* m_unk0x1124; // 0x1124
LegoROI* m_ambulance; // 0x1128
undefined4 m_unk0x112c; // 0x112c
undefined4 m_unk0x1130; // 0x1130
undefined4 m_unk0x1134; // 0x1134
Act2Actor* m_unk0x1138; // 0x1138
undefined m_unk0x113c; // 0x113c
Act2mainScript::Script m_unk0x1140; // 0x1140
Act2mainScript::Script m_unk0x1144; // 0x1144
undefined4 m_unk0x1148; // 0x1148
undefined m_firstBrick; // 0x114c
undefined m_secondBrick; // 0x114d
undefined m_thirdBrick; // 0x114e
undefined m_fourthBrick; // 0x114e
LegoGameState::Area m_destLocation; // 0x1150
};
#endif // LEGOACT2_H

View File

@ -34,40 +34,34 @@ class LegoActor : public LegoEntity {
}
// FUNCTION: LEGO1 0x1002d220
// FUNCTION: BETA10 0x10012530
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, LegoActor::ClassName()) || LegoEntity::IsA(p_name);
}
void ParseAction(char* p_extra) override; // vtable+0x20
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform) override; // vtable+0x24
void ParseAction(char* p_extra) override; // vtable+0x20
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
// FUNCTION: LEGO1 0x10002cc0
// FUNCTION: BETA10 0x1000f3e0
virtual MxFloat GetSoundFrequencyFactor() { return m_frequencyFactor; } // vtable+0x50
// FUNCTION: LEGO1 0x10002cd0
// FUNCTION: BETA10 0x1000f410
virtual void SetSoundFrequencyFactor(MxFloat p_frequencyFactor)
{
m_frequencyFactor = p_frequencyFactor;
} // vtable+0x54
// FUNCTION: LEGO1 0x10002ce0
// FUNCTION: BETA10 0x1000f440
virtual void SetLastPathStruct(MxFloat p_lastPathStruct) { m_lastPathStruct = p_lastPathStruct; } // vtable+0x58
virtual void VTable0x58(MxFloat p_unk0x70) { m_unk0x70 = p_unk0x70; } // vtable+0x58
// FUNCTION: LEGO1 0x10002cf0
// FUNCTION: BETA10 0x1000f470
virtual MxFloat GetLastPathStruct() { return m_lastPathStruct; } // vtable+0x5c
virtual MxFloat VTable0x5c() { return m_unk0x70; } // vtable+0x5c
// FUNCTION: LEGO1 0x10002d00
// FUNCTION: BETA10 0x1000f4a0
virtual MxU8 GetActorId() { return m_actorId; } // vtable+0x60
// FUNCTION: LEGO1 0x10002d10
// FUNCTION: BETA10 0x1000f4d0
virtual void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; } // vtable+0x64
static const char* GetActorName(MxU8 p_id);
@ -77,12 +71,11 @@ class LegoActor : public LegoEntity {
protected:
MxFloat m_frequencyFactor; // 0x68
LegoCacheSound* m_sound; // 0x6c
MxFloat m_lastPathStruct; // 0x70
MxFloat m_unk0x70; // 0x70
MxU8 m_actorId; // 0x74
};
// SYNTHETIC: LEGO1 0x1002d300
// SYNTHETIC: BETA10 0x1003d900
// LegoActor::`scalar deleting destructor'
#endif // LEGOACTOR_H

View File

@ -11,12 +11,12 @@ class LegoROI;
struct LegoActorInfo {
// SIZE 0x18
struct Part {
MxU8* m_partNameIndices; // 0x00
const char** m_partName; // 0x04
MxU8 m_partNameIndex; // 0x08
MxU8* m_nameIndices; // 0x0c
const char** m_names; // 0x10
MxU8 m_nameIndex; // 0x14
MxU8* m_unk0x00; // 0x00
const char** m_unk0x04; // 0x04
MxU8 m_unk0x08; // 0x08
MxU8* m_unk0x0c; // 0x0c
const char** m_unk0x10; // 0x10
MxU8 m_unk0x14; // 0x14
};
const char* m_name; // 0x00
@ -31,8 +31,8 @@ struct LegoActorInfo {
// SIZE 0x58
struct LegoActorLOD {
enum {
c_useTexture = 0x01,
c_useColor = 0x02
c_flag1 = 0x01,
c_flag2 = 0x02
};
const char* m_name; // 0x00

View File

@ -8,13 +8,13 @@ class LegoAnim;
// SIZE 0x20
struct LegoAnimActorStruct {
LegoAnimActorStruct(float p_worldSpeed, LegoAnim* p_AnimTreePtr, LegoROI** p_roiMap, MxU32 p_numROIs);
LegoAnimActorStruct(float p_unk0x00, LegoAnim* p_AnimTreePtr, LegoROI** p_roiMap, MxU32 p_numROIs);
~LegoAnimActorStruct();
float GetDuration();
// FUNCTION: BETA10 0x1000fb10
float GetWorldSpeed() { return m_worldSpeed; }
float GetUnknown0x00() { return m_unk0x00; }
// FUNCTION: BETA10 0x10012210
LegoAnim* GetAnimTreePtr() { return m_AnimTreePtr; }
@ -23,7 +23,7 @@ struct LegoAnimActorStruct {
LegoROI** GetROIMap() { return m_roiMap; }
// TODO: Possibly private
float m_worldSpeed; // 0x00
float m_unk0x00; // 0x00
LegoAnim* m_AnimTreePtr; // 0x04
LegoROI** m_roiMap; // 0x08
MxU32 m_numROIs; // 0x0c
@ -47,14 +47,9 @@ class LegoAnimActor : public virtual LegoPathActor {
void Animate(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
virtual MxResult GetTimeInCycle(float& p_timeInCycle);
virtual MxResult AnimateWithTransform(float p_time, Matrix4& p_transform);
virtual MxResult CreateAnimActorStruct(
LegoAnim* p_AnimTreePtr,
float p_worldSpeed,
LegoROI** p_roiMap,
MxU32 p_numROIs
);
virtual MxResult FUN_1001c1f0(float& p_und);
virtual MxResult FUN_1001c360(float, Matrix4& p_transform);
virtual MxResult FUN_1001c450(LegoAnim* p_AnimTreePtr, float p_unk0x00, LegoROI** p_roiMap, MxU32 p_numROIs);
virtual void ClearMaps();
// FUNCTION: LEGO1 0x1000fba0

View File

@ -16,7 +16,7 @@ class LegoFile;
class LegoPathActor;
class LegoPathBoundary;
class LegoROIList;
struct LegoOrientedEdge;
struct LegoUnknown100db7f4;
class LegoWorld;
class MxDSAction;
@ -32,20 +32,20 @@ struct ModelInfo {
// SIZE 0x30
struct AnimInfo {
char* m_name; // 0x00
MxU32 m_objectId; // 0x04
MxS16 m_location; // 0x08
MxBool m_unk0x0a; // 0x0a
MxU8 m_unk0x0b; // 0x0b
MxU8 m_unk0x0c; // 0x0c
MxU8 m_unk0x0d; // 0x0d
float m_unk0x10[4]; // 0x10
MxU8 m_modelCount; // 0x20
MxU16 m_unk0x22; // 0x22
ModelInfo* m_models; // 0x24
MxS8 m_characterIndex; // 0x28
MxBool m_unk0x29; // 0x29
MxS8 m_unk0x2a[3]; // 0x2a
char* m_name; // 0x00
MxU32 m_objectId; // 0x04
MxS16 m_location; // 0x08
MxBool m_unk0x0a; // 0x0a
MxU8 m_unk0x0b; // 0x0b
MxU8 m_unk0x0c; // 0x0c
MxU8 m_unk0x0d; // 0x0d
float m_unk0x10[4]; // 0x10
MxU8 m_modelCount; // 0x20
MxU16 m_unk0x22; // 0x22
ModelInfo* m_models; // 0x24
MxS8 m_unk0x28; // 0x28
MxBool m_unk0x29; // 0x29
MxS8 m_unk0x2a[3]; // 0x2a
};
// VTABLE: LEGO1 0x100d8d80
@ -231,7 +231,7 @@ class LegoAnimationManager : public MxCore {
MxBool FUN_100623a0(AnimInfo& p_info);
MxBool ModelExists(AnimInfo& p_info, const char* p_name);
void FUN_10062580(AnimInfo& p_info);
MxBool FUN_10062650(Mx3DPointFloat& p_position, float p_und, LegoROI* p_roi);
MxBool FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi);
MxBool FUN_10062710(AnimInfo& p_info);
MxBool FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_presenter);
void FUN_10063950(LegoROI* p_roi);
@ -240,7 +240,7 @@ class LegoAnimationManager : public MxCore {
void FUN_10063d10();
void FUN_10063e40(LegoAnimPresenter* p_presenter);
MxBool FUN_10063fb0(LegoLocation::Boundary* p_boundary, LegoWorld* p_world);
MxBool FUN_10064010(LegoPathBoundary* p_boundary, LegoOrientedEdge* p_edge, float p_destScale);
MxBool FUN_10064010(LegoPathBoundary* p_boundary, LegoUnknown100db7f4* p_edge, float p_destScale);
MxBool FUN_10064120(LegoLocation::Boundary* p_boundary, MxBool p_bool1, MxBool p_bool2);
MxResult FUN_10064380(
const char* p_name,
@ -284,7 +284,7 @@ class LegoAnimationManager : public MxCore {
MxLong m_unk0x410; // 0x410
MxU32 m_unk0x414; // 0x414
MxU32 m_numAllowedExtras; // 0x418
MxU32 m_maxAllowedExtras; // 0x41c
undefined4 m_unk0x41c; // 0x41c
AnimState* m_animState; // 0x420
LegoROIList* m_unk0x424; // 0x424
MxBool m_suspendedEnableCamAnims; // 0x428
@ -303,7 +303,4 @@ class LegoAnimationManager : public MxCore {
// TEMPLATE: LEGO1 0x10061750
// MxListCursor<LegoTranInfo *>::MxListCursor<LegoTranInfo *>
// TEMPLATE: BETA10 0x1004b5d0
// MxListCursor<LegoTranInfo *>::Next
#endif // LEGOANIMATIONMANAGER_H

View File

@ -90,7 +90,7 @@ class LegoAnimMMPresenter : public MxCompositePresenter {
MxU8 m_unk0x59; // 0x59
MxU32 m_animmanId; // 0x5c
LegoTranInfo* m_tranInfo; // 0x60
LegoWorld* m_world; // 0x64
LegoWorld* m_unk0x64; // 0x64
MxMatrix* m_unk0x68; // 0x68
LegoROI** m_roiMap; // 0x6c
MxU32 m_roiMapSize; // 0x70

View File

@ -2,7 +2,6 @@
#define LEGOANIMPRESENTER_H
#include "legoroilist.h"
#include "legoroimaplist.h"
#include "mxatom.h"
#include "mxvideopresenter.h"
@ -93,11 +92,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
const char* GetActionObjectName();
void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
// FUNCTION: BETA10 0x1005aad0
void SetUnknown0x0cTo1() { m_unk0x9c = 1; }
// FUNCTION: BETA10 0x1005ab00
void SetUnknown0xa0(Matrix4* p_unk0xa0) { m_unk0xa0 = p_unk0xa0; }
LegoAnim* GetAnimation() { return m_anim; }
@ -108,17 +103,12 @@ class LegoAnimPresenter : public MxVideoPresenter {
LegoChar* FUN_10069150(const LegoChar* p_und1);
void FUN_100692b0();
void FUN_100695c0();
LegoChar* GetVariableOrIdentity(const LegoChar* p_varName, const LegoChar* p_prefix);
LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2);
LegoBool FUN_100698b0(const CompoundObject& p_rois, const LegoChar* p_und2);
LegoROI* FindROI(const LegoChar* p_name);
LegoROI* FUN_100699e0(const LegoChar* p_und);
void FUN_10069b10();
void UpdateStructMapAndROIIndex(LegoAnimStructMap& p_map, LegoTreeNode* p_node, LegoROI* p_roi);
void UpdateStructMapAndROIIndexForNode(
LegoAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const LegoChar* p_und,
LegoROI* p_roi
);
void FUN_1006a3c0(LegoAnimStructMap& p_map, LegoTreeNode* p_node, LegoROI* p_roi);
void FUN_1006a4f0(LegoAnimStructMap& p_map, LegoAnimNodeData* p_data, const LegoChar* p_und, LegoROI* p_roi);
void FUN_1006aa60();
void FUN_1006ab70();
LegoBool FUN_1006aba0();
@ -126,13 +116,13 @@ class LegoAnimPresenter : public MxVideoPresenter {
void SubstituteVariables();
void FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
void SetDisabled(MxBool p_disabled);
void FUN_1006c8a0(MxBool p_bool);
LegoAnim* m_anim; // 0x64
LegoROI** m_roiMap; // 0x68
MxU32 m_roiMapSize; // 0x6c
LegoROIList* m_sceneROIs; // 0x70
LegoROIList* m_managedActors; // 0x74
LegoROIList* m_unk0x70; // 0x70
LegoROIList* m_unk0x74; // 0x74
Matrix4* m_unk0x78; // 0x78
MxU32 m_flags; // 0x7c
LegoWorld* m_currentWorld; // 0x80
@ -148,191 +138,14 @@ class LegoAnimPresenter : public MxVideoPresenter {
MxS16 m_unk0x9c; // 0x9c
Matrix4* m_unk0xa0; // 0xa0
// SYNTHETIC: LEGO1 0x10068650
// LegoAnimPresenter::`scalar deleting destructor'
public:
float m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8
};
// VTABLE: LEGO1 0x100d4900
// SIZE 0xc0
class LegoLoopingAnimPresenter : public LegoAnimPresenter {
public:
// FUNCTION: BETA10 0x1005c6f0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f0700
return "LegoLoopingAnimPresenter";
}
// FUNCTION: LEGO1 0x1000c9a0
// FUNCTION: BETA10 0x1005c6c0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1000c9b0
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void StreamingTickle() override; // vtable+0x20
void PutFrame() override; // vtable+0x6c
// SYNTHETIC: LEGO1 0x1006d000
// LegoLoopingAnimPresenter::~LegoLoopingAnimPresenter
// SYNTHETIC: LEGO1 0x1000f440
// LegoLoopingAnimPresenter::`scalar deleting destructor'
private:
undefined4 m_unk0xbc; // 0xbc
};
class LegoAnimActor;
// VTABLE: LEGO1 0x100d9170
// SIZE 0xd8
class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoLocomotionAnimPresenter();
~LegoLocomotionAnimPresenter() override;
// FUNCTION: BETA10 0x1005c4e0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06e4
return "LegoLocomotionAnimPresenter";
}
// FUNCTION: LEGO1 0x1006ce50
// FUNCTION: BETA10 0x1005c4b0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006ce60
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoLoopingAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
MxResult CreateAnim(MxStreamChunk* p_chunk) override; // vtable+0x88
void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value);
void DecrementUnknown0xd4()
{
if (m_unk0xd4) {
--m_unk0xd4;
}
}
undefined2 GetUnknown0xd4() { return m_unk0xd4; }
// SYNTHETIC: LEGO1 0x1006cfe0
// LegoLocomotionAnimPresenter::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 m_unk0xc0; // 0xc0
undefined4* m_unk0xc4; // 0xc4
LegoROIMapList* m_roiMapList; // 0xc8
MxS32 m_unk0xcc; // 0xcc
MxS32 m_unk0xd0; // 0xd0
undefined2 m_unk0xd4; // 0xd4
};
class LegoPathBoundary;
struct LegoHideAnimStructComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
};
// SIZE 0x08
struct LegoHideAnimStruct {
LegoPathBoundary* m_boundary; // 0x00
MxU32 m_index; // 0x04
};
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
// VTABLE: LEGO1 0x100d9278
// SIZE 0xc4
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoHideAnimPresenter();
~LegoHideAnimPresenter() override;
// FUNCTION: LEGO1 0x1006d860
void VTable0x8c() override {} // vtable+0x8c
// FUNCTION: LEGO1 0x1006d870
void VTable0x90() override {} // vtable+0x90
// FUNCTION: BETA10 0x1005d4a0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06cc
return "LegoHideAnimPresenter";
}
// FUNCTION: LEGO1 0x1006d880
// FUNCTION: BETA10 0x1005d470
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006d890
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x18
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
void FUN_1006db40(LegoTime p_time);
// SYNTHETIC: LEGO1 0x1006d9d0
// LegoHideAnimPresenter::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
void FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
);
LegoPathBoundary** m_boundaryMap; // 0xc0
};
// clang-format off
// SYNTHETIC: LEGO1 0x10068650
// LegoAnimPresenter::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100689c0
// map<char const *,char const *,LegoAnimSubstComparator,allocator<char const *> >::~map<char const *,char const *,LegoAnimSubstComparator,allocator<char const *> >
@ -390,33 +203,6 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
// GLOBAL: LEGO1 0x100f7688
// _Tree<char const *,pair<char const * const,LegoAnimStruct>,map<char const *,LegoAnimStruct,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Kfn,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Nil
// TEMPLATE: LEGO1 0x1006ddb0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
// TEMPLATE: LEGO1 0x1006de80
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
// TEMPLATE: LEGO1 0x1006dec0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
// TEMPLATE: LEGO1 0x1006e310
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
// TEMPLATE: LEGO1 0x1006e350
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
// TEMPLATE: LEGO1 0x1006e3a0
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
// TEMPLATE: LEGO1 0x1006e6d0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1006e720
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
// GLOBAL: LEGO1 0x100f768c
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
// clang-format on
#endif // LEGOANIMPRESENTER_H

View File

@ -26,10 +26,10 @@ struct LegoBuildingInfo {
MxU32 m_sound; // 0x08
MxU32 m_move; // 0x0c
MxU8 m_mood; // 0x10
MxS8 m_counter; // 0x11
MxS8 m_initialCounter; // 0x12 - initial value loaded to m_counter
MxS8 m_unk0x11; // 0x11
MxS8 m_initialUnk0x11; // 0x12 - initial value loaded to m_unk0x11
MxU8 m_flags; // 0x13
float m_adjustedY; // 0x14
float m_unk0x14; // 0x14
const char* m_boundaryName; // 0x18
float m_x; // 0x1c
float m_y; // 0x20
@ -46,7 +46,7 @@ class LegoBuildingManager : public MxCore {
LegoEntity* m_entity; // 0x00
LegoROI* m_roi; // 0x04
MxLong m_time; // 0x08
float m_y; // 0x0c
float m_unk0x0c; // 0x0c
MxBool m_muted; // 0x10
};
@ -58,8 +58,7 @@ class LegoBuildingManager : public MxCore {
// FUNCTION: LEGO1 0x1002f930
const char* ClassName() const override // vtable+0x0c
{
// While this class exists in BETA10, it didn't have a ClassName().
// The constructor suggests that it did not inherit from MxCore back then and did not have a VTABLE.
// not in BETA10
// STRING: LEGO1 0x100f37d0
return "LegoBuildingManager";
}
@ -79,17 +78,17 @@ class LegoBuildingManager : public MxCore {
MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
MxBool DecrementCounter(LegoEntity* p_entity);
MxBool DecrementCounter(MxS32 p_index);
MxBool DecrementCounter(LegoBuildingInfo* p_data);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_hideAfterAnimation);
void ClearCounters();
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
MxBool FUN_10030000(LegoEntity* p_entity);
MxBool FUN_10030030(MxS32 p_index);
MxBool FUN_10030110(LegoBuildingInfo* p_data);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_unk0x28);
void FUN_10030590();
void AdjustHeight(MxS32 p_index);
MxResult DetermineBoundaries();
MxResult FUN_10030630();
LegoBuildingInfo* GetInfoArray(MxS32& p_length);
void AdjustCounter(LegoEntity* p_entity, MxS32 p_adjust);
void SetInitialCounters();
void FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust);
void FUN_10030800();
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
@ -101,13 +100,13 @@ class LegoBuildingManager : public MxCore {
static MxS32 g_maxMove[16];
static MxU32 g_maxSound;
MxU8 m_nextVariant; // 0x08
MxBool m_boundariesDetermined; // 0x09
AnimEntry* m_entries[5]; // 0x0c
MxS8 m_numEntries; // 0x20
LegoCacheSound* m_sound; // 0x24
MxBool m_hideAfterAnimation; // 0x28
LegoWorld* m_world; // 0x2c
MxU8 m_nextVariant; // 0x08
MxBool m_unk0x09; // 0x09
AnimEntry* m_entries[5]; // 0x0c
MxS8 m_numEntries; // 0x20
LegoCacheSound* m_sound; // 0x24
MxBool m_unk0x28; // 0x28
LegoWorld* m_world; // 0x2c
};
#endif // LEGOBUILDINGMANAGER_H

View File

@ -46,13 +46,10 @@ typedef set<LegoCacheSoundEntry, Set100d6b4cComparator> Set100d6b4c;
typedef list<LegoCacheSoundEntry> List100d6b4c;
// VTABLE: LEGO1 0x100d6b4c
// VTABLE: BETA10 0x101becac
// SIZE 0x20
class LegoCacheSoundManager {
public:
// FUNCTION: BETA10 0x100d0a60
LegoCacheSoundManager() {}
~LegoCacheSoundManager();
virtual MxResult Tickle(); // vtable+0x00
@ -69,9 +66,6 @@ class LegoCacheSoundManager {
List100d6b4c m_list; // 0x14
};
// SYNTHETIC: BETA10 0x100d06b0
// LegoCacheSoundManager::`scalar deleting destructor'
// TODO: Function names subject to change.
// clang-format off

View File

@ -12,7 +12,6 @@
class LegoCacheSound : public MxCore {
public:
LegoCacheSound();
LegoCacheSound(LegoCacheSound& p_sound);
~LegoCacheSound() override; // vtable+0x00
// FUNCTION: LEGO1 0x10006580
@ -49,10 +48,6 @@ class LegoCacheSound : public MxCore {
void SetDistance(MxS32 p_min, MxS32 p_max);
void MuteSilence(MxBool p_muted);
void MuteStop(MxBool p_mute);
MxResult GetFrequency(LPDWORD p_freq);
MxResult SetFrequency(DWORD p_freq);
LegoCacheSound& operator=(LegoCacheSound& p_sound);
void CopyFrom(LegoCacheSound& p_sound);
// SYNTHETIC: LEGO1 0x10006610
// SYNTHETIC: BETA10 0x100675b0

View File

@ -2,9 +2,9 @@
#define LEGOCAMERACONTROLLER_H
#include "legopointofviewcontroller.h"
#include "mxgeometry.h"
#include "mxgeometry/mxgeometry3d.h"
#include "mxgeometry/mxmatrix.h"
#include "mxpoint32.h"
// VTABLE: LEGO1 0x100d57b0
// VTABLE: BETA10 0x101bb748
@ -38,17 +38,17 @@ class LegoCameraController : public LegoPointOfViewController {
virtual MxResult Create(); // vtable+0x44
void SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up);
void RotateZ(float p_angle);
void RotateY(float p_angle);
MxResult GetPointOfView(Matrix4& p_matrix);
void TransformPointOfView(const Matrix4& p_transform, MxU32 p_multiply);
void FUN_10012290(float p_angle);
void FUN_10012320(float p_angle);
MxResult FUN_100123b0(Matrix4& p_matrix);
void FUN_100123e0(const Matrix4& p_transform, MxU32 p_und);
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldLocation();
Mx3DPointFloat GetWorldDirection();
private:
MxMatrix m_currentTransform; // 0x38
MxMatrix m_originalTransform; // 0x80
MxMatrix m_matrix1; // 0x38
MxMatrix m_matrix2; // 0x80
};
// SYNTHETIC: LEGO1 0x10011f50

View File

@ -20,11 +20,11 @@ class MxActionNotificationParam;
class LegoVehicleBuildState : public LegoState {
public:
enum AnimationState {
e_none = 0,
e_unknown0 = 0,
e_entering = 1,
e_settingUpMovie = 2,
e_unknown2 = 2,
e_cutscene = 3,
e_finishedBuild = 4,
e_unknown4 = 4,
e_exiting = 6
};
@ -57,9 +57,9 @@ class LegoVehicleBuildState : public LegoState {
MxString m_className; // 0x38
AnimationState m_animationState; // 0x48
MxU8 m_introductionCounter; // 0x4c
MxBool m_finishedBuild; // 0x4d
MxBool m_playedExitScript; // 0x4e
MxU8 m_unk0x4c; // 0x4c
MxBool m_unk0x4d; // 0x4d
MxBool m_unk0x4e; // 0x4e
MxU8 m_placedPartCount; // 0x4f
};
@ -75,28 +75,18 @@ class LegoCarBuild : public LegoWorld {
public:
// SIZE 0x1c
struct LookupTableActions {
MxU32 m_introduction0; // 0x00
MxU32 m_leaveUnfinished; // 0x04
MxU32 m_completed; // 0x08
MxU32 m_introduction1; // 0x0c
MxU32 m_introduction2; // 0x10
MxU32 m_introduction3; // 0x14
MxU32 m_shortExplanation; // 0x18
undefined4 m_unk0x00; // 0x00
undefined4 m_unk0x04; // 0x04
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined4 m_unk0x10; // 0x10
undefined4 m_unk0x14; // 0x14
undefined4 m_unk0x18; // 0x18
};
enum LookupTableActionType {
e_introduction0 = 0,
e_introduction1 = 1,
e_introduction2 = 2,
e_introduction3 = 3,
e_leaveUnfinished = 4,
e_completed = 5,
e_shortExplanation = 6,
};
enum ResetPlacedSelectedPart {
c_disabled = -1,
c_enabled = 8
enum Unknown0xf8 {
c_unknownminusone = -1,
c_unknown8 = 8
};
LegoCarBuild();
@ -104,7 +94,7 @@ class LegoCarBuild : public LegoWorld {
// FUNCTION: LEGO1 0x10022930
// FUNCTION: BETA10 0x10070070
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x10022940
// FUNCTION: BETA10 0x10070090
@ -123,15 +113,15 @@ class LegoCarBuild : public LegoWorld {
return !strcmp(p_name, LegoCarBuild::ClassName()) || LegoWorld::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual void InitializeDisplayingTransform(); // vtable+0x6c
virtual void CalculateStartAndTargetScreenPositions(); // vtable+0x70
virtual void CalculateDragPositionAbove(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x74
virtual void CalculateDragPositionBetween(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x78
virtual void CalculateDragPositionOnGround(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x7c
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual void VTable0x6c(); // vtable+0x6c
virtual void VTable0x70(); // vtable+0x70
virtual void VTable0x74(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x74
virtual void VTable0x78(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x78
virtual void VTable0x7c(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x7c
virtual void VTable0x80(
MxFloat p_param1[2],
MxFloat p_param2[2],
@ -142,80 +132,78 @@ class LegoCarBuild : public LegoWorld {
MxS16 GetPlacedPartCount();
void SetPlacedPartCount(MxU8 p_placedPartCount);
void InitPresenters();
void DisplaySelectedPart();
void ResetSelectedPart();
void CalculateSelectedPartMatrix(MxLong p_x, MxLong p_y);
void AddSelectedPartToBuild();
MxLong HandleKeyPress(LegoEventNotificationParam* p_param);
void InitExiting();
MxLong HandleEndAction(MxActionNotificationParam* p_param);
MxLong SelectPartFromMousePosition(MxLong p_x, MxLong p_y);
MxLong HandleButtonUp(MxLong p_x, MxLong p_y);
MxLong HandleMouseMove(MxLong p_x, MxLong p_y);
MxLong HandleControl(MxParam* p_param);
MxLong HandleType0Notification(MxNotificationParam* p_param);
void StartIntroduction();
void MoveShelves();
void RotateVehicle();
void EnableColorControlsForSelectedPart(MxBool p_enabled);
void SetColorControlsEnabled(MxBool p_enabled);
void ToggleColorControlsEnabled();
void EnableDecalForSelectedPart(MxBool p_enabled);
void SetPartColor(MxS32 p_objectId);
void CalculateStartAndTargetTransforms();
void StartActorScriptByType(MxS32 p_actionType);
void StartActorScript(MxS32 p_streamId);
MxS32 GetNextIntroduction();
void TickleControl(const char* p_controlName, MxULong p_time);
void HandleEndAnim();
MxS32 GetBuildMovieId(MxS32 p_carId);
void FUN_10022f00();
void FUN_10022f30();
void FUN_10023130(MxLong p_x, MxLong p_y);
void FUN_100236d0();
undefined4 FUN_10024250(LegoEventNotificationParam* p_param);
void FUN_100243a0();
undefined4 FUN_10024480(MxActionNotificationParam* p_param);
undefined4 FUN_100244e0(MxLong p_x, MxLong p_y);
undefined4 FUN_100246e0(MxLong p_x, MxLong p_y);
MxS32 FUN_10024850(MxLong p_x, MxLong p_y);
undefined4 FUN_10024890(MxParam* p_param);
undefined4 FUN_10024c20(LegoEventNotificationParam* p_param);
void FUN_10024ef0();
void FUN_10024f30();
void FUN_10024f50();
void FUN_10024f70(MxBool p_enabled);
void SetPresentersEnabled(MxBool p_enabled);
void TogglePresentersEnabled();
void FUN_100250e0(MxBool p_param);
void FUN_10025350(MxS32 p_objectId);
void FUN_10025450();
void FUN_10025720(undefined4 p_param1);
void FUN_10025d10(MxS32 p_param);
MxS32 FUN_10025d70();
void FUN_10025db0(const char* p_param1, undefined4 p_param2);
void FUN_10025e40();
MxS32 FUN_10025ee0(undefined4 p_param1);
// FUNCTION: BETA10 0x100735b0
void SetCarBuildAnimPresenter(LegoCarBuildAnimPresenter* p_animPresenter) { m_animPresenter = p_animPresenter; }
void SetUnknown0x258(LegoCarBuildAnimPresenter* p_unk0x258) { m_unk0x258 = p_unk0x258; }
// SYNTHETIC: LEGO1 0x10022a60
// LegoCarBuild::`scalar deleting destructor'
private:
enum {
e_idle = 0,
e_returning = 3,
e_selecting = 4,
e_displaying = 5,
e_dragging = 6,
};
// inline functions
MxU32 GetLookupIndex();
void StopPlayingActorScript();
MxU32 Beta0x10070520();
void StopActionIn0x344();
ResetPlacedSelectedPart m_resetPlacedSelectedPart; // 0xf8
MxS16 m_rotateBuild; // 0xfc
MxS32 m_clickState; // 0x100
undefined4 m_unk0x104; // 0x104
Unknown0xf8 m_unk0xf8; // 0xf8
MxS16 m_unk0xfc; // 0xfc
MxS32 m_unk0x100; // 0x100
undefined4 m_unk0x104; // 0x104
// name verified by BETA10 0x1006ebba
MxS8 m_numAnimsRun; // 0x108
MxU8 m_missclickCounter; // 0x109
MxU16 m_lastActorScript; // 0x10a
MxULong m_lastActorScriptStartTime; // 0x10c
LegoROI* m_selectedPart; // 0x110
BoundingSphere m_targetBoundingSphere; // 0x114
MxMatrix m_originalSelectedPartTransform; // 0x12c
MxBool m_alreadyFinished; // 0x174
MxMatrix m_selectedPartStartTransform; // 0x178
MxMatrix m_displayTransform; // 0x1c0
MxMatrix m_selectedPartTargetTransform; // 0x208
MxS32 m_selectedPartStartMousePosition[2]; // 0x250
LegoCarBuildAnimPresenter* m_animPresenter; // 0x258
MxQuaternionTransformer m_draggingQuarternionTransformer; // 0x25c
MxS32 m_selectedPartStartScreenPosition[2]; // 0x290
MxS32 m_selectedPartTargetScreenPosition[2]; // 0x298
MxFloat m_normalizedDistance; // 0x2a0
Mx4DPointFloat m_selectedPartStartPosition; // 0x2a4
Mx4DPointFloat m_selectedPartTargetPosition; // 0x2bc
MxBool m_displayedPartIsPlaced; // 0x2d4
MxU8 m_unk0x109; // 0x109
MxU16 m_unk0x10a; // 0x10a
DWORD m_unk0x10c; // 0x10c
LegoROI* m_unk0x110; // 0x110
BoundingSphere m_unk0x114; // 0x114
MxMatrix m_unk0x12c; // 0x12c
undefined m_unk0x174; // 0x174
MxMatrix m_unk0x178; // 0x178
MxMatrix m_unk0x1c0; // 0x1c0
MxMatrix m_unk0x208; // 0x208
// This is likely a location in pixel space
MxS32 m_unk0x250[2]; // 0x250
LegoCarBuildAnimPresenter* m_unk0x258; // 0x258
MxQuaternionTransformer m_unk0x25c; // 0x25c
// These two are likely locations in pixel space
MxS32 m_unk0x290[2]; // 0x290
MxS32 m_unk0x298[2]; // 0x298
MxFloat m_unk0x2a0; // 0x2a0
Mx4DPointFloat m_unk0x2a4; // 0x2a4
Mx4DPointFloat m_unk0x2bc; // 0x2bc
MxBool m_unk0x2d4; // 0x2d4
// variable names verified by BETA10 0x1006b27a
MxStillPresenter* m_ColorBook_Bitmap; // 0x2dc
@ -244,21 +232,21 @@ class LegoCarBuild : public LegoWorld {
LegoVehicleBuildState* m_buildState; // 0x32c
// variable name verified by BETA10 0x1006d742
MxS32 m_carId; // 0x330
undefined4 m_carId; // 0x330
// variable name verified by BETA10 0x1006cba7
LegoGameState::Area m_destLocation; // 0x334
MxPresenter* m_jukeboxPresenter; // 0x338
MxControlPresenter* m_tickledControl; // 0x33c
undefined4 m_unk0x340; // 0x340
MxS32 m_playingActorScript; // 0x344
MxU8 m_presentersEnabled; // 0x348
MxPresenter* m_unk0x338; // 0x338
MxControlPresenter* m_unk0x33c; // 0x33c
undefined4 m_unk0x340; // 0x340
undefined4 m_unk0x344; // 0x344
MxU8 m_presentersEnabled; // 0x348
static MxS16 g_lastTickleState;
static MxFloat g_selectedPartRotationAngleStepYAxis;
static MxS16 g_unk0x100f11cc;
static MxFloat g_unk0x100d65a4;
static MxFloat g_rotationAngleStepYAxis;
static LookupTableActions g_actorScripts[];
static LookupTableActions g_unk0x100d65b0[];
};
#endif // LEGOCARBUILD_H

View File

@ -13,18 +13,11 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
c_bit1 = 0x01
};
enum ShelfState {
e_undefined = -1,
e_selected = 0,
e_stopped = 1,
e_moving = 2
};
// SIZE 0x0c
struct CarBuildPart {
struct UnknownListEntry {
// FUNCTION: LEGO1 0x100795c0
// FUNCTION: BETA10 0x10073850
CarBuildPart()
UnknownListEntry()
{
m_name = NULL;
m_wiredName = NULL;
@ -74,18 +67,18 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
virtual MxResult Serialize(LegoStorage* p_storage);
void MakePartPlaced(MxS16 p_index);
void FUN_10079050(MxS16 p_index);
void SwapNodesByName(LegoChar* p_param1, LegoChar* p_param2);
void InitBuildPlatform();
void HideBuildPartByName(LegoChar* p_param);
void ShowBuildPartByName(LegoChar* p_param);
void FUN_10079160();
void FUN_100795d0(LegoChar* p_param);
void FUN_10079680(LegoChar* p_param);
LegoAnimNodeData* FindNodeDataByName(LegoTreeNode* p_treeNode, const LegoChar* p_name);
LegoTreeNode* FindNodeByName(LegoTreeNode* p_treeNode, const LegoChar* p_name);
void AddPartToBuildByName(const LegoChar* p_name);
void FUN_10079790(const LegoChar* p_name);
void RotateAroundYAxis(MxFloat p_angle);
MxBool IsNextPartToPlace(const LegoChar* p_name);
MxBool FUN_10079c30(const LegoChar* p_name);
MxBool PartIsPlaced(const LegoChar* p_name);
void MoveShelfForward();
void FUN_10079a90();
MxBool StringEqualsPlatform(const LegoChar* p_string);
MxBool StringEqualsShelf(const LegoChar* p_string);
MxBool StringEndsOnY(const LegoChar* p_string);
@ -94,15 +87,15 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
void SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId);
// FUNCTION: BETA10 0x10070180
void SetShelfState(MxU16 p_shelfState) { m_shelfState = p_shelfState; }
void SetUnknown0xbc(undefined2 p_unk0xbc) { m_unk0xbc = p_unk0xbc; }
// FUNCTION: BETA10 0x100703b0
Matrix4& GetBuildViewMatrix() { return m_buildViewMatrix; }
Matrix4& GetUnknown0xe0() { return m_unk0xe0; }
MxBool StringEndsOnW(LegoChar* p_param);
MxBool StringEndsOnYOrN(const LegoChar* p_string);
const BoundingSphere& GetTargetBoundingSphere();
const BoundingSphere& FUN_10079e20();
// FUNCTION: BETA10 0x100703e0
const LegoChar* GetWiredNameOfLastPlacedPart() { return m_parts[m_placedPartCount].m_wiredName; }
@ -121,9 +114,9 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
// LegoCarBuildAnimPresenter::`scalar deleting destructor'
private:
void UpdateFlashingPartVisibility();
void Beta10Inline0x100733d0();
MxU16 m_shelfState; // 0xbc
MxU16 m_unk0xbc; // 0xbc
// variable name verified by BETA10 0x1007184f
MxS16 m_numberOfParts; // 0xbe
@ -131,21 +124,21 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
// name derived from LegoVehicleBuildState, field 0x4f
MxS16 m_placedPartCount; // 0xc0
LegoAnimNodeData* m_platformAnimNodeData; // 0xc4
LegoAnim m_platformAnim; // 0xc8
MxMatrix m_buildViewMatrix; // 0xe0
LegoAnimNodeData* m_unk0xc4; // 0xc4
LegoAnim m_unk0xc8; // 0xc8
MxMatrix m_unk0xe0; // 0xe0
// variable name verified by BETA10 0x100719f0
CarBuildPart* m_parts; // 0x128
UnknownListEntry* m_parts; // 0x128
MxFloat m_shelfFrameBuffer; // 0x12c
MxFloat m_shelfFrame; // 0x130
MxFloat m_shelfFrameMax; // 0x134
MxFloat m_shelfFrameInterval; // 0x138
MxULong m_flashingPartTimeState; // 0x13c
LegoEntity* m_carBuildEntity; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
MxFloat m_unk0x12c; // 0x12c
MxFloat m_unk0x130; // 0x130
MxFloat m_unk0x134; // 0x134
MxFloat m_unk0x138; // 0x138
MxULong m_unk0x13c; // 0x13c
LegoEntity* m_unk0x140; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
// name verified by BETA10 0x10070d63
LegoChar* m_mainSourceId; // 0x14c

View File

@ -46,7 +46,6 @@ struct LegoActorInfo;
typedef map<char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
// VTABLE: LEGO1 0x100da878
// VTABLE: BETA10 0x101bc028
// SIZE 0x24
class CustomizeAnimFileVariable : public MxVariable {
public:
@ -77,7 +76,7 @@ class LegoCharacterManager {
void ReleaseActor(const char* p_name);
void ReleaseActor(LegoROI* p_roi);
void ReleaseAutoROI(LegoROI* p_roi);
MxBool SetHeadTexture(LegoROI* p_roi, LegoTextureInfo* p_texture);
MxBool FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_texture);
LegoExtraActor* GetExtraActor(const char* p_name);
LegoActorInfo* GetActorInfo(const char* p_name);
LegoActorInfo* GetActorInfo(LegoROI* p_roi);
@ -87,10 +86,10 @@ class LegoCharacterManager {
MxBool SwitchMove(LegoROI* p_roi);
MxBool SwitchMood(LegoROI* p_roi);
MxU32 GetAnimationId(LegoROI* p_roi);
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood);
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_und);
MxU8 GetMood(LegoROI* p_roi);
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
MxResult UpdateBoundingSphereAndBox(LegoROI* p_roi);
MxResult FUN_10085870(LegoROI* p_roi);
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }

View File

@ -24,11 +24,11 @@ class LegoControlManagerNotificationParam : public LegoEventNotificationParam {
void SetClickedObjectId(MxS32 p_clickedObjectId) { m_clickedObjectId = p_clickedObjectId; }
void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; }
void SetEnabledChild(MxS16 p_enabledChild) { m_enabledChild = p_enabledChild; }
void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; }
MxS32 m_clickedObjectId; // 0x20
const char* m_clickedAtom; // 0x24
MxS16 m_enabledChild; // 0x28
MxS16 m_unk0x28; // 0x28
};
// SYNTHETIC: LEGO1 0x10028bf0
@ -66,33 +66,27 @@ class LegoControlManager : public MxCore {
return !strcmp(p_name, LegoControlManager::ClassName()) || MxCore::IsA(p_name);
}
void SetPresenterList(MxPresenterList* p_presenterList);
void FUN_10028df0(MxPresenterList* p_presenterList);
void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener);
MxBool HandleButtonDown(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void UpdateEnabledChild(MxU32 p_objectId, const char* p_atom, MxS16 p_enabledChild);
MxControlPresenter* GetControlAt(MxS32 p_x, MxS32 p_y);
MxBool HandleButtonDown();
MxBool HandleButtonUp();
void Notify();
MxBool FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS16 p_unk0x4e);
MxControlPresenter* FUN_100294e0(MxS32 p_x, MxS32 p_y);
MxBool FUN_10029630();
MxBool FUN_10029750();
void FUN_100292e0();
MxU32 HandleUpNextTickle() { return m_handleUpNextTickle; }
MxBool IsSecondButtonDown() { return m_secondButtonDown; }
undefined4 GetUnknown0x0c() { return m_unk0x0c; }
undefined GetUnknown0x10() { return m_unk0x10; }
// SYNTHETIC: LEGO1 0x10028d40
// LegoControlManager::`scalar deleting destructor'
private:
enum {
e_idle = 0,
e_waitNextTickle = 1,
e_tickled = 2,
};
MxU32 m_buttonDownState; // 0x08
MxU32 m_handleUpNextTickle; // 0x0c
MxBool m_secondButtonDown; // 0x10
MxPresenter* m_handledPresenter; // 0x14
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxBool m_unk0x10; // 0x10
MxPresenter* m_unk0x14; // 0x14
LegoControlManagerNotificationParam m_event; // 0x18
MxPresenterList* m_presenterList; // 0x44
LegoNotifyList m_notifyList; // 0x48

View File

@ -28,7 +28,7 @@ class LegoEntity : public MxEntity {
};
enum {
c_disabled = 0x01
c_altBit1 = 0x01
};
LegoEntity() { Init(); }
@ -53,10 +53,10 @@ class LegoEntity : public MxEntity {
return !strcmp(p_name, LegoEntity::ClassName()) || MxEntity::IsA(p_name);
}
virtual MxResult Create(MxDSAction& p_dsAction); // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c
virtual void ParseAction(char* p_extra); // vtable+0x20
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform); // vtable+0x24
virtual MxResult Create(MxDSAction& p_dsAction); // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c
virtual void ParseAction(char* p_extra); // vtable+0x20
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2); // vtable+0x24
virtual void SetWorldTransform(
const Vector3& p_location,
const Vector3& p_direction,
@ -68,22 +68,22 @@ class LegoEntity : public MxEntity {
// FUNCTION: BETA10 0x10013260
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
virtual void ClickSound(MxBool p_basedOnMood); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
virtual void ClickSound(MxBool p_und); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
void TransformPointOfView();
void FUN_10010c30();
void SetType(MxU8 p_type);
void SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_updateCamera);
void SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_und);
Mx3DPointFloat GetWorldDirection();
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldPosition();
MxBool IsInteraction(MxU8 p_flag) { return m_interaction & p_flag; }
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
MxU8 GetFlags() { return m_flags; }
@ -101,14 +101,14 @@ class LegoEntity : public MxEntity {
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
void ClearFlag(MxU8 p_flag) { m_flags &= ~p_flag; }
void SetInteractionFlag(MxU8 p_flag) { m_interaction |= p_flag; }
void ClearInteractionFlag(MxU8 p_flag) { m_interaction &= ~p_flag; }
void SetUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 |= p_flag; }
void ClearUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 &= ~p_flag; }
protected:
void Init();
void SetWorld();
MxU8 m_interaction; // 0x10
MxU8 m_unk0x10; // 0x10
MxU8 m_flags; // 0x11
Mx3DPointFloat m_worldLocation; // 0x14
Mx3DPointFloat m_worldDirection; // 0x28

View File

@ -23,7 +23,6 @@ struct ColorStringStruct {
};
// VTABLE: LEGO1 0x100d74a8
// VTABLE: BETA10 0x101bc4f0
// SIZE 0x30
class LegoBackgroundColor : public MxVariable {
public:
@ -44,11 +43,9 @@ class LegoBackgroundColor : public MxVariable {
};
// VTABLE: LEGO1 0x100d74b8
// VTABLE: BETA10 0x101bc500
// SIZE 0x24
class LegoFullScreenMovie : public MxVariable {
public:
LegoFullScreenMovie();
LegoFullScreenMovie(const char* p_key, const char* p_value);
void SetValue(const char* p_option) override; // vtable+0x04
@ -70,7 +67,7 @@ class LegoGameState {
e_isle,
e_infomain,
e_infodoor,
e_infocenterExited,
e_unk4,
e_elevbott,
e_elevride,
e_elevride2,
@ -81,44 +78,44 @@ class LegoGameState {
e_regbook,
e_infoscor,
e_jetrace,
e_jetraceFinished,
e_jetrace2,
e_jetraceExterior,
e_jetskibuildExited,
e_unk17,
e_carrace,
e_carraceExterior,
e_racecarbuildExited,
e_carraceFinished,
e_unk20,
e_unk21,
e_pizzeriaExterior,
e_unk23,
e_unk24,
e_garageExterior,
e_garage,
e_garadoor,
e_garageExited,
e_unk28,
e_hospitalExterior,
e_hospital,
e_hospitalExited,
e_unk31,
e_policeExterior,
e_policeExited,
e_unk33,
e_police,
e_polidoor,
e_copterbuild,
e_dunecarbuild,
e_jetskibuild,
e_racecarbuild,
e_helicopterSpawn,
e_unk40,
e_unk41,
e_unk42,
e_dunebuggySpawn,
e_racecarSpawn,
e_jetskiSpawn,
e_unk43,
e_unk44,
e_unk45,
e_act2main,
e_act3script,
e_unk48,
e_unk49,
e_unk50,
e_unk51,
e_towTrackHookedUp,
e_unk52,
e_jukeboxw,
e_jukeboxExterior,
e_unk55,
@ -132,7 +129,7 @@ class LegoGameState {
e_towtrack,
e_jetski,
e_vehicleExited = 66
e_unk66 = 66
};
// SIZE 0x0e
@ -153,18 +150,7 @@ class LegoGameState {
MxS16 m_totalScore; // 0x00
MxU8 m_scores[5][5]; // 0x02
Username m_name; // 0x1c
MxS16 m_playerId; // 0x2a
ScoreItem& operator=(const ScoreItem& p_other)
{
// MSVC auto-generates an operator=, but LegoGameState::WriteScoreHistory() has a much better match
// with a manual implementation.
m_totalScore = p_other.m_totalScore;
memcpy(m_scores, p_other.m_scores, sizeof(m_scores));
m_name = p_other.m_name;
m_playerId = p_other.m_playerId;
return *this;
}
MxS16 m_unk0x2a; // 0x2a
};
// SIZE 0x372
@ -172,7 +158,7 @@ class LegoGameState {
History();
void WriteScoreHistory();
MxResult Serialize(LegoStorage* p_storage);
ScoreItem* FindPlayerInScoreHistory(Username* p_player, MxS16 p_playerId, MxS32& p_playerScoreHistoryIndex);
ScoreItem* FUN_1003cc90(Username* p_player, MxS16 p_unk0x24, MxS32& p_unk0x2c);
// FUNCTION: BETA10 0x1002c2b0
MxS16 GetCount() { return m_count; }
@ -181,12 +167,9 @@ class LegoGameState {
// FUNCTION: BETA10 0x1002c540
ScoreItem* GetScore(MxS32 p_index) { return p_index >= m_count ? NULL : &m_scores[p_index]; }
MxS16 m_count; // 0x00
#ifdef BETA10
MxS16 m_indices[20]; // 0x02
#endif
ScoreItem m_scores[20]; // 0x02 (0x22 for BETA10)
MxS16 m_nextPlayerId; // 0x372 (0x392 for BETA10)
MxS16 m_count; // 0x00
ScoreItem m_scores[20]; // 0x02
MxS16 m_unk0x372; // 0x372
};
LegoGameState();
@ -226,8 +209,14 @@ class LegoGameState {
Act GetCurrentAct() { return m_currentAct; }
Act GetLoadedAct() { return m_loadedAct; }
Area GetPreviousArea() { return m_previousArea; }
Area GetUnknown0x42c() { return m_unk0x42c; }
void SetDirty(MxBool p_isDirty) { m_isDirty = p_isDirty; }
void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; }
Username* GetPlayersIndex(MxS32 p_index) { return &m_players[p_index]; }
MxS16 GetPlayerCount() { return m_playerCount; }
LegoBackgroundColor* GetBackgroundColor() { return m_backgroundColor; }
void SetCurrentAct(Act p_currentAct);
@ -239,7 +228,7 @@ class LegoGameState {
MxResult WriteEndOfVariables(LegoStorage* p_storage);
MxS32 ReadVariable(LegoStorage* p_storage, MxVariableTable* p_to);
void SetColors();
void SetROIColorOverride();
void SetROIHandlerFunction();
char* m_savePath; // 0x00
MxS16 m_stateCount; // 0x04
@ -251,19 +240,22 @@ class LegoGameState {
LegoBackgroundColor* m_tempBackgroundColor; // 0x1c
LegoFullScreenMovie* m_fullScreenMovie; // 0x20
// TODO: Most likely getters/setters are not used according to BETA for the following members:
public:
MxS16 m_currentPlayerId; // 0x24
MxS16 m_unk0x24; // 0x24
MxS16 m_playerCount; // 0x26
Username m_players[9]; // 0x28
History m_history; // 0xa6
undefined2 m_unk0x41a; // 0x41a
JukeboxScript::Script m_jukeboxMusic; // 0x41c
MxBool m_isDirty; // 0x420
Area m_currentArea; // 0x424
Area m_previousArea; // 0x428
Area m_savedPreviousArea; // 0x42c
Area m_unk0x42c; // 0x42c
};
MxBool ROIColorOverride(const char* p_input, char* p_output, MxU32 p_copyLen);
MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen);
// SYNTHETIC: LEGO1 0x1003c860
// LegoGameState::ScoreItem::ScoreItem

View File

@ -0,0 +1,111 @@
#ifndef LEGOHIDEANIMPRESENTER_H
#define LEGOHIDEANIMPRESENTER_H
#include "decomp.h"
#include "legoloopinganimpresenter.h"
class LegoPathBoundary;
struct LegoHideAnimStructComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
};
// SIZE 0x08
struct LegoHideAnimStruct {
LegoPathBoundary* m_boundary; // 0x00
MxU32 m_index; // 0x04
};
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
// VTABLE: LEGO1 0x100d9278
// SIZE 0xc4
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoHideAnimPresenter();
~LegoHideAnimPresenter() override;
// FUNCTION: LEGO1 0x1006d860
void VTable0x8c() override {} // vtable+0x8c
// FUNCTION: LEGO1 0x1006d870
void VTable0x90() override {} // vtable+0x90
// FUNCTION: BETA10 0x1005d4a0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06cc
return "LegoHideAnimPresenter";
}
// FUNCTION: LEGO1 0x1006d880
// FUNCTION: BETA10 0x1005d470
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006d890
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x18
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
void FUN_1006db40(LegoTime p_time);
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
void FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
);
LegoPathBoundary** m_boundaryMap; // 0xc0
};
// clang-format off
// SYNTHETIC: LEGO1 0x1006d9d0
// LegoHideAnimPresenter::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1006ddb0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
// TEMPLATE: LEGO1 0x1006de80
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
// TEMPLATE: LEGO1 0x1006dec0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
// TEMPLATE: LEGO1 0x1006e310
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
// TEMPLATE: LEGO1 0x1006e350
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
// TEMPLATE: LEGO1 0x1006e3a0
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
// TEMPLATE: LEGO1 0x1006e6d0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1006e720
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
// GLOBAL: LEGO1 0x100f768c
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
// clang-format on
#endif // LEGOHIDEANIMPRESENTER_H

View File

@ -13,8 +13,8 @@ class LegoCameraController;
class LegoControlManager;
class LegoWorld;
extern MxS32 g_clickedObjectId;
extern const char* g_clickedAtom;
extern MxS32 g_unk0x100f31b0;
extern const char* g_unk0x100f31b4;
// VTABLE: LEGO1 0x100d87b8
// class MxCollection<LegoEventNotificationParam>
@ -74,7 +74,7 @@ class LegoInputManager : public MxPresenter {
c_right = 0x02,
c_up = 0x04,
c_down = 0x08,
c_ctrl = 0x10,
c_bit5 = 0x10,
c_leftOrRight = c_left | c_right,
c_upOrDown = c_up | c_down
@ -111,15 +111,15 @@ class LegoInputManager : public MxPresenter {
void SetWorld(LegoWorld* p_world);
void ClearWorld();
void SetUnknown88(MxBool p_unk0x88) { m_unk0x88 = p_unk0x88; }
void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; }
void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; }
// FUNCTION: BETA10 0x1002e390
void DisableInputProcessing()
{
m_inputProcessingDisabled = TRUE;
m_unk0x88 = TRUE;
m_unk0x336 = FALSE;
}
@ -154,7 +154,7 @@ class LegoInputManager : public MxPresenter {
MxBool m_unk0x80; // 0x80
MxBool m_unk0x81; // 0x81
LegoControlManager* m_controlManager; // 0x84
MxBool m_inputProcessingDisabled; // 0x88
MxBool m_unk0x88; // 0x88
IDirectInput* m_directInput; // 0x8c
IDirectInputDevice* m_directInputDevice; // 0x90
MxBool m_kbStateSuccess; // 0x94

View File

@ -0,0 +1,71 @@
#ifndef LEGOLOCOMOTIONANIMPRESENTER_H
#define LEGOLOCOMOTIONANIMPRESENTER_H
#include "legoloopinganimpresenter.h"
#include "legoroimaplist.h"
class LegoAnimActor;
// VTABLE: LEGO1 0x100d9170
// SIZE 0xd8
class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoLocomotionAnimPresenter();
~LegoLocomotionAnimPresenter() override;
// FUNCTION: BETA10 0x1005c4e0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06e4
return "LegoLocomotionAnimPresenter";
}
// FUNCTION: LEGO1 0x1006ce50
// FUNCTION: BETA10 0x1005c4b0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006ce60
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoLoopingAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
MxResult CreateAnim(MxStreamChunk* p_chunk) override; // vtable+0x88
// SYNTHETIC: LEGO1 0x1006cfe0
// LegoLocomotionAnimPresenter::`scalar deleting destructor'
void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value);
void DecrementUnknown0xd4()
{
if (m_unk0xd4) {
--m_unk0xd4;
}
}
undefined2 GetUnknown0xd4() { return m_unk0xd4; }
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 m_unk0xc0; // 0xc0
undefined4* m_unk0xc4; // 0xc4
LegoROIMapList* m_roiMapList; // 0xc8
MxS32 m_unk0xcc; // 0xcc
MxS32 m_unk0xd0; // 0xd0
undefined2 m_unk0xd4; // 0xd4
};
#endif // LEGOLOCOMOTIONANIMPRESENTER_H

View File

@ -0,0 +1,43 @@
#ifndef LEGOLOOPINGANIMPRESENTER_H
#define LEGOLOOPINGANIMPRESENTER_H
#include "legoanimpresenter.h"
// VTABLE: LEGO1 0x100d4900
// SIZE 0xc0
class LegoLoopingAnimPresenter : public LegoAnimPresenter {
public:
// FUNCTION: BETA10 0x1005c6f0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f0700
return "LegoLoopingAnimPresenter";
}
// FUNCTION: LEGO1 0x1000c9a0
// FUNCTION: BETA10 0x1005c6c0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1000c9b0
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void StreamingTickle() override; // vtable+0x20
void PutFrame() override; // vtable+0x6c
private:
undefined4 m_unk0xbc; // 0xbc
};
// SYNTHETIC: LEGO1 0x1006d000
// LegoLoopingAnimPresenter::~LegoLoopingAnimPresenter
// SYNTHETIC: LEGO1 0x1000f440
// LegoLoopingAnimPresenter::`scalar deleting destructor'
#endif // LEGOLOOPINGANIMPRESENTER_H

View File

@ -3,7 +3,7 @@
#include "compat.h"
#include "mxdsaction.h"
#include "mxmain.h"
#include "mxomni.h"
class Isle;
class LegoAnimationManager;
@ -90,6 +90,9 @@ class LegoOmni : public MxOmni {
return *this;
}
World GetId() { return m_id; }
const char* GetKey() { return m_key; }
World m_id; // 0x00
char m_key[20]; // 0x04
MxAtomId* m_atomId; // 0x18
@ -109,7 +112,6 @@ class LegoOmni : public MxOmni {
}
// FUNCTION: LEGO1 0x10058ab0
// FUNCTION: BETA10 0x1008f860
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, LegoOmni::ClassName()) || MxOmni::IsA(p_name);
@ -130,7 +132,7 @@ class LegoOmni : public MxOmni {
LegoROI* FindROI(const char* p_name);
void AddWorld(LegoWorld* p_world);
void DeleteWorld(LegoWorld* p_world);
void Disable(MxBool p_disable, MxU16 p_flags);
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
MxResult RegisterWorlds();
@ -149,14 +151,9 @@ class LegoOmni : public MxOmni {
// FUNCTION: BETA10 0x1009e7a0
LegoInputManager* GetInputManager() { return m_inputManager; }
// FUNCTION: BETA10 0x100e5400
LegoTextureContainer* GetTextureContainer() { return m_textureContainer; }
ViewLODListManager* GetViewLODListManager() { return m_viewLODListManager; }
// FUNCTION: BETA10 0x100969b0
LegoWorld* GetCurrentWorld() { return m_currentWorld; }
LegoNavController* GetNavController() { return m_navController; }
LegoPathActor* GetUserActor() { return m_userActor; }
@ -186,13 +183,12 @@ class LegoOmni : public MxOmni {
// FUNCTION: BETA10 0x100d55c0
void SetExit(MxBool p_exit) { m_exit = p_exit; }
MxResult StartActionIfInitialized(MxDSAction& p_dsAction) { return m_initialized ? Start(&p_dsAction) : SUCCESS; }
void SetInitialized(MxBool p_unk0x13c) { m_initialized = p_unk0x13c; }
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) { return m_unk0x13c ? Start(&p_dsAction) : SUCCESS; }
void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
void CloseMainWindow() { PostMessage(m_windowHandle, WM_CLOSE, 0, 0); }
void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); }
// SYNTHETIC: LEGO1 0x10058b30
// SYNTHETIC: BETA10 0x1008f8d0
// LegoOmni::`scalar deleting destructor'
private:
@ -215,7 +211,7 @@ class LegoOmni : public MxOmni {
MxTransitionManager* m_transitionManager; // 0x138
public:
MxBool m_initialized; // 0x13c
MxBool m_unk0x13c; // 0x13c
};
#endif // LEGOMAIN_H

View File

@ -1,10 +1,16 @@
#ifndef LEGOMETERPRESENTER_H
#define LEGOMETERPRESENTER_H
#include "mxgeometry.h"
#include "mxrect16.h"
#include "mxstillpresenter.h"
#include "mxstring.h"
// SIZE 0x08
struct MeterRect : public MxRect16 {
// FUNCTION: BETA10 0x10097eb0
MeterRect() {}
};
// VTABLE: LEGO1 0x100d7ac8
// VTABLE: BETA10 0x101bca68
// SIZE 0x94
@ -29,12 +35,12 @@ class LegoMeterPresenter : public MxStillPresenter {
void DrawMeter();
MxU8* m_meterPixels; // 0x6c
MxU16 m_fillColor; // 0x70
MxString m_variable; // 0x74
MxFloat m_curPercent; // 0x84
MxRect16 m_meterRect; // 0x88
MxS16 m_layout; // 0x90
MxU8* m_meterPixels; // 0x6c
MxU16 m_fillColor; // 0x70
MxString m_variable; // 0x74
MxFloat m_curPercent; // 0x84
MeterRect m_meterRect; // 0x88
MxS16 m_layout; // 0x90
};
// SYNTHETIC: LEGO1 0x10043760

View File

@ -46,7 +46,7 @@ class LegoModelPresenter : public MxVideoPresenter {
void ReadyTickle() override; // vtable+0x18
void ParseExtra() override; // vtable+0x30
MxResult CreateROI(MxDSChunk& p_chunk, LegoEntity* p_entity, MxBool p_roiVisible, LegoWorld* p_world);
MxResult FUN_1007ff70(MxDSChunk& p_chunk, LegoEntity* p_entity, MxBool p_roiVisible, LegoWorld* p_world);
void Reset()
{

View File

@ -155,7 +155,7 @@ class LegoNavController : public MxCore {
float m_unk0x60; // 0x60
float m_unk0x64; // 0x64
float m_unk0x68; // 0x68
MxBool m_isAccelerating; // 0x6c
MxBool m_unk0x6c; // 0x6c
// one copy of defaults (these can be set by App.)
static int g_defdeadZone;

View File

@ -2,7 +2,7 @@
#define LEGOPATHACTOR_H
#include "legoactor.h"
#include "misc/legospline.h"
#include "misc/legounknown.h"
#include "mxtypes.h"
struct LegoEdge;
@ -10,10 +10,10 @@ struct LegoNamedPlane;
class LegoPathBoundary;
class LegoPathController;
struct LegoPathEdgeContainer;
struct LegoOrientedEdge;
struct LegoUnknown100db7f4;
class LegoWEEdge;
extern MxLong g_timeLastHitSoundPlayed;
extern MxLong g_unk0x100f3308;
extern const char* g_strHIT_WALL_SOUND;
// VTABLE: LEGO1 0x100d6e28
@ -51,11 +51,9 @@ class LegoPathActor : public LegoActor {
virtual void VTable0x74(Matrix4& p_transform); // vtable+0x74
// FUNCTION: LEGO1 0x10002d20
// FUNCTION: BETA10 0x1000f500
virtual void SetUserNavFlag(MxBool p_userNavFlag) { m_userNavFlag = p_userNavFlag; } // vtable+0x78
// FUNCTION: LEGO1 0x10002d30
// FUNCTION: BETA10 0x1000f530
virtual MxBool GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
virtual MxResult VTable0x80(
@ -69,7 +67,7 @@ class LegoPathActor : public LegoActor {
float p_time,
Vector3& p_p1,
Vector3& p_p4,
LegoOrientedEdge* p_destEdge,
LegoUnknown100db7f4& p_destEdge,
float p_destScale
); // vtable+0x84
virtual MxResult VTable0x88(
@ -77,59 +75,49 @@ class LegoPathActor : public LegoActor {
float p_time,
LegoEdge& p_srcEdge,
float p_srcScale,
LegoOrientedEdge& p_destEdge,
LegoUnknown100db7f4& p_destEdge,
float p_destScale
); // vtable+0x88
virtual MxS32 VTable0x8c(float p_time, Matrix4& p_transform); // vtable+0x8c
// FUNCTION: LEGO1 0x10002d40
// FUNCTION: BETA10 0x1000f560
virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
// FUNCTION: LEGO1 0x10002d50
// FUNCTION: BETA10 0x1000f800
virtual MxResult HitActor(LegoPathActor*, MxBool) { return 0; } // vtable+0x94
virtual void SwitchBoundary(
LegoPathBoundary*& p_boundary,
LegoOrientedEdge*& p_edge,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
); // vtable+0x98
virtual MxResult VTable0x9c(); // vtable+0x9c
// FUNCTION: LEGO1 0x10002d60
// FUNCTION: BETA10 0x1000f820
virtual MxS32 NextTargetLocation() { return 0; } // vtable+0xa0
virtual MxS32 VTable0xa0() { return 0; } // vtable+0xa0
virtual void VTable0xa4(MxBool& p_und1, MxS32& p_und2); // vtable+0xa4
virtual void VTable0xa8(); // vtable+0xa8
// FUNCTION: LEGO1 0x10002d70
// FUNCTION: BETA10 0x1000f580
virtual void SetMaxLinearVel(MxFloat p_maxLinearVel) { m_maxLinearVel = p_maxLinearVel; } // vtable+0xac
// FUNCTION: LEGO1 0x10002d80
// FUNCTION: BETA10 0x1000f5b0
virtual MxFloat GetMaxLinearVel() { return m_maxLinearVel; } // vtable+0xb0
// FUNCTION: LEGO1 0x10002d90
// FUNCTION: BETA10 0x1000f5e0
virtual MxFloat VTable0xb4() { return m_unk0x140; } // vtable+0xb4
// FUNCTION: LEGO1 0x10002da0
// FUNCTION: BETA10 0x1000f610
virtual MxFloat VTable0xb8() { return m_unk0x144; } // vtable+0xb8
// FUNCTION: LEGO1 0x10002db0
// FUNCTION: BETA10 0x1000f640
virtual void VTable0xbc(MxFloat p_unk0x140) { m_unk0x140 = p_unk0x140; } // vtable+0xbc
// FUNCTION: LEGO1 0x10002dc0
// FUNCTION: BETA10 0x1000f670
virtual void VTable0xc0(MxFloat p_unk0x144) { m_unk0x144 = p_unk0x144; } // vtable+0xc0
// FUNCTION: LEGO1 0x10002dd0
// FUNCTION: BETA10 0x1000f6a0
virtual void VTable0xc4() {} // vtable+0xc4
// FUNCTION: LEGO1 0x10002de0
@ -144,7 +132,6 @@ class LegoPathActor : public LegoActor {
}
// FUNCTION: LEGO1 0x1000c440
// FUNCTION: BETA10 0x100124c0
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, LegoPathActor::ClassName()) || LegoActor::IsA(p_name);
@ -174,7 +161,6 @@ class LegoPathActor : public LegoActor {
void PlaceActor(LegoNamedPlane& p_namedPlane);
// SYNTHETIC: LEGO1 0x1002d800
// SYNTHETIC: BETA10 0x100b04d0
// LegoPathActor::`scalar deleting destructor'
protected:
@ -194,9 +180,9 @@ class LegoPathActor : public LegoActor {
MxFloat m_actorTime; // 0x80
MxFloat m_lastTime; // 0x84
LegoPathBoundary* m_boundary; // 0x88
LegoSpline m_spline; // 0x8c
LegoUnknown m_unk0x8c; // 0x8c
MxU32 m_actorState; // 0xdc
LegoOrientedEdge* m_destEdge; // 0xe0
LegoUnknown100db7f4* m_destEdge; // 0xe0
MxFloat m_unk0xe4; // 0xe4
MxBool m_collideBox; // 0xe8
MxBool m_unk0xe9; // 0xe9

View File

@ -21,7 +21,7 @@ struct LegoPathActorSetCompare {
};
struct LegoAnimPresenterSetCompare {
MxU32 operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const
MxBool operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const
{
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
}
@ -31,7 +31,6 @@ typedef set<LegoPathActor*, LegoPathActorSetCompare> LegoPathActorSet;
typedef set<LegoAnimPresenter*, LegoAnimPresenterSetCompare> LegoAnimPresenterSet;
// VTABLE: LEGO1 0x100d8618
// VTABLE: BETA10 0x101bdd58
// SIZE 0x74
class LegoPathBoundary : public LegoWEGEdge {
public:
@ -40,16 +39,22 @@ class LegoPathBoundary : public LegoWEGEdge {
MxResult AddActor(LegoPathActor* p_actor);
MxResult RemoveActor(LegoPathActor* p_actor);
void CheckAndCallPathTriggers(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor);
void FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor);
void SwitchBoundary(
LegoPathActor* p_actor,
LegoPathBoundary*& p_boundary,
LegoOrientedEdge*& p_edge,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
);
MxU32 Intersect(float p_scale, Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, LegoOrientedEdge*& p_edge);
MxU32 AddPresenterIfInRange(LegoAnimPresenter* p_presenter);
MxU32 RemovePresenter(LegoAnimPresenter* p_presenter);
MxU32 Intersect(
float p_scale,
Vector3& p_point1,
Vector3& p_point2,
Vector3& p_point3,
LegoUnknown100db7f4*& p_edge
);
MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter);
MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter);
// FUNCTION: BETA10 0x1001ffb0
LegoPathActorSet& GetActors() { return m_actors; }
@ -58,7 +63,6 @@ class LegoPathBoundary : public LegoWEGEdge {
LegoAnimPresenterSet& GetPresenters() { return m_presenters; }
// SYNTHETIC: LEGO1 0x10047a80
// SYNTHETIC: BETA10 0x100bd300
// LegoPathBoundary::`vector deleting destructor'
private:
@ -77,7 +81,7 @@ class LegoPathBoundary : public LegoWEGEdge {
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::erase
// TEMPLATE: LEGO1 0x1002c440
// TEMPLATE: BETA10 0x10020480
// TEMPLATE: BETA10 0x100b6480
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::find
// TEMPLATE: LEGO1 0x1002c4c0
@ -184,7 +188,7 @@ class LegoPathBoundary : public LegoWEGEdge {
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::lower_bound
// TEMPLATE: BETA10 0x10082b90
// ??Econst_iterator@?$_Tree@PAVLegoAnimPresenter@@PAV1@U_Kfn@?$set@PAVLegoAnimPresenter@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@QAE?AV01@H@Z
// _Tree<LegoAnimPresenter *,LegoAnimPresenter *,set<LegoAnimPresenter *,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::_Kfn,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::const_iterator::operator++
// TEMPLATE: BETA10 0x10082ee0
// set<LegoAnimPresenter *,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::end
@ -192,20 +196,14 @@ class LegoPathBoundary : public LegoWEGEdge {
// TEMPLATE: BETA10 0x10082b40
// _Tree<LegoAnimPresenter *,LegoAnimPresenter *,set<LegoAnimPresenter *,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::_Kfn,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::const_iterator::operator*
// TEMPLATE: BETA10 0x100b6440
// set<LegoAnimPresenter *,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::find
// TEMPLATE: BETA10 0x100b6480
// _Tree<LegoAnimPresenter *,LegoAnimPresenter *,set<LegoAnimPresenter *,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::_Kfn,LegoAnimPresenterSetCompare,allocator<LegoAnimPresenter *> >::find
// TEMPLATE: BETA10 0x10021dc0
// ??0?$Set@PAVLegoPathActor@@ULegoPathActorSetCompare@@@@QAE@ABV0@@Z
// Set<LegoPathActor *,LegoPathActorSetCompare>::Set<LegoPathActor *,LegoPathActorSetCompare>
// TEMPLATE: BETA10 0x100202d0
// set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::begin
// TEMPLATE: BETA10 0x10020030
// ??Econst_iterator@?$_Tree@PAVLegoPathActor@@PAV1@U_Kfn@?$set@PAVLegoPathActor@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@QAE?AV01@H@Z
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::const_iterator::operator++
// TEMPLATE: BETA10 0x100203d0
// set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::end

View File

@ -2,7 +2,7 @@
#define LEGOPATHCONTROLLER_H
#include "decomp.h"
#include "geom/legoorientededge.h"
#include "geom/legounkown100db7f4.h"
#include "legopathactor.h"
#include "legopathboundary.h"
#include "legopathstruct.h"
@ -21,7 +21,7 @@ class Vector3;
// VTABLE: LEGO1 0x100d7da8
// SIZE 0x40
struct LegoPathCtrlEdge : public LegoOrientedEdge {};
struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
struct LegoPathCtrlEdgeCompare {
MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const
@ -60,7 +60,7 @@ class LegoPathController : public MxCore {
}
LegoPathController* m_controller; // 0x00
LegoOrientedEdge* m_edge; // 0x04
LegoUnknown100db7f4* m_edge; // 0x04
};
LegoPathController();
@ -105,7 +105,7 @@ class LegoPathController : public MxCore {
MxResult PlaceActor(LegoPathActor* p_actor);
MxResult RemoveActor(LegoPathActor* p_actor);
void FUN_100468f0(LegoAnimPresenter* p_presenter);
void RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter);
void FUN_10046930(LegoAnimPresenter* p_presenter);
MxResult FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32& p_numL);
LegoPathBoundary* GetPathBoundary(const char* p_name);
void Enable(MxBool p_enable);
@ -126,7 +126,7 @@ class LegoPathController : public MxCore {
Vector3& p_v1,
Vector3& p_v2,
float p_f1,
LegoOrientedEdge*& p_edge,
LegoUnknown100db7f4*& p_edge,
LegoPathBoundary*& p_boundary
);
MxResult FUN_1004a380(
@ -144,13 +144,13 @@ class LegoPathController : public MxCore {
static MxResult Reset();
// FUNCTION: BETA10 0x100cf580
static LegoOrientedEdge* GetControlEdgeA(MxS32 p_index) { return g_ctrlEdgesA[p_index].m_edge; }
static LegoUnknown100db7f4* GetControlEdgeA(MxS32 p_index) { return g_ctrlEdgesA[p_index].m_edge; }
// FUNCTION: BETA10 0x100cf5b0
static LegoPathBoundary* GetControlBoundaryA(MxS32 p_index) { return g_ctrlBoundariesA[p_index].m_boundary; }
// These two are an educated guess because BETA10 does not have the g_ctrl.*B globals
static LegoOrientedEdge* GetControlEdgeB(MxS32 p_index) { return g_ctrlEdgesB[p_index].m_edge; }
static LegoUnknown100db7f4* GetControlEdgeB(MxS32 p_index) { return g_ctrlEdgesB[p_index].m_edge; }
static LegoPathBoundary* GetControlBoundaryB(MxS32 p_index) { return g_ctrlBoundariesB[p_index].m_boundary; }
private:
@ -189,12 +189,12 @@ class LegoPathController : public MxCore {
LegoPathBoundary* m_boundaries; // 0x08
LegoPathCtrlEdge* m_edges; // 0x0c
Mx3DPointFloat* m_nodes; // 0x10
Mx3DPointFloat* m_unk0x10; // 0x10
LegoPathStruct* m_structs; // 0x14
MxU16 m_numL; // 0x18 Number of boundaries
MxU16 m_numE; // 0x1a Number of edges
MxU16 m_numN; // 0x1c Number of nodes
MxU16 m_numT; // 0x1e Number of structs
MxU16 m_numL; // 0x18
MxU16 m_numE; // 0x1a
MxU16 m_numN; // 0x1c
MxU16 m_numT; // 0x1e
LegoPathCtrlEdgeSet m_pfsE; // 0x20
LegoPathActorSet m_actors; // 0x30
@ -264,7 +264,7 @@ class LegoPathController : public MxCore {
// LegoPathCtrlEdge::~LegoPathCtrlEdge
// SYNTHETIC: LEGO1 0x10047ae0
// LegoOrientedEdge::~LegoOrientedEdge
// LegoUnknown100db7f4::~LegoUnknown100db7f4
// TEMPLATE: LEGO1 0x10048f00
// list<LegoBoundaryEdge,allocator<LegoBoundaryEdge> >::begin

View File

@ -106,10 +106,4 @@ struct LegoPathEdgeContainer : public list<LegoBoundaryEdge> {
MxU8 m_flags; // 0x38
};
// SYNTHETIC: BETA10 0x10012080
// LegoPathEdgeContainer::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x100120d0
// LegoPathEdgeContainer::~LegoPathEdgeContainer
#endif // LEGOPATHEDGECONTAINER_H

View File

@ -10,32 +10,32 @@ class LegoTextureInfo;
// SIZE 0x20
class LegoPhoneme {
public:
LegoPhoneme(const char* p_name, MxU32 p_count)
LegoPhoneme(const char* p_name, undefined4 p_unk0x14)
{
m_name = p_name;
m_name.ToUpperCase();
Init();
m_count = p_count;
m_unk0x14 = p_unk0x14;
}
~LegoPhoneme();
virtual MxU32 GetCount(); // vtable+0x00
virtual void SetCount(MxU32 p_count); // vtable+0x04
virtual LegoTextureInfo* GetTextureInfo(); // vtable+0x08
virtual void SetTextureInfo(LegoTextureInfo* p_textureInfo); // vtable+0x0c
virtual LegoTextureInfo* GetCachedTextureInfo(); // vtable+0x10
virtual void SetCachedTextureInfo(LegoTextureInfo* p_cachedTextureInfo); // vtable+0x14
virtual void VTable0x18(); // vtable+0x18
virtual void Init(); // vtable+0x1c
virtual void VTable0x20(undefined4); // vtable+0x20
virtual undefined4 VTable0x00(); // vtable+0x00
virtual void VTable0x04(undefined4 p_unk0x14); // vtable+0x04
virtual LegoTextureInfo* VTable0x08(); // vtable+0x08
virtual void VTable0x0c(LegoTextureInfo* p_unk0x18); // vtable+0x0c
virtual LegoTextureInfo* VTable0x10(); // vtable+0x10
virtual void VTable0x14(LegoTextureInfo* p_unk0x1c); // vtable+0x14
virtual void VTable0x18(); // vtable+0x18
virtual void Init(); // vtable+0x1c
virtual void VTable0x20(undefined4); // vtable+0x20
MxString& GetName() { return m_name; }
private:
MxString m_name; // 0x04
MxU32 m_count; // 0x14
LegoTextureInfo* m_textureInfo; // 0x18
LegoTextureInfo* m_cachedTextureInfo; // 0x1c
MxString m_name; // 0x04
undefined4 m_unk0x14; // 0x14
LegoTextureInfo* m_unk0x18; // 0x18
LegoTextureInfo* m_unk0x1c; // 0x1c
};
#endif // LEGOPHONEME_H

View File

@ -42,9 +42,9 @@ class LegoPhonemePresenter : public MxFlcPresenter {
MxS32 m_rectCount; // 0x68
LegoTextureInfo* m_textureInfo; // 0x6c
MxBool m_reusedPhoneme; // 0x70
MxBool m_unk0x70; // 0x70
MxString m_roiName; // 0x74
MxBool m_isPartOfAnimMM; // 0x84
MxBool m_unk0x84; // 0x84
};
// TEMPLATE: LEGO1 0x1004eb20

View File

@ -32,7 +32,7 @@ class LegoPlantManager : public MxCore {
const char* ClassName() const override // vtable+0x0c
{
// While this class exists in BETA10, it didn't have a ClassName().
// The constructor suggests that it did not inherit from MxCore back then and did not have a VTABLE.
// I suppose it did not inherit from MxCore back then and likely did not have a VTABLE.
// STRING: LEGO1 0x100f318c
return "LegoPlantManager";
}
@ -49,14 +49,14 @@ class LegoPlantManager : public MxCore {
MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
LegoPlantInfo* GetInfoArray(MxS32& p_length);
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
MxBool DecrementCounter(LegoEntity* p_entity);
MxBool FUN_10026c50(LegoEntity* p_entity);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length);
MxResult DetermineBoundaries();
void ClearCounters();
void SetInitialCounters();
MxResult FUN_10026410();
void FUN_10027120();
void FUN_10027200();
static void SetCustomizeAnimFile(const char* p_value);
@ -68,20 +68,20 @@ class LegoPlantManager : public MxCore {
private:
void RemovePlant(MxS32 p_index, LegoOmni::World p_worldId);
void AdjustHeight(MxS32 p_index);
void FUN_10026860(MxS32 p_index);
LegoPlantInfo* GetInfo(LegoEntity* p_entity);
MxBool DecrementCounter(MxS32 p_index);
void AdjustCounter(LegoEntity* p_entity, MxS32 p_adjust);
MxBool FUN_10026c80(MxS32 p_index);
void FUN_100271b0(LegoEntity* p_entity, MxS32 p_adjust);
static char* g_customizeAnimFile;
static MxS32 g_maxMove[4];
static MxU32 g_maxSound;
LegoOmni::World m_worldId; // 0x08
MxBool m_boundariesDetermined; // 0x0c
AnimEntry* m_entries[5]; // 0x10
MxS8 m_numEntries; // 0x24
LegoWorld* m_world; // 0x28
LegoOmni::World m_worldId; // 0x08
undefined m_unk0x0c; // 0x0c
AnimEntry* m_entries[5]; // 0x10
MxS8 m_numEntries; // 0x24
LegoWorld* m_world; // 0x28
};
#endif // LEGOPLANTMANAGER_H

View File

@ -41,8 +41,8 @@ struct LegoPlantInfo {
MxU32 m_move; // 0x10
MxU8 m_mood; // 0x14
MxU8 m_color; // 0x15 - see enum for possible values
MxS8 m_counter; // 0x16
MxS8 m_initialCounter; // 0x17 - initial value loaded to m_counter
MxS8 m_unk0x16; // 0x16
MxS8 m_initialUnk0x16; // 0x17 - initial value loaded to m_unk0x16
const char* m_name; // 0x18
undefined4 m_unk0x1c; // 0x1c
float m_x; // 0x20

View File

@ -3,7 +3,7 @@
#include "decomp.h"
#include "mxcore.h"
#include "mxgeometry.h"
#include "mxpoint32.h"
#include <windows.h>

View File

@ -7,11 +7,11 @@
#include "legoracemap.h"
#include "legostate.h"
#include "legoworld.h"
#include "mxgeometry.h"
#include "mxrect32.h"
#include "mxtypes.h"
class Act1State;
class LegoControlManagerNotificationParam;
class LegoEventNotificationParam;
class LegoPathActor;
class MxEndActionNotificationParam;
class MxNotificationParam;
@ -29,11 +29,11 @@ class RaceState : public LegoState {
Entry()
{
m_id = 0;
m_lastScore = 0;
m_unk0x02 = 0;
m_score = 0;
}
MxS16 GetLastScore() { return m_lastScore; }
MxS16 GetUnknown0x02() { return m_unk0x02; }
// FUNCTION: BETA10 0x10088970
MxS16 GetHighScore() { return m_score; }
@ -43,12 +43,12 @@ class RaceState : public LegoState {
{
if (p_storage->IsReadMode()) {
p_storage->ReadU8(m_id);
p_storage->ReadS16(m_lastScore);
p_storage->ReadS16(m_unk0x02);
p_storage->ReadS16(m_score);
}
else if (p_storage->IsWriteMode()) {
p_storage->WriteU8(m_id);
p_storage->WriteS16(m_lastScore);
p_storage->WriteS16(m_unk0x02);
p_storage->WriteS16(m_score);
}
else {
@ -59,15 +59,9 @@ class RaceState : public LegoState {
}
// TODO: Possibly private
MxU8 m_id; // 0x00
MxS16 m_lastScore; // 0x02
MxS16 m_score; // 0x04
};
enum {
e_carrace = 0,
e_jetrace = 1,
e_finished = 2,
MxU8 m_id; // 0x00
MxS16 m_unk0x02; // 0x02
MxS16 m_score; // 0x04
};
RaceState();
@ -100,8 +94,8 @@ class RaceState : public LegoState {
// TODO: Most likely getters/setters are not used according to BETA.
Entry m_entries[5]; // 0x08
MxU32 m_state; // 0x28
Entry m_state[5]; // 0x08
undefined4 m_unk0x28; // 0x28
};
// VTABLE: LEGO1 0x100d5db0
@ -123,7 +117,7 @@ class LegoRace : public LegoWorld {
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual MxLong HandleControl(LegoControlManagerNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
// FUNCTION: LEGO1 0x10015b70
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0x70
@ -153,13 +147,13 @@ class LegoRace : public LegoWorld {
// FUNCTION: LEGO1 0x1000dac0
// FUNCTION: BETA10 0x100a87d0
virtual void SetMapLocator(LegoRaceMap* p_map, MxU32 p_index) // vtable+0x7c
virtual void VTable0x7c(LegoRaceMap* p_map, MxU32 p_index) // vtable+0x7c
{
m_mapsLocators[p_index] = p_map;
m_maps[p_index] = p_map;
}
// FUNCTION: LEGO1 0x1000dae0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
void Enable(MxBool p_enable) override; // vtable+0x68
@ -167,20 +161,20 @@ class LegoRace : public LegoWorld {
// LegoRace::`scalar deleting destructor'
protected:
MxS32 m_playerLaps; // 0xf8
MxS32 m_opponent1Laps; // 0xfc
MxS32 m_opponent2Laps; // 0x100
MxS32 m_playerLastPathStruct; // 0x104
MxS32 m_opponent1LastPathStruct; // 0x108
MxS32 m_opponent2LastPathStruct; // 0x10c
LegoRaceMap* m_mapsLocators[3]; // 0x110
LegoGameState::Area m_destLocation; // 0x11c
LegoPathActor* m_pathActor; // 0x120
Act1State* m_act1State; // 0x124
MxStillPresenter* m_opponent1Locator; // 0x128
MxStillPresenter* m_opponent2Locator; // 0x12c
MxRect32 m_progressBarRect; // 0x130
RaceState* m_raceState; // 0x140
MxS32 m_unk0xf8; // 0xf8
MxS32 m_unk0xfc; // 0xfc
MxS32 m_unk0x100; // 0x100
MxS32 m_unk0x104; // 0x104
MxS32 m_unk0x108; // 0x108
MxS32 m_unk0x10c; // 0x10c
LegoRaceMap* m_maps[3]; // 0x110
LegoGameState::Area m_destLocation; // 0x11c
LegoPathActor* m_pathActor; // 0x120
Act1State* m_act1State; // 0x124
MxStillPresenter* m_unk0x128; // 0x128
MxStillPresenter* m_unk0x12c; // 0x12c
MxRect32 m_unk0x130; // 0x130
RaceState* m_raceState; // 0x140
};
#endif // LEGORACE_H

View File

@ -26,7 +26,7 @@ class LegoRaceMap : public virtual LegoRaceActor {
void Animate(float p_time) override = 0; // vtable+0x70
// LegoRaceMap vtable
virtual void UpdateMapLocatorPosition(); // vtable+0x00
virtual void FUN_1005d4b0(); // vtable+0x00
// SYNTHETIC: LEGO1 0x10012c50
// LegoRaceMap::`vbase destructor'
@ -35,28 +35,28 @@ class LegoRaceMap : public virtual LegoRaceActor {
// LegoRaceMap::`scalar deleting destructor'
private:
MxBool m_mapEnabled; // 0x08
MxBool m_unk0x08; // 0x08
MxStillPresenter* m_stillPresenter; // 0x0c
// variable name verified by BETA10 0x100ca82b
MxControlPresenter* m_Map_Ctl; // 0x10
// likely an x-offset of the race map in world space
float m_worldXOffset; // 0x14
float m_unk0x14; // 0x14
// inversely scales the map in x direction (either convert world->screen space or to control the size)
float m_worldXScale; // 0x18
// likely a z-offset of the race map in world space
float m_worldZOffset; // 0x1c
// inversely scales the map in z direction (either convert world->screen space or to control the size)
float m_worldZScale; // 0x20
float m_unk0x18; // 0x18
// likely a y-offset of the race map in world space
float m_unk0x1c; // 0x1c
// inversely scales the map in y direction (either convert world->screen space or to control the size)
float m_unk0x20; // 0x20
// scales the map in x direction (either convert world->screen space or to change the size)
float m_screenXScale; // 0x24
float m_unk0x24; // 0x24
// scales the map in y direction (either convert world->screen space or to change the size)
float m_screenYScale; // 0x28
float m_unk0x28; // 0x28
// likely an x-offset of the race map in screen space
float m_screenXOffset; // 0x2c
float m_unk0x2c; // 0x2c
// likely a y-offset of the race map in screen space
float m_screenYOffset; // 0x30
float m_unk0x30; // 0x30
};
// GLOBAL: LEGO1 0x100d8848

View File

@ -72,7 +72,7 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
// FUNCTION: LEGO1 0x100141d0
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4) override
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) override
{
LegoJetskiRaceActor::SwitchBoundary(p_boundary, p_edge, p_unk0xe4);
} // vtable+0x98
@ -136,7 +136,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
// FUNCTION: LEGO1 0x10014560
// FUNCTION: BETA10 0x100cd660
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4) override
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) override
{
LegoCarRaceActor::SwitchBoundary(p_boundary, p_edge, p_unk0xe4);
} // vtable+0x98
@ -144,10 +144,10 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
MxResult VTable0x9c() override; // vtable+0x9c
virtual void SetMaxLinearVelocity(float p_maxLinearVelocity);
virtual void KickCamera(float p_param);
virtual void FUN_10012ff0(float p_param);
virtual MxU32 HandleSkeletonKicks(float p_param1);
static void InitYouCantStopSound();
static void FUN_10012de0();
static void InitSoundIndices();
// SYNTHETIC: LEGO1 0x10014240
@ -155,7 +155,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
private:
undefined m_userState; // 0x54
float m_kickStart; // 0x58
float m_unk0x58; // 0x58
Mx3DPointFloat m_unk0x5c; // 0x5c
// Names verified by BETA10 0x100cb4a9

View File

@ -44,11 +44,8 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
Vector3& p_v3
) override; // vtable+0x6c
void Animate(float p_time) override; // vtable+0x70
void SwitchBoundary(
LegoPathBoundary*& p_boundary,
LegoOrientedEdge*& p_edge,
float& p_unk0xe4
) override; // vtable+0x98
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
// LegoCarRaceActor vtable
@ -86,7 +83,7 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
protected:
MxFloat m_unk0x08; // 0x08
MxU8 m_animState; // 0x0c
MxU8 m_unk0x0c; // 0x0c
// Could be a multiplier for the maximum speed when going straight
MxFloat m_unk0x10; // 0x10

View File

@ -17,15 +17,15 @@ class LegoSoundManager : public MxSoundManager {
void Destroy() override; // vtable+0x18
MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread) override; // vtable+0x30
// SYNTHETIC: LEGO1 0x10029920
// SYNTHETIC: BETA10 0x100d0660
// LegoSoundManager::`scalar deleting destructor'
void UpdateListener(const float* p_position, const float* p_direction, const float* p_up, const float* p_velocity);
// FUNCTION: BETA10 0x1000f350
LegoCacheSoundManager* GetCacheSoundManager() { return m_cacheSoundManager; }
// SYNTHETIC: LEGO1 0x10029920
// SYNTHETIC: BETA10 0x100d0660
// LegoSoundManager::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);

View File

@ -19,7 +19,7 @@ class LegoTextureInfo {
static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo);
static BOOL GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_textureInfo);
LegoResult LoadBits(const LegoU8* p_bits);
LegoResult FUN_10066010(const LegoU8* p_bits);
// private:
char* m_name; // 0x00

View File

@ -28,11 +28,9 @@ class LegoTranInfoList : public MxPtrList<LegoTranInfo> {
// class MxPtrListCursor<LegoTranInfo>
// VTABLE: LEGO1 0x100d8d20
// VTABLE: BETA10 0x101bad70
// SIZE 0x10
class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
public:
// FUNCTION: BETA10 0x100496d0
LegoTranInfoListCursor(LegoTranInfoList* p_list) : MxPtrListCursor<LegoTranInfo>(p_list) {}
};
@ -64,14 +62,9 @@ class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
// MxPtrList<LegoTranInfo>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100612f0
// SYNTHETIC: BETA10 0x100498c0
// LegoTranInfoListCursor::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x10049770
// MxPtrListCursor<LegoTranInfo>::MxPtrListCursor<LegoTranInfo>
// FUNCTION: LEGO1 0x10061360
// FUNCTION: BETA10 0x10049910
// MxPtrListCursor<LegoTranInfo>::~MxPtrListCursor<LegoTranInfo>
// SYNTHETIC: LEGO1 0x100613b0
@ -84,7 +77,6 @@ class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
// MxListCursor<LegoTranInfo *>::~MxListCursor<LegoTranInfo *>
// FUNCTION: LEGO1 0x100614e0
// FUNCTION: BETA10 0x10049ab0
// LegoTranInfoListCursor::~LegoTranInfoListCursor
#endif // LEGOTRANINFOLIST_H

View File

@ -45,33 +45,28 @@ LegoROI* PickROI(MxLong p_x, MxLong p_y);
LegoROI* PickRootROI(MxLong p_x, MxLong p_y);
void RotateY(LegoROI* p_roi, MxFloat p_angle);
MxBool SpheresIntersect(const BoundingSphere& p_sphere1, const BoundingSphere& p_sphere2);
MxBool CalculateRayOriginDirection(MxFloat p_coordinates[2], MxFloat p_direction[3], MxFloat p_origin[3]);
MxBool FUN_1003ded0(MxFloat p_param1[2], MxFloat p_param2[3], MxFloat p_param3[3]);
MxBool TransformWorldToScreen(const MxFloat p_world[3], MxFloat p_screen[4]);
MxS16 CountTotalTreeNodes(LegoTreeNode* p_node);
LegoTreeNode* GetTreeNode(LegoTreeNode* p_node, MxU32 p_index);
void CalculateViewFromAnimation(LegoAnimPresenter* p_presenter);
void FUN_1003e050(LegoAnimPresenter* p_presenter);
Extra::ActionType MatchActionString(const char*);
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId& p_pAtom, MxS32 p_streamId, LegoEntity* p_sender);
void SetCameraControllerFromIsle();
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool);
void ResetViewVelocity();
void FUN_1003eda0();
MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
void EnableAnimations(MxBool p_enable);
void SetAppCursor(Cursor p_cursor);
MxBool CanExit();
MxBool RemoveFromWorld(
const MxAtomId& p_entityAtom,
MxS32 p_entityId,
const MxAtomId& p_worldAtom,
MxS32 p_worldEntityId
);
MxBool FUN_1003ef60();
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);
MxS32 UpdateLightPosition(MxS32 p_increase);
void SetLightPosition(MxS32 p_index);
LegoNamedTexture* ReadNamedTexture(LegoStorage* p_storage);
void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name);
void WriteNamedTexture(LegoStorage* p_storage, LegoNamedTexture* p_namedTexture);
void LoadFromNamedTexture(LegoNamedTexture* p_namedTexture);
void FUN_1003f930(LegoNamedTexture* p_namedTexture);
// FUNCTION: BETA10 0x100260a0
inline void StartIsleAction(IsleScript::Script p_objectId)

View File

@ -17,60 +17,41 @@ extern const char* g_varVISIBILITY;
extern const char* g_varCAMERALOCATION;
extern const char* g_varCURSOR;
extern const char* g_varWHOAMI;
extern const char* g_varDEBUG;
// VTABLE: LEGO1 0x100d86c8
// VTABLE: BETA10 0x101bc980
// SIZE 0x24
class VisibilityVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093470
VisibilityVariable() { m_key = g_varVISIBILITY; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d86b8
// VTABLE: BETA10 0x101bc990
// SIZE 0x24
class CameraLocationVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093510
CameraLocationVariable() { m_key = g_varCAMERALOCATION; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d86a8
// VTABLE: BETA10 0x101bc9a0
// SIZE 0x24
class CursorVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x100935b0
CursorVariable() { m_key = g_varCURSOR; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d8698
// VTABLE: BETA10 0x101bc9b0
// SIZE 0x24
class WhoAmIVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093650
WhoAmIVariable() { m_key = g_varWHOAMI; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: BETA10 0x101bc9c0
// SIZE 0x24
class DebugVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x100936f0
DebugVariable() { m_key = g_varDEBUG; }
void SetValue(const char* p_value) override; // vtable+0x04
};
#endif // LEGOVARIABLES_H

View File

@ -20,7 +20,6 @@ class Renderer;
}
// VTABLE: LEGO1 0x100d9c88
// VTABLE: BETA10 0x101bef08
// SIZE 0x590
class LegoVideoManager : public MxVideoManager {
public:
@ -42,7 +41,6 @@ class LegoVideoManager : public MxVideoManager {
virtual MxPresenter* GetPresenterAt(MxS32 p_x, MxS32 p_y); // vtable+0x38
// FUNCTION: LEGO1 0x1007ab10
// FUNCTION: BETA10 0x100d8010
virtual LegoPhonemeList* GetPhonemeList() { return m_phonemeRefList; } // vtable+0x3c
void SetSkyColor(float p_red, float p_green, float p_blue);
@ -64,15 +62,9 @@ class LegoVideoManager : public MxVideoManager {
MxBool GetRender3D() { return m_render3d; }
double GetElapsedSeconds() { return m_elapsedSeconds; }
// FUNCTION: BETA10 0x1002e290
void SetRender3D(MxBool p_render3d) { m_render3d = p_render3d; }
void SetUnk0x554(MxBool p_unk0x554) { m_unk0x554 = p_unk0x554; }
// SYNTHETIC: LEGO1 0x1007ab20
// SYNTHETIC: BETA10 0x100d8040
// LegoVideoManager::`scalar deleting destructor'
private:
MxResult CreateDirect3D();
MxResult ConfigureD3DRM();
@ -128,4 +120,7 @@ class LegoVideoManager : public MxVideoManager {
DWORD m_bufferCount; // 0x58c
};
// SYNTHETIC: LEGO1 0x1007ab20
// LegoVideoManager::`scalar deleting destructor'
#endif // LEGOVIDEOMANAGER_H

View File

@ -47,18 +47,18 @@ class LegoWorld : public LegoEntity {
LegoWorld();
~LegoWorld() override; // vtable+0x00
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void ReadyWorld(); // vtable+0x50
virtual LegoCameraController* InitializeCameraController(); // vtable+0x54
virtual void Add(MxCore* p_object); // vtable+0x58
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void ReadyWorld(); // vtable+0x50
virtual LegoCameraController* VTable0x54(); // vtable+0x54
virtual void Add(MxCore* p_object); // vtable+0x58
// The BETA10 match could also be LegoWorld::Escape(), only the child classes might be able to tell
// FUNCTION: LEGO1 0x1001d670
// FUNCTION: BETA10 0x10017530
virtual MxBool WaitForTransition() { return FALSE; } // vtable+0x5c
virtual MxBool VTable0x5c() { return FALSE; } // vtable+0x5c
// FUNCTION: LEGO1 0x100010a0
virtual void VTable0x60() {} // vtable+0x60
@ -102,8 +102,8 @@ class LegoWorld : public LegoEntity {
);
void RemoveActor(LegoPathActor* p_actor);
MxBool ActorExists(LegoPathActor* p_actor);
void AddPresenterIfInRange(LegoAnimPresenter* p_presenter);
void RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter);
void FUN_1001fda0(LegoAnimPresenter* p_presenter);
void FUN_1001fe90(LegoAnimPresenter* p_presenter);
LegoPathBoundary* FindPathBoundary(const char* p_name);
void AddPath(LegoPathController* p_controller);
MxResult GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL);
@ -115,7 +115,7 @@ class LegoWorld : public LegoEntity {
LegoEntityList* GetEntityList() { return m_entityList; }
LegoOmni::World GetWorldId() { return m_worldId; }
MxBool NoDisabledObjects() { return m_disabledObjects.empty(); }
MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); }
list<LegoROI*>& GetROIList() { return m_roiList; }
LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnim; }
@ -125,17 +125,17 @@ class LegoWorld : public LegoEntity {
// LegoWorld::`scalar deleting destructor'
protected:
LegoPathControllerList m_pathControllerList; // 0x68
MxPresenterList m_animPresenters; // 0x80
LegoCameraController* m_cameraController; // 0x98
LegoEntityList* m_entityList; // 0x9c
LegoCacheSoundList* m_cacheSoundList; // 0xa0
MxBool m_destroyed; // 0xa4
MxCoreSet m_objects; // 0xa8
MxPresenterList m_controlPresenters; // 0xb8
MxCoreSet m_disabledObjects; // 0xd0
list<LegoROI*> m_roiList; // 0xe0
LegoOmni::World m_worldId; // 0xec
LegoPathControllerList m_list0x68; // 0x68
MxPresenterList m_animPresenters; // 0x80
LegoCameraController* m_cameraController; // 0x98
LegoEntityList* m_entityList; // 0x9c
LegoCacheSoundList* m_cacheSoundList; // 0xa0
MxBool m_destroyed; // 0xa4
MxCoreSet m_set0xa8; // 0xa8
MxPresenterList m_controlPresenters; // 0xb8
MxCoreSet m_set0xd0; // 0xd0
list<LegoROI*> m_roiList; // 0xe0
LegoOmni::World m_worldId; // 0xec
// name verified by BETA10 0x100c7f59
LegoHideAnimPresenter* m_hideAnim; // 0xf0

View File

@ -16,15 +16,12 @@ class LegoWorld;
// class MxPtrList<LegoWorld>
// VTABLE: LEGO1 0x100d8680
// VTABLE: BETA10 0x101bc900
// SIZE 0x18
class LegoWorldList : public MxPtrList<LegoWorld> {
public:
// FUNCTION: BETA10 0x10092ce0
LegoWorldList(MxBool p_ownership = FALSE) : MxPtrList<LegoWorld>(p_ownership) {}
// FUNCTION: LEGO1 0x100598d0
// FUNCTION: BETA10 0x10092d80
MxS8 Compare(LegoWorld* p_a, LegoWorld* p_b) override { return p_a == p_b ? 0 : p_a < p_b ? -1 : 1; } // vtable+0x14
// SYNTHETIC: LEGO1 0x10059a00

View File

@ -50,10 +50,10 @@ class LegoWorldPresenter : public LegoEntityPresenter {
// LegoWorldPresenter::`scalar deleting destructor'
private:
MxResult LoadWorldPart(ModelDbPart& p_part, FILE* p_wdbFile);
MxResult LoadWorldModel(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world);
MxResult FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile);
MxResult FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world);
MxU32 m_nextObjectId;
undefined4 m_unk0x50;
};
#endif // LEGOWORLDPRESENTER_H

View File

@ -48,11 +48,11 @@ LegoPlantManager* PlantManager();
LegoBuildingManager* BuildingManager();
LegoTextureContainer* TextureContainer();
ViewLODListManager* GetViewLODListManager();
void Disable(MxBool p_disable, MxU16 p_flags);
void FUN_10015820(MxBool p_disable, MxU16 p_flags);
LegoROI* FindROI(const char* p_name);
void SetROIVisible(const char* p_name, MxBool p_visible);
void SetUserActor(LegoPathActor* p_userActor);
MxResult StartActionIfInitialized(MxDSAction& p_dsAction);
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction);
void DeleteAction();
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
MxDSAction& GetCurrentAction();

View File

@ -37,21 +37,20 @@ class MxBackgroundAudioManager : public MxCore {
void StartAction(MxParam& p_param);
void StopAction(MxParam& p_param);
MxResult PlayMusic(MxDSAction& p_action, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
MxResult PlayMusic(MxDSAction& p_action, undefined4 p_speed, MxPresenter::TickleState p_tickleState);
void MakePendingPresenterActive();
void FadeInPendingPresenter();
void FadeToTargetVolume();
void FUN_1007ee70();
void FUN_1007ef40();
void FadeInOrFadeOut();
void Enable(MxBool p_enable);
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
void Init();
void Update(MxS32 p_targetVolume, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
void Stop();
void LowerVolume();
void RaiseVolume();
MxResult SetPendingPresenter(MxPresenter* p_presenter, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
undefined4 FUN_1007f610(MxPresenter* p_unk0x138, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
// SYNTHETIC: LEGO1 0x1007ec00
// MxBackgroundAudioManager::`scalar deleting destructor'
@ -60,11 +59,11 @@ class MxBackgroundAudioManager : public MxCore {
MxResult OpenMusic(MxAtomId& p_script);
void DestroyMusic();
MxBool m_enabled; // 0x08
MxDSAction m_action1; // 0x0c
MxAudioPresenter* m_activePresenter; // 0xa0
MxDSAction m_action2; // 0xa4
MxAudioPresenter* m_pendingPresenter; // 0x138
MxBool m_enabled; // 0x08
MxDSAction m_action1; // 0x0c
MxAudioPresenter* m_unk0xa0; // 0xa0
MxDSAction m_action2; // 0xa4
MxAudioPresenter* m_unk0x138; // 0x138
// name is inferred from context
MxPresenter::TickleState m_tickleState; // 0x13c
@ -72,9 +71,9 @@ class MxBackgroundAudioManager : public MxCore {
// name inferred from parameter p_speed
MxS32 m_speed; // 0x140
MxS32 m_targetVolume; // 0x144
MxS16 m_volumeSuppressionAmount; // 0x148
MxAtomId m_script; // 0x14c
MxS32 m_targetVolume; // 0x144
MxS16 m_unk0x148; // 0x148
MxAtomId m_script; // 0x14c
};
#endif // MXBACKGROUNDAUDIOMANAGER_H

View File

@ -5,6 +5,7 @@
#include "mxcompositepresenter.h"
class LegoControlManagerNotificationParam;
class MxVideoPresenter;
// VTABLE: LEGO1 0x100d7b88
// VTABLE: BETA10 0x101bf5d0
@ -44,28 +45,21 @@ class MxControlPresenter : public MxCompositePresenter {
void EndAction() override; // vtable+0x40
MxBool HasTickleStatePassed(TickleState p_tickleState) override; // vtable+0x48
void Enable(MxBool p_enable) override; // vtable+0x54
virtual void UpdateEnabledChild(MxS16 p_enabledChild); // vtable+0x6c
virtual void VTable0x6c(MxS16 p_unk0x4e); // vtable+0x6c
MxBool Notify(LegoControlManagerNotificationParam* p_param, MxPresenter* p_presenter);
MxBool CheckButtonDown(MxS32 p_x, MxS32 p_y, MxPresenter* p_presenter);
MxBool FUN_10044480(LegoControlManagerNotificationParam* p_param, MxPresenter* p_presenter);
MxBool FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter* p_presenter);
MxS16 GetEnabledChild() { return m_enabledChild; }
MxS16 GetUnknown0x4e() { return m_unk0x4e; }
private:
enum {
e_none,
e_toggle,
e_grid,
e_map,
};
MxS16 m_style; // 0x4c
MxS16 m_enabledChild; // 0x4e
MxBool m_unk0x50; // 0x50
MxS16 m_columnsOrRows; // 0x52
MxS16 m_rowsOrColumns; // 0x54
MxS16 m_stateOrCellIndex; // 0x56
MxS16* m_states; // 0x58
undefined2 m_unk0x4c; // 0x4c
MxS16 m_unk0x4e; // 0x4e
MxBool m_unk0x50; // 0x50
undefined2 m_unk0x52; // 0x52
undefined2 m_unk0x54; // 0x54
undefined2 m_unk0x56; // 0x56
MxS16* m_unk0x58; // 0x58
};
// SYNTHETIC: LEGO1 0x100440f0

View File

@ -37,7 +37,7 @@ class PizzaMissionState : public LegoState {
m_unk0x08 = 1;
m_finishTimes = p_finishTimes;
m_startTime = INT_MIN;
m_counter = 1;
m_unk0x14 = 1;
m_score = LegoState::e_grey;
m_hiScore = LegoState::e_grey;
m_actions = p_actions;
@ -52,7 +52,7 @@ class PizzaMissionState : public LegoState {
m_unk0x08 = p_mission.m_unk0x08;
m_finishTimes = p_mission.m_finishTimes;
m_startTime = p_mission.m_startTime;
m_counter = p_mission.m_counter;
m_unk0x14 = p_mission.m_unk0x14;
m_score = p_mission.m_score;
m_hiScore = p_mission.m_hiScore;
m_actions = p_mission.m_actions;
@ -100,24 +100,12 @@ class PizzaMissionState : public LegoState {
undefined m_unk0x08; // 0x08
MxLong* m_finishTimes; // 0x0c
MxLong m_startTime; // 0x10
MxS16 m_counter; // 0x14
MxS16 m_unk0x14; // 0x14
MxS16 m_score; // 0x16
MxS16 m_hiScore; // 0x18
IsleScript::Script* m_actions; // 0x1c
};
enum {
e_none = 0,
e_introduction = 1,
e_waitAcceptingQuest = 2,
e_started = 3,
e_delivering = 4,
e_arrivedAtDestination = 5,
e_suggestHelicopter = 6,
e_transitionToAct2 = 8,
e_timeoutAcceptingQuest = 9,
};
PizzaMissionState();
// FUNCTION: LEGO1 0x10039290
@ -137,10 +125,10 @@ class PizzaMissionState : public LegoState {
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
// FUNCTION: BETA10 0x100ef470
void SetPlayedAction(MxU32 p_playedAction) { m_playedAction = p_playedAction; }
void SetUnknown0xb0(MxU32 p_unk0xb0) { m_unk0xb0 = p_unk0xb0; }
// FUNCTION: BETA10 0x100ef850
MxU32 GetPlayedAction() { return m_playedAction; }
MxU32 GetUnknown0xb0() { return m_unk0xb0; }
// FUNCTION: BETA10 0x10088850
MxS16 GetHighScore(MxU8 p_actorId) { return GetMission(p_actorId)->m_hiScore; }
@ -149,12 +137,12 @@ class PizzaMissionState : public LegoState {
// PizzaMissionState::`scalar deleting destructor'
Mission* GetMission(MxU8 p_actorId);
MxS16 GetActorState();
MxS16 FUN_10039540();
PizzeriaState* m_pizzeriaState; // 0x08
MxU32 m_state; // 0x0c
undefined4 m_unk0x0c; // 0x0c
Mission m_missions[5]; // 0x10
MxU32 m_playedAction; // 0xb0
MxU32 m_unk0xb0; // 0xb0
static IsleScript::Script g_pepperActions[];
static IsleScript::Script g_mamaActions[];
@ -199,8 +187,8 @@ class Pizza : public IsleActor {
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0x80
void CreateState();
void Start(IsleScript::Script p_objectId);
void Reset();
void FUN_10038220(IsleScript::Script p_objectId);
void FUN_100382b0();
void StopActions();
void PlayAction(MxU32 p_objectId, MxBool p_param7);
@ -214,10 +202,10 @@ class Pizza : public IsleActor {
PizzaMissionState::Mission* m_mission; // 0x80
SkateBoard* m_skateBoard; // 0x84
Act1State* m_act1state; // 0x88
IsleScript::Script m_speechAction; // 0x8c
MxLong m_startTime; // 0x90
MxLong m_duration; // 0x94
MxBool m_playedLocationAnimation; // 0x98
IsleScript::Script m_unk0x8c; // 0x8c
MxLong m_unk0x90; // 0x90
MxLong m_unk0x94; // 0x94
MxBool m_unk0x98; // 0x98
};
#endif // PIZZA_H

View File

@ -34,11 +34,11 @@ class PizzeriaState : public LegoState {
// SYNTHETIC: LEGO1 0x10017ce0
// PizzeriaState::`scalar deleting destructor'
MxS16 GetActorState();
MxS16 FUN_10017d50();
MxU32 NextAction();
Playlist m_playerPlaylists[5]; // 0x08
MxS32 m_states[5]; // 0x44
Playlist m_unk0x08[5]; // 0x08
MxS32 m_unk0x44[5]; // 0x44
static IsleScript::Script g_pepperActions[];
static IsleScript::Script g_mamaActions[];

View File

@ -16,11 +16,6 @@ class MxDSAction;
// SIZE 0x10
class PoliceState : public LegoState {
public:
enum {
e_noAnimation = 0,
e_playingAnimation = 1,
};
PoliceState();
~PoliceState() override {}
@ -43,15 +38,15 @@ class PoliceState : public LegoState {
// SYNTHETIC: LEGO1 0x1005e920
// PoliceState::`scalar deleting destructor'
MxS32 GetState() { return m_state; }
void SetState(MxS32 p_state) { m_state = p_state; }
undefined4 GetUnknown0x0c() { return m_unk0x0c; }
void SetUnknown0x0c(undefined4 p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
void StartAnimation();
void FUN_1005ea40();
// TODO: Most likely getters/setters are not used according to BETA.
PoliceScript::Script m_policeScript; // 0x08
MxS32 m_state; // 0x0c
undefined4 m_unk0x0c; // 0x0c
};
// VTABLE: LEGO1 0x100d8a80
@ -65,7 +60,7 @@ class Police : public LegoWorld {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x1005e1d0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x1005e1e0
// FUNCTION: BETA10 0x100f0c50

View File

@ -15,7 +15,7 @@ class RaceSkel : public LegoAnimActor {
void ParseAction(char* p_extra) override; // vtable+0x20
MxResult AnimateWithTransform(float p_time, Matrix4& p_transform) override;
MxResult FUN_1001c360(float p_und, Matrix4& p_transform) override;
virtual void FUN_10071c80(Vector3& p_vec);

View File

@ -39,14 +39,14 @@ class RadioState : public LegoState {
void SetActive(MxBool p_active) { m_active = p_active; }
MxU32 NextPlaylistObjectId();
MxBool IsRadioObjectId(const MxAtomId& p_atom, MxU32 p_objectId);
undefined4 FUN_1002d090();
MxBool FUN_1002d0c0(const MxAtomId& p_atom, MxU32 p_objectId);
// TODO: Most likely getters/setters are not used according to BETA.
Playlist m_playlists[3]; // 0x08
MxS16 m_activePlaylist; // 0x2c
MxBool m_active; // 0x2e
Playlist m_unk0x08[3]; // 0x08
MxS16 m_unk0x2c; // 0x2c
MxBool m_active; // 0x2e
};
// VTABLE: LEGO1 0x100d6d10
@ -85,7 +85,7 @@ class Radio : public MxCore {
private:
RadioState* m_state; // 0x08
MxBool m_enabled; // 0x0c
MxBool m_unk0x0c; // 0x0c
MxBool m_audioEnabled; // 0x0d
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);

View File

@ -54,12 +54,12 @@ class RegistrationBook : public LegoWorld {
struct {
MxS16 m_letters[7]; // 0x00
MxS16 m_cursorPos; // 0x0e
} m_newName; // 0x280
} m_unk0x280; // 0x280
MxControlPresenter* m_checkmark[10]; // 0x290
undefined2 m_vehiclesToPosition; // 0x2b8
undefined2 m_unk0x2b8; // 0x2b8
InfocenterState* m_infocenterState; // 0x2bc
undefined m_unk0x2c0; // 0x2c0
undefined m_awaitLoad; // 0x2c1
undefined m_unk0x2c1; // 0x2c1
undefined m_unk0x2c2[0x02]; // 0x2c2
LPDIRECTDRAWSURFACE m_checkboxHilite; // 0x2c4
LPDIRECTDRAWSURFACE m_checkboxSurface; // 0x2c8
@ -69,9 +69,9 @@ class RegistrationBook : public LegoWorld {
MxLong HandleKeyPress(MxU8 p_key);
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param);
void LoadSave(MxS16 p_checkMarkIndex);
void FUN_100775c0(MxS16 p_playerIndex);
void WriteInfocenterLetters(MxS16);
void LoadVehicles();
void FUN_100778c0();
MxBool CreateSurface();
};

View File

@ -60,7 +60,7 @@ class Score : public LegoWorld {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x100010b0
MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
// FUNCTION: LEGO1 0x100010c0
// FUNCTION: BETA10 0x100f4f20
@ -85,8 +85,8 @@ class Score : public LegoWorld {
void Enable(MxBool p_enable) override; // vtable+0x68
void Paint();
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
MxLong FUN_10001510(MxEndActionNotificationParam& p_param);
MxLong FUN_100016d0(LegoControlManagerNotificationParam& p_param);
void FillArea(MxS32 i_activity, MxS32 i_actor, MxS16 score);
protected:

View File

@ -12,13 +12,6 @@ class MxEndActionNotificationParam;
// SIZE 0x28
class TowTrackMissionState : public LegoState {
public:
enum {
e_none = 0,
e_started = 1,
e_hookedUp = 2,
e_hookingUp = 3,
};
TowTrackMissionState();
// FUNCTION: LEGO1 0x1004dde0
@ -133,19 +126,19 @@ class TowTrackMissionState : public LegoState {
// SYNTHETIC: LEGO1 0x1004e060
// TowTrackMissionState::`scalar deleting destructor'
MxU32 m_state; // 0x08
MxLong m_startTime; // 0x0c
MxBool m_takingTooLong; // 0x10
MxS16 m_peScore; // 0x12
MxS16 m_maScore; // 0x14
MxS16 m_paScore; // 0x16
MxS16 m_niScore; // 0x18
MxS16 m_laScore; // 0x1a
MxS16 m_peHighScore; // 0x1c
MxS16 m_maHighScore; // 0x1e
MxS16 m_paHighScore; // 0x20
MxS16 m_niHighScore; // 0x22
MxS16 m_laHighScore; // 0x24
undefined4 m_unk0x08; // 0x08
MxLong m_startTime; // 0x0c
MxBool m_unk0x10; // 0x10
MxS16 m_peScore; // 0x12
MxS16 m_maScore; // 0x14
MxS16 m_paScore; // 0x16
MxS16 m_niScore; // 0x18
MxS16 m_laScore; // 0x1a
MxS16 m_peHighScore; // 0x1c
MxS16 m_maHighScore; // 0x1e
MxS16 m_paHighScore; // 0x20
MxS16 m_niHighScore; // 0x22
MxS16 m_laHighScore; // 0x24
};
// VTABLE: LEGO1 0x100d7ee0
@ -181,10 +174,10 @@ class TowTrack : public IslePathActor {
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf0
void CreateState();
void Init();
void FUN_1004dab0();
void ActivateSceneActions();
void StopActions();
void Reset();
void FUN_1004dbe0();
// SYNTHETIC: LEGO1 0x1004c950
// TowTrack::`scalar deleting destructor'
@ -192,15 +185,15 @@ class TowTrack : public IslePathActor {
private:
void Leave();
void PlayFinalAnimation(IsleScript::Script p_objectId);
void PlayActorAnimation(IsleScript::Script p_objectId);
void FUN_1004dcb0(IsleScript::Script p_objectId);
void PlayAction(IsleScript::Script p_objectId);
undefined4 m_unused0x160; // 0x160
undefined4 m_unk0x160; // 0x160
TowTrackMissionState* m_state; // 0x164
MxS16 m_unused0x168; // 0x168
MxS16 m_unk0x168; // 0x168
MxS16 m_actorId; // 0x16a
MxS16 m_treeBlockageTriggered; // 0x16c
MxS16 m_speedComplaintTriggered; // 0x16e
MxS16 m_unk0x16c; // 0x16c
MxS16 m_unk0x16e; // 0x16e
IsleScript::Script m_lastAction; // 0x170
IsleScript::Script m_lastAnimation; // 0x174
MxFloat m_fuel; // 0x178

View File

@ -36,131 +36,130 @@ Act2Actor::Location g_brickstrLocations[] = {
{{26.470566, 0.069, -44.670845}, {0.004602, 0.0, -0.99998897}, "int26", FALSE},
{{-6.323625, 0.069, -47.96045}, {-0.982068, 0.0, 0.188529}, "edg02_53", FALSE},
{{-36.689, -0.978409, 31.449}, {0.083792, -0.94303, -0.66398698}, "edg00_157", FALSE},
#ifndef BETA10
{{-44.6, 0.1, 45.3}, {0.95, 0.0, -0.3}, "edg00_154", FALSE},
#endif
};
// GLOBAL: LEGO1 0x100f0f1c
MxFloat g_lastAnimationTime = 0.0f;
MxFloat g_unk0x100f0f1c = 0.0f;
// GLOBAL: LEGO1 0x100f0f20
// GLOBAL: BETA10 0x101dbe40
MxBool g_nextEntityIsBuilding = FALSE;
MxBool g_unk0x100f0f20 = FALSE;
// GLOBAL: LEGO1 0x100f0f24
MxBool g_unk0x100f0f24 = FALSE;
// GLOBAL: LEGO1 0x100f0f28
// GLOBAL: BETA10 0x101dbe44
MxBool g_playedShootSound = FALSE;
MxBool g_unk0x100f0f28 = FALSE;
// --- All of these are indices into g_plantInfo (0x10103180) ---
// GLOBAL: LEGO1 0x100f0f30
// GLOBAL: BETA10 0x101dbe48
MxS32 g_location0Plants[] = {2, 23, 32, 66, 71, 72, 73, -1};
MxS32 g_unk0x100f0f30[] = {2, 23, 32, 66, 71, 72, 73, -1};
// GLOBAL: LEGO1 0x100f0f50
// GLOBAL: BETA10 0x101dbe68
MxS32 g_location1Plants[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1};
MxS32 g_unk0x100f0f50[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1};
// GLOBAL: LEGO1 0x100f0f90
// GLOBAL: BETA10 0x101dbea8
MxS32 g_location2Plants[] = {12, 19, 24, 48, 60, -1};
MxS32 g_unk0x100f0f90[] = {12, 19, 24, 48, 60, -1};
// GLOBAL: LEGO1 0x100f0fa8
// GLOBAL: BETA10 0x101dbec0
MxS32 g_location3Plants[] = {8, 15, 46, -1};
MxS32 g_unk0x100f0fa8[] = {8, 15, 46, -1};
// GLOBAL: LEGO1 0x100f0fb8
// GLOBAL: BETA10 0x101dbed0
MxS32 g_location4Plants[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1};
MxS32 g_unk0x100f0fb8[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1};
// GLOBAL: LEGO1 0x100f0fe8
// GLOBAL: BETA10 0x101dbf00
MxS32 g_location5Plants[] = {3, 40, 53, 55, -1};
MxS32 g_unk0x100f0fe8[] = {3, 40, 53, 55, -1};
// GLOBAL: LEGO1 0x100f1000
// GLOBAL: BETA10 0x101dbf18
MxS32 g_location6Plants[] = {22, 33, 41, 45, 67, -1};
MxS32 g_unk0x100f1000[] = {22, 33, 41, 45, 67, -1};
// GLOBAL: LEGO1 0x100f1018
// GLOBAL: BETA10 0x101dbf30
MxS32 g_location7Plants[] = {13, 30, 31, 62, -1};
MxS32 g_unk0x100f1018[] = {13, 30, 31, 62, -1};
// GLOBAL: LEGO1 0x100f1030
// GLOBAL: BETA10 0x101dbf48
MxS32 g_location8Plants[] = {1, 27, 37, 44, 47, 54, 61, 64, -1};
MxS32 g_unk0x100f1030[] = {1, 27, 37, 44, 47, 54, 61, 64, -1};
// --- End of indices into g_plantInfo ---
// GLOBAL: LEGO1 0x10102b1c
// GLOBAL: BETA10 0x10209f60
MxU32 g_nextHeadWavIndex = 0;
undefined4 g_nextHeadWavIndex = 0;
// GLOBAL: LEGO1 0x10102b20
// GLOBAL: BETA10 0x10209f64
MxU32 g_nextBehindWavIndex = 0;
undefined4 g_nextBehindWavIndex = 0;
// GLOBAL: LEGO1 0x10102b24
// GLOBAL: BETA10 0x10209f68
MxU32 g_nextInterruptWavIndex = 0;
undefined4 g_nextInterruptWavIndex = 0;
// FUNCTION: LEGO1 0x100187e0
// FUNCTION: BETA10 0x1000c7fb
Act2Actor::Act2Actor()
{
m_skipAnimation = FALSE;
m_targetLocation = 0;
m_animatingHit = FALSE;
m_createBrickTime = 0;
m_animationDuration = 0;
m_state = e_readyToShoot;
m_baseWorldSpeed = 4;
m_shootAnimEnd = 0;
m_entityAnimationTime = 0;
m_unk0x1c = 0;
m_unk0x1d = 0;
m_unk0x1f = FALSE;
m_unk0x24 = 0;
m_unk0x20 = 0;
m_unk0x1e = 0;
m_unk0x28 = 4;
m_unk0x2c = 0;
m_unk0x30 = 0;
m_shootAnim = NULL;
m_resetWorldSpeedAt = 0;
m_initializing = TRUE;
m_visitedLocations = 0;
m_nextEntity = NULL;
m_cachedShootSound = NULL;
m_unk0x44 = 0;
m_unk0x40 = 1;
m_unk0x48 = 0;
m_unk0x4c = NULL;
m_unk0x38 = NULL;
m_unk0x3c = 0;
// Odd: The code says < 10, but there are 11 entries in the array
for (MxS32 i = 0; i < 10; i++) {
g_brickstrLocations[i].m_cleared = FALSE;
g_brickstrLocations[i].m_unk0x1c = FALSE;
}
}
// FUNCTION: LEGO1 0x10018940
void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform)
// FUNCTION: BETA10 0x1003d65f
void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
{
LegoAnimActor::SetROI(p_roi, p_bool1, p_updateTransform);
LegoAnimActor::SetROI(p_roi, p_bool1, p_bool2);
m_roi->SetVisibility(FALSE);
}
// FUNCTION: LEGO1 0x10018980
// FUNCTION: BETA10 0x1000c963
void Act2Actor::InitializeNextShot()
void Act2Actor::FUN_10018980()
{
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
m_shootAnim = m_animMaps[i];
}
}
assert(m_shootAnim);
m_cachedShootSound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("xarrow");
m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("xarrow");
#ifdef BETA10
// actually 0x2c and 0x30
m_cachedShootSound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash");
m_cachedShootSound->SetDistance(35, 60);
m_cachedShootSound->SetDistance(35, 60);
m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash");
m_unk0x38->SetDistance(35, 60);
m_unk0x38->SetDistance(35, 60);
#else
m_cachedShootSound->SetDistance(45, 55);
m_unk0x38->SetDistance(45, 55);
m_roi->SetVisibility(TRUE);
#endif
}
@ -169,9 +168,9 @@ void Act2Actor::InitializeNextShot()
// FUNCTION: BETA10 0x1000ca64
MxResult Act2Actor::HitActor(LegoPathActor*, MxBool)
{
if (m_animatingHit == FALSE) {
m_animatingHit = TRUE;
m_animationDuration = 0;
if (m_unk0x1f == FALSE) {
m_unk0x1f = TRUE;
m_unk0x20 = 0;
}
SoundManager()->GetCacheSoundManager()->Play("hitactor", NULL, FALSE);
@ -187,7 +186,7 @@ MxResult Act2Actor::VTable0x9c()
return SUCCESS;
}
else {
if (m_animatingHit) {
if (m_unk0x1f) {
MxMatrix matrix = m_roi->GetLocal2World();
matrix[3][1] -= 3.0f;
m_roi->UpdateTransformationRelativeToParent(matrix);
@ -209,28 +208,28 @@ void Act2Actor::Animate(float p_time)
int dummy1; // for BETA10, not sure what it is being used for
#ifndef BETA10
MxFloat timeSinceLastAnimate = 0.0f;
if (g_lastAnimationTime != 0.0f) {
timeSinceLastAnimate = p_time - g_lastAnimationTime;
MxFloat local48float = 0.0f;
if (g_unk0x100f0f1c != 0.0f) {
local48float = p_time - g_unk0x100f0f1c;
}
g_lastAnimationTime = p_time;
g_unk0x100f0f1c = p_time;
#endif
LegoAnimActor::Animate(p_time);
if (m_resetWorldSpeedAt != 0.0f && m_resetWorldSpeedAt < p_time) {
SetWorldSpeed(m_baseWorldSpeed);
if (m_unk0x44 != 0.0f && m_unk0x44 < p_time) {
SetWorldSpeed(m_unk0x28);
}
if (m_animatingHit) {
if (m_animationDuration > 600.0f) {
m_animatingHit = FALSE;
m_animationDuration = 0;
if (m_unk0x1f) {
if (m_unk0x20 > 600.0f) {
m_unk0x1f = FALSE;
m_unk0x20 = 0;
}
else {
#ifndef BETA10
m_animationDuration += timeSinceLastAnimate;
m_unk0x20 += local48float;
#endif
MxMatrix matrix = m_roi->GetLocal2World();
matrix[3][1] += 3.0f;
@ -247,41 +246,41 @@ void Act2Actor::Animate(float p_time)
}
if (!m_grec) {
if (m_state == e_roaming) {
m_state = e_readyToShoot;
m_shootAnimEnd = m_shootAnim->GetDuration() + p_time;
m_entityAnimationTime = m_shootAnimEnd - 1300.0f;
if (m_unk0x1e == 2) {
m_unk0x1e = 0;
m_unk0x2c = m_shootAnim->GetDuration() + p_time;
m_unk0x30 = m_unk0x2c - 1300.0f;
SetWorldSpeed(0);
m_skipAnimation = FALSE;
m_unk0x1c = FALSE;
}
else if (m_state == e_endShot) {
else if (m_unk0x1e == 1) {
FindROI("pwrbrik")->SetVisibility(FALSE);
FindROI("debrick")->SetVisibility(FALSE);
FindROI("ray")->SetVisibility(FALSE);
m_nextEntity = NULL;
m_state = e_roaming;
NextTargetLocation();
SetWorldSpeed(m_baseWorldSpeed + 3, p_time + 3000.0f);
m_unk0x4c = NULL;
m_unk0x1e = 2;
VTable0xa0();
FUN_10019250(m_unk0x28 + 3, p_time + 3000.0f);
}
else if (m_state == e_readyToShoot) {
if (m_initializing) {
m_initializing = FALSE;
m_shootAnimEnd = m_shootAnim->GetDuration() + p_time;
m_entityAnimationTime = m_shootAnimEnd - 1300.0f;
else if (m_unk0x1e == 0) {
if (m_unk0x40) {
m_unk0x40 = 0;
m_unk0x2c = m_shootAnim->GetDuration() + p_time;
m_unk0x30 = m_unk0x2c - 1300.0f;
}
if (UpdateShot(p_time) == TRUE) {
if (FUN_10019700(p_time) == TRUE) {
return;
}
}
else if (m_state == e_hiding) {
else if (m_unk0x1e == 5) {
FindROI("brickstr")->SetVisibility(FALSE);
GetROI()->SetVisibility(FALSE);
CurrentWorld()->RemoveActor(this);
return;
}
#ifndef BETA10
else if (m_state == e_goingToHide) {
else if (m_unk0x1e == 4) {
if (m_worldSpeed == 0.0f) {
return;
}
@ -293,14 +292,14 @@ void Act2Actor::Animate(float p_time)
#endif
}
if (m_state == e_hiding || m_state == e_goingToHide) {
if (m_unk0x1e == 5 || m_unk0x1e == 4) {
return;
}
if (m_state == e_createdBrick) {
if (p_time - m_createBrickTime > 600.0f) {
m_state = e_roaming;
SetWorldSpeed(m_baseWorldSpeed + 4, p_time + 15000.0f);
if (m_unk0x1e == 3) {
if (p_time - m_unk0x24 > 600.0f) {
m_unk0x1e = 2;
FUN_10019250(m_unk0x28 + 4, p_time + 15000.0f);
}
}
else {
@ -325,38 +324,38 @@ void Act2Actor::Animate(float p_time)
const MxFloat* pepperWorldPosition = roiPepper->GetWorldPosition();
const MxFloat* worldPosition = m_roi->GetWorldPosition();
MxFloat distanceToAmbulance = DISTSQRD3(pepperWorldPosition, worldPosition);
MxFloat distance1 = DISTSQRD3(pepperWorldPosition, worldPosition);
if (distanceToAmbulance < 75.0f) {
if (!m_skipAnimation) {
m_skipAnimation = TRUE;
if (distance1 < 75.0f) {
if (!m_unk0x1c) {
m_unk0x1c = 1;
if (!m_state) {
PlayNextVoiceOver(VoiceOver::e_interrupt);
m_state = e_endShot;
if (!m_unk0x1e) {
FUN_100199f0(2);
m_unk0x1e = 1;
}
else {
LegoROI* childROI = m_roi->FindChildROI("windsd", m_roi);
const MxFloat* childPosition = childROI->GetWorldPosition();
MxFloat distanceToWindshield = DISTSQRD3(pepperWorldPosition, childPosition);
MxFloat distance2 = DISTSQRD3(pepperWorldPosition, childPosition);
childROI = m_roi->FindChildROI("reardr", m_roi);
childPosition = childROI->GetWorldPosition();
MxFloat distanceToRearDoor = DISTSQRD3(pepperWorldPosition, childPosition);
MxFloat distance3 = DISTSQRD3(pepperWorldPosition, childPosition);
if (distanceToRearDoor > distanceToWindshield) {
PlayNextVoiceOver(VoiceOver::e_head);
if (distance3 > distance2) {
FUN_100199f0(0);
}
else
#ifndef BETA10
if (p_time - m_createBrickTime > 3000.0f) {
if (p_time - m_unk0x24 > 3000.0f) {
#endif
SetWorldSpeed(m_baseWorldSpeed - 1);
m_state = e_createdBrick;
m_createBrickTime = p_time;
SetWorldSpeed(m_unk0x28 - 1);
m_unk0x1e = 3;
m_unk0x24 = p_time;
if (((LegoAct2*) CurrentWorld())->CreateBrick() == SUCCESS) {
PlayNextVoiceOver(VoiceOver::e_behind);
if (((LegoAct2*) CurrentWorld())->FUN_100516b0() == SUCCESS) {
FUN_100199f0(1);
}
#ifndef BETA10
}
@ -365,8 +364,8 @@ void Act2Actor::Animate(float p_time)
}
}
else {
if (m_skipAnimation) {
m_skipAnimation = FALSE;
if (m_unk0x1c) {
m_unk0x1c = 0;
}
}
}
@ -377,11 +376,11 @@ void Act2Actor::Animate(float p_time)
// FUNCTION: LEGO1 0x10019250
// FUNCTION: BETA10 0x1000d45c
void Act2Actor::SetWorldSpeed(MxFloat p_speed, MxFloat p_resetWorldSpeedAt)
void Act2Actor::FUN_10019250(MxFloat p_speed, MxFloat p_param2)
{
// The arguments have been changed from BETA10 to LEGO1
SetWorldSpeed(p_speed);
m_resetWorldSpeedAt = p_resetWorldSpeedAt;
m_unk0x44 = p_param2;
}
// FUNCTION: LEGO1 0x10019280
@ -389,12 +388,12 @@ void Act2Actor::SetWorldSpeed(MxFloat p_speed, MxFloat p_resetWorldSpeedAt)
void Act2Actor::SetWorldSpeed(MxFloat p_worldSpeed)
{
LegoAnimActor::SetWorldSpeed(p_worldSpeed);
m_resetWorldSpeedAt = 0;
m_unk0x44 = 0;
}
// FUNCTION: LEGO1 0x100192a0
// FUNCTION: BETA10 0x1000d4d6
void Act2Actor::FindPath(MxU32 p_location)
void Act2Actor::FUN_100192a0(undefined4 p_location)
{
Mx3DPointFloat newPosition(0.0, 0.0, 0.0);
Mx3DPointFloat newDirection(0.0, 0.0, 0.0);
@ -418,7 +417,7 @@ void Act2Actor::FindPath(MxU32 p_location)
newPosition,
newDirection,
newBoundary,
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
NULL
);
@ -431,37 +430,37 @@ void Act2Actor::FindPath(MxU32 p_location)
}
// FUNCTION: LEGO1 0x10019520
void Act2Actor::GoingToHide()
void Act2Actor::FUN_10019520()
{
m_state = e_goingToHide;
SetWorldSpeed(m_baseWorldSpeed + 3);
FindPath(10);
m_unk0x1e = 4;
SetWorldSpeed(m_unk0x28 + 3);
FUN_100192a0(10);
}
// FUNCTION: LEGO1 0x10019560
void Act2Actor::Hide()
void Act2Actor::FUN_10019560()
{
m_state = e_hiding;
SetWorldSpeed(m_baseWorldSpeed + 5);
FindPath(9);
m_unk0x1e = 5;
SetWorldSpeed(m_unk0x28 + 5);
FUN_100192a0(9);
}
// FUNCTION: LEGO1 0x100195a0
// FUNCTION: BETA10 0x1000d7d3
MxS32 Act2Actor::NextTargetLocation()
MxS32 Act2Actor::VTable0xa0()
{
MxU32 newLocation;
undefined4 newLocation;
assert(!m_grec);
CurrentWorld();
MxU16 randomVal = rand() / (RAND_MAX / 2) + 1;
if (m_visitedLocations == 8 && m_targetLocation != 8) {
if (m_unk0x48 == 8 && m_unk0x1d != 8) {
newLocation = 8;
}
else {
switch (m_targetLocation) {
switch (m_unk0x1d) {
case 0:
if (randomVal == 1) {
newLocation = 3;
@ -536,10 +535,10 @@ MxS32 Act2Actor::NextTargetLocation()
}
}
MxU32 firstChoice = newLocation;
undefined4 firstChoice = newLocation;
if (m_visitedLocations < 7 || g_brickstrLocations[m_targetLocation].m_cleared) {
while (g_brickstrLocations[newLocation].m_cleared || m_targetLocation == newLocation) {
if (m_unk0x48 < 7 || g_brickstrLocations[m_unk0x1d].m_unk0x1c) {
while (g_brickstrLocations[newLocation].m_unk0x1c || m_unk0x1d == newLocation) {
if (newLocation == 7) {
newLocation = 0;
}
@ -551,8 +550,8 @@ MxS32 Act2Actor::NextTargetLocation()
}
}
m_targetLocation = newLocation;
FindPath(newLocation);
m_unk0x1d = newLocation;
FUN_100192a0(newLocation);
if (m_grec) {
return SUCCESS;
@ -564,64 +563,64 @@ MxS32 Act2Actor::NextTargetLocation()
// FUNCTION: LEGO1 0x10019700
// FUNCTION: BETA10 0x1000dd27
MxU32 Act2Actor::UpdateShot(MxFloat p_time)
MxU32 Act2Actor::FUN_10019700(MxFloat p_param)
{
if (!m_nextEntity) {
g_nextEntityIsBuilding = FALSE;
m_nextEntity = GetNextEntity(&g_nextEntityIsBuilding);
if (!m_unk0x4c) {
g_unk0x100f0f20 = FALSE;
m_unk0x4c = FUN_10019b90(&g_unk0x100f0f20);
g_unk0x100f0f24 = FALSE;
g_playedShootSound = FALSE;
g_unk0x100f0f28 = FALSE;
}
if (!m_nextEntity) {
MxTrace("nothing left to destroy at location %d\n", m_targetLocation);
m_state = e_endShot;
if (!m_unk0x4c) {
MxTrace("nothing left to destroy at location %d\n", m_unk0x1d);
m_unk0x1e = 1;
if (m_targetLocation == 8) {
if (m_unk0x1d == 8) {
((LegoAct2*) CurrentWorld())->BadEnding();
}
return TRUE;
}
if (!g_playedShootSound && m_entityAnimationTime < p_time) {
g_playedShootSound = TRUE;
if (!g_unk0x100f0f28 && m_unk0x30 < p_param) {
g_unk0x100f0f28 = TRUE;
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play(m_cachedShootSound, "brickstr", FALSE);
SoundManager()->GetCacheSoundManager()->Play(m_unk0x38, "brickstr", FALSE);
if (g_nextEntityIsBuilding) {
BuildingManager()->ScheduleAnimation(m_nextEntity, 800, TRUE, FALSE);
if (g_unk0x100f0f20) {
BuildingManager()->ScheduleAnimation(m_unk0x4c, 800, TRUE, FALSE);
}
else {
PlantManager()->ScheduleAnimation(m_nextEntity, 800);
PlantManager()->ScheduleAnimation(m_unk0x4c, 800);
}
}
if (m_shootAnimEnd < p_time) {
g_nextEntityIsBuilding = FALSE;
m_nextEntity = GetNextEntity(&g_nextEntityIsBuilding);
m_shootAnimEnd = m_shootAnim->GetDuration() + p_time;
m_entityAnimationTime = m_shootAnimEnd - 1300.0f;
if (m_unk0x2c < p_param) {
g_unk0x100f0f20 = FALSE;
m_unk0x4c = FUN_10019b90(&g_unk0x100f0f20);
m_unk0x2c = m_shootAnim->GetDuration() + p_param;
m_unk0x30 = m_unk0x2c - 1300.0f;
g_unk0x100f0f24 = FALSE;
g_playedShootSound = FALSE;
g_unk0x100f0f28 = FALSE;
return FALSE;
}
m_lastTime = p_time;
m_lastTime = p_param;
LegoROI* brickstrROI = FindROI("brickstr");
MxMatrix initialTransform = m_roi->GetLocal2World();
initialTransform[3][1] += 1.0f;
brickstrROI->SetLocal2World(initialTransform);
brickstrROI->WrappedUpdateWorldData();
MxMatrix matrix = m_roi->GetLocal2World();
matrix[3][1] += 1.0f;
brickstrROI->FUN_100a58f0(matrix);
brickstrROI->VTable0x14();
Vector3 col0(initialTransform[0]);
Vector3 col1(initialTransform[1]);
Vector3 col2(initialTransform[2]);
Vector3 col3(initialTransform[3]);
Vector3 col0(matrix[0]);
Vector3 col1(matrix[1]);
Vector3 col2(matrix[2]);
Vector3 col3(matrix[3]);
col2 = col3;
col2 -= m_nextEntity->GetROI()->GetWorldPosition();
col2 -= m_unk0x4c->GetROI()->GetWorldPosition();
col2.Unitize();
col0.EqualsCross(col1, col2);
col0.Unitize();
@ -630,10 +629,10 @@ MxU32 Act2Actor::UpdateShot(MxFloat p_time)
assert(!m_cameraFlag);
LegoTreeNode* root = m_shootAnim->GetAnimTreePtr()->GetRoot();
MxFloat time = p_time - (m_shootAnimEnd - m_shootAnim->GetDuration());
MxFloat time = p_param - (m_unk0x2c - m_shootAnim->GetDuration());
for (MxS32 i = 0; i < root->GetNumChildren(); i++) {
LegoROI::ApplyAnimationTransformation(root->GetChild(i), initialTransform, time, m_shootAnim->GetROIMap());
LegoROI::FUN_100a8e80(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap());
}
return FALSE;
@ -641,68 +640,68 @@ MxU32 Act2Actor::UpdateShot(MxFloat p_time)
// FUNCTION: LEGO1 0x100199f0
// FUNCTION: BETA10 0x1000e11a
void Act2Actor::PlayNextVoiceOver(MxS8 p_voiceOverType)
void Act2Actor::FUN_100199f0(MxS8 p_param)
{
switch (p_voiceOverType) {
case VoiceOver::e_head:
switch (p_param) {
case 0:
switch (g_nextHeadWavIndex) {
case 0:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOhead0_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOhead0_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextHeadWavIndex++;
break;
default:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOhead1_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOhead1_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextHeadWavIndex = 0;
break;
}
break;
case VoiceOver::e_behind:
case 1:
switch (g_nextBehindWavIndex) {
case 0:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VObehind0_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VObehind0_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
g_nextBehindWavIndex++;
break;
case 1:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VObehind1_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VObehind1_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
g_nextBehindWavIndex++;
break;
case 2:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VObehind2_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VObehind2_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
g_nextBehindWavIndex++;
break;
default:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VObehind3_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VObehind3_PlayWav, FALSE, TRUE, NULL, NULL, NULL);
g_nextBehindWavIndex = 0;
break;
}
break;
case VoiceOver::e_interrupt:
case 2:
switch (g_nextInterruptWavIndex) {
case 0:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOinterrupt0_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOinterrupt0_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextInterruptWavIndex++;
break;
case 1:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOinterrupt1_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOinterrupt1_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextInterruptWavIndex++;
break;
case 2:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOinterrupt2_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOinterrupt2_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextInterruptWavIndex++;
break;
default:
((LegoAct2*) CurrentWorld())
->StartAction(Act2mainScript::c_VOinterrupt3_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
->FUN_10052560(Act2mainScript::c_VOinterrupt3_PlayWav, FALSE, FALSE, NULL, NULL, NULL);
g_nextInterruptWavIndex = 0;
break;
}
@ -711,150 +710,150 @@ void Act2Actor::PlayNextVoiceOver(MxS8 p_voiceOverType)
// FUNCTION: LEGO1 0x10019b90
// FUNCTION: BETA10 0x1000e374
LegoEntity* Act2Actor::GetNextEntity(MxBool* p_isBuilding)
LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
{
MxS32 i;
LegoBuildingInfo* buildingInfo = BuildingManager()->GetInfoArray(i);
LegoPlantInfo* plantInfo = PlantManager()->GetInfoArray(i);
LegoEntity* result = 0;
switch (m_targetLocation) {
switch (m_unk0x1d) {
case 0:
if (buildingInfo[12].m_counter) {
if (buildingInfo[12].m_unk0x11) {
result = buildingInfo[12].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else if (buildingInfo[14].m_counter) {
else if (buildingInfo[14].m_unk0x11) {
result = buildingInfo[14].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location0Plants[i] != -1; i++) {
if (plantInfo[g_location0Plants[i]].m_counter) {
result = plantInfo[g_location0Plants[i]].m_entity;
for (i = 0; g_unk0x100f0f30[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f30[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f30[i]].m_entity;
break;
}
}
}
break;
case 1:
if (buildingInfo[13].m_counter) {
if (buildingInfo[13].m_unk0x11) {
result = buildingInfo[13].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location1Plants[i] != -1; i++) {
if (plantInfo[g_location1Plants[i]].m_counter) {
result = plantInfo[g_location1Plants[i]].m_entity;
for (i = 0; g_unk0x100f0f50[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f50[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f50[i]].m_entity;
break;
}
}
}
break;
case 2:
if (buildingInfo[9].m_counter) {
if (buildingInfo[9].m_unk0x11) {
result = buildingInfo[9].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else if (buildingInfo[11].m_counter) {
else if (buildingInfo[11].m_unk0x11) {
result = buildingInfo[11].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location2Plants[i] != -1; i++) {
if (plantInfo[g_location2Plants[i]].m_counter) {
result = plantInfo[g_location2Plants[i]].m_entity;
for (i = 0; g_unk0x100f0f90[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f90[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f90[i]].m_entity;
break;
}
}
}
break;
case 3:
if (buildingInfo[7].m_counter) {
if (buildingInfo[7].m_unk0x11) {
result = buildingInfo[7].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else if (buildingInfo[8].m_counter) {
else if (buildingInfo[8].m_unk0x11) {
result = buildingInfo[8].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else if (buildingInfo[3].m_counter) {
else if (buildingInfo[3].m_unk0x11) {
result = buildingInfo[3].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location3Plants[i] != -1; i++) {
if (plantInfo[g_location3Plants[i]].m_counter) {
result = plantInfo[g_location3Plants[i]].m_entity;
for (i = 0; g_unk0x100f0fa8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fa8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fa8[i]].m_entity;
break;
}
}
}
break;
case 4:
if (buildingInfo[5].m_counter) {
if (buildingInfo[5].m_unk0x11) {
result = buildingInfo[5].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else if (buildingInfo[10].m_counter) {
else if (buildingInfo[10].m_unk0x11) {
result = buildingInfo[10].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location4Plants[i] != -1; i++) {
if (plantInfo[g_location4Plants[i]].m_counter) {
result = plantInfo[g_location4Plants[i]].m_entity;
for (i = 0; g_unk0x100f0fb8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fb8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fb8[i]].m_entity;
break;
}
}
}
break;
case 5:
if (buildingInfo[4].m_counter) {
if (buildingInfo[4].m_unk0x11) {
result = buildingInfo[4].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location5Plants[i] != -1; i++) {
if (plantInfo[g_location5Plants[i]].m_counter) {
result = plantInfo[g_location5Plants[i]].m_entity;
for (i = 0; g_unk0x100f0fe8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fe8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fe8[i]].m_entity;
break;
}
}
}
break;
case 6:
if (buildingInfo[2].m_counter) {
if (buildingInfo[2].m_unk0x11) {
result = buildingInfo[2].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location6Plants[i] != -1; i++) {
if (plantInfo[g_location6Plants[i]].m_counter) {
result = plantInfo[g_location6Plants[i]].m_entity;
for (i = 0; g_unk0x100f1000[i] != -1; i++) {
if (plantInfo[g_unk0x100f1000[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1000[i]].m_entity;
break;
}
}
}
break;
case 7:
if (buildingInfo[6].m_counter) {
if (buildingInfo[6].m_unk0x11) {
result = buildingInfo[6].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
else {
for (i = 0; g_location7Plants[i] != -1; i++) {
if (plantInfo[g_location7Plants[i]].m_counter) {
result = plantInfo[g_location7Plants[i]].m_entity;
for (i = 0; g_unk0x100f1018[i] != -1; i++) {
if (plantInfo[g_unk0x100f1018[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1018[i]].m_entity;
break;
}
}
}
break;
case 8:
for (i = 0; g_location8Plants[i] != -1; i++) {
if (plantInfo[g_location8Plants[i]].m_counter) {
result = plantInfo[g_location8Plants[i]].m_entity;
for (i = 0; g_unk0x100f1030[i] != -1; i++) {
if (plantInfo[g_unk0x100f1030[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1030[i]].m_entity;
break;
}
}
@ -863,16 +862,16 @@ LegoEntity* Act2Actor::GetNextEntity(MxBool* p_isBuilding)
return result;
}
if (buildingInfo[15].m_counter) {
if (buildingInfo[15].m_unk0x11) {
result = buildingInfo[15].m_entity;
*p_isBuilding = TRUE;
*p_param = TRUE;
}
break;
}
if (!result && !g_brickstrLocations[m_targetLocation].m_cleared) {
g_brickstrLocations[m_targetLocation].m_cleared = TRUE;
m_visitedLocations++;
if (!result && !g_brickstrLocations[m_unk0x1d].m_unk0x1c) {
g_brickstrLocations[m_unk0x1d].m_unk0x1c = TRUE;
m_unk0x48++;
}
return result;

View File

@ -4,9 +4,9 @@
#include "act3ammo.h"
#include "anim/legoanim.h"
#include "define.h"
#include "legoanimpresenter.h"
#include "legobuildingmanager.h"
#include "legocachesoundmanager.h"
#include "legolocomotionanimpresenter.h"
#include "legopathedgecontainer.h"
#include "legoplantmanager.h"
#include "legoplants.h"
@ -138,8 +138,8 @@ MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform)
m_unk0x1c = 0;
positionRef -= g_unk0x10104ef0;
m_roi->SetLocal2World(p_transform);
m_roi->WrappedUpdateWorldData();
m_roi->FUN_100a58f0(p_transform);
m_roi->VTable0x14();
return TRUE;
}
}
@ -163,8 +163,8 @@ MxResult Act3Actor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
Vector3(local2world[3]) += g_unk0x10104ef0;
roi->SetLocal2World(local2world);
roi->WrappedUpdateWorldData();
roi->FUN_100a58f0(local2world);
roi->VTable0x14();
p_actor->SetActorState(c_two | c_noCollide);
}
@ -244,7 +244,7 @@ void Act3Cop::ParseAction(char* p_extra)
}
}
Mx4DPointFloat* boundary0x14 = boundary->GetUp();
Mx4DPointFloat* boundary0x14 = boundary->GetUnknown0x14();
if (point.Dot(point, *boundary0x14) + boundary0x14->index_operator(3) <= 0.001 &&
point.Dot(point, *boundary0x14) + boundary0x14->index_operator(3) >= -0.001) {
@ -270,7 +270,7 @@ void Act3Cop::ParseAction(char* p_extra)
}
for (i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
m_eatAnim = m_animMaps[i];
}
}
@ -353,7 +353,7 @@ MxResult Act3Cop::FUN_10040360()
local7c,
local5c,
boundary,
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
&local34
) != SUCCESS) {
delete grec;
@ -375,7 +375,7 @@ MxResult Act3Cop::FUN_10040360()
MxMatrix locald0 = proi->GetLocal2World();
Vector3 local88(locald0[3]);
Mx3DPointFloat localec(local88);
localec -= local2c;
localec -= local88;
LegoPathEdgeContainer* r2 = new LegoPathEdgeContainer();
assert(r2);
@ -391,7 +391,7 @@ MxResult Act3Cop::FUN_10040360()
local88,
localec,
donut->GetBoundary(),
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
&locald8
) == SUCCESS &&
(grec == NULL || locald8 < local18)) {
@ -431,7 +431,7 @@ MxResult Act3Cop::FUN_10040360()
localf8,
local108,
boundary,
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
&local100
) != SUCCESS) {
local14c = local150 = grec;
@ -558,7 +558,7 @@ void Act3Brickster::ParseAction(char* p_extra)
((Act3*) m_world)->SetBrickster(this);
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
m_shootAnim = m_animMaps[i];
}
}
@ -579,7 +579,7 @@ void Act3Brickster::Animate(float p_time)
}
if (m_unk0x54 < p_time) {
((Act3*) m_world)->TriggerHitSound(5);
((Act3*) m_world)->FUN_10072ad0(5);
m_unk0x54 = p_time + 15000.0f;
}
@ -595,7 +595,7 @@ void Act3Brickster::Animate(float p_time)
assert(SoundManager()->GetCacheSoundManager());
if (m_unk0x58 >= 8) {
((Act3*) m_world)->TriggerHitSound(6);
((Act3*) m_world)->FUN_10072ad0(6);
}
else {
SoundManager()->GetCacheSoundManager()->Play("eatpz", NULL, FALSE);
@ -607,8 +607,8 @@ void Act3Brickster::Animate(float p_time)
assert(m_shootAnim && m_pInfo);
if (m_unk0x50 < p_time) {
while (m_pInfo->m_counter) {
PlantManager()->DecrementCounter(m_pInfo->m_entity);
while (m_pInfo->m_unk0x16) {
PlantManager()->FUN_10026c50(m_pInfo->m_entity);
}
assert(SoundManager()->GetCacheSoundManager());
@ -638,7 +638,7 @@ void Act3Brickster::Animate(float p_time)
float time = p_time - (m_unk0x50 - m_shootAnim->GetDuration());
for (MxS32 i = 0; i < root->GetNumChildren(); i++) {
LegoROI::ApplyAnimationTransformation(root->GetChild(i), local70, time, m_shootAnim->GetROIMap());
LegoROI::FUN_100a8e80(root->GetChild(i), local70, time, m_shootAnim->GetROIMap());
}
}
@ -653,8 +653,8 @@ void Act3Brickster::Animate(float p_time)
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("thpt", NULL, FALSE);
while (m_bInfo->m_counter > 0 || m_bInfo->m_counter == -1) {
if (!BuildingManager()->DecrementCounter(m_bInfo)) {
while (m_bInfo->m_unk0x11 > 0 || m_bInfo->m_unk0x11 == -1) {
if (!BuildingManager()->FUN_10030110(m_bInfo)) {
break;
}
}
@ -685,7 +685,7 @@ void Act3Brickster::Animate(float p_time)
float time = p_time - (m_unk0x50 - m_shootAnim->GetDuration());
for (MxS32 i = 0; i < root->GetNumChildren(); i++) {
LegoROI::ApplyAnimationTransformation(root->GetChild(i), locale4, time, m_shootAnim->GetROIMap());
LegoROI::FUN_100a8e80(root->GetChild(i), locale4, time, m_shootAnim->GetROIMap());
}
}
@ -831,7 +831,7 @@ MxResult Act3Brickster::FUN_100417c0()
local88,
localec,
pizza->GetBoundary(),
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
&locald8
) == SUCCESS &&
(grec == NULL || locald8 < local18)) {
@ -865,7 +865,7 @@ MxResult Act3Brickster::FUN_100417c0()
float local124;
for (MxS32 i = 0; i < length; i++) {
if (bInfo[i].m_counter < 0 && bInfo[i].m_boundary != NULL && bInfo[i].m_entity != NULL && i != 0 &&
if (bInfo[i].m_unk0x11 < 0 && bInfo[i].m_boundary != NULL && bInfo[i].m_entity != NULL && i != 0 &&
(local120 == -1 || i != 15)) {
Mx3DPointFloat local188(bInfo[i].m_x, bInfo[i].m_y, bInfo[i].m_z);
@ -915,7 +915,7 @@ MxResult Act3Brickster::FUN_100417c0()
local108,
local138,
localf4,
LegoOrientedEdge::c_bit1,
LegoUnknown100db7f4::c_bit1,
&local13c
) != SUCCESS) {
local1bc = local1c0 = grec;
@ -1055,7 +1055,7 @@ MxS32 Act3Brickster::FUN_10042300()
assert(m_boundary && m_destEdge && m_roi);
LegoPathBoundary* boundaries[2];
LegoOrientedEdge* maxE = NULL;
LegoUnknown100db7f4* maxE = NULL;
boundaries[0] = m_boundary;
if (m_destEdge->FUN_10048c40(local38)) {
@ -1069,7 +1069,7 @@ MxS32 Act3Brickster::FUN_10042300()
for (MxS32 i = 0; i < (MxS32) sizeOfArray(boundaries); i++) {
if (boundaries[i] != NULL) {
for (MxS32 j = 0; j < boundaries[i]->GetNumEdges(); j++) {
LegoOrientedEdge* e = boundaries[i]->GetEdges()[j];
LegoUnknown100db7f4* e = boundaries[i]->GetEdges()[j];
if (e->GetMask0x03()) {
Mx3DPointFloat local94(*e->GetPointA());
@ -1109,7 +1109,7 @@ MxS32 Act3Brickster::FUN_10042300()
// FUNCTION: LEGO1 0x10042990
// FUNCTION: BETA10 0x1001b6e2
void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
if (m_unk0x38 != 8) {
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
@ -1186,7 +1186,7 @@ void Act3Shark::Animate(float p_time)
vec = m_unk0x3c;
LegoTreeNode* node = m_unk0x34->GetAnimTreePtr()->GetRoot();
LegoROI::ApplyAnimationTransformation(node, mat, duration, m_unk0x34->GetROIMap());
LegoROI::FUN_100a8e80(node, mat, duration, m_unk0x34->GetROIMap());
}
else {
roiMap[1] = m_unk0x38;

View File

@ -17,7 +17,7 @@ DECOMP_SIZE_ASSERT(Act3Ammo, 0x1a0)
// Initialized at LEGO1 0x100537c0
// GLOBAL: LEGO1 0x10104f08
Mx3DPointFloat Act3Ammo::g_hitTranslation = Mx3DPointFloat(0.0, 5.0, 0.0);
Mx3DPointFloat Act3Ammo::g_unk0x10104f08 = Mx3DPointFloat(0.0, 5.0, 0.0);
// FUNCTION: LEGO1 0x100537f0
// FUNCTION: BETA10 0x1001d648
@ -70,9 +70,7 @@ MxResult Act3Ammo::Remove()
// FUNCTION: BETA10 0x1001d8b3
MxResult Act3Ammo::Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index)
{
#ifdef BETA10
assert(m_ammoFlag);
#endif
char name[12];
if (p_isPizza) {
@ -111,44 +109,43 @@ MxResult Act3Ammo::Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index)
// FUNCTION: LEGO1 0x10053b40
// FUNCTION: BETA10 0x1001db2a
MxResult Act3Ammo::CalculateArc(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp)
MxResult Act3Ammo::FUN_10053b40(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp)
{
assert(p_srcDir[1] != 0);
MxFloat yRatioLocDir = -(p_srcLoc[1] / p_srcDir[1]);
Mx3DPointFloat groundPoint(p_srcDir);
Mx3DPointFloat negNormalUp;
MxFloat local1c = -(p_srcLoc[1] / p_srcDir[1]);
Mx3DPointFloat local18(p_srcDir);
Mx3DPointFloat local34;
groundPoint *= yRatioLocDir;
groundPoint += p_srcLoc;
local18 *= local1c;
local18 += p_srcLoc;
negNormalUp[0] = negNormalUp[2] = 0.0f;
negNormalUp[1] = -1.0f;
local34[0] = local34[2] = 0.0f;
local34[1] = -1.0f;
m_coefficients[1] = p_srcUp;
m_coefficients[2] = p_srcLoc;
m_eq[1] = p_srcUp;
m_eq[2] = p_srcLoc;
Mx3DPointFloat upRelative(negNormalUp);
upRelative -= m_coefficients[1];
Mx3DPointFloat local48(local34);
local48 -= m_eq[1];
for (MxS32 i = 0; i < 3; i++) {
if (groundPoint[0] == p_srcLoc[0]) {
if (local18[0] == p_srcLoc[0]) {
return FAILURE;
}
m_coefficients[0][i] = (upRelative[i] * upRelative[i] + upRelative[i] * m_coefficients[1][i] * 2.0f) /
((groundPoint[i] - p_srcLoc[i]) * 4.0f);
m_eq[0][i] = (local48[i] * local48[i] + local48[i] * m_eq[1][i] * 2.0f) / ((local18[i] - p_srcLoc[i]) * 4.0f);
}
assert(m_coefficients[0][0] > 0.000001 || m_coefficients[0][0] < -0.000001);
assert(m_eq[0][0] > 0.000001 || m_eq[0][0] < -0.000001);
m_apexParameter = upRelative[0] / (m_coefficients[0][0] * 2.0f);
m_unk0x19c = local48[0] / (m_eq[0][0] * 2.0f);
return SUCCESS;
}
// FUNCTION: LEGO1 0x10053cb0
// FUNCTION: BETA10 0x1001ddf4
MxResult Act3Ammo::Shoot(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_apexParameter)
MxResult Act3Ammo::FUN_10053cb0(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_unk0x19c)
{
assert(p_p);
assert(IsValid());
@ -165,7 +162,7 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, LegoPathBoundary* p_boundary,
m_pathController = p_p;
m_boundary = p_boundary;
m_BADuration = 10000.0f;
m_apexParameter = p_apexParameter;
m_unk0x19c = p_unk0x19c;
m_unk0x7c = 0.0f;
m_lastTime = -1.0f;
m_actorState = c_one;
@ -174,12 +171,12 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, LegoPathBoundary* p_boundary,
// FUNCTION: LEGO1 0x10053d30
// FUNCTION: BETA10 0x1001df73
MxResult Act3Ammo::Shoot(LegoPathController* p_p, MxFloat p_apexParameter)
MxResult Act3Ammo::FUN_10053d30(LegoPathController* p_p, MxFloat p_unk0x19c)
{
assert(p_p);
assert(IsValid());
SetShootWithoutBoundary(TRUE);
SetBit4(TRUE);
if (IsPizza()) {
assert(SoundManager()->GetCacheSoundManager());
@ -192,7 +189,7 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, MxFloat p_apexParameter)
m_pathController = p_p;
m_BADuration = 10000.0f;
m_apexParameter = p_apexParameter;
m_unk0x19c = p_unk0x19c;
m_unk0x7c = 0.0f;
m_lastTime = -1.0f;
m_actorState = c_one;
@ -201,49 +198,49 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, MxFloat p_apexParameter)
// FUNCTION: LEGO1 0x10053db0
// FUNCTION: BETA10 0x1001e0f0
MxResult Act3Ammo::CalculateTransform(float p_curveParameter, Matrix4& p_transform)
MxResult Act3Ammo::FUN_10053db0(float p_param1, const Matrix4& p_param2)
{
float curveParameterSquare = p_curveParameter * p_curveParameter;
float local34 = p_param1 * p_param1;
Vector3 right(p_transform[0]);
Vector3 up(p_transform[1]);
Vector3 dir(p_transform[2]);
Vector3 pos(p_transform[3]);
Mx3DPointFloat sndCoeff;
Vector3 local14(p_param2[0]);
Vector3 local3c(p_param2[1]);
Vector3 localc(p_param2[2]);
Vector3 local30(p_param2[3]);
Mx3DPointFloat local28;
sndCoeff = m_coefficients[1];
sndCoeff *= p_curveParameter;
pos = m_coefficients[0];
pos *= curveParameterSquare;
pos += sndCoeff;
pos += m_coefficients[2];
dir = m_coefficients[0];
dir *= 2.0f;
dir *= p_curveParameter;
dir += m_coefficients[1];
dir *= -1.0f;
local28 = m_eq[1];
local28 *= p_param1;
local30 = m_eq[0];
local30 *= local34;
local30 += local28;
local30 += m_eq[2];
localc = m_eq[0];
localc *= 2.0f;
localc *= p_param1;
localc += m_eq[1];
localc *= -1.0f;
if (dir.Unitize() != 0) {
if (localc.Unitize() != 0) {
assert(0);
return FAILURE;
}
right[1] = right[2] = 0.0f;
right[0] = 1.0f;
up.EqualsCross(dir, right);
local14[1] = local14[2] = 0.0f;
local14[0] = 1.0f;
local3c.EqualsCross(localc, local14);
if (up.Unitize() != 0) {
right[0] = right[1] = 0.0f;
right[2] = 1.0f;
up.EqualsCross(dir, right);
if (local3c.Unitize() != 0) {
local14[0] = local14[1] = 0.0f;
local14[2] = 1.0f;
local3c.EqualsCross(localc, local14);
if (up.Unitize() != 0) {
if (local3c.Unitize() != 0) {
assert(0);
return FAILURE;
}
}
right.EqualsCross(up, dir);
local14.EqualsCross(local3c, localc);
return SUCCESS;
}
@ -258,7 +255,7 @@ void Act3Ammo::Animate(float p_time)
case c_one:
break;
case c_two:
m_rotateTimeout = p_time + 2000.0f;
m_unk0x158 = p_time + 2000.0f;
m_actorState = c_three;
return;
case c_three:
@ -267,24 +264,24 @@ void Act3Ammo::Animate(float p_time)
transform = m_roi->GetLocal2World();
if (m_rotateTimeout > p_time) {
if (m_unk0x158 > p_time) {
Mx3DPointFloat position;
position = positionRef;
positionRef.Clear();
transform.RotateX(0.6);
positionRef = position;
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
m_roi->FUN_100a58f0(transform);
m_roi->VTable0x14();
return;
}
else {
m_actorState = c_initial;
m_rotateTimeout = 0;
m_unk0x158 = 0;
positionRef -= g_hitTranslation;
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
positionRef -= g_unk0x10104f08;
m_roi->FUN_100a58f0(transform);
m_roi->VTable0x14();
return;
}
}
@ -298,15 +295,15 @@ void Act3Ammo::Animate(float p_time)
m_unk0x7c = 0.0f;
}
MxMatrix transform;
MxMatrix additionalTransform;
MxMatrix local104;
MxMatrix local60;
float f = (m_BADuration - m_unk0x7c) / m_worldSpeed + m_lastTime;
undefined4 unused1 = 0;
undefined4 unused2 = 0;
MxU32 annihilated = FALSE;
MxU32 reachedTarget = FALSE;
undefined4 localb4 = 0;
undefined4 localbc = 0;
MxU32 local14 = FALSE;
MxU32 localb8 = FALSE;
if (f >= p_time) {
m_actorTime = (p_time - m_lastTime) * m_worldSpeed + m_actorTime;
@ -314,79 +311,77 @@ void Act3Ammo::Animate(float p_time)
m_lastTime = p_time;
}
else {
reachedTarget = TRUE;
localb8 = TRUE;
m_unk0x7c = m_BADuration;
m_lastTime = p_time;
}
transform.SetIdentity();
local104.SetIdentity();
MxResult r = CalculateTransform((m_unk0x7c / m_BADuration) * m_apexParameter, transform);
MxResult r = FUN_10053db0((m_unk0x7c / m_BADuration) * m_unk0x19c, local104);
assert(r == 0); // SUCCESS
additionalTransform.SetIdentity();
local60.SetIdentity();
if (IsPizza()) {
additionalTransform.Scale(2.0f, 2.0f, 2.0f);
local60.Scale(2.0f, 2.0f, 2.0f);
}
else {
additionalTransform.Scale(5.0f, 5.0f, 5.0f);
local60.Scale(5.0f, 5.0f, 5.0f);
}
if (reachedTarget) {
if (localb8) {
if (m_boundary != NULL) {
Vector3 right(transform[0]);
Vector3 up(transform[1]);
Vector3 dir(transform[2]);
Vector3 local17c(local104[0]);
Vector3 local184(local104[1]);
Vector3 local174(local104[2]);
if (IsPizza()) {
up = *m_boundary->GetUp();
right[0] = 1.0f;
right[1] = right[2] = 0.0f;
dir.EqualsCross(right, up);
dir.Unitize();
right.EqualsCross(up, dir);
local184 = *m_boundary->GetUnknown0x14();
local17c[0] = 1.0f;
local17c[1] = local17c[2] = 0.0f;
local174.EqualsCross(local17c, local184);
local174.Unitize();
local17c.EqualsCross(local184, local174);
}
else {
right = *m_boundary->GetUp();
up[0] = 1.0f;
up[1] = up[2] = 0.0f;
dir.EqualsCross(right, up);
dir.Unitize();
up.EqualsCross(dir, right);
local17c = *m_boundary->GetUnknown0x14();
local184[0] = 1.0f;
local184[1] = local184[2] = 0.0f;
local174.EqualsCross(local17c, local184);
local174.Unitize();
local184.EqualsCross(local174, local17c);
}
}
m_actorState = c_initial;
}
else {
additionalTransform.RotateX(m_actorTime / 10.0f);
additionalTransform.RotateY(m_actorTime / 6.0f);
local60.RotateX(m_actorTime / 10.0f);
local60.RotateY(m_actorTime / 6.0f);
}
MxMatrix transformCopy(transform);
transform.Product(additionalTransform, transformCopy);
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
MxMatrix localb0(local104);
local104.Product(local60, localb0);
m_roi->FUN_100a58f0(local104);
m_roi->VTable0x14();
if (m_BADuration <= m_unk0x7c) {
m_worldSpeed = 0.0f;
}
Vector3 position(transform[3]);
Vector3 local68(local104[3]);
if (reachedTarget) {
if (IsShootWithoutBoundary()) {
if (localb8) {
if (IsBit4()) {
if (IsPizza()) {
m_world->RemovePizza(*this);
m_world->TriggerHitSound(2);
m_world->FUN_10072ad0(2);
}
else {
m_world->RemoveDonut(*this);
m_world->TriggerHitSound(4);
m_world->FUN_10072ad0(4);
}
return;
}
else {
if (IsPizza()) {
@ -397,99 +392,89 @@ void Act3Ammo::Animate(float p_time)
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("stickdn", NULL, FALSE);
}
}
LegoPathActorSet& plpas = m_boundary->GetActors();
LegoPathActorSet lpas(plpas);
LegoPathActorSet& plpas = m_boundary->GetActors();
LegoPathActorSet lpas(plpas);
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
if (plpas.find(*itpa) == plpas.end()) {
continue;
}
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
if (plpas.find(*itpa) != plpas.end() && this != *itpa) {
LegoROI* r = (*itpa)->GetROI();
assert(r);
if (this == *itpa) {
continue;
}
if (!strncmp(r->GetName(), "pammo", 5)) {
Mx3DPointFloat local1c8;
Mx3DPointFloat local1b4;
LegoROI* r = (*itpa)->GetROI();
assert(r);
local1c8 = r->GetLocal2World()[3];
local1b4 = m_roi->GetLocal2World()[3];
if (!strncmp(r->GetName(), "pammo", 5)) {
Mx3DPointFloat otherPosition;
Mx3DPointFloat distance;
local1b4 -= local1c8;
otherPosition = r->GetLocal2World()[3];
distance = m_roi->GetLocal2World()[3];
float radius = r->GetWorldBoundingSphere().Radius();
if (local1b4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
assert(0);
}
distance -= otherPosition;
assert(m_world);
float radius = r->GetWorldBoundingSphere().Radius();
if (distance.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
assert(0);
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
m_world->EatPizza(index);
m_world->m_brickster->FUN_100417c0();
}
if (IsDonut()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
m_world->RemoveDonut(*this);
local14 = TRUE;
break;
}
}
}
else if (!strncmp(r->GetName(), "dammo", 5)) {
Mx3DPointFloat local1f8;
Mx3DPointFloat local1e4;
assert(m_world);
local1f8 = r->GetLocal2World()[3];
local1e4 = m_roi->GetLocal2World()[3];
#ifdef BETA10
m_world->EatPizza(index);
#else
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
m_world->EatPizza(index);
m_world->m_brickster->FUN_100417c0();
}
#endif
local1e4 -= local1f8;
if (IsDonut()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
m_world->RemoveDonut(*this);
annihilated = TRUE;
break;
float radius = r->GetWorldBoundingSphere().Radius();
if (local1e4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
assert(0);
}
assert(m_world);
m_world->EatDonut(index);
if (IsPizza()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
m_world->RemovePizza(*this);
local14 = TRUE;
break;
}
}
}
}
}
else if (!strncmp(r->GetName(), "dammo", 5)) {
Mx3DPointFloat otherPosition;
Mx3DPointFloat distance;
otherPosition = r->GetLocal2World()[3];
distance = m_roi->GetLocal2World()[3];
distance -= otherPosition;
float radius = r->GetWorldBoundingSphere().Radius();
if (distance.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
assert(0);
}
assert(m_world);
m_world->EatDonut(index);
if (IsPizza()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
m_world->RemovePizza(*this);
annihilated = TRUE;
break;
}
if (!local14) {
if (IsPizza()) {
m_world->FUN_10073360(*this, local68);
}
else {
m_world->FUN_10073390(*this, local68);
}
}
}
if (!annihilated) {
if (IsPizza()) {
m_world->FUN_10073360(*this, position);
m_worldSpeed = -1.0f;
}
else {
m_world->FUN_10073390(*this, position);
}
m_worldSpeed = -1.0f;
}
}
}

View File

@ -37,11 +37,11 @@ Ambulance::Ambulance()
m_state = NULL;
m_unk0x168 = 0;
m_actorId = -1;
m_atPoliceTask = 0;
m_atBeachTask = 0;
m_taskState = Ambulance::e_none;
m_unk0x16c = 0;
m_unk0x16e = 0;
m_unk0x170 = 0;
m_lastAction = IsleScript::c_noneIsle;
m_enableRandomAudio = 0;
m_unk0x172 = 0;
m_lastAnimation = IsleScript::c_noneIsle;
m_fuel = 1.0;
}
@ -70,7 +70,7 @@ MxResult Ambulance::Create(MxDSAction& p_dsAction)
m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState");
if (!m_state) {
m_state = new AmbulanceMissionState();
m_state->m_state = AmbulanceMissionState::e_ready;
m_state->m_unk0x08 = 0;
GameState()->RegisterState(m_state);
}
}
@ -170,25 +170,25 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
m_lastAction = IsleScript::c_noneIsle;
}
else if (objectId == IsleScript::c_hho027en_RunAnim) {
m_state->m_state = AmbulanceMissionState::e_enteredAmbulance;
m_state->m_unk0x08 = 1;
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
m_enableRandomAudio = 0;
m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000);
}
else if (objectId == IsleScript::c_hpz047pe_RunAnim || objectId == IsleScript::c_hpz048pe_RunAnim || objectId == IsleScript::c_hpz049bd_RunAnim || objectId == IsleScript::c_hpz053pa_RunAnim) {
if (m_taskState == Ambulance::e_finished) {
if (m_unk0x170 == 3) {
PlayAnimation(IsleScript::c_hpz055pa_RunAnim);
m_taskState = Ambulance::e_none;
m_unk0x170 = 0;
}
else {
PlayAnimation(IsleScript::c_hpz053pa_RunAnim);
}
}
else if (objectId == IsleScript::c_hpz050bd_RunAnim || objectId == IsleScript::c_hpz052ma_RunAnim) {
if (m_taskState == Ambulance::e_finished) {
if (m_unk0x170 == 3) {
PlayAnimation(IsleScript::c_hpz057ma_RunAnim);
m_taskState = Ambulance::e_none;
m_unk0x170 = 0;
}
else {
PlayAnimation(IsleScript::c_hpz052ma_RunAnim);
@ -198,21 +198,21 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
SpawnPlayer(LegoGameState::e_pizzeriaExterior, TRUE, 0);
m_enableRandomAudio = 0;
m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000);
if (m_atPoliceTask != 0) {
if (m_unk0x16c != 0) {
StopActions();
}
}
else if (objectId == IsleScript::c_hps116bd_RunAnim || objectId == IsleScript::c_hps118re_RunAnim) {
if (objectId == IsleScript::c_hps116bd_RunAnim && m_taskState != Ambulance::e_finished) {
if (objectId == IsleScript::c_hps116bd_RunAnim && m_unk0x170 != 3) {
PlayAction(IsleScript::c_Avo923In_PlayWav);
}
if (m_taskState == Ambulance::e_finished) {
if (m_unk0x170 == 3) {
PlayAnimation(IsleScript::c_hps117bd_RunAnim);
m_taskState = Ambulance::e_none;
m_unk0x170 = 0;
}
else {
PlayAnimation(IsleScript::c_hps118re_RunAnim);
@ -221,16 +221,16 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
else if (objectId == IsleScript::c_hps117bd_RunAnim) {
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
SpawnPlayer(LegoGameState::e_policeExited, TRUE, 0);
m_enableRandomAudio = 0;
SpawnPlayer(LegoGameState::e_unk33, TRUE, 0);
m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000);
if (m_atBeachTask != 0) {
if (m_unk0x16e != 0) {
StopActions();
}
}
else if (objectId == IsleScript::c_hho142cl_RunAnim || objectId == IsleScript::c_hho143cl_RunAnim || objectId == IsleScript::c_hho144cl_RunAnim) {
Reset();
FUN_10037250();
}
}
@ -241,18 +241,18 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
// FUNCTION: BETA10 0x100230bf
MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
{
if (m_taskState == Ambulance::e_waiting) {
if (m_unk0x170 == 1) {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "ps-gate")) {
m_taskState = Ambulance::e_finished;
m_unk0x170 = 3;
return 1;
}
roi = PickRootROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !strcmpi(roi->GetName(), "gd")) {
m_taskState = Ambulance::e_finished;
m_unk0x170 = 3;
return 1;
}
}
@ -270,9 +270,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && p_param.GetData() == 0x0b) {
if (m_atBeachTask != 0) {
if (m_atPoliceTask != 0) {
m_state->m_state = AmbulanceMissionState::e_prepareAmbulance;
if (m_unk0x16e != 0) {
if (m_unk0x16c != 0) {
m_state->m_unk0x08 = 2;
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -297,7 +297,7 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
return 0;
}
if (m_atBeachTask != 0) {
if (m_unk0x16e != 0) {
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
}
@ -307,7 +307,7 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
}
if (m_atPoliceTask != 0) {
if (m_unk0x16c != 0) {
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
}
@ -315,9 +315,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
PlayAction(IsleScript::c_Avo915In_PlayWav);
}
}
else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_atBeachTask == 0) {
m_atBeachTask = 1;
m_taskState = Ambulance::e_waiting;
else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_unk0x16e == 0) {
m_unk0x16e = 1;
m_unk0x170 = 1;
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -345,9 +345,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
break;
}
}
else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_atPoliceTask == 0) {
m_atPoliceTask = 1;
m_taskState = Ambulance::e_waiting;
else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_unk0x16c == 0) {
m_unk0x16c = 1;
m_unk0x170 = 1;
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -364,15 +364,15 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
// FUNCTION: BETA10 0x10023506
MxLong Ambulance::HandleClick()
{
if (((Act1State*) GameState()->GetState("Act1State"))->m_state != Act1State::e_ambulance) {
if (((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 != 10) {
return 1;
}
if (m_state->m_state == AmbulanceMissionState::e_prepareAmbulance) {
if (m_state->m_unk0x08 == 2) {
return 1;
}
Disable(TRUE, 0);
FUN_10015820(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
@ -387,8 +387,8 @@ MxLong Ambulance::HandleClick()
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
ControlManager()->Register(this);
if (m_state->m_state == AmbulanceMissionState::e_enteredAmbulance) {
SpawnPlayer(LegoGameState::e_hospitalExited, TRUE, 0);
if (m_state->m_unk0x08 == 1) {
SpawnPlayer(LegoGameState::e_unk31, TRUE, 0);
m_state->m_startTime = Timer()->GetTime();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns018rd_RunAnim, NULL);
}
@ -398,9 +398,9 @@ MxLong Ambulance::HandleClick()
// FUNCTION: LEGO1 0x10036e60
// FUNCTION: BETA10 0x100236bb
void Ambulance::Init()
void Ambulance::FUN_10036e60()
{
m_state->m_state = AmbulanceMissionState::e_prepareAmbulance;
m_state->m_unk0x08 = 2;
PlayAnimation(IsleScript::c_hho027en_RunAnim);
m_lastAction = IsleScript::c_noneIsle;
m_lastAnimation = IsleScript::c_noneIsle;
@ -411,7 +411,7 @@ void Ambulance::Exit()
{
GameState()->m_currentArea = LegoGameState::e_hospitalExterior;
StopActions();
Reset();
FUN_10037250();
Leave();
}
@ -437,24 +437,24 @@ MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_enabledChild == 1) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_AmbulanceArms_Ctl:
Exit();
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
GameState()->m_currentArea = LegoGameState::e_unk66;
result = 1;
break;
case IsleScript::c_AmbulanceInfo_Ctl:
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
Exit();
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
GameState()->m_currentArea = LegoGameState::e_unk66;
result = 1;
break;
case IsleScript::c_AmbulanceHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "AmbulanceHorn_Sound");
presenter->Enable(p_param.m_enabledChild);
presenter->Enable(p_param.m_unk0x28);
break;
}
}
@ -467,11 +467,11 @@ void Ambulance::ActivateSceneActions()
{
PlayMusic(JukeboxScript::c_Hospital_Music);
if (m_state->m_state == AmbulanceMissionState::e_enteredAmbulance) {
m_state->m_state = AmbulanceMissionState::e_ready;
if (m_state->m_unk0x08 == 1) {
m_state->m_unk0x08 = 0;
PlayAction(IsleScript::c_ham033cl_PlayWav);
}
else if (m_atPoliceTask != 0 && m_atBeachTask != 0) {
else if (m_unk0x16c != 0 && m_unk0x16e != 0) {
IsleScript::Script objectId;
switch (rand() % 2) {
@ -513,8 +513,8 @@ void Ambulance::ActivateSceneActions()
// FUNCTION: BETA10 0x100237df
MxResult Ambulance::Tickle()
{
if (m_enableRandomAudio == 0) {
m_enableRandomAudio = 1;
if (m_unk0x172 == 0) {
m_unk0x172 = 1;
}
else if (m_lastAction == IsleScript::c_noneIsle) {
IsleScript::Script objectId;
@ -571,14 +571,14 @@ void Ambulance::StopActions()
}
// FUNCTION: LEGO1 0x10037250
void Ambulance::Reset()
void Ambulance::FUN_10037250()
{
StopAction(m_lastAction);
BackgroundAudioManager()->RaiseVolume();
((Act1State*) GameState()->GetState("Act1State"))->m_state = Act1State::e_none;
m_state->m_state = AmbulanceMissionState::e_ready;
m_atBeachTask = 0;
m_atPoliceTask = 0;
((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 = 0;
m_state->m_unk0x08 = 0;
m_unk0x16e = 0;
m_unk0x16c = 0;
g_isleFlags |= Isle::c_playMusic;
AnimationManager()->EnableCamAnims(TRUE);
AnimationManager()->FUN_1005f6d0(TRUE);
@ -626,7 +626,7 @@ void Ambulance::PlayAction(IsleScript::Script p_objectId)
// FUNCTION: LEGO1 0x100373a0
AmbulanceMissionState::AmbulanceMissionState()
{
m_state = AmbulanceMissionState::e_ready;
m_unk0x08 = 0;
m_startTime = 0;
m_peScore = 0;
m_maScore = 0;

View File

@ -52,9 +52,9 @@ void Bike::Exit()
// FUNCTION: LEGO1 0x100769a0
MxLong Bike::HandleClick()
{
if (CanExit()) {
if (FUN_1003ef60()) {
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
Disable(TRUE, 0);
FUN_10015820(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_bike);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@ -81,11 +81,11 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_enabledChild == 1) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_BikeArms_Ctl:
Exit();
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
GameState()->m_currentArea = LegoGameState::e_unk66;
result = 1;
break;
case IsleScript::c_BikeInfo_Ctl:
@ -97,7 +97,7 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param)
case IsleScript::c_BikeHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "BikeHorn_Sound");
presenter->Enable(p_param.m_enabledChild);
presenter->Enable(p_param.m_unk0x28);
break;
}
}
@ -111,8 +111,8 @@ void Bike::ActivateSceneActions()
PlayMusic(JukeboxScript::c_InformationCenter_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

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