Merge remote-tracking branch 'upstream/master' into impl/1005b4f0

This commit is contained in:
Misha 2024-01-17 14:12:42 -05:00
commit f019012d29
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
275 changed files with 6327 additions and 3170 deletions

View File

@ -4,6 +4,7 @@ on: [push, pull_request]
jobs: jobs:
decomplint-isle: decomplint-isle:
name: 'ISLE annotations'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -18,6 +19,7 @@ jobs:
python3 tools/decomplint/decomplint.py ISLE --module ISLE --warnfail python3 tools/decomplint/decomplint.py ISLE --module ISLE --warnfail
decomplint-lego1: decomplint-lego1:
name: 'LEGO1 annotations'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -3,7 +3,53 @@ name: Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build-current-toolchain:
name: 'Current ${{ matrix.toolchain.name }}'
runs-on: windows-latest
defaults:
run:
shell: ${{ matrix.toolchain.shell }}
strategy:
fail-fast: false
matrix:
toolchain:
- { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true }
- { name: 'msys2 mingw32', shell: 'msys2 {0}', setup-msys2: true }
steps:
- name: Set up MSYS2
if: matrix.toolchain.setup-msys2
uses: msys2/setup-msys2@v2
with:
msystem: mingw32
install: >-
mingw-w64-i686-cc
mingw-w64-i686-cmake
mingw-w64-i686-ninja
- name: Setup cmake
if: matrix.toolchain.setup-cmake
uses: jwlawson/actions-setup-cmake@v1.13
- name: Setup ninja
if: matrix.toolchain.setup-ninja
uses: ashutoshvarma/setup-ninja@master
- name: Setup vcvars
if: matrix.toolchain.setup-msvc
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86 # Use the 64-bit x64-native cross tools to build 32-bit x86 code
- uses: actions/checkout@v3
- name: Build
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -GNinja -Werror=dev
cmake --build build
build: build:
name: 'MSVC 4.20'
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -28,10 +74,8 @@ jobs:
shell: cmd shell: cmd
run: | run: |
call .\msvc420\bin\VCVARS32.BAT x86 call .\msvc420\bin\VCVARS32.BAT x86
mkdir build cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles"
cd build cmake --build build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles"
cmake --build .
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
@ -44,6 +88,7 @@ jobs:
build/LEGO1.PDB build/LEGO1.PDB
compare: compare:
name: 'Compare with master'
needs: build needs: build
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -109,6 +154,7 @@ jobs:
LEGO1PROGRESS.* LEGO1PROGRESS.*
upload: upload:
name: 'Upload artifacts'
needs: [build, compare] needs: [build, compare]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle' }} if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle' }}

View File

@ -4,6 +4,7 @@ on: [push, pull_request]
jobs: jobs:
clang-format: clang-format:
name: 'C++'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -19,6 +20,7 @@ jobs:
-i -i
python-format: python-format:
name: 'Python'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -4,6 +4,7 @@ on: [push, pull_request]
jobs: jobs:
ncc: ncc:
name: 'C++'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -1,9 +1,10 @@
name: Unit Tests name: Test
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
pytest-win: pytest-win:
name: 'Python Windows'
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -20,6 +21,7 @@ jobs:
pytest tools/isledecomp pytest tools/isledecomp
pytest-ubuntu: pytest-ubuntu:
name: 'Python Linux'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -2,8 +2,24 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(isle CXX) project(isle CXX)
math(EXPR bits "8 * ${CMAKE_SIZEOF_VOID_P}")
message(STATUS "Building ${bits}-bit LEGO Island")
if (NOT bits EQUAL 32)
message(WARNING "Only 32-bit executables are supported")
endif()
set(MSVC_FOR_DECOMP FALSE)
if (MSVC)
# Visual C++ 4.2 -> cl version 10.2.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0")
set(MSVC_FOR_DECOMP TRUE)
endif()
endif()
message(STATUS "MSVC for decompilation: ${MSVC_FOR_DECOMP}")
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
option(ISLE_USE_SMARTHEAP "Build with SmartHeap" ${MSVC}) option(ISLE_USE_SMARTHEAP "Build with SmartHeap" ${MSVC_FOR_DECOMP})
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON) option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON)
add_library(lego1 SHARED add_library(lego1 SHARED
@ -42,7 +58,9 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/common/legoutil.cpp LEGO1/lego/legoomni/src/common/legoutil.cpp
LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp
LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp
LEGO1/lego/legoomni/src/control/mxcontrolpresenter.cpp
LEGO1/lego/legoomni/src/entity/legoactor.cpp LEGO1/lego/legoomni/src/entity/legoactor.cpp
LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp
LEGO1/lego/legoomni/src/entity/legoanimactor.cpp LEGO1/lego/legoomni/src/entity/legoanimactor.cpp
LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp
LEGO1/lego/legoomni/src/entity/legoentity.cpp LEGO1/lego/legoomni/src/entity/legoentity.cpp
@ -81,7 +99,7 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/isle/jukebox.cpp LEGO1/lego/legoomni/src/isle/jukebox.cpp
LEGO1/lego/legoomni/src/isle/jukeboxentity.cpp LEGO1/lego/legoomni/src/isle/jukeboxentity.cpp
LEGO1/lego/legoomni/src/isle/jukeboxstate.cpp LEGO1/lego/legoomni/src/isle/jukeboxstate.cpp
LEGO1/lego/legoomni/src/isle/motorcycle.cpp LEGO1/lego/legoomni/src/isle/motocycle.cpp
LEGO1/lego/legoomni/src/isle/radio.cpp LEGO1/lego/legoomni/src/isle/radio.cpp
LEGO1/lego/legoomni/src/isle/radiostate.cpp LEGO1/lego/legoomni/src/isle/radiostate.cpp
LEGO1/lego/legoomni/src/isle/skateboard.cpp LEGO1/lego/legoomni/src/isle/skateboard.cpp
@ -123,8 +141,11 @@ add_library(lego1 SHARED
LEGO1/lego/sources/3dmanager/legoview1.cpp LEGO1/lego/sources/3dmanager/legoview1.cpp
LEGO1/lego/sources/3dmanager/tglsurface.cpp LEGO1/lego/sources/3dmanager/tglsurface.cpp
LEGO1/lego/sources/roi/legoroi.cpp LEGO1/lego/sources/roi/legoroi.cpp
LEGO1/main.cpp
LEGO1/mxdirectx/mxdirect3d.cpp LEGO1/mxdirectx/mxdirect3d.cpp
LEGO1/mxdirectx/mxdirectdraw.cpp LEGO1/mxdirectx/mxdirectdraw.cpp
LEGO1/mxgeometry/mxgeometry3d.cpp
LEGO1/mxgeometry/mxmatrix.cpp
LEGO1/omni/src/action/mxdsaction.cpp LEGO1/omni/src/action/mxdsaction.cpp
LEGO1/omni/src/action/mxdsanim.cpp LEGO1/omni/src/action/mxdsanim.cpp
LEGO1/omni/src/action/mxdsevent.cpp LEGO1/omni/src/action/mxdsevent.cpp
@ -161,11 +182,9 @@ add_library(lego1 SHARED
LEGO1/omni/src/common/mxutil.cpp LEGO1/omni/src/common/mxutil.cpp
LEGO1/omni/src/common/mxvariable.cpp LEGO1/omni/src/common/mxvariable.cpp
LEGO1/omni/src/common/mxvariabletable.cpp LEGO1/omni/src/common/mxvariabletable.cpp
LEGO1/omni/src/control/mxcontrolpresenter.cpp
LEGO1/omni/src/entity/mxentity.cpp LEGO1/omni/src/entity/mxentity.cpp
LEGO1/omni/src/event/mxeventmanager.cpp LEGO1/omni/src/event/mxeventmanager.cpp
LEGO1/omni/src/event/mxeventpresenter.cpp LEGO1/omni/src/event/mxeventpresenter.cpp
LEGO1/omni/src/main/mxmain.cpp
LEGO1/omni/src/main/mxomni.cpp LEGO1/omni/src/main/mxomni.cpp
LEGO1/omni/src/main/mxomnicreateflags.cpp LEGO1/omni/src/main/mxomnicreateflags.cpp
LEGO1/omni/src/main/mxomnicreateparam.cpp LEGO1/omni/src/main/mxomnicreateparam.cpp
@ -275,6 +294,8 @@ if (ISLE_BUILD_APP)
ISLE/define.cpp ISLE/define.cpp
) )
target_compile_definitions(isle PRIVATE ISLE_APP)
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/util") target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/util")
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1") target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include") target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include")
@ -300,6 +321,29 @@ if (ISLE_BUILD_APP)
endif() endif()
if (MSVC) if (MSVC)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
target_compile_definitions(lego1 PRIVATE _CRT_SECURE_NO_WARNINGS)
if (ISLE_BUILD_APP)
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif()
endif()
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428")
target_compile_options(lego1 PRIVATE "-Zc:__cplusplus")
if (ISLE_BUILD_APP)
target_compile_options(isle PRIVATE "-Zc:__cplusplus")
endif()
endif()
endif()
if (MSVC_FOR_DECOMP)
target_compile_definitions(lego1 PRIVATE "ENABLE_DECOMP_ASSERTS")
if (ISLE_BUILD_APP)
target_compile_definitions(isle PRIVATE "ENABLE_DECOMP_ASSERTS")
endif()
endif()
if (MSVC_FOR_DECOMP)
# These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the # These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the
# game was originally built with) and tweaked slightly to produce more debugging info for reccmp. # game was originally built with) and tweaked slightly to produce more debugging info for reccmp.
# They ensure a recompilation that can be byte/instruction accurate to the original binaries. # They ensure a recompilation that can be byte/instruction accurate to the original binaries.

View File

@ -614,8 +614,8 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
LegoAnimationManager::configureLegoAnimationManager(m_islandQuality); LegoAnimationManager::configureLegoAnimationManager(m_islandQuality);
if (LegoOmni::GetInstance()) { if (LegoOmni::GetInstance()) {
if (LegoOmni::GetInstance()->GetInputManager()) { if (LegoOmni::GetInstance()->GetInputManager()) {
LegoOmni::GetInstance()->GetInputManager()->m_useJoystick = m_useJoystick; LegoOmni::GetInstance()->GetInputManager()->SetUseJoystick(m_useJoystick);
LegoOmni::GetInstance()->GetInputManager()->m_joystickIndex = m_joystickIndex; LegoOmni::GetInstance()->GetInputManager()->SetJoystickIndex(m_joystickIndex);
} }
} }
if (m_fullScreen) { if (m_fullScreen) {
@ -792,11 +792,11 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
LegoOmni::GetInstance()->CreateBackgroundAudio(); LegoOmni::GetInstance()->CreateBackgroundAudio();
BackgroundAudioManager()->Enable(this->m_useMusic); BackgroundAudioManager()->Enable(this->m_useMusic);
MxStreamController* stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", MxStreamer::e_DiskStream); MxStreamController* stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", MxStreamer::e_diskStream);
MxDSAction ds; MxDSAction ds;
if (!stream) { if (!stream) {
stream = Streamer()->Open("\\lego\\scripts\\nocd", MxStreamer::e_DiskStream); stream = Streamer()->Open("\\lego\\scripts\\nocd", MxStreamer::e_diskStream);
if (!stream) { if (!stream) {
return; return;
} }

63
ISLE/library_msvc.h Normal file
View File

@ -0,0 +1,63 @@
#ifdef 0
// For ISLE symbols only
// aka `operator new`
// LIBRARY: ISLE 0x402f80
// ??2@YAPAXI@Z
// aka `operator delete`
// LIBRARY: ISLE 0x402fa0
// ??3@YAXPAX@Z
// LIBRARY: ISLE 0x406dd0
// _malloc
// LIBRARY: ISLE 0x406f00
// _free
// LIBRARY: ISLE 0x407ec0
// ___CxxFrameHandler
// LIBRARY: ISLE 0x4081e0
// _srand
// LIBRARY: ISLE 0x4081f0
// _rand
// LIBRARY: ISLE 0x408220
// _atol
// LIBRARY: ISLE 0x4082d0
// _atoi
// LIBRARY: ISLE 0x4084c0
// ?_query_new_handler@@YAP6AHI@ZXZ
// LIBRARY: ISLE 0x4084d0
// ?_query_new_mode@@YAHXZ
// LIBRARY: ISLE 0x4085c0
// _sprintf
// LIBRARY: ISLE 0x408630
// _abort
// LIBRARY: ISLE 0x409110
// __mtinit
// LIBRARY: ISLE 0x409190
// __getptd
// GLOBAL: ISLE 0x4108e8
// __osver
// GLOBAL: ISLE 0x4108f0
// __winmajor
// GLOBAL: ISLE 0x4108f4
// __winminor
// GLOBAL: ISLE 0x410d50
// __newmode
#endif

312
ISLE/library_smartheap.h Normal file
View File

@ -0,0 +1,312 @@
#ifdef 0
// LIBRARY: ISLE 0x402f10
// ?shi_New@@YAPAXKIPAU_SHI_Pool@@@Z
// LIBRARY: ISLE 0x402fb0
// _MemInitDefaultPool@0
// LIBRARY: ISLE 0x403020
// _shi_call_new_handler_msc
// LIBRARY: ISLE 0x403050
// _MemPoolShrink@4
// LIBRARY: ISLE 0x403180
// _MemPoolPreAllocate@12
// LIBRARY: ISLE 0x403300
// @_shi_initPageHeaders@4
// LIBRARY: ISLE 0x403570
// @shi_allocPageHeader@4
// LIBRARY: ISLE 0x4035a0
// @shi_freePageHeader@8
// LIBRARY: ISLE 0x403750
// @_shi_deletePage@8
// LIBRARY: ISLE 0x403830
// @_shi_allocExternal@12
// LIBRARY: ISLE 0x403a50
// @_shi_initPageVariable@8
// LIBRARY: ISLE 0x403b00
// _MemAllocPtr@12
// LIBRARY: ISLE 0x403d60
// @_shi_allocVar@12
// LIBRARY: ISLE 0x403ef0
// @_shi_allocBlock@12
// LIBRARY: ISLE 0x4040c0
// _MemFreePtr@4
// LIBRARY: ISLE 0x404170
// @_shi_freeVar@4
// LIBRARY: ISLE 0x404260
// _MemReAllocPtr@12
// LIBRARY: ISLE 0x4043b0
// @_shi_resizeAny@16
// LIBRARY: ISLE 0x404650
// @_shi_resizeVar@8
// LIBRARY: ISLE 0x404820
// _MemSizePtr@4
// LIBRARY: ISLE 0x4048d0
// @shi_findAllocAddress@4
// LIBRARY: ISLE 0x404910
// @_shi_sysAlloc@8
// LIBRARY: ISLE 0x4049a0
// @_shi_sysFree@4
// LIBRARY: ISLE 0x404a00
// @_shi_sysRealloc@12
// LIBRARY: ISLE 0x404ab0
// @_shi_sysResize@12
// LIBRARY: ISLE 0x404b90
// @_shi_sysSize@4
// LIBRARY: ISLE 0x404bd0
// @_shi_sysAllocNear@4
// LIBRARY: ISLE 0x404bf0
// @_shi_sysFreeNear@4
// LIBRARY: ISLE 0x404c10
// @_shi_sysValidatePtr@12
// LIBRARY: ISLE 0x404d10
// @_shi_sysValidateFunction@4
// LIBRARY: ISLE 0x405300
// @_shi_sysAllocPool@12
// LIBRARY: ISLE 0x405520
// @_shi_sysResizePool@16
// LIBRARY: ISLE 0x405690
// @_shi_sysFreePage@4
// LIBRARY: ISLE 0x4057b0
// @_shi_sysSizePage@4
// LIBRARY: ISLE 0x4057e0
// @_shi_sysSizePool@8
// LIBRARY: ISLE 0x405800
// @_shi_registerShared@16
// LIBRARY: ISLE 0x405a00
// @_shi_unregisterShared@8
// LIBRARY: ISLE 0x405b20
// @_shi_getNextPool@4
// LIBRARY: ISLE 0x405b30
// @shi_delNextPool@4
// LIBRARY: ISLE 0x405d30
// @shi_createAndEnterMutexShr@12
// LIBRARY: ISLE 0x405e20
// @shi_termPoolMutexShr@4
// LIBRARY: ISLE 0x405e40
// @shi_enterPoolMutexShr@4
// LIBRARY: ISLE 0x405e60
// @shi_leavePoolMutexShr@4
// LIBRARY: ISLE 0x405e80
// __shi_enterCriticalSection@0
// LIBRARY: ISLE 0x405ea0
// __shi_leaveCriticalSection@0
// LIBRARY: ISLE 0x405ec0
// __shi_createAndEnterMutex
// LIBRARY: ISLE 0x405ef0
// _shi_enterPoolMutexSafely
// LIBRARY: ISLE 0x405fd0
// _shi_enterPoolInitMutexReader
// LIBRARY: ISLE 0x406060
// _shi_leavePoolInitMutexReader
// LIBRARY: ISLE 0x406090
// _shi_enterPoolInitMutexWriter
// LIBRARY: ISLE 0x406160
// _shi_leavePoolInitMutexWriter
// LIBRARY: ISLE 0x406180
// _shi_isNT
// LIBRARY: ISLE 0x4061b0
// _MemPoolInit@4
// LIBRARY: ISLE 0x406520
// _MemPoolSetPageSize@8
// LIBRARY: ISLE 0x406630
// _MemPoolSetBlockSizeFS@8
// LIBRARY: ISLE 0x406710
// @_shi_poolFree@8
// LIBRARY: ISLE 0x4068c0
// @_shi_invokeErrorHandler1@8
// LIBRARY: ISLE 0x406be0
// _MemErrorUnwind@0
// LIBRARY: ISLE 0x406c30
// _MemDefaultErrorHandler@4
// LIBRARY: ISLE 0x406cb0
// @_shi_taskRemovePool@4
// LIBRARY: ISLE 0x406d50
// @_shi_getCurrentThreadContext@8
// LIBRARY: ISLE 0x406db0
// @_shi_deleteThreadContext@8
// LIBRARY: ISLE 0x406e40
// _calloc
// LIBRARY: ISLE 0x406ea0
// _realloc
// LIBRARY: ISLE 0x406f10
// __expand
// LIBRARY: ISLE 0x406f50
// __heapadd
// LIBRARY: ISLE 0x406f60
// __heapwalk
// LIBRARY: ISLE 0x406ff0
// __heapused
// LIBRARY: ISLE 0x407020
// __heapmin
// LIBRARY: ISLE 0x407040
// __msize
// LIBRARY: ISLE 0x407050
// __heapchk
// LIBRARY: ISLE 0x407080
// __heapset
// LIBRARY: ISLE 0x407090
// @_shi_sysReportError@16
// LIBRARY: ISLE 0x407110
// _MemPoolSize@4
// LIBRARY: ISLE 0x4071a0
// _MemPoolWalk@8
// LIBRARY: ISLE 0x407240
// @_shi_walkPool@16
// LIBRARY: ISLE 0x407540
// @shi_isBlockInUseSmall@8
// LIBRARY: ISLE 0x407800
// @_shi_isBlockInUseFS@12
// LIBRARY: ISLE 0x407880
// _MemPoolCheck@4
// LIBRARY: ISLE 0x407b20
// _MemCheckPtr@8
// LIBRARY: ISLE 0x4084e0
// __except_handler3
// GLOBAL: ISLE 0x40f0a0
// _szLibName
// GLOBAL: ISLE 0x4102f4
// ?_new_handler@@3P6AXXZA
// GLOBAL: ISLE 0x4102fc
// _MemDefaultPool
// GLOBAL: ISLE 0x41031c
// __shi_compactPoolFn
// GLOBAL: ISLE 0x410320
// __shi_compactPageFn
// GLOBAL: ISLE 0x410324
// _MemDefaultPoolFlags
// GLOBAL: ISLE 0x41032c
// __shi_mutexGlobalInit
// GLOBAL: ISLE 0x410330
// __shi_mutexMovInit
// GLOBAL: ISLE 0x410334
// __shi_mutexMovLockCount
// GLOBAL: ISLE 0x410338
// _shi_initPoolReaders
// GLOBAL: ISLE 0x41033c
// _shi_eventInitPool
// GLOBAL: ISLE 0x410340
// _shi_mutexMovShr
// GLOBAL: ISLE 0x410368
// _shi_deferFreePools
// GLOBAL: ISLE 0x410378
// __shi_poolTerminating
// GLOBAL: ISLE 0x41037c
// _MemDefaultPoolBlockSizeFS
// GLOBAL: ISLE 0x410380
// _MemDefaultPoolPageSize
// GLOBAL: ISLE 0x410384
// _SmartHeap_malloc
// GLOBAL: ISLE 0x4105b0
// __shi_TaskRecord
// GLOBAL: ISLE 0x4125f8
// ?_pnhHeap@@3P6AHI@ZA
// GLOBAL: ISLE 0x412830
// __shi_mutexMov
// GLOBAL: ISLE 0x412850
// _shi_mutexPoolSynch
// GLOBAL: ISLE 0x412870
// __shi_mutexGlobal
#endif

View File

@ -10,20 +10,26 @@ MxS32 g_mxcoreCount[101] = {0, -6643, -5643, -5058, -4643, -4321, -4058, -38
-358, -340, -321, -304, -286, -268, -251, -234, -217, -200, -184, -168, -152, -358, -340, -321, -304, -286, -268, -251, -234, -217, -200, -184, -168, -152,
-136, -120, -104, -89, -74, -58, -43, -29, -14, 0}; -136, -120, -104, -89, -74, -58, -43, -29, -14, 0};
// GLOBAL: LEGO1 0x10101eac // GLOBAL: LEGO1 0x10102048
const char* g_parseExtraTokens = ":;"; // STRING: LEGO1 0x10102040
// GLOBAL: LEGO1 0x10101edc
const char* g_strWORLD = "WORLD";
// GLOBAL: LEGO1 0x10101f20
const char* g_strSOUND = "SOUND";
// GLOBAL: LEGO1 0x10101f58
const char* g_strOBJECT = "OBJECT";
// GLOBAL: LEGO1 0x10102040
const char* g_strACTION = "ACTION"; const char* g_strACTION = "ACTION";
// GLOBAL: LEGO1 0x1010209c
// STRING: LEGO1 0x10101f58
const char* g_strOBJECT = "OBJECT";
// GLOBAL: LEGO1 0x101020b0
// STRING: LEGO1 0x10101f20
const char* g_strSOUND = "SOUND";
// GLOBAL: LEGO1 0x101020cc // GLOBAL: LEGO1 0x101020cc
// STRING: LEGO1 0x100f3808
const char* g_strVISIBILITY = "VISIBILITY"; const char* g_strVISIBILITY = "VISIBILITY";
// GLOBAL: LEGO1 0x101020d0
// STRING: LEGO1 0x10101edc
const char* g_strWORLD = "WORLD";
// GLOBAL: LEGO1 0x101020e4
// STRING: LEGO1 0x10101eac
const char* g_parseExtraTokens = ":;";

View File

@ -24,10 +24,21 @@ class Act1State : public LegoState {
inline void SetUnknown18(MxU32 p_unk0x18) { m_unk0x18 = p_unk0x18; } inline void SetUnknown18(MxU32 p_unk0x18) { m_unk0x18 = p_unk0x18; }
inline MxU32 GetUnknown18() { return m_unk0x18; } inline MxU32 GetUnknown18() { return m_unk0x18; }
inline void SetUnknown21(MxS16 p_unk0x21) { m_unk0x21 = p_unk0x21; }
inline MxS16 GetUnknown21() { return m_unk0x21; }
void FUN_10034d00();
protected: protected:
undefined m_unk0x8[0x10]; // 0x8 undefined m_unk0x8[0x10]; // 0x8
MxU32 m_unk0x18; // 0x18 MxU32 m_unk0x18; // 0x18
undefined2 m_unk0x1c; // 0x1c
undefined m_unk0x1e; // 0x1e
undefined m_unk0x1f; // 0x1f
undefined m_unk0x20; // 0x20
MxBool m_unk0x21; // 0x21
undefined m_unk0x22; // 0x22
// TODO
}; };
#endif // ACT1STATE_H #endif // ACT1STATE_H

View File

@ -1,9 +1,11 @@
#ifndef ELEVATORBOTTOM_H #ifndef ELEVATORBOTTOM_H
#define ELEVATORBOTTOM_H #define ELEVATORBOTTOM_H
#include "decomp.h"
#include "legoworld.h" #include "legoworld.h"
// VTABLE: LEGO1 0x100d5f20 // VTABLE: LEGO1 0x100d5f20
// SIZE: 0xfc (from inlined ctor at 0x1000a8aa)
class ElevatorBottom : public LegoWorld { class ElevatorBottom : public LegoWorld {
public: public:
ElevatorBottom(); ElevatorBottom();
@ -23,6 +25,9 @@ class ElevatorBottom : public LegoWorld {
{ {
return !strcmp(p_name, ElevatorBottom::ClassName()) || LegoWorld::IsA(p_name); return !strcmp(p_name, ElevatorBottom::ClassName()) || LegoWorld::IsA(p_name);
} }
private:
undefined4 m_unk0xf8; // 0xf8
}; };
#endif // ELEVATORBOTTOM_H #endif // ELEVATORBOTTOM_H

View File

@ -3,19 +3,21 @@
// Items related to the Extra string of key-value pairs found in MxOb // Items related to the Extra string of key-value pairs found in MxOb
enum ExtraActionType { struct Extra {
ExtraActionType_none = 0, enum ActionType {
ExtraActionType_opendisk = 1, e_none = 0,
ExtraActionType_openram = 2, e_opendisk,
ExtraActionType_close = 3, e_openram,
ExtraActionType_start = 4, e_close,
ExtraActionType_stop = 5, e_start,
ExtraActionType_run = 6, e_stop,
ExtraActionType_exit = 7, e_run,
ExtraActionType_enable = 8, e_exit,
ExtraActionType_disable = 9, e_enable,
ExtraActionType_notify = 10, e_disable,
ExtraActionType_unknown = 11, e_notify,
e_unknown,
};
}; };
#endif // EXTRA_H #endif // EXTRA_H

View File

@ -1,7 +1,9 @@
#ifndef GASSTATION_H #ifndef GASSTATION_H
#define GASSTATION_H #define GASSTATION_H
#include "decomp.h"
#include "legoworld.h" #include "legoworld.h"
#include "radio.h"
// VTABLE: LEGO1 0x100d4650 // VTABLE: LEGO1 0x100d4650
// SIZE 0x128 // SIZE 0x128
@ -26,6 +28,20 @@ class GasStation : public LegoWorld {
{ {
return !strcmp(p_name, GasStation::ClassName()) || LegoWorld::IsA(p_name); return !strcmp(p_name, GasStation::ClassName()) || LegoWorld::IsA(p_name);
} }
private:
undefined2 m_unk0xf8; // 0xf8
undefined2 m_unk0xfa; // 0xfa
undefined4 m_unk0xfc; // 0xfc
undefined4 m_unk0x100; // 0x100
undefined2 m_unk0x104; // 0x104
undefined2 m_unk0x106; // 0x106
undefined4 m_unk0x108; // 0x108
undefined4 m_unk0x10c; // 0x10c
undefined4 m_unk0x110; // 0x110
undefined m_unk0x114; // 0x114
undefined m_unk0x115; // 0x115
Radio m_radio; // 0x118
}; };
#endif // GASSTATION_H #endif // GASSTATION_H

View File

@ -9,11 +9,11 @@
class HelicopterSubclass { class HelicopterSubclass {
public: public:
inline HelicopterSubclass() : m_unk0x30(0) {} inline HelicopterSubclass() : m_unk0x30(0) {}
MxResult FUN_100040a0(Vector4Impl& p_v, float p_f); MxResult FUN_100040a0(Vector4& p_v, float p_f);
private: private:
Vector4Data m_unk0x0; // 0x0 Mx4DPointFloat m_unk0x0; // 0x0
Vector4Data m_unk0x18; // 0x18 Mx4DPointFloat m_unk0x18; // 0x18
undefined4 m_unk0x30; // 0x30 undefined4 m_unk0x30; // 0x30
}; };
@ -37,9 +37,9 @@ class Helicopter : public IslePathActor {
return !strcmp(p_name, Helicopter::ClassName()) || IslePathActor::IsA(p_name); return !strcmp(p_name, Helicopter::ClassName()) || IslePathActor::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70 void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x74(Matrix4Impl& p_transform) override; // vtable+0x74 void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
virtual MxU32 VTable0xcc() override; // vtable+0xcc virtual MxU32 VTable0xcc() override; // vtable+0xcc
virtual MxU32 VTable0xd4(MxType17NotificationParam& p_param) override; // vtable+0xd4 virtual MxU32 VTable0xd4(MxType17NotificationParam& p_param) override; // vtable+0xd4
virtual MxU32 VTable0xd8(MxType18NotificationParam& p_param) override; // vtable+0xd8 virtual MxU32 VTable0xd8(MxType18NotificationParam& p_param) override; // vtable+0xd8
@ -49,8 +49,8 @@ class Helicopter : public IslePathActor {
// Helicopter::`scalar deleting destructor' // Helicopter::`scalar deleting destructor'
protected: protected:
Matrix4Data m_unk0x160; // 0x160 MxMatrix m_unk0x160; // 0x160
Matrix4Data m_unk0x1a8; // 0x1a8 MxMatrix m_unk0x1a8; // 0x1a8
float m_unk0x1f0; // 0x1f0 float m_unk0x1f0; // 0x1f0
HelicopterSubclass m_unk0x1f4; // 0x1f4 HelicopterSubclass m_unk0x1f4; // 0x1f4
HelicopterState* m_state; // 0x228 HelicopterState* m_state; // 0x228

View File

@ -2,11 +2,111 @@
#define INFOCENTER_H #define INFOCENTER_H
#include "legoworld.h" #include "legoworld.h"
#include "radio.h"
class InfocenterState;
// SIZE 0x18
struct InfocenterUnkDataEntry {
// FUNCTION: LEGO1 0x1006ec80
InfocenterUnkDataEntry() {}
undefined m_pad[0x18];
};
// VTABLE: LEGO1 0x100d9338 // VTABLE: LEGO1 0x100d9338
// SIZE 0x1d8 // SIZE 0x1d8
class Infocenter : public LegoWorld { class Infocenter : public LegoWorld {
public: public:
enum Cutscene {
e_noIntro = -1,
e_legoMovie,
e_mindscapeMovie,
e_introMovie,
e_outroMovie,
e_badEndMovie,
e_goodEndMovie
};
enum InfomainScript {
c_noInfomain = -1,
c_welcomeDialogue = 500,
c_goodJobDialogue = 501,
c_clickOnInfomanDialogue = 502,
c_tickleInfomanDialogue = 503,
c_letsGetStartedDialogue = 504,
c_clickOnObjectsGuidanceDialogue = 505,
c_arrowNavigationGuidanceDialogue = 506,
c_elevatorGuidanceDialogue = 507,
c_radioGuidanceDialogue = 508,
c_exitGuidanceDialogue1 = 509,
c_exitGuidanceDialogue2 = 510,
c_goOutsideGuidanceDialogue = 511,
c_experimentGuidanceDialogue = 512,
c_returnBackGuidanceDialogue1 = 513,
c_returnBackGuidanceDialogue2 = 514,
c_bricksterWarningDialogue = 515,
c_newGameGuidanceDialogue = 516,
c_returnBackGuidanceDialogue3 = 517,
c_reenterInfoCenterDialogue1 = 518,
c_reenterInfoCenterDialogue2 = 519,
c_reenterInfoCenterDialogue3 = 520,
c_reenterInfoCenterDialogue4 = 521,
c_exitConfirmationDialogue = 522,
c_saveGameOptionsDialogueUnused = 523,
c_exitGameDialogue = 524,
c_bricksterEscapedDialogue1 = 525,
c_bricksterEscapedDialogue2 = 526,
c_bricksterEscapedDialogue3 = 527,
c_bricksterEscapedDialogue4 = 528,
c_bricksterEscapedDialogue5 = 529,
c_bricksterEscapedDialogue6 = 530,
c_bricksterEscapedDialogue7 = 531,
c_infomanHiccup = 532,
c_infomanWalkOffScreenLeftUnused = 533,
c_infomanSneeze = 534,
c_infomanWalkOffScreenRightUnused = 535,
c_infomanLaughs = 536,
c_infomanLooksBehindAtScreenUnused = 537,
c_infomanReturnsFromScreenUnused = 538,
c_goodEndingDialogue = 539,
c_badEndingDialogue = 540,
c_pepperCharacterSelect = 541,
c_mamaCharacterSelect = 542,
c_papaCharacterSelect = 543,
c_nickCharacterSelect = 544,
c_lauraCharacterSelect = 545,
c_creditsDialogue = 551,
c_noCDDialogueUnused1 = 552,
c_noCDDialogueUnused2 = 553,
c_leaveInfoCenterDialogue1 = 562,
c_leaveInfoCenterDialogue2 = 563,
c_leaveInfoCenterDialogue3 = 564,
c_leaveInfoCenterDialogue4 = 565,
c_registerToContinueDialogue = 573,
c_bricksterDialogue = 574,
c_bricksterLaughs = 575,
};
enum SndAmimScript {
c_bookWig = 400
};
Infocenter(); Infocenter();
virtual ~Infocenter() override; virtual ~Infocenter() override;
@ -26,11 +126,51 @@ class Infocenter : public LegoWorld {
return !strcmp(p_name, Infocenter::ClassName()) || LegoWorld::IsA(p_name); return !strcmp(p_name, Infocenter::ClassName()) || LegoWorld::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void Stop() override; // vtable+0x50 virtual void VTable0x50() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64 virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68 virtual void VTable0x68(MxBool p_add) override; // vtable+0x68
private:
void InitializeBitmaps();
MxLong HandleKeyPress(MxS8 p_key);
MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y);
MxU8 HandleButtonUp(MxS32 p_x, MxS32 p_y);
MxU8 HandleNotification17(MxParam&);
MxLong HandleEndAction(MxParam& p_param);
MxLong HandleNotification0(MxParam&);
void FUN_10070dc0(MxBool);
void FUN_10070e90();
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void StopCutscene();
void StartCredits();
void StopCredits();
void PlayDialogue(InfomainScript p_objectId);
void StopCurrentDialogue();
void PlayBookAnimation();
void StopBookAnimation();
InfomainScript m_currentInfomainScript; // 0xf8
MxS16 m_unk0xfc; // 0xfc
InfocenterState* m_infocenterState; // 0x100
undefined4 m_unk0x104; // 0x104
Cutscene m_currentCutscene; // 0x108
Radio m_radio; // 0x10c
undefined4 m_unk0x11c; // 0x11c
InfocenterUnkDataEntry m_entries[7]; // 0x120
MxS16 m_unk0x1c8; // 0x1c8
undefined4 m_unk0x1cc; // 0x1cc
MxU16 m_unk0x1d0; // 0x1d0
MxU16 m_unk0x1d2; // 0x1d2
MxU16 m_unk0x1d4; // 0x1d4
MxU16 m_unk0x1d6; // 0x1d6
}; };
#endif // INFOCENTER_H #endif // INFOCENTER_H

View File

@ -25,6 +25,9 @@ class InfocenterState : public LegoState {
} }
inline MxU32 GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; } inline MxU32 GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; }
inline MxU32 GetUnknown0x74() { return m_unk0x74; }
inline void SetUnknown0x74(MxU32 p_unk0x74) { m_unk0x74 = p_unk0x74; }
private: private:
// Members should be renamed with their offsets before use // Members should be renamed with their offsets before use
@ -55,7 +58,8 @@ class InfocenterState : public LegoState {
undefined4 unk13; undefined4 unk13;
*/ */
undefined m_pad[0x70]; undefined m_pad[0x6c];
MxU32 m_unk0x74; // 0x74
MxU32 m_buffer[7]; // 0x78 MxU32 m_buffer[7]; // 0x78
}; };

View File

@ -12,7 +12,7 @@ class JukeBoxEntity;
class Helicopter; class Helicopter;
class Bike; class Bike;
class DuneBuggy; class DuneBuggy;
class Motorcycle; class Motocycle;
class SkateBoard; class SkateBoard;
class RaceCar; class RaceCar;
class Jetski; class Jetski;
@ -40,8 +40,8 @@ class Isle : public LegoWorld {
return !strcmp(p_name, Isle::ClassName()) || LegoWorld::IsA(p_name); return !strcmp(p_name, Isle::ClassName()) || LegoWorld::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void Stop() override; // vtable+50 virtual void VTable0x50() override; // vtable+50
virtual void VTable0x58(MxCore* p_object) override; // vtable+58 virtual void VTable0x58(MxCore* p_object) override; // vtable+58
// FUNCTION: LEGO1 0x10030900 // FUNCTION: LEGO1 0x10030900
virtual MxBool VTable0x5c() override { return TRUE; } // vtable+5c virtual MxBool VTable0x5c() override { return TRUE; } // vtable+5c
@ -57,6 +57,7 @@ class Isle : public LegoWorld {
MxLong HandleType17Notification(MxParam& p_param); MxLong HandleType17Notification(MxParam& p_param);
MxLong HandleType19Notification(MxParam& p_param); MxLong HandleType19Notification(MxParam& p_param);
MxLong HandleTransitionEnd(); MxLong HandleTransitionEnd();
void FUN_10032620();
protected: protected:
Act1State* m_act1state; // 0xf8 Act1State* m_act1state; // 0xf8
@ -68,7 +69,7 @@ class Isle : public LegoWorld {
Helicopter* m_helicopter; // 0x110 Helicopter* m_helicopter; // 0x110
Bike* m_bike; // 0x114 Bike* m_bike; // 0x114
DuneBuggy* m_dunebuggy; // 0x118 DuneBuggy* m_dunebuggy; // 0x118
Motorcycle* m_motorcycle; // 0x11c Motocycle* m_motocycle; // 0x11c
SkateBoard* m_skateboard; // 0x120 SkateBoard* m_skateboard; // 0x120
RaceCar* m_racecar; // 0x124 RaceCar* m_racecar; // 0x124
Jetski* m_jetski; // 0x128 Jetski* m_jetski; // 0x128

View File

@ -20,4 +20,10 @@ class IsleActor : public LegoActor {
} }
}; };
// SYNTHETIC: LEGO1 0x1000e940
// IsleActor::~IsleActor
// SYNTHETIC: LEGO1 0x1000e990
// IsleActor::`scalar deleting destructor'
#endif // ISLEACTOR_H #endif // ISLEACTOR_H

View File

@ -13,6 +13,8 @@
class IslePathActor : public LegoPathActor { class IslePathActor : public LegoPathActor {
public: public:
IslePathActor(); IslePathActor();
// FUNCTION: LEGO1 0x10002e10
inline virtual ~IslePathActor() override { IslePathActor::Destroy(TRUE); } // vtable+0x0 inline virtual ~IslePathActor() override { IslePathActor::Destroy(TRUE); } // vtable+0x0
// FUNCTION: LEGO1 0x10002ea0 // FUNCTION: LEGO1 0x10002ea0
@ -28,7 +30,8 @@ class IslePathActor : public LegoPathActor {
return !strcmp(p_name, IslePathActor::ClassName()) || LegoPathActor::IsA(p_name); return !strcmp(p_name, IslePathActor::ClassName()) || LegoPathActor::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
// FUNCTION: LEGO1 0x10002e70 // FUNCTION: LEGO1 0x10002e70
virtual MxU32 VTable0xcc() { return 0; } // vtable+0xcc virtual MxU32 VTable0xcc() { return 0; } // vtable+0xcc
// FUNCTION: LEGO1 0x10002df0 // FUNCTION: LEGO1 0x10002df0

View File

@ -9,7 +9,7 @@
// SIZE 0x68 // SIZE 0x68
class LegoActionControlPresenter : public MxMediaPresenter { class LegoActionControlPresenter : public MxMediaPresenter {
public: public:
inline LegoActionControlPresenter() { m_unk0x50 = ExtraActionType_none; } inline LegoActionControlPresenter() { m_unk0x50 = Extra::ActionType::e_none; }
virtual ~LegoActionControlPresenter() override { Destroy(TRUE); }; // vtable+0x00 virtual ~LegoActionControlPresenter() override { Destroy(TRUE); }; // vtable+0x00
// FUNCTION: LEGO1 0x1000d0e0 // FUNCTION: LEGO1 0x1000d0e0
@ -32,7 +32,7 @@ class LegoActionControlPresenter : public MxMediaPresenter {
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x5c virtual void Destroy(MxBool p_fromDestructor); // vtable+0x5c
private: private:
ExtraActionType m_unk0x50; // 0x50 Extra::ActionType m_unk0x50; // 0x50
MxString m_unk0x54; // 0x54 MxString m_unk0x54; // 0x54
undefined4 m_unk0x64; // 0x64 undefined4 m_unk0x64; // 0x64
}; };

View File

@ -9,6 +9,7 @@
class LegoActor : public LegoEntity { class LegoActor : public LegoEntity {
public: public:
LegoActor(); LegoActor();
virtual ~LegoActor() override;
// FUNCTION: LEGO1 0x1002d210 // FUNCTION: LEGO1 0x1002d210
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -43,4 +44,7 @@ class LegoActor : public LegoEntity {
MxU8 m_unk0x74; // 0x74 MxU8 m_unk0x74; // 0x74
}; };
// SYNTHETIC: LEGO1 0x1002d300
// LegoActor::`scalar deleting destructor'
#endif // LEGOACTOR_H #endif // LEGOACTOR_H

View File

@ -7,6 +7,8 @@
// SIZE 0x50 // SIZE 0x50
class LegoActorPresenter : public LegoEntityPresenter { class LegoActorPresenter : public LegoEntityPresenter {
public: public:
virtual ~LegoActorPresenter() override{};
// FUNCTION: LEGO1 0x1000cb10 // FUNCTION: LEGO1 0x1000cb10
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
{ {
@ -19,6 +21,13 @@ class LegoActorPresenter : public LegoEntityPresenter {
{ {
return !strcmp(p_name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name); return !strcmp(p_name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(p_name);
} }
virtual void ReadyTickle() override; // vtable+0x18
virtual void StartingTickle() override; // vtable+0x1c
virtual void ParseExtra() override; // vtable+0x30
}; };
// SYNTHETIC: LEGO1 0x1000cc30
// LegoActorPresenter::`scalar deleting destructor'
#endif // LEGOACTORPRESENTER_H #endif // LEGOACTORPRESENTER_H

View File

@ -1,6 +1,7 @@
#ifndef LEGOANIMATIONMANAGER_H #ifndef LEGOANIMATIONMANAGER_H
#define LEGOANIMATIONMANAGER_H #define LEGOANIMATIONMANAGER_H
#include "decomp.h"
#include "mxcore.h" #include "mxcore.h"
// VTABLE: LEGO1 0x100d8c18 // VTABLE: LEGO1 0x100d8c18
@ -26,7 +27,9 @@ class LegoAnimationManager : public MxCore {
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
} }
void FUN_1005ef10();
void FUN_1005f6d0(MxBool); void FUN_1005f6d0(MxBool);
void FUN_1005f720(undefined4);
void FUN_10064670(MxBool); void FUN_10064670(MxBool);
__declspec(dllexport) static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); __declspec(dllexport) static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig);

View File

@ -1,12 +1,19 @@
#ifndef LEGOANIMPRESENTER_H #ifndef LEGOANIMPRESENTER_H
#define LEGOANIMPRESENTER_H #define LEGOANIMPRESENTER_H
#include "mxgeometry/mxgeometry3d.h"
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
class LegoWorld;
class LegoMemoryStream;
class LegoAnimClass;
// VTABLE: LEGO1 0x100d90c8 // VTABLE: LEGO1 0x100d90c8
// SIZE 0xc0
class LegoAnimPresenter : public MxVideoPresenter { class LegoAnimPresenter : public MxVideoPresenter {
public: public:
LegoAnimPresenter(); LegoAnimPresenter();
virtual ~LegoAnimPresenter() override;
// FUNCTION: LEGO1 0x10068530 // FUNCTION: LEGO1 0x10068530
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -21,8 +28,84 @@ class LegoAnimPresenter : public MxVideoPresenter {
return !strcmp(p_name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); return !strcmp(p_name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(p_name);
} }
virtual void ReadyTickle() override; // vtable+0x18
virtual void StartingTickle() override; // vtable+0x1c
virtual void StreamingTickle() override; // vtable+0x20
virtual void ParseExtra() override; // vtable+0x30
virtual void Destroy() override; // vtable+0x38
virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c
virtual void EndAction() override; // vtable+0x40
virtual void PutFrame() override; // vtable+0x6c
virtual MxResult VTable0x88(MxStreamChunk* p_chunk); // vtable+0x88
// 6 more virtual functions here
private: private:
void Init(); void Init();
void Destroy(MxBool p_fromDestructor);
LegoAnimClass* m_unk0x64; // 0x64
undefined4 m_unk0x68; // 0x68
undefined4 m_unk0x6c; // 0x6c
undefined4 m_unk0x70; // 0x70
undefined4 m_unk0x74; // 0x74
undefined4 m_unk0x78; // 0x78
undefined4 m_unk0x7c; // 0x7c
LegoWorld* m_currentWorld; // 0x80
MxAtomId m_animAtom; // 0x84
undefined4 m_unk0x88; // 0x88
undefined4 m_unk0x8c; // 0x8c
undefined4 m_unk0x90; // 0x90
undefined m_unk0x94; // 0x94
undefined m_unk0x95; // 0x95
undefined m_unk0x96; // 0x96
undefined m_unk0x97; // 0x97
undefined4 m_unk0x98; // 0x98
MxS16 m_unk0x9c; // 0x9c
undefined4 m_unk0xa0; // 0xa0
undefined4 m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8
undefined4 m_unk0xbc; // 0xbc
}; };
// SYNTHETIC: LEGO1 0x10068650
// LegoAnimPresenter::`scalar deleting destructor'
// VTABLE: LEGO1 0x100db768
// SIZE 0x08
class LegoAnimClassBase {
public:
LegoAnimClassBase();
virtual ~LegoAnimClassBase();
virtual void VTable0x4(); // vtable+0x04
virtual void VTable0x8(); // vtable+0x08
virtual void VTable0xc(); // vtable+0x0c
undefined4 m_unk0x4; // 0x04
};
// SYNTHETIC: LEGO1 0x10099de0
// LegoAnimClassBase::`scalar deleting destructor'
// VTABLE: LEGO1 0x100db8d8
// SIZE 0x18
class LegoAnimClass : public LegoAnimClassBase {
public:
LegoAnimClass();
virtual ~LegoAnimClass() override;
virtual void VTable0x8() override; // vtable+0x08
virtual void VTable0xc() override; // vtable+0x0c
virtual MxResult VTable0x10(LegoMemoryStream* p_stream, MxS32); // vtable+0x10
MxLong m_unk0x8; // 0x08
undefined4 m_unk0xc; // 0x0c
undefined4 m_unk0x10; // 0x10
undefined4 m_unk0x14; // 0x14
};
// SYNTHETIC: LEGO1 0x100a0ba0
// LegoAnimClass::`scalar deleting destructor'
#endif // LEGOANIMPRESENTER_H #endif // LEGOANIMPRESENTER_H

View File

@ -19,6 +19,8 @@ class LegoBuildingManager : public MxCore {
__declspec(dllexport) static void configureLegoBuildingManager(MxS32); __declspec(dllexport) static void configureLegoBuildingManager(MxS32);
void FUN_1002fa00();
private: private:
void Init(); void Init();
}; };

View File

@ -3,9 +3,9 @@
#include "legopointofviewcontroller.h" #include "legopointofviewcontroller.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxgeometry/mxgeometry3d.h"
#include "mxgeometry/mxmatrix.h"
#include "mxpoint32.h" #include "mxpoint32.h"
#include "realtime/matrix.h"
#include "realtime/vector.h"
// VTABLE: LEGO1 0x100d57b0 // VTABLE: LEGO1 0x100d57b0
// SIZE 0xc8 // SIZE 0xc8
@ -29,22 +29,22 @@ class LegoCameraController : public LegoPointOfViewController {
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
} }
virtual void OnLButtonDown(MxPoint32 p_point) override; // vtable+0x30 virtual void OnLButtonDown(MxPoint32 p_point); // vtable+0x30
virtual void OnLButtonUp(MxPoint32 p_point) override; // vtable+0x34 virtual void OnLButtonUp(MxPoint32 p_point); // vtable+0x34
virtual void OnRButtonDown(MxPoint32 p_point) override; // vtable+0x38 virtual void OnRButtonDown(MxPoint32 p_point); // vtable+0x38
virtual void OnRButtonUp(MxPoint32 p_point) override; // vtable+0x3c virtual void OnRButtonUp(MxPoint32 p_point); // vtable+0x3c
virtual void OnMouseMove(MxU8 p_modifier, MxPoint32 p_point) override; // vtable+0x40 virtual void OnMouseMove(MxU8 p_modifier, MxPoint32 p_point); // vtable+0x40
virtual MxResult Create(); // vtable+0x44 virtual MxResult Create(); // vtable+0x44
void SetWorldTransform(Vector3Impl& p_at, Vector3Impl& p_dir, Vector3Impl& p_up); void SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up);
void FUN_100123e0(Matrix4Data& p_transform, MxU32); void FUN_100123e0(const MxMatrix& p_transform, MxU32);
Vector3Data& FUN_10012740(); Mx3DPointFloat GetWorldUp();
Vector3Data& FUN_100127f0(); Mx3DPointFloat GetWorldLocation();
Vector3Data& FUN_100128a0(); Mx3DPointFloat GetWorldDirection();
private: private:
Matrix4Data m_matrix1; // 0x38 MxMatrix m_matrix1; // 0x38
Matrix4Data m_matrix2; // 0x80 MxMatrix m_matrix2; // 0x80
}; };
// SYNTHETIC: LEGO1 0x10011f50 // SYNTHETIC: LEGO1 0x10011f50

View File

@ -2,6 +2,7 @@
#define LEGOCONTROLMANAGER_H #define LEGOCONTROLMANAGER_H
#include "mxcore.h" #include "mxcore.h"
#include "mxpresenterlist.h"
// VTABLE: LEGO1 0x100d6a80 // VTABLE: LEGO1 0x100d6a80
class LegoControlManager : public MxCore { class LegoControlManager : public MxCore {
@ -24,8 +25,10 @@ class LegoControlManager : public MxCore {
return !strcmp(p_name, LegoControlManager::ClassName()) || MxCore::IsA(p_name); return !strcmp(p_name, LegoControlManager::ClassName()) || MxCore::IsA(p_name);
} }
void FUN_10028df0(MxPresenterList* p_presenterList);
void Register(MxCore* p_listener); void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener); void Unregister(MxCore* p_listener);
void FUN_100293c0(undefined4, const MxAtomId&, undefined2);
}; };
#endif // LEGOCONTROLMANAGER_H #endif // LEGOCONTROLMANAGER_H

View File

@ -3,7 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include "extra.h" #include "extra.h"
#include "mxdsobject.h" #include "mxdsaction.h"
#include "mxentity.h" #include "mxentity.h"
#include "realtime/vector.h" #include "realtime/vector.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
@ -12,10 +12,19 @@
// SIZE 0x68 (probably) // SIZE 0x68 (probably)
class LegoEntity : public MxEntity { class LegoEntity : public MxEntity {
public: public:
enum {
c_bit1 = 0x01
};
// Inlined at 0x100853f7 // Inlined at 0x100853f7
inline LegoEntity() { Init(); } inline LegoEntity() { Init(); }
__declspec(dllexport) virtual ~LegoEntity() override; // vtable+0x0 #ifdef ISLE_APP
__declspec(dllexport) virtual ~LegoEntity() override;
#else
// FUNCTION: LEGO1 0x1000c290
__declspec(dllexport) virtual ~LegoEntity() override { Destroy(TRUE); }
#endif
virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4 virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4
@ -32,11 +41,12 @@ class LegoEntity : public MxEntity {
return !strcmp(p_name, LegoEntity::ClassName()) || MxEntity::IsA(p_name); return !strcmp(p_name, LegoEntity::ClassName()) || MxEntity::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject); // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction); // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c
virtual void ParseAction(char*); // vtable+0x20 virtual void ParseAction(char*); // vtable+0x20
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2); // vtable+0x24 virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2); // vtable+0x24
virtual void SetWorldTransform(Vector3Impl& p_loc, Vector3Impl& p_dir, Vector3Impl& p_up); // vtable+0x28 virtual void SetWorldTransform(const Vector3& p_loc, const Vector3& p_dir,
const Vector3& p_up); // vtable+0x28
virtual void ResetWorldTransform(MxBool p_inVehicle); // vtable+0x2c virtual void ResetWorldTransform(MxBool p_inVehicle); // vtable+0x2c
// FUNCTION: LEGO1 0x10001090 // FUNCTION: LEGO1 0x10001090
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30 virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
@ -49,26 +59,31 @@ class LegoEntity : public MxEntity {
virtual void VTable0x4c(); // vtable+0x4c virtual void VTable0x4c(); // vtable+0x4c
void FUN_10010c30(); void FUN_10010c30();
void SetLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up, MxBool); void SetLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direction, Mx3DPointFloat& p_up, MxBool);
inline LegoROI* GetROI() { return m_roi; }
protected: protected:
void Init(); void Init();
void SetWorld(); void SetWorld();
undefined m_unk0x10; undefined m_unk0x10; // 0x10
undefined m_unk0x11; MxU8 m_flags; // 0x11
Vector3Data m_worldLocation; // 0x14 Mx3DPointFloat m_worldLocation; // 0x14
Vector3Data m_worldDirection; // 0x28 Mx3DPointFloat m_worldDirection; // 0x28
Vector3Data m_worldUp; // 0x3c Mx3DPointFloat m_worldUp; // 0x3c
MxFloat m_worldSpeed; // 0x50 MxFloat m_worldSpeed; // 0x50
LegoROI* m_roi; // 0x54 LegoROI* m_roi; // 0x54
MxBool m_cameraFlag; // 0x58 MxBool m_cameraFlag; // 0x58
undefined m_unk0x59; undefined m_unk0x59; // 0x59
// For tokens from the extra string that look like this: // For tokens from the extra string that look like this:
// "Action:openram;\lego\scripts\Race\CarRaceR;0" // "Action:openram;\lego\scripts\Race\CarRaceR;0"
ExtraActionType m_actionType; // 0x5c Extra::ActionType m_actionType; // 0x5c
char* m_actionArgString; // 0x60 char* m_actionArgString; // 0x60
MxS32 m_actionArgNumber; // 0x64 MxS32 m_actionArgNumber; // 0x64
}; };
// SYNTHETIC: LEGO1 0x1000c3b0
// LegoEntity::`scalar deleting destructor'
#endif // LEGOENTITY_H #endif // LEGOENTITY_H

View File

@ -0,0 +1,92 @@
#ifndef LEGOENTITYLIST_H
#define LEGOENTITYLIST_H
#include "mxlist.h"
#include "mxtypes.h"
class LegoEntity;
// VTABLE: LEGO1 0x100d6410
// class MxCollection<LegoEntity *>
// VTABLE: LEGO1 0x100d6428
// class MxList<LegoEntity *>
// VTABLE: LEGO1 0x100d6440
// class MxPtrList<LegoEntity>
// VTABLE: LEGO1 0x100d6458
// SIZE 0x18
class LegoEntityList : public MxPtrList<LegoEntity> {
public:
LegoEntityList(MxBool p_ownership = FALSE) : MxPtrList<LegoEntity>(p_ownership) {}
// FUNCTION: LEGO1 0x1001e2d0
virtual MxS8 Compare(LegoEntity* p_a, LegoEntity* p_b) override
{
return p_a == p_b ? 0 : p_a < p_b ? -1 : 1;
}; // vtable+0x14
};
// VTABLE: LEGO1 0x100d64e8
// class MxListCursor<LegoEntity *>
// VTABLE: LEGO1 0x100d64b8
// class MxPtrListCursor<LegoEntity>
// VTABLE: LEGO1 0x100d64d0
// SIZE 0x10
class LegoEntityListCursor : public MxPtrListCursor<LegoEntity> {
public:
LegoEntityListCursor(LegoEntityList* p_list) : MxPtrListCursor<LegoEntity>(p_list){};
};
// TEMPLATE: LEGO1 0x1001e2f0
// MxCollection<LegoEntity *>::Compare
// TEMPLATE: LEGO1 0x1001e300
// MxCollection<LegoEntity *>::~MxCollection<LegoEntity *>
// TEMPLATE: LEGO1 0x1001e350
// MxCollection<LegoEntity *>::Destroy
// TEMPLATE: LEGO1 0x1001e360
// MxList<LegoEntity *>::~MxList<LegoEntity *>
// TEMPLATE: LEGO1 0x1001e3f0
// MxPtrList<LegoEntity>::Destroy
// SYNTHETIC: LEGO1 0x1001e400
// LegoEntityList::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1001e470
// MxPtrList<LegoEntity>::~MxPtrList<LegoEntity>
// SYNTHETIC: LEGO1 0x1001e4c0
// MxCollection<LegoEntity *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001e530
// MxList<LegoEntity *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001e5e0
// MxPtrList<LegoEntity>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001f110
// LegoEntityListCursor::`scalar deleting destructor'
// FUNCTION: LEGO1 0x1001f180
// MxPtrListCursor<LegoEntity>::~MxPtrListCursor<LegoEntity>
// SYNTHETIC: LEGO1 0x1001f1d0
// MxListCursor<LegoEntity *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001f240
// MxPtrListCursor<LegoEntity>::`scalar deleting destructor'
// FUNCTION: LEGO1 0x1001f2b0
// MxListCursor<LegoEntity *>::~MxListCursor<LegoEntity *>
// FUNCTION: LEGO1 0x1001edc6
// LegoEntityListCursor::~LegoEntityListCursor
#endif // LEGOENTITYLIST_H

View File

@ -26,20 +26,20 @@ class LegoEntityPresenter : public MxCompositePresenter {
} }
virtual void ReadyTickle() override; // vtable+0x18 virtual void ReadyTickle() override; // vtable+0x18
virtual void RepeatingTickle(); // vtable+0x24 virtual void RepeatingTickle() override; // vtable+0x24
virtual void ParseExtra(); // vtable+0x30 virtual void ParseExtra() override; // vtable+0x30
virtual void Destroy() override; // vtable+0x38 virtual void Destroy() override; // vtable+0x38
virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c virtual MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c
virtual void Init(); // vtable+0x68 virtual void Init(); // vtable+0x68
virtual undefined4 SetBackend(LegoEntity* p_unk0x4c); // vtable+0x6c virtual undefined4 SetEntity(LegoEntity* p_entity); // vtable+0x6c
void SetBackendLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up); void SetEntityLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direction, Mx3DPointFloat& p_up);
private: private:
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);
protected: protected:
LegoEntity* m_objectBackend; // 0x4c LegoEntity* m_entity; // 0x4c
}; };
#endif // LEGOENTITYPRESENTER_H #endif // LEGOENTITYPRESENTER_H

View File

@ -7,9 +7,10 @@
#include <stdlib.h> #include <stdlib.h>
// VTABLE: LEGO1 0x100d6aa0 // VTABLE: LEGO1 0x100d6aa0
// SIZE 0x20
class LegoEventNotificationParam : public MxNotificationParam { class LegoEventNotificationParam : public MxNotificationParam {
public: public:
inline LegoEventNotificationParam() : MxNotificationParam(PARAM_NONE, NULL) {} inline LegoEventNotificationParam() : MxNotificationParam(c_notificationType0, NULL) {}
inline LegoEventNotificationParam( inline LegoEventNotificationParam(
NotificationId p_type, NotificationId p_type,
MxCore* p_sender, MxCore* p_sender,
@ -22,8 +23,9 @@ class LegoEventNotificationParam : public MxNotificationParam {
{ {
} }
virtual ~LegoEventNotificationParam() override {} // vtable+0x0 (scalar deleting destructor)
inline MxU8 GetKey() const { return m_key; } inline MxU8 GetKey() const { return m_key; }
inline MxS32 GetX() const { return m_x; }
inline MxS32 GetY() const { return m_y; }
protected: protected:
MxU8 m_modifier; // 0x0c MxU8 m_modifier; // 0x0c
@ -33,4 +35,10 @@ class LegoEventNotificationParam : public MxNotificationParam {
MxU32 m_unk0x1c; // 0x1c MxU32 m_unk0x1c; // 0x1c
}; };
// SYNTHETIC: LEGO1 0x10028770
// LegoEventNotificationParam::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100287e0
// LegoEventNotificationParam::~LegoEventNotificationParam
#endif // LEGOEVENTNOTIFICATIONPARAM_H #endif // LEGOEVENTNOTIFICATIONPARAM_H

View File

@ -43,6 +43,7 @@ class LegoGameState {
void SetSomeEnumState(undefined4 p_state); void SetSomeEnumState(undefined4 p_state);
void FUN_1003ceb0(); void FUN_1003ceb0();
void FUN_10039780(MxU8);
struct ScoreStruct { struct ScoreStruct {
void WriteScoreHistory(); void WriteScoreHistory();
@ -72,7 +73,7 @@ class LegoGameState {
undefined m_unk0x41a[8]; // 0x41a - might be part of the structure at 0xa6 undefined m_unk0x41a[8]; // 0x41a - might be part of the structure at 0xa6
MxBool m_isDirty; // 0x420 MxBool m_isDirty; // 0x420
undefined4 m_unk0x424; // 0x424 undefined4 m_unk0x424; // 0x424
undefined4 m_unk0x428; // 0x428 undefined4 m_prevArea; // 0x428
undefined4 m_unk0x42c; // 0x42c undefined4 m_unk0x42c; // 0x42c
}; };

View File

@ -1,6 +1,7 @@
#ifndef LEGOHIDEANIMPRESENTER_H #ifndef LEGOHIDEANIMPRESENTER_H
#define LEGOHIDEANIMPRESENTER_H #define LEGOHIDEANIMPRESENTER_H
#include "decomp.h"
#include "legoloopinganimpresenter.h" #include "legoloopinganimpresenter.h"
// VTABLE: LEGO1 0x100d9278 // VTABLE: LEGO1 0x100d9278
@ -8,6 +9,7 @@
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter { class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
public: public:
LegoHideAnimPresenter(); LegoHideAnimPresenter();
virtual ~LegoHideAnimPresenter() override;
// FUNCTION: LEGO1 0x1006d880 // FUNCTION: LEGO1 0x1006d880
inline const char* ClassName() const override // vtable+0xc inline const char* ClassName() const override // vtable+0xc
@ -22,8 +24,16 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name); return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
} }
virtual void Destroy() override; // vtable+0x38
private: private:
void Init(); void Init();
void Destroy(MxBool p_fromDestructor);
undefined4* m_unk0xc0; // 0xc0
}; };
// SYNTHETIC: LEGO1 0x1006d9d0
// LegoHideAnimPresenter::`scalar deleting destructor'
#endif // LEGOHIDEANIMPRESENTER_H #endif // LEGOHIDEANIMPRESENTER_H

View File

@ -53,7 +53,10 @@ class LegoInputManager : public MxPresenter {
void ClearWorld(); void ClearWorld();
inline void SetUnknown88(MxBool p_unk0x88) { m_unk0x88 = p_unk0x88; } inline void SetUnknown88(MxBool p_unk0x88) { m_unk0x88 = p_unk0x88; }
inline void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
inline void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; } inline void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
inline void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; }
inline void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; }
inline void AllowEventProcessing() inline void AllowEventProcessing()
{ {
@ -68,7 +71,7 @@ class LegoInputManager : public MxPresenter {
void ProcessEvents(); void ProcessEvents();
MxBool ProcessOneEvent(LegoEventNotificationParam& p_param); MxBool ProcessOneEvent(LegoEventNotificationParam& p_param);
// private: private:
MxCriticalSection m_criticalSection; MxCriticalSection m_criticalSection;
MxList<undefined4>* m_unk0x5c; // list or hash table MxList<undefined4>* m_unk0x5c; // list or hash table
LegoCameraController* m_camera; LegoCameraController* m_camera;
@ -101,6 +104,9 @@ class LegoInputManager : public MxPresenter {
// TEMPLATE: LEGO1 0x1005bb80 // TEMPLATE: LEGO1 0x1005bb80
// MxCollection<LegoEventNotificationParam>::Compare // MxCollection<LegoEventNotificationParam>::Compare
// TEMPLATE: LEGO1 0x1005bbe0
// MxCollection<LegoEventNotificationParam>::~MxCollection<LegoEventNotificationParam>
// TEMPLATE: LEGO1 0x1005bc30 // TEMPLATE: LEGO1 0x1005bc30
// MxCollection<LegoEventNotificationParam>::Destroy // MxCollection<LegoEventNotificationParam>::Destroy
@ -116,6 +122,9 @@ class LegoInputManager : public MxPresenter {
// SYNTHETIC: LEGO1 0x1005beb0 // SYNTHETIC: LEGO1 0x1005beb0
// LegoEventQueue::`scalar deleting destructor' // LegoEventQueue::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1005bf20
// MxQueue<LegoEventNotificationParam>::~MxQueue<LegoEventNotificationParam>
// SYNTHETIC: LEGO1 0x1005bf70 // SYNTHETIC: LEGO1 0x1005bf70
// MxQueue<LegoEventNotificationParam>::`scalar deleting destructor' // MxQueue<LegoEventNotificationParam>::`scalar deleting destructor'

View File

@ -21,4 +21,10 @@ class LegoLoopingAnimPresenter : public LegoAnimPresenter {
} }
}; };
// SYNTHETIC: LEGO1 0x1006d000
// LegoLoopingAnimPresenter::~LegoLoopingAnimPresenter
// SYNTHETIC: LEGO1 0x1000f440
// LegoLoopingAnimPresenter::`scalar deleting destructor'
#endif // LEGOLOOPINGANIMPRESENTER_H #endif // LEGOLOOPINGANIMPRESENTER_H

View File

@ -7,7 +7,30 @@
// SIZE 0x94 (from 0x1000a163) // SIZE 0x94 (from 0x1000a163)
class LegoMeterPresenter : public MxStillPresenter { class LegoMeterPresenter : public MxStillPresenter {
public: public:
LegoMeterPresenter();
virtual ~LegoMeterPresenter() override;
// MxStillPresenter's `::ClassName` and `::IsA` are used. // MxStillPresenter's `::ClassName` and `::IsA` are used.
virtual void StreamingTickle() override; // vtable+0x20
virtual void RepeatingTickle() override; // vtable+0x24
virtual void ParseExtra() override; // vtable+0x30
private:
void FUN_10043a50();
MxU8* m_unk0x6c; // 0x6c
MxU16 m_type; // 0x70
MxString m_variable; // 0x74
MxFloat m_unk0x84; // 0x84
MxU16 m_unk0x88; // 0x88
MxU16 m_unk0x8a; // 0x8a
MxU16 m_unk0x8c; // 0x8c
MxU16 m_unk0x8e; // 0x8e
MxU16 m_layout; // 0x90
}; };
// SYNTHETIC: LEGO1 0x10043760
// LegoMeterPresenter::`scalar deleting destructor'
#endif // LEGOMETERPRESENTER_H #endif // LEGOMETERPRESENTER_H

View File

@ -28,6 +28,10 @@ class LegoModelPresenter : public MxVideoPresenter {
protected: protected:
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);
private:
undefined4 m_unk0x64; // 0x64
MxBool m_addedToView; // 0x68
}; };
#endif // LEGOMODELPRESENTER_H #endif // LEGOMODELPRESENTER_H

View File

@ -70,7 +70,7 @@
X(RaceCar) \ X(RaceCar) \
X(Jetski) \ X(Jetski) \
X(Bike) \ X(Bike) \
X(Motorcycle) \ X(Motocycle) \
X(Ambulance) \ X(Ambulance) \
X(AmbulanceMissionState) \ X(AmbulanceMissionState) \
X(TowTrack) \ X(TowTrack) \

View File

@ -115,11 +115,14 @@ class LegoOmni : public MxOmni {
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; } MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
MxTransitionManager* GetTransitionManager() { return m_transitionManager; } MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
MxDSAction& GetCurrentAction() { return m_action; } MxDSAction& GetCurrentAction() { return m_action; }
LegoUnkSaveDataWriter* GetUnkSaveDataWriter() { return m_saveDataWriter; }
inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; } inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; }
inline void SetWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
inline void SetExit(MxBool p_exit) { m_exit = p_exit; }; inline void SetExit(MxBool p_exit) { m_exit = p_exit; };
inline void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); }
private: private:
undefined4* m_unk0x68; // 0x68 undefined4* m_unk0x68; // 0x68
ViewLODListManager* m_viewLODListManager; // 0x6c ViewLODListManager* m_viewLODListManager; // 0x6c
@ -149,7 +152,6 @@ __declspec(dllexport) LegoOmni* Lego();
__declspec(dllexport) LegoEntity* PickEntity(MxLong, MxLong); __declspec(dllexport) LegoEntity* PickEntity(MxLong, MxLong);
__declspec(dllexport) LegoROI* PickROI(MxLong, MxLong); __declspec(dllexport) LegoROI* PickROI(MxLong, MxLong);
__declspec(dllexport) LegoSoundManager* SoundManager(); __declspec(dllexport) LegoSoundManager* SoundManager();
__declspec(dllexport) MxResult Start(MxDSAction*);
__declspec(dllexport) MxTransitionManager* TransitionManager(); __declspec(dllexport) MxTransitionManager* TransitionManager();
__declspec(dllexport) LegoVideoManager* VideoManager(); __declspec(dllexport) LegoVideoManager* VideoManager();
@ -159,14 +161,18 @@ LegoControlManager* ControlManager();
IslePathActor* GetCurrentVehicle(); IslePathActor* GetCurrentVehicle();
LegoPlantManager* PlantManager(); LegoPlantManager* PlantManager();
LegoWorld* GetCurrentWorld(); LegoWorld* GetCurrentWorld();
LegoUnkSaveDataWriter* GetUnkSaveDataWriter();
GifManager* GetGifManager(); GifManager* GetGifManager();
void FUN_10015820(MxU32, MxU32); void FUN_10015820(MxU32, MxU32);
void FUN_10015860(const char*, MxU8);
LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid); LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid);
MxDSAction& GetCurrentAction(); MxDSAction& GetCurrentAction();
void PlayMusic(MxU32 p_index); void PlayMusic(MxU32 p_index);
void SetIsWorldActive(MxBool p_isWorldActive); void SetIsWorldActive(MxBool p_isWorldActive);
void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last);
void RegisterScripts(); void RegisterScripts();
void UnregisterScripts(); void UnregisterScripts();
void SetCurrentWorld(LegoWorld* p_world);
#endif // LEGOOMNI_H #endif // LEGOOMNI_H

View File

@ -28,7 +28,7 @@ class LegoPathActor : public LegoActor {
virtual void VTable0x68(); // vtable+0x68 virtual void VTable0x68(); // vtable+0x68
virtual void VTable0x6c(); // vtable+0x6c virtual void VTable0x6c(); // vtable+0x6c
virtual void VTable0x70(float p_float); // vtable+0x70 virtual void VTable0x70(float p_float); // vtable+0x70
virtual void VTable0x74(Matrix4Impl& p_transform); // vtable+0x74 virtual void VTable0x74(Matrix4& p_transform); // vtable+0x74
// FUNCTION: LEGO1 0x10002d20 // FUNCTION: LEGO1 0x10002d20
virtual void VTable0x78(MxU8 p_unk0xea) { m_unk0xea = p_unk0xea; } // vtable+0x78 virtual void VTable0x78(MxU8 p_unk0xea) { m_unk0xea = p_unk0xea; } // vtable+0x78
// FUNCTION: LEGO1 0x10002d30 // FUNCTION: LEGO1 0x10002d30

View File

@ -8,6 +8,7 @@
class LegoPathPresenter : public MxMediaPresenter { class LegoPathPresenter : public MxMediaPresenter {
public: public:
LegoPathPresenter(); LegoPathPresenter();
virtual ~LegoPathPresenter() override;
// FUNCTION: LEGO1 0x100449a0 // FUNCTION: LEGO1 0x100449a0
inline const char* ClassName() const override // vtable+0xc inline const char* ClassName() const override // vtable+0xc
@ -22,6 +23,8 @@ class LegoPathPresenter : public MxMediaPresenter {
return !strcmp(p_name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(p_name); return !strcmp(p_name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(p_name);
} }
virtual void ReadyTickle() override; // vtable+0x18
virtual void StreamingTickle() override; // vtable+0x20
virtual void RepeatingTickle() override; // vtable+0x24 virtual void RepeatingTickle() override; // vtable+0x24
virtual void ParseExtra() override; // vtable+0x30 virtual void ParseExtra() override; // vtable+0x30
virtual MxResult AddToManager() override; // vtable+0x34 virtual MxResult AddToManager() override; // vtable+0x34

View File

@ -1,6 +1,7 @@
#ifndef LEGOPLANTMANAGER_H #ifndef LEGOPLANTMANAGER_H
#define LEGOPLANTMANAGER_H #define LEGOPLANTMANAGER_H
#include "decomp.h"
#include "mxcore.h" #include "mxcore.h"
// VTABLE: LEGO1 0x100d6758 // VTABLE: LEGO1 0x100d6758
@ -19,6 +20,8 @@ class LegoPlantManager : public MxCore {
return "LegoPlantManager"; return "LegoPlantManager";
} }
void FUN_10026360(undefined4 p_world);
private: private:
void Init(); void Init();
}; };

View File

@ -3,6 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxpoint32.h"
#include <windows.h> #include <windows.h>
@ -82,6 +83,7 @@ class LegoPointOfViewController : public LegoMouseController {
virtual void SetEntity(LegoEntity* p_entity); // vtable+0x2c virtual void SetEntity(LegoEntity* p_entity); // vtable+0x2c
MxResult Create(Lego3DView* p_lego3DView); MxResult Create(Lego3DView* p_lego3DView);
void OnViewSize(int p_width, int p_height);
inline LegoEntity* GetEntity() { return m_entity; } inline LegoEntity* GetEntity() { return m_entity; }

View File

@ -28,7 +28,7 @@ class LegoRace : public LegoWorld {
return !strcmp(p_name, LegoRace::ClassName()) || LegoWorld::IsA(p_name); return !strcmp(p_name, LegoRace::ClassName()) || LegoWorld::IsA(p_name);
} }
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+0x18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual MxBool VTable0x5c() override; // vtable+0x5c virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64 virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68 virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View File

@ -18,7 +18,8 @@ class MxVariableTable;
class LegoStream { class LegoStream {
public: public:
LegoStream() : m_mode(0) {} LegoStream() : m_mode(0) {}
inline virtual ~LegoStream(){}; // FUNCTION: LEGO1 0x10045ad0
inline virtual ~LegoStream() {}
virtual MxResult Read(void* p_buffer, MxU32 p_size) = 0; virtual MxResult Read(void* p_buffer, MxU32 p_size) = 0;
virtual MxResult Write(const void* p_buffer, MxU32 p_size) = 0; virtual MxResult Write(const void* p_buffer, MxU32 p_size) = 0;
@ -29,9 +30,9 @@ class LegoStream {
virtual MxBool IsReadMode(); virtual MxBool IsReadMode();
enum OpenFlags { enum OpenFlags {
ReadBit = 1, c_readBit = 1,
WriteBit = 2, c_writeBit = 2,
BinaryBit = 4, c_binaryBit = 4,
}; };
static MxResult __stdcall WriteVariable(LegoStream* p_stream, MxVariableTable* p_from, const char* p_variableName); static MxResult __stdcall WriteVariable(LegoStream* p_stream, MxVariableTable* p_from, const char* p_variableName);
@ -41,11 +42,14 @@ class LegoStream {
MxU8 m_mode; MxU8 m_mode;
}; };
// SYNTHETIC: LEGO1 0x10045b00
// LegoStream::`scalar deleting destructor'
// VTABLE: LEGO1 0x100db730 // VTABLE: LEGO1 0x100db730
class LegoFileStream : public LegoStream { class LegoFileStream : public LegoStream {
public: public:
LegoFileStream(); LegoFileStream();
virtual ~LegoFileStream(); virtual ~LegoFileStream() override;
MxResult Read(void* p_buffer, MxU32 p_size) override; MxResult Read(void* p_buffer, MxU32 p_size) override;
MxResult Write(const void* p_buffer, MxU32 p_size) override; MxResult Write(const void* p_buffer, MxU32 p_size) override;
@ -60,11 +64,13 @@ class LegoFileStream : public LegoStream {
FILE* m_hFile; FILE* m_hFile;
}; };
// SYNTHETIC: LEGO1 0x10099230
// LegoFileStream::`scalar deleting destructor'
// VTABLE: LEGO1 0x100db710 // VTABLE: LEGO1 0x100db710
class LegoMemoryStream : public LegoStream { class LegoMemoryStream : public LegoStream {
public: public:
LegoMemoryStream(char* p_buffer); LegoMemoryStream(char* p_buffer);
~LegoMemoryStream() {}
MxResult Read(void* p_buffer, MxU32 p_size) override; MxResult Read(void* p_buffer, MxU32 p_size) override;
MxResult Write(const void* p_buffer, MxU32 p_size) override; MxResult Write(const void* p_buffer, MxU32 p_size) override;
@ -76,4 +82,10 @@ class LegoMemoryStream : public LegoStream {
MxU32 m_offset; MxU32 m_offset;
}; };
// SYNTHETIC: LEGO1 0x10045a80
// LegoMemoryStream::~LegoMemoryStream
// SYNTHETIC: LEGO1 0x100990f0
// LegoMemoryStream::`scalar deleting destructor'
#endif // LEGOSTREAM_H #endif // LEGOSTREAM_H

View File

@ -4,6 +4,7 @@
#include "decomp.h" #include "decomp.h"
#include "mxstring.h" #include "mxstring.h"
// VTABLE: LEGO1 0x100d7c88
class LegoUnknown100d7c88 { class LegoUnknown100d7c88 {
public: public:
~LegoUnknown100d7c88(); ~LegoUnknown100d7c88();

View File

@ -27,9 +27,15 @@ class LegoUnknown100d9d00 : public MxList<LegoUnknown100d7c88*> {
// TEMPLATE: LEGO1 0x1007b300 // TEMPLATE: LEGO1 0x1007b300
// MxCollection<LegoUnknown100d7c88 *>::Compare // MxCollection<LegoUnknown100d7c88 *>::Compare
// TEMPLATE: LEGO1 0x1007b310
// MxCollection<LegoUnknown100d7c88 *>::~MxCollection<LegoUnknown100d7c88 *>
// TEMPLATE: LEGO1 0x1007b360 // TEMPLATE: LEGO1 0x1007b360
// MxCollection<LegoUnknown100d7c88 *>::Destroy // MxCollection<LegoUnknown100d7c88 *>::Destroy
// TEMPLATE: LEGO1 0x1007b370
// MxList<LegoUnknown100d7c88 *>::~MxList<LegoUnknown100d7c88 *>
// SYNTHETIC: LEGO1 0x1007b400 // SYNTHETIC: LEGO1 0x1007b400
// LegoUnknown100d9d00::`scalar deleting destructor' // LegoUnknown100d9d00::`scalar deleting destructor'

View File

@ -4,6 +4,7 @@
#include "decomp.h" #include "decomp.h"
#include "mxtypes.h" #include "mxtypes.h"
class LegoROI;
class LegoStream; class LegoStream;
struct LegoSaveDataEntry3 { struct LegoSaveDataEntry3 {
@ -32,7 +33,9 @@ struct LegoSaveDataEntry3 {
}; };
class LegoUnkSaveDataWriter { class LegoUnkSaveDataWriter {
public:
MxResult WriteSaveData3(LegoStream* p_stream); MxResult WriteSaveData3(LegoStream* p_stream);
void FUN_10083db0(LegoROI* p_roi);
}; };
#endif // LEGOUNKSAVEDATAWRITER_H #endif // LEGOUNKSAVEDATAWRITER_H

View File

@ -10,8 +10,8 @@
class MxAtomId; class MxAtomId;
class LegoEntity; class LegoEntity;
ExtraActionType MatchActionString(const char*); Extra::ActionType MatchActionString(const char*);
void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender); void InvokeAction(Extra::ActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender);
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut); void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id); MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool); void FUN_1003ef00(MxBool);

View File

@ -40,7 +40,8 @@ class LegoVideoManager : public MxVideoManager {
inline Lego3DManager* Get3DManager() { return this->m_3dManager; } inline Lego3DManager* Get3DManager() { return this->m_3dManager; }
inline MxDirect3D* GetDirect3D() { return this->m_direct3d; } inline MxDirect3D* GetDirect3D() { return this->m_direct3d; }
inline void SetUnkE4(MxBool p_unk0xe4) { this->m_unk0xe4 = p_unk0xe4; } inline void SetRender3D(MxBool p_render3d) { this->m_render3d = p_render3d; }
inline void SetUnk0x554(MxBool p_unk0x554) { this->m_unk0x554 = p_unk0x554; }
private: private:
MxResult CreateDirect3D(); MxResult CreateDirect3D();
@ -55,7 +56,7 @@ class LegoVideoManager : public MxVideoManager {
undefined4 m_unk0x70; // 0x70 undefined4 m_unk0x70; // 0x70
MxDirect3D* m_direct3d; // 0x74 MxDirect3D* m_direct3d; // 0x74
undefined4 m_unk0x78[27]; // 0x78 undefined4 m_unk0x78[27]; // 0x78
MxBool m_unk0xe4; // 0xe4 MxBool m_render3d; // 0xe4
MxBool m_unk0xe5; // 0xe5 MxBool m_unk0xe5; // 0xe5
MxBool m_unk0xe6; // 0xe6 MxBool m_unk0xe6; // 0xe6
PALETTEENTRY m_paletteEntries[256]; // 0xe7 PALETTEENTRY m_paletteEntries[256]; // 0xe7
@ -65,7 +66,7 @@ class LegoVideoManager : public MxVideoManager {
MxPalette* m_palette; // 0x4f0 MxPalette* m_palette; // 0x4f0
MxStopWatch* m_stopWatch; // 0x4f4 MxStopWatch* m_stopWatch; // 0x4f4
double m_elapsedSeconds; // 0x4f8 double m_elapsedSeconds; // 0x4f8
MxBool m_unk0x500; // 0x500 MxBool m_fullScreenMovie; // 0x500
MxBool m_drawCursor; // 0x501 MxBool m_drawCursor; // 0x501
MxS32 m_cursorXCopy; // 0x504 MxS32 m_cursorXCopy; // 0x504
MxS32 m_cursorYCopy; // 0x508 MxS32 m_cursorYCopy; // 0x508
@ -80,7 +81,7 @@ class LegoVideoManager : public MxVideoManager {
SIZE m_fpsSize; // 0x544 SIZE m_fpsSize; // 0x544
undefined m_pad0x54c[8]; // 0x54c undefined m_pad0x54c[8]; // 0x54c
MxBool m_unk0x554; // 0x554 MxBool m_unk0x554; // 0x554
MxBool m_initialized; // 0x555 MxBool m_paused; // 0x555
undefined m_pad0x556[0x39]; // 0x556 undefined m_pad0x556[0x39]; // 0x556
}; };

View File

@ -3,7 +3,9 @@
#include "legocameracontroller.h" #include "legocameracontroller.h"
#include "legoentity.h" #include "legoentity.h"
#include "legoentitylist.h"
#include "legopathcontrollerlist.h" #include "legopathcontrollerlist.h"
#include "mxcorelist.h"
#include "mxpresenter.h" #include "mxpresenter.h"
#include "mxpresenterlist.h" #include "mxpresenterlist.h"
@ -33,36 +35,44 @@ class LegoWorld : public LegoEntity {
return !strcmp(p_name, LegoWorld::ClassName()) || LegoEntity::IsA(p_name); return !strcmp(p_name, LegoWorld::ClassName()) || LegoEntity::IsA(p_name);
} }
virtual void Stop(); // vtable+50 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x54(); // vtable+54 virtual void VTable0x50(); // vtable+0x50
virtual void VTable0x58(MxCore* p_object); // vtable+58 virtual LegoCameraController* VTable0x54(); // vtable+0x54
virtual MxBool VTable0x5c(); // vtable+5c virtual void VTable0x58(MxCore* p_object); // vtable+0x58
// FUNCTION: LEGO1 0x100010a0 virtual MxBool VTable0x5c(); // vtable+0x5c
virtual void VTable0x60() {} // vtable+60
virtual MxBool VTable0x64(); // vtable+64
virtual void VTable0x68(MxBool p_add); // vtable+68
inline LegoCameraController* GetCamera() { return m_camera; } // FUNCTION: LEGO1 0x100010a0
virtual void VTable0x60() {} // vtable+0x60
virtual MxBool VTable0x64(); // vtable+0x64
virtual void VTable0x68(MxBool p_add); // vtable+0x68
inline LegoCameraController* GetCamera() { return m_cameraController; }
inline undefined4 GetUnknown0xec() { return m_unk0xec; }
undefined FUN_100220e0(); undefined FUN_100220e0();
MxResult SetAsCurrentWorld(MxDSObject& p_dsObject);
void EndAction(MxCore* p_object); void EndAction(MxCore* p_object);
void FUN_1001fc80(IslePathActor* p_actor); void FUN_1001fc80(IslePathActor* p_actor);
MxBool FUN_100727e0(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up); MxBool FUN_100727e0(MxU32, Mx3DPointFloat& p_loc, Mx3DPointFloat& p_dir, Mx3DPointFloat& p_up);
MxBool FUN_10072980(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up); MxBool FUN_10072980(MxU32, Mx3DPointFloat& p_loc, Mx3DPointFloat& p_dir, Mx3DPointFloat& p_up);
void FUN_10073400(); void FUN_10073400();
void FUN_10073430(); void FUN_10073430();
MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value);
MxPresenter* FindPresenter(const char* p_presenter, const char* p_name);
protected: protected:
LegoPathControllerList m_list0x68; // 0x68 LegoPathControllerList m_list0x68; // 0x68
MxPresenterList m_list0x80; // 0x80 MxPresenterList m_list0x80; // 0x80
LegoCameraController* m_camera; // 0x98 LegoCameraController* m_cameraController; // 0x98
undefined m_unk0x9c[0x1c]; // 0x9c LegoEntityList* m_entityList; // 0x9c
MxCoreList* m_coreList; // 0xa0
undefined m_unk0xa4[0x14]; // 0xa4
MxPresenterList m_list0xb8; // 0xb8 MxPresenterList m_list0xb8; // 0xb8
undefined m_unk0xd0[0x24]; // 0xd0 undefined m_unk0xd0[0x1c]; // 0xd0
undefined4 m_unk0xec; // 0xec
undefined4 m_unk0xf0; // 0xf0
MxS16 m_unk0xf4; // 0xf4 MxS16 m_unk0xf4; // 0xf4
MxBool m_unk0xf6; // 0xf6 MxBool m_worldStarted; // 0xf6
undefined m_unk0xf7; // 0xf7 undefined m_unk0xf7; // 0xf7
}; };

View File

@ -28,6 +28,31 @@ class LegoWorldList : public MxPtrList<LegoWorld> {
}; // vtable+0x14 }; // vtable+0x14
}; };
// VTABLE: LEGO1 0x100d75b8
// class MxListCursor<LegoWorld *>
// VTABLE: LEGO1 0x100d7588
// class MxPtrListCursor<LegoWorld>
// VTABLE: LEGO1 0x100d75a0
// SIZE 0x10
class LegoWorldListCursor : public MxPtrListCursor<LegoWorld> {
public:
LegoWorldListCursor(LegoWorldList* p_list) : MxPtrListCursor<LegoWorld>(p_list){};
};
// SYNTHETIC: LEGO1 0x1003e870
// LegoWorldListCursor::`scalar deleting destructor'
// FUNCTION: LEGO1 0x1003e8e0
// MxPtrListCursor<LegoWorld>::~MxPtrListCursor<LegoWorld>
// FUNCTION: LEGO1 0x1003ea10
// MxListCursor<LegoWorld *>::~MxListCursor<LegoWorld *>
// FUNCTION: LEGO1 0x1003ea60
// LegoWorldListCursor::~LegoWorldListCursor
// TEMPLATE: LEGO1 0x100598f0 // TEMPLATE: LEGO1 0x100598f0
// MxCollection<LegoWorld *>::Compare // MxCollection<LegoWorld *>::Compare

View File

@ -1,14 +1,14 @@
#ifndef MOTORCYCLE_H #ifndef MOTOCYCLE_H
#define MOTORCYCLE_H #define MOTOCYCLE_H
#include "decomp.h" #include "decomp.h"
#include "islepathactor.h" #include "islepathactor.h"
// VTABLE: LEGO1 0x100d7090 // VTABLE: LEGO1 0x100d7090
// SIZE 0x16c // SIZE 0x16c
class Motorcycle : public IslePathActor { class Motocycle : public IslePathActor {
public: public:
Motorcycle(); Motocycle();
// FUNCTION: LEGO1 0x10035840 // FUNCTION: LEGO1 0x10035840
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -20,7 +20,7 @@ class Motorcycle : public IslePathActor {
// FUNCTION: LEGO1 0x10035850 // FUNCTION: LEGO1 0x10035850
inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10 inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10
{ {
return !strcmp(p_name, Motorcycle::ClassName()) || IslePathActor::IsA(p_name); return !strcmp(p_name, Motocycle::ClassName()) || IslePathActor::IsA(p_name);
} }
private: private:
@ -29,4 +29,4 @@ class Motorcycle : public IslePathActor {
undefined m_unk0x168[4]; undefined m_unk0x168[4];
}; };
#endif // MOTORCYCLE_H #endif // MOTOCYCLE_H

View File

@ -33,7 +33,8 @@ class MxControlPresenter : public MxCompositePresenter {
virtual MxBool HasTickleStatePassed(TickleState p_tickleState) override; // vtable+0x48 virtual MxBool HasTickleStatePassed(TickleState p_tickleState) override; // vtable+0x48
virtual void Enable(MxBool p_enable) override; // vtable+0x54 virtual void Enable(MxBool p_enable) override; // vtable+0x54
virtual MxBool VTable0x64(undefined4 p_undefined) override; // vtable+0x64 virtual MxBool VTable0x64(undefined4 p_undefined) override; // vtable+0x64
virtual void VTable0x68(MxBool p_undefined); // vtable+0x68 virtual void VTable0x68(MxBool p_unk0x50); // vtable+0x68
virtual void VTable0x6c(undefined4); // vtable+0x6c
private: private:
MxBool FUN_10044270(undefined4, undefined4, undefined4*); MxBool FUN_10044270(undefined4, undefined4, undefined4*);

View File

@ -32,13 +32,13 @@ class MxTransitionManager : public MxCore {
virtual MxResult GetDDrawSurfaceFromVideoManager(); // vtable+0x14 virtual MxResult GetDDrawSurfaceFromVideoManager(); // vtable+0x14
enum TransitionType { enum TransitionType {
NOT_TRANSITIONING, e_notTransitioning = 0,
NO_ANIMATION, e_noAnimation,
DISSOLVE, e_dissolve,
PIXELATION, e_pixelation,
SCREEN_WIPE, e_screenWipe,
WINDOWS, e_windows,
BROKEN // Unknown what this is supposed to be, it locks the game up e_broken // Unknown what this is supposed to be, it locks the game up
}; };
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim); MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim);

View File

@ -31,8 +31,8 @@ class Score : public LegoWorld {
// SYNTHETIC: LEGO1 0x100011e0 // SYNTHETIC: LEGO1 0x100011e0
// Score::`scalar deleting destructor' // Score::`scalar deleting destructor'
virtual MxResult Create(MxDSObject& p_dsObject) override; // vtable+18 virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+18
virtual void Stop() override; // vtable+50 virtual void VTable0x50() override; // vtable+50
virtual MxBool VTable0x5c() override; // vtable+5c virtual MxBool VTable0x5c() override; // vtable+5c
virtual MxBool VTable0x64() override; // vtable+64 virtual MxBool VTable0x64() override; // vtable+64
virtual void VTable0x68(MxBool p_add) override; // vtable+68 virtual void VTable0x68(MxBool p_add) override; // vtable+68

View File

@ -2,6 +2,19 @@
// STUB: LEGO1 0x100334b0 // STUB: LEGO1 0x100334b0
Act1State::Act1State() Act1State::Act1State()
{
// TODO
m_unk0x1e = 0;
m_unk0x18 = 1;
m_unk0x20 = 0;
m_unk0x1f = 0;
m_unk0x21 = TRUE;
m_unk0x22 = 0;
m_unk0x1c = 1;
}
// STUB: LEGO1 0x10034d00
void Act1State::FUN_10034d00()
{ {
// TODO // TODO
} }

View File

@ -77,13 +77,13 @@ void MxBackgroundAudioManager::DestroyMusic()
MxResult MxBackgroundAudioManager::Tickle() MxResult MxBackgroundAudioManager::Tickle()
{ {
switch (m_unk0x13c) { switch (m_unk0x13c) {
case MxPresenter::TickleState_Starting: case MxPresenter::e_starting:
FadeInOrFadeOut(); FadeInOrFadeOut();
return SUCCESS; return SUCCESS;
case MxPresenter::TickleState_Streaming: case MxPresenter::e_streaming:
FUN_1007ee70(); FUN_1007ee70();
return SUCCESS; return SUCCESS;
case MxPresenter::TickleState_Repeating: case MxPresenter::e_repeating:
FUN_1007ef40(); FUN_1007ef40();
return SUCCESS; return SUCCESS;
default: default:

View File

@ -27,9 +27,9 @@ Helicopter::~Helicopter()
} }
// FUNCTION: LEGO1 0x100032c0 // FUNCTION: LEGO1 0x100032c0
MxResult Helicopter::Create(MxDSObject& p_dsObject) MxResult Helicopter::Create(MxDSAction& p_dsAction)
{ {
MxResult result = IslePathActor::Create(p_dsObject); MxResult result = IslePathActor::Create(p_dsAction);
LegoWorld* world = GetCurrentWorld(); LegoWorld* world = GetCurrentWorld();
SetWorld(world); SetWorld(world);
if (world->IsA("Act3")) { if (world->IsA("Act3")) {
@ -100,7 +100,7 @@ MxU32 Helicopter::VTable0xcc()
VTable0xe8(0x29, TRUE, 7); VTable0xe8(0x29, TRUE, 7);
((Isle*) GetCurrentWorld())->SetUnknown13c(0x3c); ((Isle*) GetCurrentWorld())->SetUnknown13c(0x3c);
FUN_10015820(1, 0); FUN_10015820(1, 0);
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 50, FALSE, TRUE); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, TRUE);
SetUnknownDC(4); SetUnknownDC(4);
PlayMusic(9); PlayMusic(9);
break; break;
@ -112,7 +112,7 @@ MxU32 Helicopter::VTable0xcc()
break; break;
} }
VTable0xe0(); VTable0xe0();
InvokeAction(ExtraActionType_start, m_script, 0x15, NULL); InvokeAction(Extra::ActionType::e_start, m_script, 0x15, NULL);
GetCurrentAction().SetObjectId(-1); GetCurrentAction().SetObjectId(-1);
ControlManager()->Register(this); ControlManager()->Register(this);
return 1; return 1;
@ -139,7 +139,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
case 0x17: case 0x17:
if (*g_act3Script == script) { if (*g_act3Script == script) {
((Act3*) GetCurrentWorld())->SetUnkown4270(2); ((Act3*) GetCurrentWorld())->SetUnkown4270(2);
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
} }
else if (m_state->GetUnkown8() != 0) else if (m_state->GetUnkown8() != 0)
break; break;
@ -155,7 +155,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
state->SetUnknown18(4); state->SetUnknown18(4);
m_state->SetUnknown8(1); m_state->SetUnknown8(1);
m_world->FUN_1001fc80(this); m_world->FUN_1001fc80(this);
InvokeAction(ExtraActionType_start, script, 0x20, NULL); InvokeAction(Extra::ActionType::e_start, script, 0x20, NULL);
SetUnknownDC(0); SetUnknownDC(0);
} }
ret = 1; ret = 1;
@ -167,7 +167,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
if (m_state->GetUnkown8() == 2) { if (m_state->GetUnkown8() == 2) {
m_state->SetUnknown8(3); m_state->SetUnknown8(3);
m_world->FUN_1001fc80(this); m_world->FUN_1001fc80(this);
InvokeAction(ExtraActionType_start, script, 0x21, NULL); InvokeAction(Extra::ActionType::e_start, script, 0x21, NULL);
SetUnknownDC(4); SetUnknownDC(4);
} }
ret = 1; ret = 1;
@ -181,15 +181,15 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
if (*g_act3Script != script) if (*g_act3Script != script)
break; break;
if (m_world && m_world->GetCamera()) { if (m_world && m_world->GetCamera()) {
Vector3Data loc, dir, lookat; Mx3DPointFloat loc, dir, lookat;
loc.CopyFrom(m_world->GetCamera()->FUN_100127f0()); loc.CopyFrom(m_world->GetCamera()->GetWorldLocation());
dir.CopyFrom(m_world->GetCamera()->FUN_100128a0()); dir.CopyFrom(m_world->GetCamera()->GetWorldDirection());
lookat = dir; lookat = dir;
float scale = 3; float scale = 3;
lookat.Mul(scale); lookat.Mul(scale);
lookat.Add(&loc); lookat.Add(&loc);
Vector3Data v68, v7c, v90(0, 1, 0), va4; Mx3DPointFloat v68, v7c, v90(0, 1, 0), va4;
v68.CopyFrom(m_world->GetCamera()->FUN_10012740()); v68.CopyFrom(m_world->GetCamera()->GetWorldUp());
va4.EqualsCross(v68, dir); va4.EqualsCross(v68, dir);
v7c.EqualsCross(va4, v90); v7c.EqualsCross(va4, v90);
if (ret) if (ret)
@ -203,7 +203,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
case 0x1c: case 0x1c:
if (GameState()->GetUnknown10() == 0) { if (GameState()->GetUnknown10() == 0) {
((Isle*) GetCurrentWorld())->SetUnknown13c(2); ((Isle*) GetCurrentWorld())->SetUnknown13c(2);
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
VTable0xe4(); VTable0xe4();
} }
ret = 1; ret = 1;
@ -219,6 +219,8 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
// FUNCTION: LEGO1 0x10003c20 // FUNCTION: LEGO1 0x10003c20
MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param) MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param)
{ {
MxU32 ret = 0;
switch (m_state->GetUnkown8()) { switch (m_state->GetUnkown8()) {
case 1: { case 1: {
if (GameState()->GetUnknown10() == 0) { if (GameState()->GetUnknown10() == 0) {
@ -227,44 +229,54 @@ MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param)
} }
else else
VTable0xe8(0x31, TRUE, 7); VTable0xe8(0x31, TRUE, 7);
m_state->SetUnknown8(2); m_state->SetUnknown8(2);
Matrix4Data mat;
mat.SetIdentity(); MxMatrix matrix;
Matrix4 mat2 = mat.GetMatrix(); matrix.SetIdentity();
float s = sin(0.5235987901687622); // PI / 6, 30 deg float s = sin(0.5235987901687622); // PI / 6, 30 deg
float c = cos(0.5235987901687622); // PI / 6, 30 deg float c = cos(0.5235987901687622); // PI / 6, 30 deg
float matrixCopy[4][4];
memcpy(matrixCopy, matrix.GetData(), sizeof(matrixCopy));
for (MxS32 i = 0; i < 4; i++) { for (MxS32 i = 0; i < 4; i++) {
mat.GetMatrix()[i][1] = mat2[i][1] * c - mat2[i][2] * s; matrix.GetData()[i][1] = matrixCopy[i][1] * c - matrixCopy[i][2] * s;
mat.GetMatrix()[i][2] = mat2[i][2] * c + mat2[i][1] * s; matrix.GetData()[i][2] = matrixCopy[i][2] * c + matrixCopy[i][1] * s;
} }
Vector3Impl at(mat.GetMatrix()[3]), dir(mat.GetMatrix()[2]), up(mat.GetMatrix()[1]);
Vector3 at(matrix[3]), dir(matrix[2]), up(matrix[1]);
m_world->GetCamera()->SetWorldTransform(at, dir, up); m_world->GetCamera()->SetWorldTransform(at, dir, up);
FUN_10010c30(); FUN_10010c30();
ret = 1;
break; break;
} }
case 3: { case 3: {
Matrix4Data mat; MxMatrix matrix;
mat.SetIdentity(); matrix.SetIdentity();
Vector3Impl at(mat.GetMatrix()[3]), dir(mat.GetMatrix()[2]), up(mat.GetMatrix()[1]);
Vector3 at(matrix[3]), dir(matrix[2]), up(matrix[1]);
at[1] = 1.25; at[1] = 1.25;
m_world->GetCamera()->SetWorldTransform(at, dir, up); m_world->GetCamera()->SetWorldTransform(at, dir, up);
if (GameState()->GetUnknown10() == 0) { if (GameState()->GetUnknown10() == 0) {
((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(0); ((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(0);
VTable0xe8(0x29, TRUE, 7); VTable0xe8(0x29, TRUE, 7);
} }
else else
VTable0xe8(0x30, TRUE, 7); VTable0xe8(0x30, TRUE, 7);
m_state->SetUnknown8(0); m_state->SetUnknown8(0);
ret = 1;
break; break;
} }
default:
return 0;
} }
return 1;
return ret;
} }
// FUNCTION: LEGO1 0x10003e90 // FUNCTION: LEGO1 0x10003e90
void Helicopter::VTable0x74(Matrix4Impl& p_transform) void Helicopter::VTable0x74(Matrix4& p_transform)
{ {
if (m_unk0xea != 0) { if (m_unk0xea != 0) {
m_roi->FUN_100a46b0(p_transform); m_roi->FUN_100a46b0(p_transform);
@ -295,13 +307,13 @@ void Helicopter::VTable0x70(float p_float)
f2 = 0; f2 = 0;
if (1.0f < f2) if (1.0f < f2)
f2 = 1.0f; f2 = 1.0f;
Vector3Impl v(m_unk0x160.GetMatrix()[3]); Vector3 v(m_unk0x160[3]);
Matrix4Data mat; MxMatrix mat;
Vector3Impl v2(m_unk0x1a8.GetMatrix()[3]); Vector3 v2(m_unk0x1a8[3]);
float* loc = m_unk0x1a8.GetMatrix()[3]; float* loc = m_unk0x1a8[3];
mat.SetIdentity(); mat.SetIdentity();
float fa[4]; float fa[4];
Vector4Impl v3(fa); Vector4 v3(fa);
if (m_unk0x1f4.FUN_100040a0(v3, f2) == SUCCESS) { if (m_unk0x1f4.FUN_100040a0(v3, f2) == SUCCESS) {
mat.FromQuaternion(v3); mat.FromQuaternion(v3);
} }
@ -322,18 +334,17 @@ void Helicopter::VTable0x70(float p_float)
} }
// FUNCTION: LEGO1 0x100040a0 // FUNCTION: LEGO1 0x100040a0
MxResult HelicopterSubclass::FUN_100040a0(Vector4Impl& p_v, float p_f) MxResult HelicopterSubclass::FUN_100040a0(Vector4& p_v, float p_f)
{ {
MxU32 state = m_unk0x30; MxU32 state = m_unk0x30;
if (state == 1) { if (state == 1) {
p_v.EqualsImpl(m_unk0x0.GetVector().elements); p_v.EqualsImpl(m_unk0x0.GetData());
p_v[3] = acos(p_v[3]) * (1 - p_f) * 2.0; p_v[3] = acos(p_v[3]) * (1 - p_f) * 2.0;
return p_v.NormalizeQuaternion(); return p_v.NormalizeQuaternion();
} }
else if (state == 2) { else if (state == 2) {
p_v.EqualsImpl(m_unk0x18.GetVector().elements); p_v.EqualsImpl(m_unk0x18.GetData());
p_v[3] = acos(p_v[3]) * p_f * 2.0; p_v[3] = acos(p_v[3]) * p_f * 2.0;
p_v.NormalizeQuaternion();
return p_v.NormalizeQuaternion(); return p_v.NormalizeQuaternion();
} }
else if (state == 3) { else if (state == 3) {

View File

@ -26,3 +26,9 @@ void LegoBuildingManager::Init()
{ {
// TODO // TODO
} }
// STUB: LEGO1 0x1002fa00
void LegoBuildingManager::FUN_1002fa00()
{
// TODO
}

View File

@ -6,6 +6,7 @@ DECOMP_SIZE_ASSERT(GifMap, 0x08);
DECOMP_SIZE_ASSERT(GifManagerBase, 0x14); DECOMP_SIZE_ASSERT(GifManagerBase, 0x14);
DECOMP_SIZE_ASSERT(GifManager, 0x30); DECOMP_SIZE_ASSERT(GifManager, 0x30);
// GLOBAL: LEGO1 0x100f0100
GifMapEntry* g_unk0x100f0100; GifMapEntry* g_unk0x100f0100;
// FUNCTION: LEGO1 0x10001cc0 // FUNCTION: LEGO1 0x10001cc0

View File

@ -19,8 +19,7 @@ void LegoActionControlPresenter::ReadyTickle()
if (chunk) { if (chunk) {
ParseExtra(); ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_starting);
m_currentTickleState = TickleState_Starting;
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
if (m_compositePresenter) { if (m_compositePresenter) {
@ -39,9 +38,15 @@ void LegoActionControlPresenter::RepeatingTickle()
ParseExtra(); ParseExtra();
} }
InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), LookupMode_LowerCase2), m_unk0x64, NULL); #ifdef COMPAT_MODE
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; {
m_currentTickleState = TickleState_Done; MxAtomId atom(m_unk0x54.GetData(), e_lowerCase2);
InvokeAction(m_unk0x50, atom, m_unk0x64, NULL);
}
#else
InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), e_lowerCase2), m_unk0x64, NULL);
#endif
ProgressTickleState(e_done);
} }
} }
@ -87,11 +92,11 @@ void LegoActionControlPresenter::ParseExtra()
char output[1024]; char output[1024];
if (KeyValueStringParse(output, g_strACTION, buf)) { if (KeyValueStringParse(output, g_strACTION, buf)) {
m_unk0x50 = MatchActionString(strtok(output, g_parseExtraTokens)); m_unk0x50 = MatchActionString(strtok(output, g_parseExtraTokens));
if (m_unk0x50 != ExtraActionType_exit) { if (m_unk0x50 != Extra::ActionType::e_exit) {
MakeSourceName(buf, strtok(NULL, g_parseExtraTokens)); MakeSourceName(buf, strtok(NULL, g_parseExtraTokens));
m_unk0x54 = buf; m_unk0x54 = buf;
m_unk0x54.ToLowerCase(); m_unk0x54.ToLowerCase();
if (m_unk0x50 != ExtraActionType_run) { if (m_unk0x50 != Extra::ActionType::e_run) {
m_unk0x64 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x64 = atoi(strtok(NULL, g_parseExtraTokens));
} }
} }

View File

@ -7,8 +7,16 @@
DECOMP_SIZE_ASSERT(LegoBackgroundColor, 0x30) DECOMP_SIZE_ASSERT(LegoBackgroundColor, 0x30)
const char* g_delimiter = "\t"; // GLOBAL: LEGO1 0x100f3fb0
// STRING: LEGO1 0x100f3a18
const char* g_delimiter = " \t";
// GLOBAL: LEGO1 0x100f3fb4
// STRING: LEGO1 0x100f3bf0
const char* g_set = "set"; const char* g_set = "set";
// GLOBAL: LEGO1 0x100f3fb8
// STRING: LEGO1 0x100f0cdc
const char* g_reset = "reset"; const char* g_reset = "reset";
// FUNCTION: LEGO1 0x1003bfb0 // FUNCTION: LEGO1 0x1003bfb0

View File

@ -7,10 +7,12 @@
DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24) DECOMP_SIZE_ASSERT(LegoFullScreenMovie, 0x24)
// GLOBAL: LEGO1 0x100f3be8 // GLOBAL: LEGO1 0x100f3fbc
// STRING: LEGO1 0x100f3be8
const char* g_strEnable = "enable"; const char* g_strEnable = "enable";
// GLOBAL: LEGO1 0x100f3bf4 // GLOBAL: LEGO1 0x100f3fc0
// STRING: LEGO1 0x100f3bf4
const char* g_strDisable = "disable"; const char* g_strDisable = "disable";
// FUNCTION: LEGO1 0x1003c500 // FUNCTION: LEGO1 0x1003c500
@ -29,7 +31,6 @@ void LegoFullScreenMovie::SetValue(const char* p_option)
LegoVideoManager* videomanager = VideoManager(); LegoVideoManager* videomanager = VideoManager();
if (videomanager) { if (videomanager) {
if (!strcmp(m_value.GetData(), g_strEnable)) { if (!strcmp(m_value.GetData(), g_strEnable)) {
videomanager->EnableFullScreenMovie(TRUE); videomanager->EnableFullScreenMovie(TRUE);
return; return;

View File

@ -1,9 +1,13 @@
#include "legogamestate.h" #include "legogamestate.h"
#include "infocenterstate.h" #include "infocenterstate.h"
#include "legoanimationmanager.h"
#include "legoomni.h" #include "legoomni.h"
#include "legostate.h" #include "legostate.h"
#include "legostream.h" #include "legostream.h"
#include "legoutil.h"
#include "legovideomanager.h"
#include "mxbackgroundaudiomanager.h"
#include "mxobjectfactory.h" #include "mxobjectfactory.h"
#include "mxstring.h" #include "mxstring.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
@ -15,14 +19,17 @@
// There may be other members that come after. // There may be other members that come after.
DECOMP_SIZE_ASSERT(LegoGameState, 0x430) DECOMP_SIZE_ASSERT(LegoGameState, 0x430)
// GLOBAL: LEGO1 0x100f3e24 // GLOBAL: LEGO1 0x100f3e40
const char* g_historyGSI = "History.gsi"; // STRING: LEGO1 0x100f3e3c
const char* g_fileExtensionGS = ".GS";
// GLOBAL: LEGO1 0x100f3e30 // GLOBAL: LEGO1 0x100f3e44
// STRING: LEGO1 0x100f3e30
const char* g_playersGSI = "Players.gsi"; const char* g_playersGSI = "Players.gsi";
// GLOBAL: LEGO1 0x100f3e40 // GLOBAL: LEGO1 0x100f3e48
const char* g_fileExtensionGS = ".GS"; // STRING: LEGO1 0x100f3e24
const char* g_historyGSI = "History.gsi";
// GLOBAL: LEGO1 0x100f3e58 // GLOBAL: LEGO1 0x100f3e58
ColorStringStruct g_colorSaveData[43] = { ColorStringStruct g_colorSaveData[43] = {
@ -85,11 +92,18 @@ LegoGameState::~LegoGameState()
delete[] m_savePath; delete[] m_savePath;
} }
// STUB: LEGO1 0x10039780
void LegoGameState::FUN_10039780(MxU8)
{
// TODO
}
// FUNCTION: LEGO1 0x10039980 // FUNCTION: LEGO1 0x10039980
MxResult LegoGameState::Save(MxULong p_slot) MxResult LegoGameState::Save(MxULong p_slot)
{ {
MxResult result; MxResult result;
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState"); InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == 0) if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == 0)
result = SUCCESS; result = SUCCESS;
else { else {
@ -98,7 +112,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
MxString savePath; MxString savePath;
GetFileSavePath(&savePath, p_slot); GetFileSavePath(&savePath, p_slot);
LegoFileStream fileStream; LegoFileStream fileStream;
if (fileStream.Open(savePath.GetData(), LegoStream::WriteBit) != FAILURE) { if (fileStream.Open(savePath.GetData(), LegoStream::c_writeBit) != FAILURE) {
MxU32 maybeVersion = 0x1000C; MxU32 maybeVersion = 0x1000C;
fileStream.Write(&maybeVersion, 4); fileStream.Write(&maybeVersion, 4);
fileStream.Write(&m_unk0x24, 2); fileStream.Write(&m_unk0x24, 2);
@ -164,7 +178,7 @@ void LegoGameState::GetFileSavePath(MxString* p_outPath, MxULong p_slotn)
strcpy(path, m_savePath); strcpy(path, m_savePath);
// Slot: "G0", "G1", ... // Slot: "G0", "G1", ...
strcat(path, "G"); strcat(path, "\\G");
baseForSlot[0] += p_slotn; baseForSlot[0] += p_slotn;
strcat(path, baseForSlot); strcat(path, baseForSlot);
@ -186,9 +200,30 @@ void LegoGameState::FUN_1003a720(MxU32)
} }
// STUB: LEGO1 0x1003b060 // STUB: LEGO1 0x1003b060
void LegoGameState::HandleAction(MxU32) void LegoGameState::HandleAction(MxU32 p_area)
{ {
// TODO m_prevArea = p_area;
BackgroundAudioManager()->Stop();
AnimationManager()->FUN_1005ef10();
VideoManager()->SetUnk0x554(0);
MxAtomId* script = g_isleScript;
switch (p_area) {
case 1:
break;
case 2:
VideoManager()->SetUnk0x554(1);
script = g_infomainScript;
break;
case 3:
VideoManager()->SetUnk0x554(1);
script = g_infodoorScript;
break;
// TODO: implement other cases
}
InvokeAction(Extra::ActionType::e_opendisk, *script, 0, NULL);
} }
// FUNCTION: LEGO1 0x1003bac0 // FUNCTION: LEGO1 0x1003bac0
@ -282,7 +317,7 @@ void LegoGameState::SerializeScoreHistory(MxS16 p_flags)
savePath += "\\"; savePath += "\\";
savePath += g_historyGSI; savePath += g_historyGSI;
if (p_flags == LegoStream::WriteBit) { if (p_flags == LegoStream::c_writeBit) {
m_unk0xa6.WriteScoreHistory(); m_unk0xa6.WriteScoreHistory();
} }

View File

@ -68,7 +68,7 @@
#include "doors.h" #include "doors.h"
#include "jetski.h" #include "jetski.h"
#include "legoanimmmpresenter.h" #include "legoanimmmpresenter.h"
#include "motorcycle.h" #include "motocycle.h"
#include "racecar.h" #include "racecar.h"
#include "towtrack.h" #include "towtrack.h"
#include "towtrackmissionstate.h" #include "towtrackmissionstate.h"
@ -106,7 +106,7 @@
// FUNCTION: LEGO1 0x10006e40 // FUNCTION: LEGO1 0x10006e40
LegoObjectFactory::LegoObjectFactory() LegoObjectFactory::LegoObjectFactory()
{ {
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact); #define X(V) this->m_id##V = MxAtomId(#V, e_exact);
FOR_LEGOOBJECTFACTORY_OBJECTS(X) FOR_LEGOOBJECTFACTORY_OBJECTS(X)
#undef X #undef X
} }
@ -114,7 +114,7 @@ LegoObjectFactory::LegoObjectFactory()
// FUNCTION: LEGO1 0x10009a90 // FUNCTION: LEGO1 0x10009a90
MxCore* LegoObjectFactory::Create(const char* p_name) MxCore* LegoObjectFactory::Create(const char* p_name)
{ {
MxAtomId atom(p_name, LookupMode_Exact); MxAtomId atom(p_name, e_exact);
#define X(V) \ #define X(V) \
if (this->m_id##V == atom) { \ if (this->m_id##V == atom) { \

View File

@ -18,6 +18,12 @@ void LegoPlantManager::Init()
// TODO // TODO
} }
// STUB: LEGO1 0x10026360
void LegoPlantManager::FUN_10026360(undefined4 p_world)
{
// TODO
}
// STUB: LEGO1 0x10026e00 // STUB: LEGO1 0x10026e00
MxResult LegoPlantManager::Tickle() MxResult LegoPlantManager::Tickle()
{ {

View File

@ -10,6 +10,7 @@
// the text "END_OF_VARIABLES" in it. // the text "END_OF_VARIABLES" in it.
// TODO: make g_endOfVariables reference the actual end of the variable array. // TODO: make g_endOfVariables reference the actual end of the variable array.
// GLOBAL: LEGO1 0x100f3e50 // GLOBAL: LEGO1 0x100f3e50
// STRING: LEGO1 0x100f3e00
const char* g_endOfVariables = "END_OF_VARIABLES"; const char* g_endOfVariables = "END_OF_VARIABLES";
// Very likely but not certain sizes. // Very likely but not certain sizes.
@ -166,18 +167,18 @@ MxResult LegoFileStream::Open(const char* p_filename, OpenFlags p_mode)
fclose(m_hFile); fclose(m_hFile);
modeString[0] = '\0'; modeString[0] = '\0';
if (p_mode & ReadBit) { if (p_mode & c_readBit) {
m_mode = LEGOSTREAM_MODE_READ; m_mode = LEGOSTREAM_MODE_READ;
strcat(modeString, "r"); strcat(modeString, "r");
} }
if (p_mode & WriteBit) { if (p_mode & c_writeBit) {
if (m_mode != LEGOSTREAM_MODE_READ) if (m_mode != LEGOSTREAM_MODE_READ)
m_mode = LEGOSTREAM_MODE_WRITE; m_mode = LEGOSTREAM_MODE_WRITE;
strcat(modeString, "w"); strcat(modeString, "w");
} }
if ((p_mode & 4) != 0) if ((p_mode & c_binaryBit) != 0)
strcat(modeString, "b"); strcat(modeString, "b");
else else
strcat(modeString, "t"); strcat(modeString, "t");

View File

@ -47,3 +47,9 @@ MxResult LegoUnkSaveDataWriter::WriteSaveData3(LegoStream* p_stream)
} }
return result; return result;
} }
// STUB: LEGO1 0x10083db0
void LegoUnkSaveDataWriter::FUN_10083db0(LegoROI* p_roi)
{
// TODO
}

View File

@ -11,30 +11,30 @@
#include <string.h> #include <string.h>
// FUNCTION: LEGO1 0x1003e300 // FUNCTION: LEGO1 0x1003e300
ExtraActionType MatchActionString(const char* p_str) Extra::ActionType MatchActionString(const char* p_str)
{ {
ExtraActionType result = ExtraActionType_unknown; Extra::ActionType result = Extra::ActionType::e_unknown;
if (!strcmpi("openram", p_str)) if (!strcmpi("openram", p_str))
result = ExtraActionType_openram; result = Extra::ActionType::e_openram;
else if (!strcmpi("opendisk", p_str)) else if (!strcmpi("opendisk", p_str))
result = ExtraActionType_opendisk; result = Extra::ActionType::e_opendisk;
else if (!strcmpi("close", p_str)) else if (!strcmpi("close", p_str))
result = ExtraActionType_close; result = Extra::ActionType::e_close;
else if (!strcmpi("start", p_str)) else if (!strcmpi("start", p_str))
result = ExtraActionType_start; result = Extra::ActionType::e_start;
else if (!strcmpi("stop", p_str)) else if (!strcmpi("stop", p_str))
result = ExtraActionType_stop; result = Extra::ActionType::e_stop;
else if (!strcmpi("run", p_str)) else if (!strcmpi("run", p_str))
result = ExtraActionType_run; result = Extra::ActionType::e_run;
else if (!strcmpi("exit", p_str)) else if (!strcmpi("exit", p_str))
result = ExtraActionType_exit; result = Extra::ActionType::e_exit;
else if (!strcmpi("enable", p_str)) else if (!strcmpi("enable", p_str))
result = ExtraActionType_enable; result = Extra::ActionType::e_enable;
else if (!strcmpi("disable", p_str)) else if (!strcmpi("disable", p_str))
result = ExtraActionType_disable; result = Extra::ActionType::e_disable;
else if (!strcmpi("notify", p_str)) else if (!strcmpi("notify", p_str))
result = ExtraActionType_notify; result = Extra::ActionType::e_notify;
return result; return result;
} }
@ -43,54 +43,54 @@ MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_enti
void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender); void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender);
// FUNCTION: LEGO1 0x1003e430 // FUNCTION: LEGO1 0x1003e430
void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender) void InvokeAction(Extra::ActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender)
{ {
MxDSAction action; MxDSAction action;
action.SetAtomId(p_pAtom); action.SetAtomId(p_pAtom);
action.SetObjectId(p_targetEntityId); action.SetObjectId(p_targetEntityId);
switch (p_actionId) { switch (p_actionId) {
case ExtraActionType_opendisk: case Extra::ActionType::e_opendisk:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_DiskStream); Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_diskStream);
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_openram: case Extra::ActionType::e_openram:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_RAMStream); Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_RAMStream);
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_close: case Extra::ActionType::e_close:
action.SetUnknown24(-2); action.SetUnknown24(-2);
DeleteObject(action); DeleteObject(action);
Streamer()->Close(p_pAtom.GetInternal()); Streamer()->Close(p_pAtom.GetInternal());
break; break;
case ExtraActionType_start: case Extra::ActionType::e_start:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_stop: case Extra::ActionType::e_stop:
action.SetUnknown24(-2); action.SetUnknown24(-2);
if (!FUN_1003ee00(p_pAtom, p_targetEntityId)) { if (!FUN_1003ee00(p_pAtom, p_targetEntityId)) {
DeleteObject(action); DeleteObject(action);
} }
break; break;
case ExtraActionType_run: case Extra::ActionType::e_run:
_spawnl(0, "\\lego\\sources\\main\\main.exe", "\\lego\\sources\\main\\main.exe", "/script", &p_pAtom, 0); _spawnl(0, "\\lego\\sources\\main\\main.exe", "\\lego\\sources\\main\\main.exe", "/script", &p_pAtom, 0);
break; break;
case ExtraActionType_exit: case Extra::ActionType::e_exit:
Lego()->SetExit(TRUE); Lego()->SetExit(TRUE);
break; break;
case ExtraActionType_enable: case Extra::ActionType::e_enable:
CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId); CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId);
break; break;
case ExtraActionType_disable: case Extra::ActionType::e_disable:
CheckIfEntityExists(FALSE, p_pAtom.GetInternal(), p_targetEntityId); CheckIfEntityExists(FALSE, p_pAtom.GetInternal(), p_targetEntityId);
break; break;
case ExtraActionType_notify: case Extra::ActionType::e_notify:
NotifyEntity(p_pAtom.GetInternal(), p_targetEntityId, p_sender); NotifyEntity(p_pAtom.GetInternal(), p_targetEntityId, p_sender);
break; break;
} }
@ -99,8 +99,7 @@ void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEnt
// FUNCTION: LEGO1 0x1003e670 // FUNCTION: LEGO1 0x1003e670
MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_entityId) MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_entityId)
{ {
LegoWorld* world = LegoWorld* world = (LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, e_lowerCase2), p_entityId);
(LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, LookupMode_LowerCase2), p_entityId);
if (world) { if (world) {
world->VTable0x68(p_enable); world->VTable0x68(p_enable);
return TRUE; return TRUE;

View File

@ -16,13 +16,13 @@ MxCompositeMediaPresenter::MxCompositeMediaPresenter()
{ {
m_unk0x4c = 0; m_unk0x4c = 0;
m_unk0x4e = FALSE; m_unk0x4e = FALSE;
VideoManager()->AddPresenter(*this); VideoManager()->RegisterPresenter(*this);
} }
// FUNCTION: LEGO1 0x10074020 // FUNCTION: LEGO1 0x10074020
MxCompositeMediaPresenter::~MxCompositeMediaPresenter() MxCompositeMediaPresenter::~MxCompositeMediaPresenter()
{ {
VideoManager()->RemovePresenter(*this); VideoManager()->UnregisterPresenter(*this);
} }
// FUNCTION: LEGO1 0x10074090 // FUNCTION: LEGO1 0x10074090
@ -55,12 +55,12 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
if (presenter && presenter->AddToManager() == SUCCESS) { if (presenter && presenter->AddToManager() == SUCCESS) {
presenter->SetCompositePresenter(this); presenter->SetCompositePresenter(this);
if (presenter->StartAction(p_controller, action) == SUCCESS) { if (presenter->StartAction(p_controller, action) == SUCCESS) {
presenter->SetTickleState(TickleState_Idle); presenter->SetTickleState(e_idle);
if (presenter->IsA("MxVideoPresenter")) if (presenter->IsA("MxVideoPresenter"))
VideoManager()->RemovePresenter(*presenter); VideoManager()->UnregisterPresenter(*presenter);
else if (presenter->IsA("MxAudioPresenter")) else if (presenter->IsA("MxAudioPresenter"))
SoundManager()->RemovePresenter(*presenter); SoundManager()->UnregisterPresenter(*presenter);
success = TRUE; success = TRUE;
} }
@ -75,7 +75,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
} }
if (!m_compositePresenter) { if (!m_compositePresenter) {
SetTickleState(TickleState_Ready); SetTickleState(e_ready);
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time); m_action->SetUnknown90(time);
} }
@ -93,10 +93,10 @@ void MxCompositeMediaPresenter::StartingTickle()
if (!m_unk0x4e) { if (!m_unk0x4e) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if ((*it)->GetCurrentTickleState() < TickleState_Streaming) { if ((*it)->GetCurrentTickleState() < e_streaming) {
(*it)->Tickle(); (*it)->Tickle();
if ((*it)->GetCurrentTickleState() == TickleState_Streaming || if ((*it)->GetCurrentTickleState() == e_streaming ||
((*it)->GetAction() && (*it)->GetAction()->GetStartTime())) ((*it)->GetAction() && (*it)->GetAction()->GetStartTime()))
m_unk0x4c++; m_unk0x4c++;
} }
@ -115,16 +115,15 @@ void MxCompositeMediaPresenter::StartingTickle()
else { else {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if (!(*it)->GetAction()->GetStartTime() && ((MxMediaPresenter*) *it)->CurrentChunk() && if (!(*it)->GetAction()->GetStartTime() && ((MxMediaPresenter*) *it)->CurrentChunk() &&
!((*it)->GetAction()->GetFlags() & MxDSAction::Flag_Bit9)) { !((*it)->GetAction()->GetFlags() & MxDSAction::c_bit9)) {
(*it)->Tickle(); (*it)->Tickle();
(*it)->GetAction()->SetFlags((*it)->GetAction()->GetFlags() | MxDSAction::Flag_Bit9); (*it)->GetAction()->SetFlags((*it)->GetAction()->GetFlags() | MxDSAction::c_bit9);
m_unk0x4c--; m_unk0x4c--;
} }
} }
if (!m_unk0x4c) { if (!m_unk0x4c) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_streaming);
m_currentTickleState = TickleState_Streaming;
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time); m_action->SetUnknown90(time);
} }
@ -137,16 +136,15 @@ MxResult MxCompositeMediaPresenter::Tickle()
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
switch (m_currentTickleState) { switch (m_currentTickleState) {
case TickleState_Ready: case e_ready:
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_starting);
m_currentTickleState = TickleState_Starting; case e_starting:
case TickleState_Starting:
StartingTickle(); StartingTickle();
break; break;
case TickleState_Streaming: case e_streaming:
case TickleState_Repeating: case e_repeating:
case TickleState_unk5: case e_unk5:
case TickleState_Done: { case e_done: {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++)
(*it)->Tickle(); (*it)->Tickle();
break; break;
@ -163,7 +161,7 @@ MxResult MxCompositeMediaPresenter::PutData()
{ {
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
if (m_currentTickleState >= TickleState_Streaming && m_currentTickleState <= TickleState_Done) { if (m_currentTickleState >= e_streaming && m_currentTickleState <= e_done) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++)
(*it)->PutData(); (*it)->PutData();
} }

View File

@ -12,6 +12,12 @@ LegoControlManager::~LegoControlManager()
// TODO // TODO
} }
// STUB: LEGO1 0x10028df0
void LegoControlManager::FUN_10028df0(MxPresenterList* p_presenterList)
{
// TODO
}
// STUB: LEGO1 0x10028e10 // STUB: LEGO1 0x10028e10
void LegoControlManager::Register(MxCore* p_listener) void LegoControlManager::Register(MxCore* p_listener)
{ {
@ -24,6 +30,11 @@ void LegoControlManager::Unregister(MxCore* p_listener)
// TODO // TODO
} }
// STUB: LEGO1 0x100293c0
void LegoControlManager::FUN_100293c0(undefined4, const MxAtomId&, undefined2)
{
}
// STUB: LEGO1 0x10029600 // STUB: LEGO1 0x10029600
MxResult LegoControlManager::Tickle() MxResult LegoControlManager::Tickle()
{ {

View File

@ -1,6 +1,7 @@
#include "mxcontrolpresenter.h" #include "mxcontrolpresenter.h"
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include "mxutil.h"
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
@ -28,9 +29,9 @@ MxBool MxControlPresenter::VTable0x64(undefined4 p_undefined)
} }
// FUNCTION: LEGO1 0x10043ff0 // FUNCTION: LEGO1 0x10043ff0
void MxControlPresenter::VTable0x68(MxBool p_undefined) void MxControlPresenter::VTable0x68(MxBool p_unk0x50)
{ {
m_unk0x50 = p_undefined; m_unk0x50 = p_unk0x50;
} }
// FUNCTION: LEGO1 0x10044110 // FUNCTION: LEGO1 0x10044110
@ -47,11 +48,28 @@ MxResult MxControlPresenter::AddToManager()
return SUCCESS; return SUCCESS;
} }
// STUB: LEGO1 0x10044190 // FUNCTION: LEGO1 0x10044190
MxResult MxControlPresenter::StartAction(MxStreamController*, MxDSAction*) MxResult MxControlPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{ {
// TODO MxResult result = MxCompositePresenter::StartAction(p_controller, p_action);
return SUCCESS;
FUN_100b7220(m_action, MxDSAction::c_world | MxDSAction::c_looping, TRUE);
ParseExtra();
MxS16 i = 0;
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
(*it)->Enable((m_unk0x4c != 3 || m_unk0x4e) && IsEnabled() ? m_unk0x4e == i : FALSE);
i++;
}
if (m_unk0x4c == 3) {
MxDSAction* action = (*m_list.begin())->GetAction();
action->SetFlags(action->GetFlags() | MxDSAction::c_bit11);
}
TickleManager()->RegisterClient(this, 200);
return result;
} }
// FUNCTION: LEGO1 0x10044260 // FUNCTION: LEGO1 0x10044260
@ -78,7 +96,7 @@ MxBool MxControlPresenter::FUN_10044480(undefined4, undefined4*)
} }
// STUB: LEGO1 0x10044540 // STUB: LEGO1 0x10044540
void MxControlPresenter::FUN_10044540(undefined2) void MxControlPresenter::VTable0x6c(undefined4)
{ {
// TODO // TODO
} }
@ -88,9 +106,7 @@ void MxControlPresenter::ReadyTickle()
{ {
MxPresenter::ParseExtra(); MxPresenter::ParseExtra();
TickleManager()->UnregisterClient(this); TickleManager()->UnregisterClient(this);
ProgressTickleState(e_repeating);
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
} }
// STUB: LEGO1 0x10044640 // STUB: LEGO1 0x10044640
@ -99,15 +115,34 @@ void MxControlPresenter::ParseExtra()
// TODO // TODO
} }
// STUB: LEGO1 0x10044820 // FUNCTION: LEGO1 0x10044820
void MxControlPresenter::Enable(MxBool p_enable) void MxControlPresenter::Enable(MxBool p_enable)
{ {
// TODO if (MxPresenter::IsEnabled() != p_enable) {
MxPresenter::Enable(p_enable);
MxS16 i = 0;
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if (i == m_unk0x4e) {
(*it)->Enable((m_unk0x4c != 3 || i != 0) ? p_enable : 0);
break;
}
i++;
}
if (!p_enable) {
m_unk0x4e = 0;
}
}
} }
// STUB: LEGO1 0x100448a0 // FUNCTION: LEGO1 0x100448a0
MxBool MxControlPresenter::HasTickleStatePassed(TickleState p_tickleState) MxBool MxControlPresenter::HasTickleStatePassed(TickleState p_tickleState)
{ {
// TODO MxCompositePresenterList::iterator it = m_list.begin();
return TRUE; for (MxS16 i = m_unk0x4e; i > 0; i--, it++)
;
return (*it)->HasTickleStatePassed(p_tickleState);
} }

View File

@ -11,3 +11,9 @@ LegoActor::LegoActor()
m_unk0x10 = 0; m_unk0x10 = 0;
m_unk0x74 = 0; m_unk0x74 = 0;
} }
// STUB: LEGO1 0x1002d320
LegoActor::~LegoActor()
{
// TODO
}

View File

@ -0,0 +1,39 @@
#include "legoactorpresenter.h"
#include "legoentity.h"
#include "legoomni.h"
// FUNCTION: LEGO1 0x10076c30
void LegoActorPresenter::ReadyTickle()
{
if (GetCurrentWorld()) {
m_entity = (LegoEntity*) CreateEntity("LegoActor");
if (m_entity) {
SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
m_entity->Create(*m_action);
}
ProgressTickleState(e_starting);
}
}
// FUNCTION: LEGO1 0x10076c90
void LegoActorPresenter::StartingTickle()
{
if (m_entity->GetROI()) {
ProgressTickleState(e_streaming);
ParseExtra();
}
}
// FUNCTION: LEGO1 0x10076cc0
void LegoActorPresenter::ParseExtra()
{
char buffer[512];
char* extraData = m_action->GetExtraData();
if (m_action->GetExtraLength()) {
memcpy(buffer, extraData, m_action->GetExtraLength());
buffer[m_action->GetExtraLength()] = 0;
m_entity->ParseAction(buffer);
}
}

View File

@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(LegoCameraController, 0xc8);
// FUNCTION: LEGO1 0x10011d50 // FUNCTION: LEGO1 0x10011d50
LegoCameraController::LegoCameraController() LegoCameraController::LegoCameraController()
{ {
SetWorldTransform(Vector3Data(0, 0, 0), Vector3Data(0, 0, 1), Vector3Data(0, 1, 0)); SetWorldTransform(Mx3DPointFloat(0, 0, 0), Mx3DPointFloat(0, 0, 1), Mx3DPointFloat(0, 1, 0));
} }
// FUNCTION: LEGO1 0x10011f70 // FUNCTION: LEGO1 0x10011f70
@ -71,37 +71,49 @@ void LegoCameraController::OnMouseMove(MxU8 p_modifier, MxPoint32 p_point)
} }
// FUNCTION: LEGO1 0x10012260 // FUNCTION: LEGO1 0x10012260
void LegoCameraController::SetWorldTransform(Vector3Impl& p_at, Vector3Impl& p_dir, Vector3Impl& p_up) void LegoCameraController::SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up)
{ {
CalcLocalTransform(p_at, p_dir, p_up, m_matrix1); CalcLocalTransform(p_at, p_dir, p_up, m_matrix1);
m_matrix2 = m_matrix1; m_matrix2 = m_matrix1;
} }
// STUB: LEGO1 0x100123e0 // STUB: LEGO1 0x100123e0
void LegoCameraController::FUN_100123e0(Matrix4Data& p_transform, MxU32) void LegoCameraController::FUN_100123e0(const MxMatrix& p_transform, MxU32)
{ {
} }
// STUB: LEGO1 0x10012740 // FUNCTION: LEGO1 0x10012740
Vector3Data& LegoCameraController::FUN_10012740() Mx3DPointFloat LegoCameraController::GetWorldUp()
{ {
// Actually returns reference to a member if (m_lego3DView && m_lego3DView->GetPointOfView()) {
static Vector3Data g_v; Mx3DPointFloat vec;
return g_v; vec = m_lego3DView->GetPointOfView()->GetWorldUp();
return Mx3DPointFloat(vec[0], vec[1], vec[2]);
}
else
return Mx3DPointFloat(0, 0, 0);
} }
// STUB: LEGO1 0x100127f0 // FUNCTION: LEGO1 0x100127f0
Vector3Data& LegoCameraController::FUN_100127f0() Mx3DPointFloat LegoCameraController::GetWorldLocation()
{ {
// Actually returns reference to a member if (m_lego3DView && m_lego3DView->GetPointOfView()) {
static Vector3Data g_v; Mx3DPointFloat vec;
return g_v; vec = m_lego3DView->GetPointOfView()->GetWorldPosition();
return Mx3DPointFloat(vec[0], vec[1] - m_entityOffsetUp, vec[2]);
}
else
return Mx3DPointFloat(0, 0, 0);
} }
// STUB: LEGO1 0x100128a0 // FUNCTION: LEGO1 0x100128a0
Vector3Data& LegoCameraController::FUN_100128a0() Mx3DPointFloat LegoCameraController::GetWorldDirection()
{ {
// Actually returns reference to a member if (m_lego3DView && m_lego3DView->GetPointOfView()) {
static Vector3Data g_v; Mx3DPointFloat vec;
return g_v; vec = m_lego3DView->GetPointOfView()->GetWorldDirection();
return Mx3DPointFloat(vec[0], vec[1], vec[2]);
}
else
return Mx3DPointFloat(0, 0, 0);
} }

View File

@ -2,17 +2,13 @@
#include "define.h" #include "define.h"
#include "legoomni.h" #include "legoomni.h"
#include "legounksavedatawriter.h"
#include "legoutil.h" #include "legoutil.h"
#include "legovideomanager.h"
#include "legoworld.h" #include "legoworld.h"
DECOMP_SIZE_ASSERT(LegoEntity, 0x68) DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
// FUNCTION: LEGO1 0x1000c290
LegoEntity::~LegoEntity()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100105f0 // FUNCTION: LEGO1 0x100105f0
void LegoEntity::Init() void LegoEntity::Init()
{ {
@ -20,11 +16,11 @@ void LegoEntity::Init()
m_worldDirection.Fill(0); m_worldDirection.Fill(0);
m_worldSpeed = 0; m_worldSpeed = 0;
m_roi = NULL; m_roi = NULL;
m_cameraFlag = 0; m_cameraFlag = FALSE;
m_actionArgString = NULL; m_actionArgString = NULL;
m_unk0x10 = 0; m_unk0x10 = 0;
m_unk0x11 = 0; m_flags = 0;
m_actionType = ExtraActionType_unknown; m_actionType = Extra::ActionType::e_unknown;
m_actionArgNumber = -1; m_actionArgNumber = -1;
m_unk0x59 = 4; m_unk0x59 = 4;
} }
@ -36,25 +32,34 @@ void LegoEntity::ResetWorldTransform(MxBool p_inVehicle)
} }
// STUB: LEGO1 0x10010790 // STUB: LEGO1 0x10010790
void LegoEntity::SetWorldTransform(Vector3Impl& p_loc, Vector3Impl& p_dir, Vector3Impl& p_up) void LegoEntity::SetWorldTransform(const Vector3& p_loc, const Vector3& p_dir, const Vector3& p_up)
{ {
// TODO // TODO
} }
// FUNCTION: LEGO1 0x100107e0 // FUNCTION: LEGO1 0x100107e0
MxResult LegoEntity::Create(MxDSObject& p_dsObject) MxResult LegoEntity::Create(MxDSAction& p_dsAction)
{ {
m_mxEntityId = p_dsObject.GetObjectId(); m_mxEntityId = p_dsAction.GetObjectId();
m_atom = p_dsObject.GetAtomId(); m_atom = p_dsAction.GetAtomId();
Init(); SetWorld();
return SUCCESS; return SUCCESS;
} }
// STUB: LEGO1 0x10010810 // FUNCTION: LEGO1 0x10010810
void LegoEntity::Destroy(MxBool p_fromDestructor) void LegoEntity::Destroy(MxBool p_fromDestructor)
{ {
if (m_roi) { if (m_roi) {
// TODO if (m_flags & c_bit1) {
if (m_roi->GetUnknown0x104() == this)
m_roi->SetUnknown0x104(NULL);
GetUnkSaveDataWriter()->FUN_10083db0(m_roi);
}
else {
VideoManager()->Get3DManager()->GetLego3DView()->Remove(*m_roi);
delete m_roi;
}
} }
delete[] m_actionArgString; delete[] m_actionArgString;
@ -77,14 +82,18 @@ void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
} }
// STUB: LEGO1 0x100109b0 // STUB: LEGO1 0x100109b0
void LegoEntity::SetLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up, MxBool) void LegoEntity::SetLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direction, Mx3DPointFloat& p_up, MxBool)
{ {
// TODO // TODO
} }
// STUB: LEGO1 0x10010c30 // FUNCTION: LEGO1 0x10010c30
void LegoEntity::FUN_10010c30() void LegoEntity::FUN_10010c30()
{ {
LegoWorld* world = GetCurrentWorld();
if (m_cameraFlag && world && world->GetCamera() && m_roi)
world->GetCamera()->FUN_100123e0(m_roi->GetLocal2World(), 1);
} }
// FUNCTION: LEGO1 0x10010e10 // FUNCTION: LEGO1 0x10010e10
@ -97,13 +106,13 @@ void LegoEntity::ParseAction(char* p_extra)
if (KeyValueStringParse(actionValue, g_strACTION, copy)) { if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens)); m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens));
if (m_actionType != ExtraActionType_exit) { if (m_actionType != Extra::ActionType::e_exit) {
char* token = strtok(NULL, g_parseExtraTokens); char* token = strtok(NULL, g_parseExtraTokens);
m_actionArgString = new char[strlen(token) + 1]; m_actionArgString = new char[strlen(token) + 1];
strcpy(m_actionArgString, token); strcpy(m_actionArgString, token);
if (m_actionType != ExtraActionType_run) { if (m_actionType != Extra::ActionType::e_run) {
m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens)); m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens));
} }
} }

View File

@ -15,7 +15,7 @@ LegoEntityPresenter::LegoEntityPresenter()
// FUNCTION: LEGO1 0x100535c0 // FUNCTION: LEGO1 0x100535c0
void LegoEntityPresenter::Init() void LegoEntityPresenter::Init()
{ {
m_objectBackend = 0; m_entity = NULL;
} }
// FUNCTION: LEGO1 0x100535d0 // FUNCTION: LEGO1 0x100535d0
@ -25,9 +25,9 @@ LegoEntityPresenter::~LegoEntityPresenter()
} }
// FUNCTION: LEGO1 0x10053630 // FUNCTION: LEGO1 0x10053630
undefined4 LegoEntityPresenter::SetBackend(LegoEntity* p_backend) undefined4 LegoEntityPresenter::SetEntity(LegoEntity* p_entity)
{ {
m_objectBackend = p_backend; m_entity = p_entity;
return 0; return 0;
} }
@ -35,7 +35,7 @@ undefined4 LegoEntityPresenter::SetBackend(LegoEntity* p_backend)
void LegoEntityPresenter::Destroy(MxBool p_fromDestructor) void LegoEntityPresenter::Destroy(MxBool p_fromDestructor)
{ {
if (VideoManager()) { if (VideoManager()) {
VideoManager()->RemovePresenter(*this); VideoManager()->UnregisterPresenter(*this);
} }
Init(); Init();
@ -53,7 +53,7 @@ MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDS
MxResult result = MxCompositePresenter::StartAction(p_controller, p_action); MxResult result = MxCompositePresenter::StartAction(p_controller, p_action);
if (VideoManager()) { if (VideoManager()) {
VideoManager()->AddPresenter(*this); VideoManager()->RegisterPresenter(*this);
} }
return result; return result;
@ -63,14 +63,13 @@ MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDS
void LegoEntityPresenter::ReadyTickle() void LegoEntityPresenter::ReadyTickle()
{ {
if (GetCurrentWorld()) { if (GetCurrentWorld()) {
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoEntity"); m_entity = (LegoEntity*) MxPresenter::CreateEntity("LegoEntity");
if (m_objectBackend) { if (m_entity) {
m_objectBackend->Create(*m_action); m_entity->Create(*m_action);
m_objectBackend->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE); m_entity->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
ParseExtra(); ParseExtra();
} }
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_starting);
m_currentTickleState = TickleState_Starting;
} }
} }
@ -83,10 +82,14 @@ void LegoEntityPresenter::RepeatingTickle()
} }
// FUNCTION: LEGO1 0x10053730 // FUNCTION: LEGO1 0x10053730
void LegoEntityPresenter::SetBackendLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up) void LegoEntityPresenter::SetEntityLocation(
Mx3DPointFloat& p_location,
Mx3DPointFloat& p_direction,
Mx3DPointFloat& p_up
)
{ {
if (m_objectBackend) { if (m_entity) {
m_objectBackend->SetLocation(p_location, p_direction, p_up, TRUE); m_entity->SetLocation(p_location, p_direction, p_up, TRUE);
} }
} }
@ -100,6 +103,6 @@ void LegoEntityPresenter::ParseExtra()
data[len] = 0; data[len] = 0;
len &= MAXWORD; len &= MAXWORD;
m_objectBackend->ParseAction(data); m_entity->ParseAction(data);
} }
} }

View File

@ -39,7 +39,7 @@ void LegoPathActor::VTable0x8c()
} }
// STUB: LEGO1 0x1002e740 // STUB: LEGO1 0x1002e740
void LegoPathActor::VTable0x74(Matrix4Impl& p_transform) void LegoPathActor::VTable0x74(Matrix4& p_transform)
{ {
// TODO // TODO
} }

View File

@ -100,6 +100,12 @@ MxResult LegoPointOfViewController::Create(Lego3DView* p_lego3DView)
return SUCCESS; return SUCCESS;
} }
// FUNCTION: LEGO1 0x100658a0
void LegoPointOfViewController::OnViewSize(int p_width, int p_height)
{
m_nav->SetControlMax(p_width, p_height);
}
// FUNCTION: LEGO1 0x100658c0 // FUNCTION: LEGO1 0x100658c0
void LegoPointOfViewController::LeftDown(int p_x, int p_y) void LegoPointOfViewController::LeftDown(int p_x, int p_y)
{ {

View File

@ -62,7 +62,7 @@ MxBool LegoRace::VTable0x64()
} }
// STUB: LEGO1 0x10015ce0 // STUB: LEGO1 0x10015ce0
MxResult LegoRace::Create(MxDSObject& p_dsObject) MxResult LegoRace::Create(MxDSAction& p_dsAction)
{ {
// TODO // TODO
return SUCCESS; return SUCCESS;

View File

@ -1,21 +1,27 @@
#include "legoworld.h" #include "legoworld.h"
#include "legocontrolmanager.h"
#include "legoinputmanager.h" #include "legoinputmanager.h"
#include "legoomni.h" #include "legoomni.h"
#include "legoutil.h" #include "legoutil.h"
#include "legovideomanager.h"
#include "mxactionnotificationparam.h" #include "mxactionnotificationparam.h"
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
#include "mxnotificationparam.h" #include "mxnotificationparam.h"
#include "mxomni.h" #include "mxomni.h"
#include "mxticklemanager.h" #include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(LegoWorld, 0xf8); DECOMP_SIZE_ASSERT(LegoWorld, 0xf8)
DECOMP_SIZE_ASSERT(LegoEntityList, 0x18)
DECOMP_SIZE_ASSERT(LegoEntityListCursor, 0x10)
DECOMP_SIZE_ASSERT(MxCoreList, 0x18)
DECOMP_SIZE_ASSERT(MxCoreListCursor, 0x10)
// STUB: LEGO1 0x1001ca40 // STUB: LEGO1 0x1001ca40
LegoWorld::LegoWorld() : m_list0x68(TRUE) LegoWorld::LegoWorld() : m_list0x68(TRUE)
{ {
// TODO // TODO
m_unk0xf6 = FALSE; m_worldStarted = FALSE;
m_unk0xf4 = 4; m_unk0xf4 = 4;
NotificationManager()->Register(this); NotificationManager()->Register(this);
} }
@ -38,10 +44,36 @@ LegoWorld::~LegoWorld()
// TODO // TODO
} }
// STUB: LEGO1 0x1001e0b0 // FUNCTION: LEGO1 0x1001e0b0
MxResult LegoWorld::SetAsCurrentWorld(MxDSObject& p_dsObject) MxResult LegoWorld::Create(MxDSAction& p_dsAction)
{ {
// TODO MxEntity::Create(p_dsAction);
m_entityList = new LegoEntityList(TRUE);
if (!m_entityList)
return FAILURE;
m_coreList = new MxCoreList(TRUE);
if (!m_coreList)
return FAILURE;
if (!VTable0x54())
return FAILURE;
if (p_dsAction.GetFlags() & MxDSAction::c_enabled) {
if (GetCurrentWorld()) {
GetCurrentWorld()->VTable0x68(0);
}
SetCurrentWorld(this);
ControlManager()->FUN_10028df0(&m_list0xb8);
}
SetIsWorldActive(TRUE);
m_unk0xec = -1;
return SUCCESS; return SUCCESS;
} }
@ -63,10 +95,37 @@ MxLong LegoWorld::Notify(MxParam& p_param)
return ret; return ret;
} }
// STUB: LEGO1 0x1001f630 // FUNCTION: LEGO1 0x1001f630
void LegoWorld::VTable0x54() LegoCameraController* LegoWorld::VTable0x54()
{ {
// TODO MxBool success = FALSE;
if (!VideoManager()) {
goto done;
}
if (!(m_cameraController = new LegoCameraController())) {
goto done;
}
if (m_cameraController->Create() != SUCCESS) {
goto done;
}
m_cameraController->OnViewSize(
VideoManager()->GetVideoParam().GetRect().GetWidth(),
VideoManager()->GetVideoParam().GetRect().GetHeight()
);
success = TRUE;
done:
if (!success) {
if (m_cameraController) {
delete m_cameraController;
m_cameraController = NULL;
}
}
return m_cameraController;
} }
// STUB: LEGO1 0x1001fc80 // STUB: LEGO1 0x1001fc80
@ -92,6 +151,12 @@ void LegoWorld::EndAction(MxCore* p_object)
{ {
} }
// STUB: LEGO1 0x100213a0
MxPresenter* LegoWorld::FindPresenter(const char* p_presenter, const char* p_name)
{
return NULL;
}
// STUB: LEGO1 0x10021a70 // STUB: LEGO1 0x10021a70
void LegoWorld::VTable0x68(MxBool p_add) void LegoWorld::VTable0x68(MxBool p_add)
{ {
@ -101,12 +166,12 @@ void LegoWorld::VTable0x68(MxBool p_add)
// FUNCTION: LEGO1 0x10022080 // FUNCTION: LEGO1 0x10022080
MxResult LegoWorld::Tickle() MxResult LegoWorld::Tickle()
{ {
if (!m_unk0xf6) { if (!m_worldStarted) {
switch (m_unk0xf4) { switch (m_unk0xf4) {
case 0: case 0:
m_unk0xf6 = TRUE; m_worldStarted = TRUE;
SetAppCursor(0); SetAppCursor(0);
Stop(); VTable0x50();
return TRUE; return TRUE;
case 2: case 2:
if (FUN_100220e0() == 1) if (FUN_100220e0() == 1)
@ -121,23 +186,23 @@ MxResult LegoWorld::Tickle()
// STUB: LEGO1 0x100220e0 // STUB: LEGO1 0x100220e0
undefined LegoWorld::FUN_100220e0() undefined LegoWorld::FUN_100220e0()
{ {
return TRUE; return 0;
} }
// FUNCTION: LEGO1 0x10022340 // FUNCTION: LEGO1 0x10022340
void LegoWorld::Stop() void LegoWorld::VTable0x50()
{ {
TickleManager()->UnregisterClient(this); TickleManager()->UnregisterClient(this);
} }
// STUB: LEGO1 0x100727e0 // STUB: LEGO1 0x100727e0
MxBool LegoWorld::FUN_100727e0(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up) MxBool LegoWorld::FUN_100727e0(MxU32, Mx3DPointFloat& p_loc, Mx3DPointFloat& p_dir, Mx3DPointFloat& p_up)
{ {
return FALSE; return FALSE;
} }
// STUB: LEGO1 0x10072980 // STUB: LEGO1 0x10072980
MxBool LegoWorld::FUN_10072980(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up) MxBool LegoWorld::FUN_10072980(MxU32, Mx3DPointFloat& p_loc, Mx3DPointFloat& p_dir, Mx3DPointFloat& p_up)
{ {
return FALSE; return FALSE;
} }

View File

@ -1,12 +1,18 @@
#include "legoworldpresenter.h" #include "legoworldpresenter.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legoentity.h" #include "legoentity.h"
#include "legoomni.h" #include "legoomni.h"
#include "legoplantmanager.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "legoworld.h"
#include "mxactionnotificationparam.h" #include "mxactionnotificationparam.h"
#include "mxautolocker.h" #include "mxautolocker.h"
#include "mxdsactionlist.h" #include "mxdsactionlist.h"
#include "mxdsmediaaction.h"
#include "mxdsmultiaction.h" #include "mxdsmultiaction.h"
#include "mxnotificationmanager.h"
#include "mxobjectfactory.h" #include "mxobjectfactory.h"
#include "mxpresenter.h" #include "mxpresenter.h"
#include "mxstl/stlcompat.h" #include "mxstl/stlcompat.h"
@ -26,10 +32,32 @@ LegoWorldPresenter::LegoWorldPresenter()
m_unk0x50 = 50000; m_unk0x50 = 50000;
} }
// STUB: LEGO1 0x10066770 // FUNCTION: LEGO1 0x10066770
LegoWorldPresenter::~LegoWorldPresenter() LegoWorldPresenter::~LegoWorldPresenter()
{ {
// TODO MxBool result = FALSE;
if (m_entity) {
undefined4 world = ((LegoWorld*) m_entity)->GetUnknown0xec();
PlantManager()->FUN_10026360(world);
AnimationManager()->FUN_1005f720(world);
BuildingManager()->FUN_1002fa00();
result = ((LegoWorld*) m_entity)->VTable0x5c();
}
if (result == FALSE) {
FUN_10015820(0, 7);
}
if (m_entity) {
#ifdef COMPAT_MODE
{
MxNotificationParam param(c_notificationNewPresenter, NULL);
NotificationManager()->Send(m_entity, &param);
}
#else
NotificationManager()->Send(m_entity, &MxNotificationParam(c_notificationNewPresenter, NULL));
#endif
}
} }
// FUNCTION: LEGO1 0x10066870 // FUNCTION: LEGO1 0x10066870
@ -63,7 +91,7 @@ MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSA
if (presenter && presenter->AddToManager() == SUCCESS) { if (presenter && presenter->AddToManager() == SUCCESS) {
presenter->SetCompositePresenter(this); presenter->SetCompositePresenter(this);
if (presenter->StartAction(p_controller, action) == SUCCESS) { if (presenter->StartAction(p_controller, action) == SUCCESS) {
presenter->SetTickleState(TickleState_Idle); presenter->SetTickleState(e_idle);
success = TRUE; success = TRUE;
} }
} }
@ -76,7 +104,7 @@ MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSA
delete presenter; delete presenter;
} }
VideoManager()->AddPresenter(*this); VideoManager()->RegisterPresenter(*this);
result = SUCCESS; result = SUCCESS;
} }
@ -87,16 +115,15 @@ MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSA
// FUNCTION: LEGO1 0x10066a50 // FUNCTION: LEGO1 0x10066a50
void LegoWorldPresenter::ReadyTickle() void LegoWorldPresenter::ReadyTickle()
{ {
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoWorld"); m_entity = (LegoEntity*) MxPresenter::CreateEntity("LegoWorld");
if (m_objectBackend) { if (m_entity) {
m_objectBackend->Create(*m_action); m_entity->Create(*m_action);
Lego()->AddWorld((LegoWorld*) m_objectBackend); Lego()->AddWorld((LegoWorld*) m_entity);
SetBackendLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp()); SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
} }
ParseExtra(); ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_starting);
m_currentTickleState = TickleState_Starting;
} }
// FUNCTION: LEGO1 0x10066ac0 // FUNCTION: LEGO1 0x10066ac0
@ -104,25 +131,42 @@ void LegoWorldPresenter::StartingTickle()
{ {
if (m_action->IsA("MxDSSerialAction")) { if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *m_list.begin(); MxPresenter* presenter = *m_list.begin();
if (presenter->GetCurrentTickleState() == TickleState_Idle) { if (presenter->GetCurrentTickleState() == e_idle) {
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
} }
} }
else { else {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if ((*it)->GetCurrentTickleState() == TickleState_Idle) { if ((*it)->GetCurrentTickleState() == e_idle) {
(*it)->SetTickleState(TickleState_Ready); (*it)->SetTickleState(e_ready);
} }
} }
} }
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_streaming);
m_currentTickleState = TickleState_Streaming;
} }
// STUB: LEGO1 0x10067a70 // FUNCTION: LEGO1 0x10067a70
void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter) void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter)
{ {
MxCompositePresenter::VTable0x60(p_presenter);
MxDSAction* action = p_presenter->GetAction();
if (action->GetDuration() != -1 && (action->GetFlags() & MxDSAction::c_looping) == 0) {
if (!action->IsA("MxDSMediaAction")) {
return;
}
if (((MxDSMediaAction*) action)->GetSustainTime() != -1) {
return;
}
}
if (!p_presenter->IsA("LegoAnimPresenter") && !p_presenter->IsA("MxControlPresenter") &&
!p_presenter->IsA("MxCompositePresenter")) {
p_presenter->SendToCompositePresenter(Lego());
((LegoWorld*) m_entity)->VTable0x58(p_presenter);
}
} }
// STUB: LEGO1 0x10067b00 // STUB: LEGO1 0x10067b00

View File

@ -1,9 +1,22 @@
#include "gasstation.h" #include "gasstation.h"
// STUB: LEGO1 0x100046a0 #include "mxnotificationmanager.h"
// FUNCTION: LEGO1 0x100046a0
GasStation::GasStation() GasStation::GasStation()
{ {
// TODO this->m_unk0xf8 = 0;
this->m_unk0x100 = 0;
this->m_unk0xfc = 0;
this->m_unk0x108 = 0;
this->m_unk0x104 = 0;
this->m_unk0x114 = 0;
this->m_unk0x106 = 0;
this->m_unk0x10c = 0;
this->m_unk0x115 = 0;
this->m_unk0x110 = 0;
NotificationManager()->Register(this);
} }
// STUB: LEGO1 0x100048c0 // STUB: LEGO1 0x100048c0

View File

@ -1,15 +1,28 @@
#include "elevatorbottom.h" #include "elevatorbottom.h"
// STUB: LEGO1 0x10017e90 DECOMP_SIZE_ASSERT(ElevatorBottom, 0xfc)
#include "legocontrolmanager.h"
#include "legoinputmanager.h"
#include "legoomni.h"
#include "mxnotificationmanager.h"
#include "mxomni.h"
// FUNCTION: LEGO1 0x10017e90
ElevatorBottom::ElevatorBottom() ElevatorBottom::ElevatorBottom()
{ {
// TODO NotificationManager()->Register(this);
this->m_unk0xf8 = 0;
} }
// STUB: LEGO1 0x10018060 // FUNCTION: LEGO1 0x10018060
ElevatorBottom::~ElevatorBottom() ElevatorBottom::~ElevatorBottom()
{ {
// TODO if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
ControlManager()->Unregister(this);
NotificationManager()->Unregister(this);
} }
// STUB: LEGO1 0x10018150 // STUB: LEGO1 0x10018150

View File

@ -1,9 +1,49 @@
#include "infocenter.h" #include "infocenter.h"
// STUB: LEGO1 0x1006ea20 #include "infocenterstate.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoomni.h"
#include "legoutil.h"
#include "legovideomanager.h"
#include "mxactionnotificationparam.h"
#include "mxbackgroundaudiomanager.h"
#include "mxnotificationmanager.h"
#include "mxstillpresenter.h"
#include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
DECOMP_SIZE_ASSERT(InfocenterUnkDataEntry, 0x18)
// GLOBAL: LEGO1 0x100f76a0
const char* g_object2x4red = "2x4red";
// GLOBAL: LEGO1 0x100f76a4
const char* g_object2x4grn = "2x4grn";
// FUNCTION: LEGO1 0x1006ea20
Infocenter::Infocenter() Infocenter::Infocenter()
{ {
// TODO m_unk0xfc = 0;
m_unk0x11c = 0;
m_infocenterState = NULL;
m_unk0x1cc = 0;
m_unk0x11c = 0;
m_unk0x104 = 0;
m_currentInfomainScript = c_noInfomain;
m_currentCutscene = e_noIntro;
memset(&m_entries, 0, sizeof(InfocenterUnkDataEntry) * 7);
m_unk0x1c8 = -1;
SetAppCursor(1);
NotificationManager()->Register(this);
m_unk0x1d0 = 0;
m_unk0x1d2 = 0;
m_unk0x1d4 = 0;
m_unk0x1d6 = 0;
} }
// STUB: LEGO1 0x1006ec90 // STUB: LEGO1 0x1006ec90
@ -13,35 +53,423 @@ Infocenter::~Infocenter()
} }
// STUB: LEGO1 0x1006ed90 // STUB: LEGO1 0x1006ed90
MxResult Infocenter::Create(MxDSObject& p_dsObject) MxResult Infocenter::Create(MxDSAction& p_dsAction)
{ {
return FAILURE; if (LegoWorld::Create(p_dsAction) == SUCCESS) {
InputManager()->SetWorld(this);
ControlManager()->Register(this);
}
LegoGameState* gs = GameState();
m_infocenterState = (InfocenterState*) gs->GetState("InfocenterState");
if (!m_infocenterState) {
m_infocenterState = (InfocenterState*) gs->CreateState("InfocenterState");
m_infocenterState->SetUnknown0x74(3);
}
else {
// TODO
}
// TODO
InputManager()->Register(this);
SetIsWorldActive(FALSE);
return SUCCESS;
} }
// STUB: LEGO1 0x1006ef10 // FUNCTION: LEGO1 0x1006ef10
MxLong Infocenter::Notify(MxParam& p_param) MxLong Infocenter::Notify(MxParam& p_param)
{ {
// TODO MxLong result = 0;
return 0; LegoWorld::Notify(p_param);
if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationType0:
result = HandleNotification0(p_param);
break;
case c_notificationEndAction:
result = HandleEndAction(p_param);
break;
case c_notificationKeyPress:
result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey());
break;
case c_notificationButtonUp:
result = HandleButtonUp(
((LegoEventNotificationParam&) p_param).GetX(),
((LegoEventNotificationParam&) p_param).GetY()
);
break;
case c_notificationMouseMove:
result = HandleMouseMove(
((LegoEventNotificationParam&) p_param).GetX(),
((LegoEventNotificationParam&) p_param).GetY()
);
break;
case c_notificationType17:
result = HandleNotification17(p_param);
break;
case c_notificationTransitioned:
StopBookAnimation();
m_unk0x1d2 = 0;
if (m_infocenterState->GetUnknown0x74() == 0xc) {
StartCredits();
m_infocenterState->SetUnknown0x74(0xd);
}
else if (m_unk0x104 != 0) {
BackgroundAudioManager()->RaiseVolume();
GameState()->HandleAction(m_unk0x104);
m_unk0x104 = 0;
}
break;
}
}
return result;
}
// FUNCTION: LEGO1 0x1006f080
MxLong Infocenter::HandleEndAction(MxParam& p_param)
{
MxDSAction* action = ((MxEndActionNotificationParam&) p_param).GetAction();
if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == 499) {
Lego()->CloseMainWindow();
return 1;
}
if (action->GetAtomId() == m_atom &&
(action->GetObjectId() == 40 || action->GetObjectId() == 41 || action->GetObjectId() == 42 ||
action->GetObjectId() == 43 || action->GetObjectId() == 44)) {
if (m_unk0x1d4) {
m_unk0x1d4--;
}
if (!m_unk0x1d4) {
PlayMusic(11);
GameState()->FUN_10039780(m_unk0xfc);
switch (m_unk0xfc) {
case 1:
PlayDialogue(c_pepperCharacterSelect);
break;
case 2:
PlayDialogue(c_mamaCharacterSelect);
break;
case 3:
PlayDialogue(c_papaCharacterSelect);
break;
case 4:
PlayDialogue(c_nickCharacterSelect);
break;
case 5:
PlayDialogue(c_lauraCharacterSelect);
break;
default:
break;
}
FUN_10070dc0(TRUE);
}
}
MxLong result = m_radio.Notify(p_param);
if (result || (action->GetAtomId() != m_atom && action->GetAtomId() != *g_introScript))
return result;
if (action->GetObjectId() == c_returnBackGuidanceDialogue2) {
ControlManager()->FUN_100293c0(0x10, action->GetAtomId(), 0);
m_unk0x1d6 = 0;
}
switch (m_infocenterState->GetUnknown0x74()) {
case 0:
switch (m_currentCutscene) {
case e_legoMovie:
PlayCutscene(e_mindscapeMovie, FALSE);
return 1;
case e_mindscapeMovie:
PlayCutscene(e_introMovie, TRUE);
return 1;
case e_badEndMovie:
StopCutscene();
m_infocenterState->SetUnknown0x74(11);
PlayDialogue(c_badEndingDialogue);
m_currentCutscene = e_noIntro;
return 1;
case e_goodEndMovie:
StopCutscene();
m_infocenterState->SetUnknown0x74(11);
PlayDialogue(c_goodEndingDialogue);
m_currentCutscene = e_noIntro;
return 1;
}
// default / 2nd case probably?
StopCutscene();
m_infocenterState->SetUnknown0x74(11);
PlayDialogue(c_welcomeDialogue);
m_currentCutscene = e_noIntro;
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
m_unk0x1d2 = 1;
return 1;
}
break;
case 1:
m_infocenterState->SetUnknown0x74(11);
switch (m_currentCutscene) {
case e_badEndMovie:
PlayDialogue(c_badEndingDialogue);
break;
case e_goodEndMovie:
PlayDialogue(c_goodEndingDialogue);
break;
default:
PlayDialogue(c_welcomeDialogue);
}
m_currentCutscene = e_noIntro;
return 1;
case 2:
FUN_10015860(g_object2x4red, 0);
FUN_10015860(g_object2x4grn, 0);
BackgroundAudioManager()->RaiseVolume();
return 1;
case 4:
if (action->GetObjectId() == 70 || action->GetObjectId() == 71) {
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
m_infocenterState->SetUnknown0x74(14);
return 1;
}
break;
case 5:
if (action->GetObjectId() == m_currentInfomainScript) {
if (GameState()->GetUnknown10() != 2 && m_unk0xfc != 0) {
GameState()->FUN_10039780(m_unk0xfc);
}
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
m_infocenterState->SetUnknown0x74(14);
return 1;
}
break;
case 11:
if (m_infocenterState->GetInfocenterBufferElement(0) == 0 && m_currentInfomainScript != 40 &&
m_currentInfomainScript != 41 && m_currentInfomainScript != 42 && m_currentInfomainScript != 43 &&
m_currentInfomainScript != 44) {
m_unk0x1d0 = 1;
PlayMusic(11);
}
m_infocenterState->SetUnknown0x74(2);
FUN_10015860("infoman", 1);
return 1;
case 12:
if (action->GetObjectId() == m_currentInfomainScript) {
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
}
}
result = 1;
return result;
} }
// STUB: LEGO1 0x1006f4e0 // STUB: LEGO1 0x1006f4e0
void Infocenter::Stop() void Infocenter::VTable0x50()
{ {
m_unk0x1d0 = 0;
m_unk0x1d2 = 0;
m_unk0x1d4 = 0;
m_unk0x1d6 = 0;
MxStillPresenter* bg = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Background_Bitmap");
MxStillPresenter* bgRed = (MxStillPresenter*) FindPresenter("MxStillPresenter", "BackgroundRed_Bitmap");
switch (GameState()->GetUnknown10()) {
case 0:
// bg->Enable(1); // TODO: Uncomment once LegoWorld::FindPresenter and LegoWorld::VTable0x58 are implemented.
InitializeBitmaps();
switch (m_infocenterState->GetUnknown0x74()) {
case 3:
PlayCutscene(e_legoMovie, TRUE);
m_infocenterState->SetUnknown0x74(0);
return;
case 4:
m_infocenterState->SetUnknown0x74(2);
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
m_unk0x1d2 = 1;
}
PlayDialogue(c_letsGetStartedDialogue);
PlayMusic(11);
FUN_10015820(0, 7);
return;
default:
PlayMusic(11);
// TODO // TODO
break;
case 8:
PlayMusic(11);
PlayDialogue(c_exitConfirmationDialogue);
FUN_10015820(0, 7);
return;
case 0xf:
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
m_unk0x1d2 = 1;
}
PlayDialogue(c_clickOnInfomanDialogue);
PlayMusic(11);
FUN_10015820(0, 7);
return;
}
break;
case 1:
// TODO
break;
case 2:
// TODO
break;
default:
m_infocenterState->SetUnknown0x74(11);
FUN_10015820(0, 7);
return;
}
} }
// STUB: LEGO1 0x10070aa0 // STUB: LEGO1 0x1006f9a0
void Infocenter::InitializeBitmaps()
{
// TODO: Infocenter class size is wrong
}
// STUB: LEGO1 0x1006fd00
MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
{
return 1;
}
// FUNCTION: LEGO1 0x1006fda0
MxLong Infocenter::HandleKeyPress(MxS8 p_key)
{
MxLong result = 0;
if (p_key == ' ' && m_worldStarted) {
switch (m_infocenterState->GetUnknown0x74()) {
case 0:
StopCutscene();
m_infocenterState->SetUnknown0x74(1);
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
m_unk0x1d2 = 1;
return 1;
}
break;
case 1:
case 4:
break;
default: {
InfomainScript script = m_currentInfomainScript;
StopCurrentDialogue();
switch (m_infocenterState->GetUnknown0x74()) {
case 5:
case 12:
m_currentInfomainScript = script;
return 1;
default:
m_infocenterState->SetUnknown0x74(2);
return 1;
case 8:
case 11:
break;
}
}
case 13:
StopCredits();
break;
}
result = 1;
}
return result;
}
// STUB: LEGO1 0x1006feb0
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
{
return 1;
}
// STUB: LEGO1 0x10070370
MxU8 Infocenter::HandleNotification17(MxParam&)
{
return 1;
}
// STUB: LEGO1 0x10070870
MxLong Infocenter::HandleNotification0(MxParam&)
{
return 1;
}
// FUNCTION: LEGO1 0x10070aa0
void Infocenter::VTable0x68(MxBool p_add) void Infocenter::VTable0x68(MxBool p_add)
{ {
// TODO LegoWorld::VTable0x68(p_add);
if (p_add) {
InputManager()->SetWorld(this);
SetIsWorldActive(FALSE);
}
else {
if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
}
} }
// STUB: LEGO1 0x10070af0 // STUB: LEGO1 0x10070af0
MxResult Infocenter::Tickle() MxResult Infocenter::Tickle()
{ {
// TODO // TODO
return 0; return LegoWorld::Tickle();
}
// FUNCTION: LEGO1 0x10070c20
void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
{
m_currentCutscene = p_entityId;
VideoManager()->EnableFullScreenMovie(TRUE, p_scale);
InputManager()->SetUnknown336(TRUE);
InputManager()->SetUnknown335(TRUE);
SetAppCursor(0xb); // Hide cursor
VideoManager()->GetDisplaySurface()->ClearScreen();
if (m_currentCutscene != e_noIntro) {
// check if the cutscene is not an ending
if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) {
FUN_10070e90();
}
InvokeAction(Extra::ActionType::e_opendisk, *g_introScript, m_currentCutscene, NULL);
}
}
// FUNCTION: LEGO1 0x10070cb0
void Infocenter::StopCutscene()
{
if (m_currentCutscene != e_noIntro) {
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
}
VideoManager()->EnableFullScreenMovie(FALSE);
InputManager()->SetUnknown335(FALSE);
SetAppCursor(0); // Restore cursor to arrow
FUN_10015820(0, 7);
} }
// FUNCTION: LEGO1 0x10070d00 // FUNCTION: LEGO1 0x10070d00
@ -50,8 +478,79 @@ MxBool Infocenter::VTable0x5c()
return TRUE; return TRUE;
} }
// STUB: LEGO1 0x10070dc0
void Infocenter::FUN_10070dc0(MxBool)
{
}
// STUB: LEGO1 0x10070e90
void Infocenter::FUN_10070e90()
{
}
// STUB: LEGO1 0x10070f60 // STUB: LEGO1 0x10070f60
MxBool Infocenter::VTable0x64() MxBool Infocenter::VTable0x64()
{ {
return FALSE; return FALSE;
} }
// STUB: LEGO1 0x10071030
void Infocenter::StartCredits()
{
// TODO
}
// FUNCTION: LEGO1 0x10071250
void Infocenter::StopCredits()
{
MxDSAction action;
action.SetObjectId(499);
action.SetAtomId(*g_creditsScript);
action.SetUnknown24(-2);
DeleteObject(action);
}
// FUNCTION: LEGO1 0x10071300
void Infocenter::PlayDialogue(InfomainScript p_objectId)
{
MxDSAction action;
action.SetObjectId(p_objectId);
action.SetAtomId(*g_infomainScript);
StopCurrentDialogue();
m_currentInfomainScript = p_objectId;
BackgroundAudioManager()->LowerVolume();
Start(&action);
}
// FUNCTION: LEGO1 0x100713d0
void Infocenter::StopCurrentDialogue()
{
if (m_currentInfomainScript != c_noInfomain) {
MxDSAction action;
action.SetObjectId(m_currentInfomainScript);
action.SetAtomId(*g_infomainScript);
action.SetUnknown24(-2);
DeleteObject(action);
m_currentInfomainScript = c_noInfomain;
}
}
// FUNCTION: LEGO1 0x100714a0
void Infocenter::PlayBookAnimation()
{
MxDSAction action;
action.SetObjectId(c_bookWig);
action.SetAtomId(*g_sndAnimScript);
Start(&action);
}
// FUNCTION: LEGO1 0x10071550
void Infocenter::StopBookAnimation()
{
MxDSAction action;
action.SetObjectId(c_bookWig);
action.SetAtomId(*g_sndAnimScript);
action.SetUnknown24(-2);
DeleteObject(action);
}

View File

@ -6,6 +6,7 @@ DECOMP_SIZE_ASSERT(InfocenterState, 0x94);
InfocenterState::InfocenterState() InfocenterState::InfocenterState()
{ {
// TODO // TODO
memset(m_buffer, 0, sizeof(m_buffer));
} }
// STUB: LEGO1 0x10071920 // STUB: LEGO1 0x10071920

View File

@ -39,9 +39,9 @@ Score::~Score()
} }
// FUNCTION: LEGO1 0x100012a0 // FUNCTION: LEGO1 0x100012a0
MxResult Score::Create(MxDSObject& p_dsObject) MxResult Score::Create(MxDSAction& p_dsAction)
{ {
MxResult result = SetAsCurrentWorld(p_dsObject); MxResult result = LegoWorld::Create(p_dsAction);
if (result == SUCCESS) { if (result == SUCCESS) {
InputManager()->SetWorld(this); InputManager()->SetWorld(this);
@ -76,7 +76,7 @@ MxLong Score::Notify(MxParam& p_param)
{ {
MxLong ret = 0; MxLong ret = 0;
LegoWorld::Notify(p_param); LegoWorld::Notify(p_param);
if (m_unk0xf6) { if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) { switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationStartAction: case c_notificationStartAction:
ret = 1; ret = 1;
@ -90,10 +90,10 @@ MxLong Score::Notify(MxParam& p_param)
DeleteScript(); // Shutting down DeleteScript(); // Shutting down
ret = 1; ret = 1;
break; break;
case TYPE17: case c_notificationType17:
ret = FUN_100016d0((MxType17NotificationParam&) p_param); ret = FUN_100016d0((MxType17NotificationParam&) p_param);
break; break;
case MXTRANSITIONMANAGER_TRANSITIONENDED: case c_notificationTransitioned:
DeleteObjects(g_infoscorScript, 7, 9); DeleteObjects(g_infoscorScript, 7, 9);
if (m_unk0xf8) if (m_unk0xf8)
GameState()->HandleAction(m_unk0xf8); GameState()->HandleAction(m_unk0xf8);
@ -116,7 +116,7 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param)
switch (action->GetObjectId()) { switch (action->GetObjectId()) {
case 10: case 10:
m_unk0xf8 = 0x38; m_unk0xf8 = 0x38;
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 0x32, 0, 0);
break; break;
case 0x1f5: case 0x1f5:
PlayMusic(11); PlayMusic(11);
@ -128,9 +128,9 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param)
} }
// FUNCTION: LEGO1 0x10001580 // FUNCTION: LEGO1 0x10001580
void Score::Stop() void Score::VTable0x50()
{ {
LegoWorld::Stop(); LegoWorld::VTable0x50();
MxDSAction action; MxDSAction action;
action.SetObjectId(0x1f4); action.SetObjectId(0x1f4);
@ -160,12 +160,12 @@ MxLong Score::FUN_100016d0(MxType17NotificationParam& p_param)
case 1: case 1:
m_unk0xf8 = 2; m_unk0xf8 = 2;
DeleteScript(); DeleteScript();
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 0x32, 0, 0);
break; break;
case 2: case 2:
m_unk0xf8 = 3; m_unk0xf8 = 3;
DeleteScript(); DeleteScript();
TransitionManager()->StartTransition(MxTransitionManager::PIXELATION, 0x32, 0, 0); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 0x32, 0, 0);
break; break;
case 3: { case 3: {
LegoInputManager* im = InputManager(); LegoInputManager* im = InputManager();

View File

@ -26,7 +26,7 @@ Isle::Isle()
m_helicopter = NULL; m_helicopter = NULL;
m_bike = NULL; m_bike = NULL;
m_dunebuggy = NULL; m_dunebuggy = NULL;
m_motorcycle = NULL; m_motocycle = NULL;
m_skateboard = NULL; m_skateboard = NULL;
m_racecar = NULL; m_racecar = NULL;
m_jetski = NULL; m_jetski = NULL;
@ -54,11 +54,11 @@ Isle::~Isle()
} }
// FUNCTION: LEGO1 0x10030b20 // FUNCTION: LEGO1 0x10030b20
MxResult Isle::Create(MxDSObject& p_dsObject) MxResult Isle::Create(MxDSAction& p_dsAction)
{ {
GameState()->FUN_1003ceb0(); GameState()->FUN_1003ceb0();
MxResult result = LegoWorld::SetAsCurrentWorld(p_dsObject); MxResult result = LegoWorld::Create(p_dsAction);
if (result == SUCCESS) { if (result == SUCCESS) {
ControlManager()->Register(this); ControlManager()->Register(this);
InputManager()->SetWorld(this); InputManager()->SetWorld(this);
@ -99,7 +99,7 @@ MxLong Isle::Notify(MxParam& p_param)
MxLong result = 0; MxLong result = 0;
LegoWorld::Notify(p_param); LegoWorld::Notify(p_param);
if (m_unk0xf6) { if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) { switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationEndAction: case c_notificationEndAction:
result = StopAction(p_param); result = StopAction(p_param);
@ -115,10 +115,10 @@ MxLong Isle::Notify(MxParam& p_param)
break; break;
} }
break; break;
case TYPE17: case c_notificationType17:
result = HandleType17Notification(p_param); result = HandleType17Notification(p_param);
break; break;
case TYPE18: case c_notificationType18:
switch (m_act1state->GetUnknown18()) { switch (m_act1state->GetUnknown18()) {
case 4: case 4:
result = GetCurrentVehicle()->Notify(p_param); result = GetCurrentVehicle()->Notify(p_param);
@ -131,13 +131,13 @@ MxLong Isle::Notify(MxParam& p_param)
break; break;
} }
break; break;
case TYPE19: case c_notificationType19:
result = HandleType19Notification(p_param); result = HandleType19Notification(p_param);
break; break;
case TYPE20: case c_notificationType20:
VTable0x68(TRUE); VTable0x68(TRUE);
break; break;
case MXTRANSITIONMANAGER_TRANSITIONENDED: case c_notificationTransitioned:
result = HandleTransitionEnd(); result = HandleTransitionEnd();
break; break;
} }
@ -152,10 +152,22 @@ MxLong Isle::StopAction(MxParam& p_param)
return 0; return 0;
} }
// STUB: LEGO1 0x10030fc0 // FUNCTION: LEGO1 0x10030fc0
void Isle::Stop() void Isle::VTable0x50()
{ {
// TODO LegoWorld::VTable0x50();
if (m_act1state->GetUnknown21()) {
GameState()->HandleAction(2);
m_act1state->SetUnknown18(0);
m_act1state->SetUnknown21(0);
}
else if (GameState()->GetCurrentAct()) {
FUN_1003ef00(TRUE);
FUN_10032620();
m_act1state->FUN_10034d00();
FUN_10015820(0, 7);
}
} }
// STUB: LGEO1 0x10031030 // STUB: LGEO1 0x10031030
@ -176,6 +188,12 @@ void Isle::VTable0x68(MxBool p_add)
// TODO // TODO
} }
// STUB: LEGO1 0x10032620
void Isle::FUN_10032620()
{
// TODO
}
// STUB: LEGO1 0x100327a0 // STUB: LEGO1 0x100327a0
MxLong Isle::HandleTransitionEnd() MxLong Isle::HandleTransitionEnd()
{ {
@ -212,7 +230,7 @@ void Isle::VTable0x58(MxCore* p_object)
m_dunebuggy = (DuneBuggy*) p_object; m_dunebuggy = (DuneBuggy*) p_object;
} }
else if (p_object->IsA("Motorcycle")) { else if (p_object->IsA("Motorcycle")) {
m_motorcycle = (Motorcycle*) p_object; m_motocycle = (Motocycle*) p_object;
} }
else if (p_object->IsA("SkateBoard")) { else if (p_object->IsA("SkateBoard")) {
m_skateboard = (SkateBoard*) p_object; m_skateboard = (SkateBoard*) p_object;

View File

@ -12,9 +12,16 @@ IslePathActor::IslePathActor()
} }
// FUNCTION: LEGO1 0x1001a280 // FUNCTION: LEGO1 0x1001a280
MxResult IslePathActor::Create(MxDSObject& p_dsObject) MxResult IslePathActor::Create(MxDSAction& p_dsAction)
{ {
return MxEntity::Create(p_dsObject); return MxEntity::Create(p_dsAction);
}
// FUNCTION: LEGO1 0x1001a2a0
void IslePathActor::Destroy(MxBool p_fromDestructor)
{
if (!p_fromDestructor)
LegoPathActor::Destroy(FALSE);
} }
// STUB: LEGO1 0x1001a350 // STUB: LEGO1 0x1001a350

View File

@ -1,9 +1,9 @@
#include "motorcycle.h" #include "motocycle.h"
DECOMP_SIZE_ASSERT(Motorcycle, 0x16c); DECOMP_SIZE_ASSERT(Motocycle, 0x16c);
// FUNCTION: LEGO1 0x100357b0 // FUNCTION: LEGO1 0x100357b0
Motorcycle::Motorcycle() Motocycle::Motocycle()
{ {
this->m_unk0x13c = 40.0; this->m_unk0x13c = 40.0;
this->m_unk0x150 = 1.75; this->m_unk0x150 = 1.75;

View File

@ -23,6 +23,7 @@
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(LegoWorldList, 0x18); DECOMP_SIZE_ASSERT(LegoWorldList, 0x18);
DECOMP_SIZE_ASSERT(LegoWorldListCursor, 0x10);
// GLOBAL: LEGO1 0x100f451c // GLOBAL: LEGO1 0x100f451c
MxAtomId* g_copterScript = NULL; MxAtomId* g_copterScript = NULL;
@ -99,7 +100,7 @@ MxAtomId* g_testScript = NULL;
// GLOBAL: LEGO1 0x100f457c // GLOBAL: LEGO1 0x100f457c
MxAtomId* g_jukeboxwScript = NULL; MxAtomId* g_jukeboxwScript = NULL;
// GLOBAL: LEGO1 0x100f4580c // GLOBAL: LEGO1 0x100f4580
MxAtomId* g_sndAnimScript = NULL; MxAtomId* g_sndAnimScript = NULL;
// GLOBAL: LEGO1 0x100f4584 // GLOBAL: LEGO1 0x100f4584
@ -109,6 +110,7 @@ MxAtomId* g_creditsScript = NULL;
MxAtomId* g_nocdSourceName = NULL; MxAtomId* g_nocdSourceName = NULL;
// GLOBAL: LEGO1 0x100f6718 // GLOBAL: LEGO1 0x100f6718
// STRING: LEGO1 0x100f6710
const char* g_current = "current"; const char* g_current = "current";
// GLOBAL: LEGO1 0x100f4c58 // GLOBAL: LEGO1 0x100f4c58
@ -117,7 +119,7 @@ MxBool g_isWorldActive = TRUE;
// FUNCTION: LEGO1 0x10015700 // FUNCTION: LEGO1 0x10015700
LegoOmni* Lego() LegoOmni* Lego()
{ {
return (LegoOmni*) MxOmni::GetInstance(); return LegoOmni::GetInstance();
} }
// FUNCTION: LEGO1 0x10015710 // FUNCTION: LEGO1 0x10015710
@ -180,6 +182,12 @@ LegoWorld* GetCurrentWorld()
return LegoOmni::GetInstance()->GetCurrentOmniWorld(); return LegoOmni::GetInstance()->GetCurrentOmniWorld();
} }
// FUNCTION: LEGO1 0x100157b0
LegoUnkSaveDataWriter* GetUnkSaveDataWriter()
{
return LegoOmni::GetInstance()->GetUnkSaveDataWriter();
}
// FUNCTION: LEGO1 0x100157e0 // FUNCTION: LEGO1 0x100157e0
LegoPlantManager* PlantManager() LegoPlantManager* PlantManager()
{ {
@ -204,6 +212,12 @@ void FUN_10015820(MxU32, MxU32)
// TODO // TODO
} }
// STUB: LEGO1 0x10015860
void FUN_10015860(const char*, MxU8)
{
// TODO
}
// FUNCTION: LEGO1 0x100158c0 // FUNCTION: LEGO1 0x100158c0
LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid) LegoEntity* FindEntityByAtomIdOrEntityId(const MxAtomId& p_atom, MxS32 p_entityid)
{ {
@ -216,6 +230,12 @@ MxDSAction& GetCurrentAction()
return LegoOmni::GetInstance()->GetCurrentAction(); return LegoOmni::GetInstance()->GetCurrentAction();
} }
// FUNCTION: LEGO1 0x100158f0
void SetCurrentWorld(LegoWorld* p_world)
{
LegoOmni::GetInstance()->SetWorld(p_world);
}
// FUNCTION: LEGO1 0x10015900 // FUNCTION: LEGO1 0x10015900
MxTransitionManager* TransitionManager() MxTransitionManager* TransitionManager()
{ {
@ -241,6 +261,20 @@ void SetIsWorldActive(MxBool p_isWorldActive)
g_isWorldActive = p_isWorldActive; g_isWorldActive = p_isWorldActive;
} }
// FUNCTION: LEGO1 0x100159e0
void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last)
{
MxDSAction action;
action.SetAtomId(*p_id);
action.SetUnknown24(-2);
for (MxS32 first = p_first, last = p_last; first <= last; first++) {
action.SetObjectId(first);
DeleteObject(action);
}
}
// STUB: LEGO1 0x1001a700 // STUB: LEGO1 0x1001a700
void FUN_1001a700() void FUN_1001a700()
{ {
@ -265,34 +299,34 @@ LegoEntity* PickEntity(MxLong, MxLong)
// FUNCTION: LEGO1 0x100528e0 // FUNCTION: LEGO1 0x100528e0
void RegisterScripts() void RegisterScripts()
{ {
g_copterScript = new MxAtomId("\\lego\\scripts\\build\\copter", LookupMode_LowerCase2); g_copterScript = new MxAtomId("\\lego\\scripts\\build\\copter", e_lowerCase2);
g_dunecarScript = new MxAtomId("\\lego\\scripts\\build\\dunecar", LookupMode_LowerCase2); g_dunecarScript = new MxAtomId("\\lego\\scripts\\build\\dunecar", e_lowerCase2);
g_jetskiScript = new MxAtomId("\\lego\\scripts\\build\\jetski", LookupMode_LowerCase2); g_jetskiScript = new MxAtomId("\\lego\\scripts\\build\\jetski", e_lowerCase2);
g_racecarScript = new MxAtomId("\\lego\\scripts\\build\\racecar", LookupMode_LowerCase2); g_racecarScript = new MxAtomId("\\lego\\scripts\\build\\racecar", e_lowerCase2);
g_carraceScript = new MxAtomId("\\lego\\scripts\\race\\carrace", LookupMode_LowerCase2); g_carraceScript = new MxAtomId("\\lego\\scripts\\race\\carrace", e_lowerCase2);
g_carracerScript = new MxAtomId("\\lego\\scripts\\race\\carracer", LookupMode_LowerCase2); g_carracerScript = new MxAtomId("\\lego\\scripts\\race\\carracer", e_lowerCase2);
g_jetraceScript = new MxAtomId("\\lego\\scripts\\race\\jetrace", LookupMode_LowerCase2); g_jetraceScript = new MxAtomId("\\lego\\scripts\\race\\jetrace", e_lowerCase2);
g_jetracerScript = new MxAtomId("\\lego\\scripts\\race\\jetracer", LookupMode_LowerCase2); g_jetracerScript = new MxAtomId("\\lego\\scripts\\race\\jetracer", e_lowerCase2);
g_isleScript = new MxAtomId("\\lego\\scripts\\isle\\isle", LookupMode_LowerCase2); g_isleScript = new MxAtomId("\\lego\\scripts\\isle\\isle", e_lowerCase2);
g_elevbottScript = new MxAtomId("\\lego\\scripts\\infocntr\\elevbott", LookupMode_LowerCase2); g_elevbottScript = new MxAtomId("\\lego\\scripts\\infocntr\\elevbott", e_lowerCase2);
g_infodoorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infodoor", LookupMode_LowerCase2); g_infodoorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infodoor", e_lowerCase2);
g_infomainScript = new MxAtomId("\\lego\\scripts\\infocntr\\infomain", LookupMode_LowerCase2); g_infomainScript = new MxAtomId("\\lego\\scripts\\infocntr\\infomain", e_lowerCase2);
g_infoscorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infoscor", LookupMode_LowerCase2); g_infoscorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infoscor", e_lowerCase2);
g_regbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\regbook", LookupMode_LowerCase2); g_regbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\regbook", e_lowerCase2);
g_histbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\histbook", LookupMode_LowerCase2); g_histbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\histbook", e_lowerCase2);
g_hospitalScript = new MxAtomId("\\lego\\scripts\\hospital\\hospital", LookupMode_LowerCase2); g_hospitalScript = new MxAtomId("\\lego\\scripts\\hospital\\hospital", e_lowerCase2);
g_policeScript = new MxAtomId("\\lego\\scripts\\police\\police", LookupMode_LowerCase2); g_policeScript = new MxAtomId("\\lego\\scripts\\police\\police", e_lowerCase2);
g_garageScript = new MxAtomId("\\lego\\scripts\\garage\\garage", LookupMode_LowerCase2); g_garageScript = new MxAtomId("\\lego\\scripts\\garage\\garage", e_lowerCase2);
g_act2mainScript = new MxAtomId("\\lego\\scripts\\act2\\act2main", LookupMode_LowerCase2); g_act2mainScript = new MxAtomId("\\lego\\scripts\\act2\\act2main", e_lowerCase2);
g_act3Script = new MxAtomId("\\lego\\scripts\\act3\\act3", LookupMode_LowerCase2); g_act3Script = new MxAtomId("\\lego\\scripts\\act3\\act3", e_lowerCase2);
g_jukeboxScript = new MxAtomId("\\lego\\scripts\\isle\\jukebox", LookupMode_LowerCase2); g_jukeboxScript = new MxAtomId("\\lego\\scripts\\isle\\jukebox", e_lowerCase2);
g_pz5Script = new MxAtomId("\\lego\\scripts\\isle\\pz5", LookupMode_LowerCase2); g_pz5Script = new MxAtomId("\\lego\\scripts\\isle\\pz5", e_lowerCase2);
g_introScript = new MxAtomId("\\lego\\scripts\\intro", LookupMode_LowerCase2); g_introScript = new MxAtomId("\\lego\\scripts\\intro", e_lowerCase2);
g_testScript = new MxAtomId("\\lego\\scripts\\test\\test", LookupMode_LowerCase2); g_testScript = new MxAtomId("\\lego\\scripts\\test\\test", e_lowerCase2);
g_jukeboxwScript = new MxAtomId("\\lego\\scripts\\isle\\jukeboxw", LookupMode_LowerCase2); g_jukeboxwScript = new MxAtomId("\\lego\\scripts\\isle\\jukeboxw", e_lowerCase2);
g_sndAnimScript = new MxAtomId("\\lego\\scripts\\sndanim", LookupMode_LowerCase2); g_sndAnimScript = new MxAtomId("\\lego\\scripts\\sndanim", e_lowerCase2);
g_creditsScript = new MxAtomId("\\lego\\scripts\\credits", LookupMode_LowerCase2); g_creditsScript = new MxAtomId("\\lego\\scripts\\credits", e_lowerCase2);
g_nocdSourceName = new MxAtomId("\\lego\\scripts\\nocd", LookupMode_LowerCase2); g_nocdSourceName = new MxAtomId("\\lego\\scripts\\nocd", e_lowerCase2);
} }
// FUNCTION: LEGO1 0x100530c0 // FUNCTION: LEGO1 0x100530c0
@ -577,10 +611,20 @@ void LegoOmni::RemoveWorld(const MxAtomId&, MxLong)
// TODO // TODO
} }
// STUB: LEGO1 0x1005b0c0 // FUNCTION: LEGO1 0x1005b0c0
LegoEntity* LegoOmni::FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid) LegoEntity* LegoOmni::FindByEntityIdOrAtomId(const MxAtomId& p_atom, MxS32 p_entityid)
{ {
// TODO if (m_worldList) {
LegoWorld* world;
LegoWorldListCursor cursor(m_worldList);
while (cursor.Next(world)) {
if ((p_entityid == -1 || world->GetEntityId() == p_entityid) &&
(!p_atom.GetInternal() || world->GetAtom() == p_atom))
return world;
}
}
return NULL; return NULL;
} }
@ -595,7 +639,7 @@ MxEntity* LegoOmni::FindWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p
{ {
LegoWorld* foundEntity = NULL; LegoWorld* foundEntity = NULL;
if (strcmpi(p_id, g_current)) { if (strcmpi(p_id, g_current)) {
foundEntity = (LegoWorld*) FindByEntityIdOrAtomId(MxAtomId(p_id, LookupMode_LowerCase2), p_entityId); foundEntity = (LegoWorld*) FindByEntityIdOrAtomId(MxAtomId(p_id, e_lowerCase2), p_entityId);
} }
else { else {
foundEntity = this->m_currentWorld; foundEntity = this->m_currentWorld;
@ -687,7 +731,7 @@ MxLong LegoOmni::Notify(MxParam& p_param)
MxLong result = MxOmni::Notify(p_param); MxLong result = MxOmni::Notify(p_param);
if (isCD) { if (isCD) {
// Exit the game if nocd.si ended // Exit the game if nocd.si ended
PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); CloseMainWindow();
} }
return result; return result;
@ -706,9 +750,3 @@ void LegoOmni::StopTimer()
MxOmni::StopTimer(); MxOmni::StopTimer();
SetAppCursor(0); SetAppCursor(0);
} }
// FUNCTION: LEGO1 0x100acf50
MxResult Start(MxDSAction* p_dsAction)
{
return MxOmni::GetInstance()->Start(p_dsAction);
}

View File

@ -17,13 +17,19 @@ void LegoPathPresenter::Init()
{ {
} }
// FUNCTION: LEGO1 0x10044ac0
LegoPathPresenter::~LegoPathPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x10044b40 // FUNCTION: LEGO1 0x10044b40
MxResult LegoPathPresenter::AddToManager() MxResult LegoPathPresenter::AddToManager()
{ {
MxResult status = FAILURE; MxResult status = FAILURE;
if (VideoManager()) { if (VideoManager()) {
VideoManager()->AddPresenter(*this); VideoManager()->RegisterPresenter(*this);
status = SUCCESS; status = SUCCESS;
} }
@ -34,7 +40,7 @@ MxResult LegoPathPresenter::AddToManager()
void LegoPathPresenter::Destroy(MxBool p_fromDestructor) void LegoPathPresenter::Destroy(MxBool p_fromDestructor)
{ {
if (VideoManager()) if (VideoManager())
VideoManager()->RemovePresenter(*this); VideoManager()->UnregisterPresenter(*this);
{ {
MxAutoLocker lock(&this->m_criticalSection); MxAutoLocker lock(&this->m_criticalSection);
@ -51,6 +57,27 @@ void LegoPathPresenter::Destroy()
Destroy(FALSE); Destroy(FALSE);
} }
// STUB: LEGO1 0x10044c20
void LegoPathPresenter::ReadyTickle()
{
// TODO
ProgressTickleState(e_starting); // Allow initialization process to continue
}
// FUNCTION: LEGO1 0x10044d00
void LegoPathPresenter::StreamingTickle()
{
MxStreamChunk* chunk = m_subscriber->NextChunk();
if (chunk) {
if (chunk->GetFlags() & MxStreamChunk::c_end) {
ProgressTickleState(e_repeating);
}
m_subscriber->DestroyChunk(chunk);
}
}
// FUNCTION: LEGO1 0x10044d40 // FUNCTION: LEGO1 0x10044d40
void LegoPathPresenter::RepeatingTickle() void LegoPathPresenter::RepeatingTickle()
{ {

View File

@ -21,6 +21,11 @@ LegoAnimationManager::~LegoAnimationManager()
// TODO // TODO
} }
// STUB: LEGO1 0x1005ef10
void LegoAnimationManager::FUN_1005ef10()
{
}
// STUB: LEGO1 0x1005f130 // STUB: LEGO1 0x1005f130
void LegoAnimationManager::Init() void LegoAnimationManager::Init()
{ {
@ -33,6 +38,12 @@ void LegoAnimationManager::FUN_1005f6d0(MxBool)
// TODO // TODO
} }
// STUB: LEGO1 0x1005f720
void LegoAnimationManager::FUN_1005f720(undefined4)
{
// TODO
}
// STUB: LEGO1 0x100619f0 // STUB: LEGO1 0x100619f0
MxLong LegoAnimationManager::Notify(MxParam& p_param) MxLong LegoAnimationManager::Notify(MxParam& p_param)
{ {

View File

@ -1,13 +1,243 @@
#include "legoanimpresenter.h" #include "legoanimpresenter.h"
// STUB: LEGO1 0x10068420 #include "legoomni.h"
#include "legostream.h"
#include "legoworld.h"
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxstreamchunk.h"
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xc0)
DECOMP_SIZE_ASSERT(LegoAnimClassBase, 0x08)
DECOMP_SIZE_ASSERT(LegoAnimClass, 0x18)
// FUNCTION: LEGO1 0x10068420
LegoAnimPresenter::LegoAnimPresenter() LegoAnimPresenter::LegoAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x10068670
LegoAnimPresenter::~LegoAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100686f0
void LegoAnimPresenter::Init()
{
m_unk0x64 = NULL;
m_unk0x68 = 0;
m_unk0x6c = 0;
m_unk0x74 = 0;
m_unk0x70 = 0;
m_unk0x78 = 0;
m_unk0x7c = 0;
m_unk0xa8.Clear();
m_unk0xa4 = 0;
m_currentWorld = NULL;
m_unk0x95 = 0;
m_unk0x88 = -1;
m_unk0x98 = 0;
m_animAtom.Clear();
m_unk0x9c = 0;
m_unk0x8c = 0;
m_unk0x90 = 0;
m_unk0x94 = 0;
m_unk0x96 = 1;
m_unk0xa0 = 0;
}
// STUB: LEGO1 0x10068770
void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
{
// TODO
MxVideoPresenter::Destroy(p_fromDestructor);
}
// FUNCTION: LEGO1 0x10068fb0
MxResult LegoAnimPresenter::VTable0x88(MxStreamChunk* p_chunk)
{
MxResult result = FAILURE;
LegoMemoryStream stream((char*) p_chunk->GetData());
MxS32 magicSig;
MxS32 val2 = 0;
MxS32 val3;
if (stream.Read(&magicSig, sizeof(MxS32)) == SUCCESS && magicSig == 0x11) {
if (stream.Read(&m_unk0xa4, sizeof(MxU32)) == SUCCESS) {
if (stream.Read(&m_unk0xa8[0], sizeof(float)) == SUCCESS) {
if (stream.Read(&m_unk0xa8[1], sizeof(float)) == SUCCESS) {
if (stream.Read(&m_unk0xa8[2], sizeof(float)) == SUCCESS) {
if (stream.Read(&val2, sizeof(MxS32)) == SUCCESS) {
if (stream.Read(&val3, sizeof(MxS32)) == SUCCESS) {
m_unk0x64 = new LegoAnimClass();
if (m_unk0x64) {
if (m_unk0x64->VTable0x10(&stream, val2) == SUCCESS) {
result = SUCCESS;
}
}
}
}
}
}
}
}
}
if (result != SUCCESS) {
delete m_unk0x64;
Init();
}
return result;
}
// STUB: LEGO1 0x1006ad30
void LegoAnimPresenter::PutFrame()
{ {
// TODO // TODO
} }
// STUB: LEGO1 0x100686f0 // FUNCTION: LEGO1 0x1006b550
void LegoAnimPresenter::Init() void LegoAnimPresenter::ReadyTickle()
{
m_currentWorld = GetCurrentWorld();
if (m_currentWorld) {
MxStreamChunk* chunk = m_subscriber->CurrentChunk();
if (chunk && chunk->GetTime() + m_action->GetStartTime() <= m_action->GetElapsedTime()) {
chunk = m_subscriber->NextChunk();
MxResult result = VTable0x88(chunk);
m_subscriber->DestroyChunk(chunk);
if (result == SUCCESS) {
ProgressTickleState(e_starting);
ParseExtra();
}
else {
EndAction();
}
}
}
}
// STUB: LEGO1 0x1006b5e0
void LegoAnimPresenter::StartingTickle()
{
// TODO
ProgressTickleState(e_streaming);
EndAction(); // Allow game to start
}
// FUNCTION: LEGO1 0x1006b840
void LegoAnimPresenter::StreamingTickle()
{
if (m_subscriber->CurrentChunk()) {
MxStreamChunk* chunk = m_subscriber->NextChunk();
m_subscriber->DestroyChunk(chunk);
}
if (m_unk0x95 == 0) {
if (m_unk0x64->m_unk0x8 + m_action->GetStartTime() < m_action->GetElapsedTime()) {
m_unk0x95 = 1;
}
}
else {
ProgressTickleState(e_done);
if (m_compositePresenter) {
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_compositePresenter->VTable0x60(this);
}
}
}
}
// FUNCTION: LEGO1 0x1006b8e0
void LegoAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// STUB: LEGO1 0x1006bac0
void LegoAnimPresenter::ParseExtra()
{
// TODO
}
// FUNCTION: LEGO1 0x1006c620
MxResult LegoAnimPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxResult result = MxVideoPresenter::StartAction(p_controller, p_action);
m_displayZ = 0;
return result;
}
// STUB: LEGO1 0x1006c640
void LegoAnimPresenter::EndAction()
{
// TODO
MxVideoPresenter::EndAction();
}
// FUNCTION: LEGO1 0x10099dd0
LegoAnimClassBase::LegoAnimClassBase()
{
m_unk0x4 = 0;
}
// STUB: LEGO1 0x10099e00
LegoAnimClassBase::~LegoAnimClassBase()
{
// TODO
}
// STUB: LEGO1 0x10099e20
void LegoAnimClassBase::VTable0x4()
{
}
// STUB: LEGO1 0x10099e40
void LegoAnimClassBase::VTable0x8()
{
}
// STUB: LEGO1 0x10099f70
void LegoAnimClassBase::VTable0xc()
{
}
// FUNCTION: LEGO1 0x100a0b30
LegoAnimClass::LegoAnimClass()
{
m_unk0x8 = 0;
m_unk0xc = 0;
m_unk0x10 = 0;
m_unk0x14 = 0;
}
// STUB: LEGO1 0x100a0bc0
LegoAnimClass::~LegoAnimClass()
{
// TODO
}
// STUB: LEGO1 0x100a0c70
MxResult LegoAnimClass::VTable0x10(LegoMemoryStream* p_stream, MxS32)
{
return SUCCESS;
}
// STUB: LEGO1 0x100a0e30
void LegoAnimClass::VTable0x8()
{
// TODO
}
// STUB: LEGO1 0x100a1040
void LegoAnimClass::VTable0xc()
{ {
// TODO // TODO
} }

View File

@ -1,12 +1,43 @@
#include "legohideanimpresenter.h" #include "legohideanimpresenter.h"
DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4)
// FUNCTION: LEGO1 0x1006d7e0 // FUNCTION: LEGO1 0x1006d7e0
LegoHideAnimPresenter::LegoHideAnimPresenter() LegoHideAnimPresenter::LegoHideAnimPresenter()
{ {
Init(); Init();
} }
// STUB: LEGO1 0x1006da50 // FUNCTION: LEGO1 0x1006d9f0
LegoHideAnimPresenter::~LegoHideAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1006da50
void LegoHideAnimPresenter::Init() void LegoHideAnimPresenter::Init()
{ {
m_unk0xc0 = NULL;
}
// FUNCTION: LEGO1 0x1006da60
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
if (m_unk0xc0)
delete m_unk0xc0;
Init();
m_criticalSection.Leave();
// This appears to be a bug, since it results in an endless loop
if (!p_fromDestructor)
LegoHideAnimPresenter::Destroy();
}
// FUNCTION: LEGO1 0x1006dac0
void LegoHideAnimPresenter::Destroy()
{
Destroy(FALSE);
} }

View File

@ -1,6 +1,126 @@
#include "legometerpresenter.h" #include "legometerpresenter.h"
#include "decomp.h" #include "decomp.h"
#include "mxbitmap.h"
#include "mxutil.h"
// Uncomment when member class variables are fleshed out. DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94)
// DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94); // 0x1000a163
// GLOBAL: LEGO1 0x1010207c
// STRING: LEGO1 0x10101fb4
const char* g_filterIndex = "FILTER_INDEX";
// GLOBAL: LEGO1 0x10102094
// STRING: LEGO1 0x10101f70
const char* g_type = "TYPE";
// GLOBAL: LEGO1 0x10102088
// STRING: LEGO1 0x10101f94
const char* g_leftToRight = "LEFT_TO_RIGHT";
// GLOBAL: LEGO1 0x101020ac
// STRING: LEGO1 0x10101f28
const char* g_rightToLeft = "RIGHT_TO_LEFT";
// GLOBAL: LEGO1 0x1010205c
// STRING: LEGO1 0x10102000
const char* g_bottomToTop = "BOTTOM_TO_TOP";
// GLOBAL: LEGO1 0x101020c0
// STRING: LEGO1 0x10101f00
const char* g_topToBottom = "TOP_TO_BOTTOM";
// GLOBAL: LEGO1 0x101020c8
// STRING: LEGO1 0x10101ee4
const char* g_variable = "VARIABLE";
// FUNCTION: LEGO1 0x10043430
LegoMeterPresenter::LegoMeterPresenter()
{
m_layout = 0;
m_unk0x6c = 0;
m_unk0x84 = 0;
m_type = 1;
m_flags &= ~c_bit2;
}
// FUNCTION: LEGO1 0x10043780
LegoMeterPresenter::~LegoMeterPresenter()
{
delete m_unk0x6c;
}
// FUNCTION: LEGO1 0x10043800
void LegoMeterPresenter::ParseExtra()
{
char buffer[256];
MxStillPresenter::ParseExtra();
*((MxU16*) &buffer[0]) = m_action->GetExtraLength();
char* extraData = m_action->GetExtraData();
if (*((MxU16*) &buffer[0])) {
MxU16 len = *((MxU16*) &buffer[0]);
memcpy(buffer, extraData, len);
buffer[len] = '\0';
char result[256];
if (KeyValueStringParse(buffer, g_type, result)) {
if (!strcmpi(result, g_leftToRight)) {
m_layout = 0;
}
else if (!strcmpi(result, g_rightToLeft)) {
m_layout = 1;
}
else if (!strcmpi(result, g_bottomToTop)) {
m_layout = 2;
}
else if (!strcmpi(result, g_topToBottom)) {
m_layout = 3;
}
}
if (KeyValueStringParse(buffer, g_filterIndex, result)) {
m_type = atoi(result);
}
if (KeyValueStringParse(buffer, g_variable, result)) {
m_variable = result;
}
else {
EndAction();
}
}
else {
EndAction();
}
}
// FUNCTION: LEGO1 0x10043990
void LegoMeterPresenter::StreamingTickle()
{
MxStillPresenter::StreamingTickle();
m_unk0x6c = new MxU8[m_bitmap->GetBmiStride() * m_bitmap->GetBmiHeightAbs()];
if (m_unk0x6c == NULL) {
EndAction();
}
memcpy(m_unk0x6c, m_bitmap->GetBitmapData(), m_bitmap->GetBmiStride() * m_bitmap->GetBmiHeightAbs());
m_unk0x88 = 0;
m_unk0x8a = 0;
m_unk0x8c = m_bitmap->GetBmiWidth() - 1;
m_unk0x8e = m_bitmap->GetBmiHeightAbs() - 1;
}
// FUNCTION: LEGO1 0x10043a30
void LegoMeterPresenter::RepeatingTickle()
{
FUN_10043a50();
MxStillPresenter::RepeatingTickle();
}
// STUB: LEGO1 0x10043a50
void LegoMeterPresenter::FUN_10043a50()
{
}

View File

@ -15,16 +15,23 @@ void LegoModelPresenter::configureLegoModelPresenter(MxS32 p_modelPresenterConfi
g_modelPresenterConfig = p_modelPresenterConfig; g_modelPresenterConfig = p_modelPresenterConfig;
} }
// STUB: LEGO1 0x1007f670 // FUNCTION: LEGO1 0x1007f670
void LegoModelPresenter::Destroy(MxBool p_fromDestructor) void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
{ {
// TODO m_criticalSection.Enter();
m_unk0x64 = 0;
m_addedToView = FALSE;
m_criticalSection.Leave();
if (!p_fromDestructor) {
MxVideoPresenter::Destroy(FALSE);
}
} }
// STUB: LEGO1 0x10080050 // STUB: LEGO1 0x10080050
void LegoModelPresenter::ReadyTickle() void LegoModelPresenter::ReadyTickle()
{ {
// TODO // TODO
SetTickleState(e_starting);
} }
// STUB: LEGO1 0x100801b0 // STUB: LEGO1 0x100801b0

View File

@ -49,12 +49,13 @@ void LegoPalettePresenter::Destroy()
MxResult LegoPalettePresenter::ParsePalette(MxStreamChunk* p_chunk) MxResult LegoPalettePresenter::ParsePalette(MxStreamChunk* p_chunk)
{ {
MxU8 buffer[40]; MxU8 buffer[40];
RGBQUAD palleteData[256]; RGBQUAD palette[256];
MxResult result = FAILURE; MxResult result = FAILURE;
LegoMemoryStream stream((char*) p_chunk->GetData()); LegoMemoryStream stream((char*) p_chunk->GetData());
if (stream.Read(buffer, 40) == SUCCESS) { if (stream.Read(buffer, sizeof(buffer)) == SUCCESS) {
if (stream.Read(palleteData, sizeof(RGBQUAD) * 256) == SUCCESS) { if (stream.Read(palette, sizeof(palette)) == SUCCESS) {
m_palette = new MxPalette(palleteData); m_palette = new MxPalette(palette);
if (m_palette) { if (m_palette) {
result = SUCCESS; result = SUCCESS;
} }
@ -76,8 +77,8 @@ void LegoPalettePresenter::ReadyTickle()
if (chunk) { if (chunk) {
if (chunk->GetTime() <= m_action->GetElapsedTime()) { if (chunk->GetTime() <= m_action->GetElapsedTime()) {
ParseExtra(); ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; ProgressTickleState(e_starting);
m_currentTickleState = TickleState_Starting;
chunk = m_subscriber->NextChunk(); chunk = m_subscriber->NextChunk();
MxResult result = ParsePalette(chunk); MxResult result = ParsePalette(chunk);
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);

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