Compare commits

223 Commits

Author SHA1 Message Date
Fabian Neundorf
33c4d1fdcb Clear unknowns in LegoGameState (#1670) 2025-08-08 12:32:37 -07:00
Fabian Neundorf
3d6ab8ff9d Name g_plantInfo indices in act2actor.cpp (#1669) 2025-08-08 12:31:39 -07:00
MS
2fc48b620e Dead code in MxBackgroundAudioManager (#1668)
* Dead code in MxBackgroundAudioManager

* Rename
2025-08-06 14:23:48 -04:00
MS
48b922d8f0 Add dead code from LegoCacheSound (#1667)
* Dead code from LegoCacheSound

* Use windef.h typedefs
2025-08-05 22:57:17 -04:00
Fabian Neundorf
f381d692d0 Clear unknowns in Act3List and Act3ListElement (#1666) 2025-08-04 20:52:19 +02:00
Fabian Neundorf
67695b5233 Clear unknowns in Act3State (#1665) 2025-08-03 19:17:17 -07:00
Fabian Neundorf
1e9c0a95df Clear unknowns in Act1State (#1664) 2025-08-02 08:20:37 -07:00
Fabian Neundorf
3ed6c58701 Clear unknowns in PizzaMissionState and Pizza (#1662) 2025-07-31 18:03:06 +02:00
Fabian Neundorf
d32384fc66 Cleared unknown in Jetski (#1661)
Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-07-31 02:17:12 +02:00
Fabian Neundorf
5361b01a10 Clear unknowns in Isle (#1660) 2025-07-30 15:43:11 -07:00
Fabian Neundorf
5495da6c53 Clear unknown in MxLoopingFlcPresenter (#1659) 2025-07-27 08:28:17 -07:00
Fabian Neundorf
9f242021a4 Clear unknowns in MxSmkPresenter and MxLoopingSmkPresenter (#1658) 2025-07-27 08:27:51 -07:00
Fabian Neundorf
0442fadc0e Clear unknown in InfocenterState (#1657) 2025-07-26 00:58:49 +02:00
Fabian Neundorf
ddaf497cc4 Clear unknowns in MxVideoPresenter (#1656) 2025-07-26 00:16:36 +02:00
jonschz
d555df6a58 Add BETA10 matches on LegoWEGEdge and others (#1655)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-25 23:49:16 +02:00
jonschz
a9e261606d Fix mxomni.* file names (#1654)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-25 22:19:09 +02:00
jonschz
03adac0c58 Match LegoOmni::Create(), other BETA10 matches (#1651)
* Match `LegoOmni::Create()`, other BETA10 matches

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-25 17:13:34 +02:00
Fabian Neundorf
2451b041f6 Clear remaining unknown in Ambulance (#1650) 2025-07-23 19:14:10 +02:00
Fabian Neundorf
eae038f6a9 Clear unknowns in MxVideoParamFlags (#1648) 2025-07-22 20:58:00 +02:00
Fabian Neundorf
ed33541a2e Clear unknowns in LegoAnimScene (#1649) 2025-07-22 10:45:50 -07:00
jonschz
36f6d963dc BETA matches for SoundManagers (#1646)
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-21 23:42:42 +02:00
Fabian Neundorf
fd299137ff Clear unknowns LegoCameraController (#1647) 2025-07-21 22:18:59 +02:00
MS
b1dcc26d79 Beta functions for MxVariable (#1645)
* Beta match MxVariable classes

* CustomizeAnimFileVariable
2025-07-20 23:08:26 -04:00
MS
4edd8d1214 Beta match MxThread and MxSemaphore (#1644) 2025-07-20 21:58:16 -04:00
jonschz
2980f88bb0 Fix filenames based on BETA10 MxAutoLock (#1640)
* Inline LegoAnimPresenters
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-20 18:20:40 +02:00
MS
132d9c817f Build BETA10 in CI (#1639) 2025-07-20 11:47:08 -04:00
Fabian Neundorf
0a58d112e8 Clear unknowns in LegoOmni and misc.h (#1642) 2025-07-20 08:18:59 -07:00
Fabian Neundorf
56c15699da Clear unknown in MxSoundManager (#1641) 2025-07-20 16:05:28 +02:00
jonschz
6b5f3724c0 Beta match MxAutoLock and MxCriticalSection (#1638)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-20 07:57:26 +02:00
Fabian Neundorf
9e860d910c Name spawn areas (#1636) 2025-07-19 07:29:34 -07:00
jonschz
73d9ef1d80 Improve FUN_10061010, other fixes (#1634)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-19 16:28:35 +02:00
jonschz
29d7a5df89 Get BETA10 to compile again (#1635)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-19 12:24:49 +02:00
Fabian Neundorf
bd71370602 Clear unknown in LegoControlManagerNotificationParam (#1633) 2025-07-19 01:09:37 +02:00
Fabian Neundorf
cfd36ec88f Clear unknowns in LegoPhonemePresenter (#1632) 2025-07-18 23:26:34 +02:00
Fabian Neundorf
66844aa945 Clear unknown in TimeROI (#1631) 2025-07-18 01:53:35 +02:00
Fabian Neundorf
6d6971734b Clear unknowns in LegoROI (#1630) 2025-07-17 01:19:17 +02:00
Fabian Neundorf
05360b4468 Clear unknowns in TowTrack and TowTrackMissionState (#1629) 2025-07-15 20:39:22 +02:00
Joshua Peisach
8a82ebeb7e Fix typo in SetSkyColor (#1628) 2025-07-15 19:16:25 +02:00
MS
bf98bfffdf CONFIG (#1627) 2025-07-15 12:58:13 -04:00
MS
9c9baf3c3e Beta matching in mxdirectxinfo.cpp (#1626)
* Use goto

* Fix constructors

* Reorder error strings

* Compat mode todo

* Rename p_context to p_d

* Use count variable

* Fix typo
2025-07-15 10:43:40 -04:00
Fabian Neundorf
3b79b4c834 Use enum values for LegoPathStructNotificationParam.GetTrigger() (#1625) 2025-07-14 22:18:21 +02:00
MS
e155bea7fd Remove GetDriverList getter (#1624) 2025-07-14 11:44:14 -04:00
Fabian Neundorf
356c64ce0e Name state field, getter and setter in Act1State (#1621) 2025-07-13 12:01:06 -07:00
jonschz
40c1a40d2b Match FUN_1006b140() and related functions (#1623)
* Match on BETA10

* Possible improvement on Matrix4::Swap

* Document entropy build result

* Comments at at Matrix4::Invert

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-13 16:50:51 +02:00
jonschz
657720c825 Match Act3List::FUN_100720d0 (#1622) 2025-07-13 16:50:20 +02:00
MS
00a4861914 Beta matching CConfigApp (#1620)
* Beta matching CConfigApp

* Docs
2025-07-12 12:39:16 -04:00
jonschz
ac46537599 Interpret Act3List properties, minor fixes (#1619)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-07-12 17:05:29 +02:00
MS
10986376cb Fix #1575 (#1618) 2025-07-11 23:26:21 -04:00
Fabian Neundorf
d9d9880d8b Clear unknowns in LegoAnimNodeData (#1617) 2025-07-11 17:11:12 -07:00
Fabian Neundorf
a34c293177 Name Disable function in LegoOmni and misc (#1616) 2025-07-11 17:10:36 -07:00
Fabian Neundorf
6497cb42b7 Clear unknowns in Matrix (#1615) 2025-07-10 18:58:53 -07:00
MS
c784fc32f1 Move g_skeletonKickPhases to .data (#1614) 2025-07-10 00:29:22 -04:00
Fabian Neundorf
f0f771f3f4 Clear global unknowns in LegoROI (#1611) 2025-07-09 21:28:59 -07:00
MS
4ebc5b453f Improve match for Act3Ammo::Animate (#1612)
* Improve Act3Ammo

* Early return
2025-07-09 14:09:49 -04:00
Fabian Neundorf
5d3b6884e0 Clear unknowns in legoutils.h (#1610) 2025-07-08 07:26:32 -07:00
Fabian Neundorf
c7fda26cf4 Clear unknowns in Infocenter and InfocenterMapEntry (#1609) 2025-07-08 02:35:21 +02:00
Fabian Neundorf
8ffe7b776a Clear unknowns in LegoControlManager (#1607) 2025-07-05 18:23:00 -07:00
Fabian Neundorf
d3aecadb07 Clear unknown in LegoModelPresenter (#1608) 2025-07-05 16:55:59 -07:00
Fabian Neundorf
5544640b22 Clear unknowns in MxControlPresenter (#1606) 2025-07-04 21:53:50 +02:00
MasterTimeThief
df3d144ed9 Renamed more functions and variables in Car Build sections (#1605)
* Renamed variables and functions related to the Car Build sections

* Car Build variable renaming - fixed issues and added enum `ShelfState`

* Fixed some spacing in `legocarbuildpresenter.h`

* Fixed tab spacing

* Changed `m_shelfState` back to `MxU16`

* Cleared up `InitBuildPlatform`

* Fixed comments

* Renamed more functions and variables in Car Build sections

* Named `SelectPartFromMousePosition`

* Updated spacing formatting in `LegoCarBuild`
2025-07-04 02:23:07 +02:00
Fabian Neundorf
16c76c96f2 Clear time started unknown in MxDSAction (#1604)
This should not be confused with `GetStartTime()`, as that represents the time offset from the SI file.
2025-07-03 23:56:48 +02:00
Anders Jenbo
44d1ad13fe Set dwDDFX using flag (#1603) 2025-07-03 21:57:47 +02:00
Christian Semmler
4d8ba1986e Fix writing default texture (#1602) 2025-07-03 02:07:16 +02:00
Christian Semmler
89fe7fa924 Fix wrong notification type in LegoRace::Notify (#1601) 2025-07-02 22:43:57 +02:00
Fabian Neundorf
40ec911811 Clear unknown in MxWavePresenter (#1600) 2025-07-02 21:09:25 +02:00
Fabian Neundorf
805c57b6aa Clear unknowns in ViewLOD (#1599) 2025-07-02 02:02:03 +02:00
Fabian Neundorf
f825b053ff Clear unknown in mxutilities.h (#1598)
Also change the parameter name to mask as it better represents the
usage.
2025-07-01 00:29:23 +02:00
Korbo
f0df3cd0ef Clear a few unknowns in act 3 (#1597)
* Clear a few unknowns in act 3

* fix build error

* fix other build error

* requested changes
2025-06-30 12:20:53 -07:00
Christian Semmler
aa825aeecf Add macro for switchable building index (#1596) 2025-06-29 17:55:34 +02:00
Fabian Neundorf
0982038453 Clear unknown in Hospital (#1595) 2025-06-28 15:38:48 -07:00
Fabian Neundorf
9dcc701fcb Clear unknowns in GetSoundId (#1594) 2025-06-28 20:32:09 +02:00
Fabian Neundorf
89539a64f1 Clear unknown 0x10 in LegoEntity (#1593)
The naming is a bit weird, as only one bit is used so there are no other usages of this value.
2025-06-28 07:28:13 -07:00
Korbo
16a94c725c Names for race related or adjacent functions and variables (#1592)
* Names for race related or adjacent functions and variables

* fix formatting

* fix formatting
2025-06-28 01:08:45 +02:00
Fabian Neundorf
056064f9d4 Clear unknown in LegoLOD (#1590)
The function does mostly the same as `SetTextureInfo` but does not
explicitly set the color as well.
2025-06-26 22:35:04 +02:00
Fabian Neundorf
b66d1e2f64 Clear unknowns in Ambulance and AmbulanceMissionState (#1588) 2025-06-26 20:31:30 +02:00
Fabian Neundorf
8498c69af1 Clear unknowns in LegoPlantManager (#1587) 2025-06-24 22:38:08 +02:00
MattKC
ce85377f18 Create LICENSE (#1497) 2025-06-24 18:00:23 +02:00
Fabian Neundorf
7f10f7ae14 Clear unknown in ModelDbModel (#1586) 2025-06-23 14:34:02 -07:00
jonschz
edae5f58ec Remove getters/setters that (likely) don't exist (#1583)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-23 20:58:16 +02:00
MS
1701117e6f Improve MeshBuilderImpl::CreateMesh (#1584)
* CreateMesh

* Effective match for Clone()
2025-06-23 10:24:13 -04:00
jonschz
1677193635 Add reference to isle-portable to README (#1579)
* Add reference to `isle-portable` to README

* Fix uppercase

* Address review comments

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-23 12:32:19 +02:00
Christian Semmler
8195d2b251 Update legogamestate.cpp (#1582) 2025-06-22 18:48:09 +02:00
Christian Semmler
0a50915312 Fix implicit signed char-ness (#1581) 2025-06-22 17:55:36 +02:00
Fabian Neundorf
2595537c4c Clear unknowns in LegoAnimActorEntry and LegoAnimKey (#1580) 2025-06-22 05:34:29 -07:00
jonschz
16db496832 Match LegoGameState::History::WriteScoreHistory(), clear unknowns (#1576)
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-22 08:22:25 +02:00
Fabian Neundorf
e3fc6fd135 Use enum from LegoActor to map between string and id (#1577) 2025-06-21 15:32:30 -07:00
jonschz
f64af166c8 Add BETA10 addresses for LegoROI and others (#1569)
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-21 07:52:24 +02:00
Florian Kaiser
72eb194424 Clear unknowns in LegoAnimPresenter and related classes (#1565)
* Clear unknowns in `LegoAnimPresenter` and related classes

* Update LEGO1/lego/legoomni/include/legoanimpresenter.h

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-06-21 01:24:32 +02:00
jonschz
4691b0253c Fix BETA10 linker settings (#1572)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-20 06:53:42 +02:00
Fabian Neundorf
f9e34c46e3 Clear unknowns in PizzeriaState, Pizza and PizzaMissionState (#1574) 2025-06-20 00:38:31 +02:00
Fabian Neundorf
6159d23cde Clear unknowns in Radio and RadioState (#1573) 2025-06-19 23:52:02 +02:00
Fabian Neundorf
cf32607933 Clear unknown in ViewROI and ViewManager (#1571) 2025-06-18 07:06:43 -07:00
jonschz
94300afb6c Add minimal documentation for ALPHA, README cleanup (#1570)
* Add minimal documentation for ALPHA

* README cleanup

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-17 23:10:00 +02:00
Christian Semmler
f48e947552 BETA only assertion in Act3Ammo::Create (#1568) 2025-06-17 19:33:14 +02:00
Fabian Neundorf
0b46acab54 Name m_unk0x21 as GetUseAlias in LegoMesh (#1567) 2025-06-17 18:42:59 +02:00
Fabian Neundorf
fd3f08f4c4 Clear unknowns in LegoBuildingInfo and LegoBuildingManager (#1566)
* Clear unknowns in `LegoBuildingInfo` and `LegoBuildingManager`

* Name remaining unknown in `LegoBuildingManager`
2025-06-16 23:08:17 +02:00
Fabian Neundorf
16ccb0e06e Name locations after exiting buildings/vehicles (#1564)
* Hospital
* Infocenter
* Garage
* Police
* Jetski Build
* Racecar Build
* Any vehicle
2025-06-15 19:31:19 +02:00
Fabian Neundorf
aeac9f787e Gasstation (#1560)
* Clear unknowns in `GasStation` and `GasStationState`

* Make global variable in gasstation unique

* Apply same name to global variable in hospital.cpp
2025-06-15 08:48:54 -07:00
jonschz
86f35f5aba Remove reccmp README duplication (#1563)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-15 12:55:54 +02:00
Fabian Neundorf
26978f5484 Name LegoLOD::FUN_100aae20 (#1562) 2025-06-14 19:56:46 +02:00
Christian Semmler
e321385803 BETA matches in ViewManager (#1559)
* BETA matches

* Fix

* Fix `ViewManager::Update`
2025-06-13 04:14:28 +02:00
Fabian Neundorf
7b619d5544 Clear unknowns in LegoPlantManager (#1557) 2025-06-12 09:33:32 -07:00
jonschz
596ebde9d3 Add BETA10 assertions in LegoPathController (#1555)
* Add BETA10 assertions in LegoPathController

* formatting

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-06-12 08:52:56 +02:00
MasterTimeThief
9aa8dbfc46 Clear unknowns in 'LegoCarBuild' and 'LegoCarBuildPresenter' (#1542)
* Renamed variables and functions related to the Car Build sections

* Car Build variable renaming - fixed issues and added enum `ShelfState`

* Fixed some spacing in `legocarbuildpresenter.h`

* Fixed tab spacing

* Changed `m_shelfState` back to `MxU16`

* Cleared up `InitBuildPlatform`

* Fixed comments
2025-06-11 23:37:50 +02:00
Fabian Neundorf
3b3fe276c4 Clear unknowns in LegoPhoneme (#1556) 2025-06-11 23:29:23 +02:00
Anonymous Maarten
bc481cc1c5 assert(0) in LegoCarRaceActor::VTable0x1c is beta10-only (#1553) 2025-06-11 03:17:24 +02:00
Fabian Neundorf
99ff92e49e Use enum for states in PoliceState (#1552) 2025-06-10 16:07:10 -07:00
Fabian Neundorf
180d4949da Clear unknowns in PoliceState (#1551) 2025-06-10 11:51:21 -07:00
Christian Semmler
8cdc8fbc05 Name LegoAnimationManager::m_unk0x41c (#1550) 2025-06-10 01:17:34 +02:00
MS
f334eae667 Fix #1548 (#1549) 2025-06-08 21:38:36 -04:00
Fabian Neundorf
82f1ce8814 Clear unknowns/numbers in Hospital and HospitalState (#1545)
* Define state variables in `HospitalState`

* Cleared unknown for flashing leds in `Hospital`

* Misc name changes in `Hospital`

* Name states in `Hospital`
2025-06-08 15:57:38 -07:00
Florian Kaiser
36c1093c88 Clear unknowns in LegoPathBoundary, LegoWEEdge, LegoWEGEdge and LegoPathController (#1546) 2025-06-08 11:04:58 -07:00
Florian Kaiser
06af7d25c6 Rename g_wdbOffset to g_wdbSkipGlobalPartsOffset for clarity (#1547) 2025-06-08 08:04:06 -07:00
Fabian Neundorf
7471852e9d Named unknown function in LegoTextureInfo (#1544) 2025-06-07 18:04:55 +02:00
Christian Semmler
d714bf62f1 Improve LegoPathActor::VTable0x84 BETA match (#1543) 2025-06-06 23:22:46 +02:00
Fabian Neundorf
ac4d3b2490 Name for bounding box in ROI (#1541)
* Name for bounding box in ROI

* Use snake_case for member
2025-06-06 11:47:45 -07:00
Fabian Neundorf
9134dd791c Name boolean field in Mesh (#1540) 2025-06-04 23:30:06 +02:00
Fabian Neundorf
d272054d5a Clear unknowns in legocharactermanager (#1539) 2025-06-04 23:29:41 +02:00
Fabian Neundorf
d7d3a47cd2 Add names to LegoActorInfo.Part (#1538)
Each part consists of two "blocks" where every block has a list of
indices which reference into a list of names and the actual index used
for the list of indices.

By doing that, it is possible to reuse the list of name for every actor
and instead have a "sublist" through the indices list.
2025-06-03 18:11:01 -07:00
Fabian Neundorf
b4fb9f3a15 Better name for LegoActorLOD's flags (#1537) 2025-06-02 14:21:12 -07:00
Christian Semmler
f48dd8c912 Update legogamestate.cpp (#1535) 2025-06-01 18:46:14 +02:00
Anonymous Maarten
ac971f8c15 Assertion in MxTransitionManager::StartTransition is beta10-only (#1534)
This fixes an assertion error when:
1. Start the game
2  Skip intro (probably optional)
3. Turn left to the elevator room
4. Enter the elevator
5. Press the (I) button
2025-05-31 02:33:28 +02:00
Anonymous Maarten
941bc6ffa9 Fix UBSAN entering the petrol station car building minigame (#1533) 2025-05-31 02:19:11 +02:00
Anonymous Maarten
e813a12a4a Fix notification/presenter casts (#1532)
* LegoCarBuild: cast c_notificationType0 to MxNotificationParam

* MxBackgroundAuioManager gets a MxWavePresenter
2025-05-30 21:43:33 +02:00
Fabian Neundorf
d0f4725f0f Fill in unknown color string descriptions (#1531) 2025-05-30 21:12:49 +02:00
Christian Semmler
168bd4b26c Fix LegoTreeNode* construction (#1530)
* Fix LegoTreeNode* construction

* Fix
2025-05-29 23:41:57 +02:00
Anders Jenbo
211d409992 Apply RAND_MAX to legoanimationmanager.cpp (#1528) 2025-05-29 06:52:15 -07:00
Anders Jenbo
6e0b580b86 Correct delete[] in legocarbuildpresenter.cpp (#1529) 2025-05-29 06:51:42 -07:00
Anonymous Maarten
30ae89f483 LegoMeterPresenter: use array deleter + BETA10-only assertion (#1527)
* LegoMeterPresenter: use array deleter

(cherry picked from commit 0897f75c7ca0b10df2b43783d0e99ff5059a29fb)

* assert in LegoCarBUild::InitPresenter is BETA10-only

(cherry picked from commit 1a41b62f6f7ae5f5926941e621a740a31d3c745f)
2025-05-28 20:25:05 -07:00
MS
5646d017f1 RendererImpl, CameraImpl, LightImpl (#1525) 2025-05-28 22:04:01 -04:00
Anonymous Maarten
45890eec94 legoanimationmanager: use delete[] (#1526) 2025-05-28 18:28:30 -07:00
jonschz
b7090bd838 Match LegoActor and LegoPathActor in BETA10 (#1524)
* Match `LegoActor` in BETA10

* Cleanup

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-05-27 22:04:01 +02:00
jonschz
4186bae786 Match Helicopter::FUN_100042a0 (#1523)
* Match `Helicopter::FUN_100042a0`

* Add comment

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-05-26 23:33:52 +02:00
MS
b28fcae005 Match TextureImpl functions (#1521)
* TextureImpl functions

* TglD3DRMIMAGE functions
2025-05-26 18:46:22 +02:00
Christian Semmler
04b669cf96 Fix type cast in MxControlPresenter::FUN_10044270 (#1522) 2025-05-26 18:45:06 +02:00
jonschz
f7744f5550 Fix ambiguous matches in BETA10 (#1520)
* Fix ambiguous matches in BETA10

* Add more functions, fix one LINE annotation

* Fix LEGO1 matches

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-05-26 07:25:47 +02:00
MS
5ad885f958 TglImpl::DeviceImpl functions (#1519) 2025-05-25 11:37:16 -04:00
Florian Kaiser
804632b13f Refactor LegoUnknown100db7f4 to LegoOrientedEdge (#1515)
* Refactor `LegoUnknown100db7f4` to `LegoOrientedEdge`

* Update LEGO1/lego/sources/geom/legoorientededge.h

* Update legopathcontroller.h

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-24 23:09:24 -07:00
jonschz
8e54a20d7d Match DecodeSS2 (#1476)
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-05-25 07:59:58 +02:00
Christian Semmler
a860e76dba Match LegoOmni::GetWorldId (#1517) 2025-05-24 17:12:07 +02:00
Florian Kaiser
90b5c27a8b Clear unknowns in MxBackgroundAudioManager (#1516)
* Clear unknowns in `MxBackgroundAudioManager`

* Apply suggestions from code review

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-24 06:49:43 -07:00
MS
4e49712391 Match Tgl MeshImpl and GroupImpl functions (#1514) 2025-05-23 12:27:41 -04:00
Erik Schulze
eb1177b409 rename functions and parameters in OrientableROI (#1512) 2025-05-21 20:13:28 -07:00
Anders Jenbo
5c67c26c3f Fix MxHashTableNode constructor (#1511) 2025-05-20 20:42:42 +02:00
Anonymous Maarten
40a21867e8 Document buttonId in RegistrationBook (#1510) 2025-05-19 18:05:35 -07:00
Anonymous Maarten
0b9c1756c7 Fix inclusion guards of 3 files (#1509)
* Fix inclusion guards of 3 files

* Apply suggestions from code review

Co-authored-by: Christian Semmler <mail@csemmler.com>

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-20 02:15:30 +02:00
Erik Schulze
d67318e78b propagate name changes from commit fce97ea (#1508)
* propagate name changes from commit fce97ea

* remove dependency on omni types

* rename parameter too
2025-05-19 21:25:52 +02:00
MS
6808669da0 Use argument file for reccmp-aggregate samples (#1507) 2025-05-18 21:47:00 -07:00
Erik Schulze
7b34eea690 Use SUCCESS and FAILURE in MxPalette::SetSkyColor (#1506) 2025-05-18 16:36:25 -07:00
Anonymous Maarten
2915aa014f Use sizeof(type) instead of sizeof(variableName) when (de)serializing data (#1505)
* Use sizeof(type) instead of sizeof(variableName) when (de)serializing data

* Less usage of sizeof(variableName) while (de)serializing
2025-05-18 22:56:28 +02:00
Anders Jenbo
c9b41e2db8 Fix delete in legoanimmmpresenter.cpp (#1504) 2025-05-17 19:09:44 -07:00
Anders Jenbo
d00c08cc19 Rename FUN_1009e020 to ClearBackBuffers (#1503)
* Rename FUN_1009e020 to ClearBackBuffers

* Update mxdirectdraw.h
2025-05-17 18:01:29 -07:00
Anders Jenbo
3f0fe654ff Fix delete[] in mxstillpresenter.cpp (#1496)
* Fix delete[] in mxstillpresenter.cpp

Without this the game doesn't  run on Linux :)

* Update LEGO1/omni/src/video/mxstillpresenter.cpp

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Update mxstillpresenter.cpp

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-17 16:14:25 -07:00
Anders Jenbo
45e0e5bdd1 Correct delete[] in mxflcpresenter.cpp (#1501)
* Correct delete[] in mxflcpresenter.cpp

* Update LEGO1/omni/src/video/mxflcpresenter.cpp

Co-authored-by: Christian Semmler <mail@csemmler.com>

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-17 14:22:30 -07:00
Anders Jenbo
bc920a295b Correct assert in view.cpp (#1500) 2025-05-17 13:26:01 -07:00
Anders Jenbo
d3cd491765 Correct delete[] in legowegedge.cpp (#1499) 2025-05-17 13:25:22 -07:00
Anders Jenbo
2d92aee589 Correct delete[] in mxcontrolpresenter.cpp (#1498) 2025-05-17 13:24:06 -07:00
Anders Jenbo
46ae3fbe89 Order enums the same way in both places (#1495)
To match LEGO1/mxdirectx/mxdirectdraw.cpp so it's not so confusing to compare uage
2025-05-15 21:11:06 -07:00
Anders Jenbo
f5cb2d4732 Use consts in callbacks (#1494) 2025-05-15 19:22:40 -07:00
Anders Jenbo
4c754b376c Enums in mxdisplaysurface.cpp (#1493)
* Enums in mxdisplaysurface.cpp

* Update mxdisplaysurface.cpp
2025-05-14 22:08:50 -07:00
Anders Jenbo
d52af9f4e3 Enum in legovideomanager.cpp (#1492) 2025-05-14 22:03:52 -07:00
Anders Jenbo
ad5ccd4e8b Enums in mxtransitionmanager.cpp (#1491) 2025-05-14 22:03:33 -07:00
Anders Jenbo
dabd404111 Correct enums in mxdirectdraw.cpp (#1490) 2025-05-14 22:03:16 -07:00
Anders Jenbo
f99da0cea7 Correct enums in legotextureinfo.cpp (#1489) 2025-05-14 22:02:35 -07:00
Anders Jenbo
a055567fa3 Correct CooperativeLevel endum (#1488) 2025-05-14 21:59:16 -07:00
Anders Jenbo
dbbf373748 Correct dwCaps bit flags (#1487)
* Correct dwCaps bit flags

* Update legotextureinfo.cpp
2025-05-15 02:01:10 +02:00
Anders Jenbo
fce97ea06f Correct check for lighting support (#1486) 2025-05-15 01:39:55 +02:00
Anders Jenbo
88651404cb Correct dwCaps enum in detectdx5.cpp (#1484) 2025-05-14 21:54:35 +02:00
Anders Jenbo
561825f6a0 Apply some enums to CONFIG (#1483) 2025-05-14 21:40:12 +02:00
Christian Semmler
396bf6b562 Fix wrong deletes in MxBitmap (#1482) 2025-05-13 18:42:12 -07:00
Christian Semmler
934d90fc96 Fix wrong use of delete vs delete[] (#1481) 2025-05-14 00:37:53 +02:00
MS
810c0b0654 Fix some MSVC annotations for LEGO1 (#1480) 2025-05-13 14:18:08 -04:00
Anders Jenbo
7e98f0e11c Rename FUN_1009d0d0 into GetBestDevice (#1478) 2025-05-12 22:34:37 +02:00
Florian Kaiser
e59345c88c Rename SetUnknown84 to SetNotificationObject (#1474) 2025-05-12 17:20:38 +02:00
Zoë B
81f28f149f pin container base image repository and debian version (#1473) [skip ci] 2025-05-11 21:59:16 -04:00
Anders Jenbo
6482a89ea2 Correct argument names for FUN_100bc8b0 (#1472)
* Correct argument names for FUN_100bc8b0

* Update mxdisplaysurface.h
2025-05-11 16:17:28 -07:00
Ramen2X
38e3ecb1c6 make MIDIOUTCAPS format-agnostic (#1471)
Signed-off-by: Ramen2X <contact@ramen2x.com>
2025-05-11 19:02:41 -04:00
Ramen2X
2b3e7176d3 make all calls to winapi format-agnostic (#1470) 2025-05-11 15:03:32 -04:00
Anders Jenbo
6968a3ba00 Fix definition of WriteRegisterSettings() (#1469)
I think this is right ...
2025-05-11 17:42:45 +02:00
Anders Jenbo
00ac032761 Fix input to FUN_10064740 (#1467) 2025-05-10 17:37:02 -07:00
Christian Semmler
fff2021bb5 Match Hospital::ReadyWorld (#1465) 2025-05-10 18:11:53 +02:00
Christian Semmler
447fcd0c00 Match LegoCarBuild::FUN_100246e0 (#1464) 2025-05-10 17:48:08 +02:00
Christian Semmler
30facd3c90 Match JetskiRace::Create (#1463) 2025-05-10 17:16:18 +02:00
Florian Kaiser
a3d773f629 Rename functions in LegoWorldPresenter : FUN_10067360 to LoadWorldPart and FUN_100674b0 to LoadWorldModel. Update m_unk0x50 to m_maxObjectId. (#1460) 2025-05-09 21:23:02 +02:00
Florian Kaiser
c59343c220 Rename m_unk0x64 to m_world in LegoAnimMMPresenter (#1461) 2025-05-09 20:55:22 +02:00
Florian Kaiser
81ce446628 Rename m_unk0x28 to m_characterIndex in AnimInfo struct and update references in LegoAnimationManager (#1462) 2025-05-09 20:54:44 +02:00
Florian Kaiser
674197555c Rename m_list0x68 to m_pathControllerList in LegoWorld class (#1459) 2025-05-09 20:49:52 +02:00
Florian Kaiser
5fd5a4cec0 Clear unknowns in LegoROI and related classes (#1457)
* Clear unknowns in LegoROI and related classes

* Update names

* Consistently naming: `GetTextureInfo`

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-09 18:13:19 +02:00
Florian Kaiser
3811d61ea4 Rename c_bit5 to c_ctrl in LegoInputManager, change m_unk0x6c to m_isAccelerating and clear some local unknowns (#1458) 2025-05-09 07:40:00 -07:00
Florian Kaiser
711134b3b8 Replace m_unk0x04 and m_unk0x08 with m_modelDataLength and m_modelDataOffset (#1456) 2025-05-09 07:35:11 -07:00
Florian Kaiser
9027849848 Rename parameter p_stack to p_stackSize in MxThread::Start method (#1452) 2025-05-09 12:44:53 +02:00
Florian Kaiser
0a2d598b57 Refactor Deserialize method parameters in MxDS classes to use p_flags instead of p_unk0x24 (#1450) 2025-05-08 12:26:48 -07:00
Florian Kaiser
c8ae2e22cc Update .gitignore to include .DS_Store (#1448) 2025-05-08 12:24:22 -07:00
MattKC
2fac11cff0 readme: update playlist link (#1444)
Co-authored-by: MattKC <mattkc@noreply.git.mattkc.com>
2025-05-07 20:31:34 -07:00
Christian Semmler
f851103d48 Match LegoDeviceEnumerate::SupportsMMX (#1443)
* Match `LegoDeviceEnumerate::SupportsMMX`

* Fix indent
2025-05-08 00:46:21 +02:00
Florian Kaiser
2cab039a5f Add info about long file path issue to README.md (#1442)
* Add info about long file path issue to README.md

* Update README.md

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-05-07 21:43:54 +02:00
Christian Semmler
02c38d55a3 Match MxDisplaySurface::SetPalette (#1438)
* Match `MxDisplaySurface::SetPalette`

* Match
2025-05-05 17:19:23 -07:00
Christian Semmler
fa6c62f7b3 Match MxCompositeMediaPresenter::Tickle (#1437)
* Match `MxCompositeMediaPresenter::Tickle`

* Remove file
2025-05-06 01:04:55 +02:00
MS
2fef2858c9 Add all TglImpl::ImplementationData methods (#1436)
* ImplementationData methods and typedefs

* RendererImpl::CreateView

* RendererImpl::CreateMeshBuilder

* DeepClone

* CreateCamera and CreateTexture

* CreateDevice

* Disable static var annotation
2025-04-19 10:30:47 -04:00
MS
451fd63eee Match a few more Tgl functions (#1435)
* RendererImpl::CreateLight

* Swap addrs for LightImpl and MeshBuilderImpl

* SetShadingModel functions
2025-04-17 17:19:54 -04:00
MS
544372759e Add abstraction functions to TglImpl::ViewImpl (#1434)
* Add Destroy methods to TglImpl

* Test one abstraction

* More ViewImpl abstractions

* Finish ViewImpl
2025-04-15 16:30:56 -04:00
MS
0bc31450a4 Some beta addrs for Tgl and TglImpl (#1433) 2025-04-14 18:29:38 -04:00
MS
688c203f70 Beta match and cleanup of MxDS* classes (#1432)
* Clean up / beta match MxDS* classes

* ;)
2025-04-10 22:59:55 -04:00
MS
95431347ee Add getters to AlphaMask (#1431) 2025-04-09 23:48:16 -04:00
MS
4ec020ed89 MxVideoPresenter::IsHit to 100% (#1428) 2025-04-06 10:36:13 -04:00
MS
93d6c18c9a Fix AlphaMask functions (#1425) 2025-04-03 20:18:00 -04:00
MS
3b63506648 Fix FUN_10044270 (#1423) 2025-04-03 17:10:11 -04:00
MS
8821593b63 Improve MxControlPresenter::FUN_10044270 (#1422) 2025-04-03 16:25:40 -04:00
Anonymous Maarten
466c345201 cmake: smartheap and libcmt are first in link order (#1420) 2025-03-18 08:29:15 -07:00
MS
20bcea0c81 Fix address for MxRect constructor (#1419) 2025-03-16 19:47:06 -04:00
Christian Semmler
6220ab32c3 Match FUN_100b7220 (#1418) 2025-03-16 23:19:13 +01:00
Christian Semmler
1027a80d9e Match MxEventPresenter::PutData (#1417) 2025-03-16 23:02:13 +01:00
Christian Semmler
aa60386196 Match MxStreamController::RemoveSubscriber (#1416) 2025-03-16 22:59:10 +01:00
Christian Semmler
a301f84566 Match LegoAnimPresenterSetCompare comparison (#1415) 2025-03-16 22:58:48 +01:00
Christian Semmler
e9467864d8 Match LegoHideAnimPresenter::FUN_1006db60 (#1414)
* Match `LegoHideAnimPresenter::FUN_1006db60`

* Remove comment
2025-03-16 22:57:23 +01:00
Christian Semmler
401fa7674e Match MxBackgroundAudioManager::FadeInOrFadeOut (#1413) 2025-03-16 22:19:11 +01:00
Christian Semmler
67c71cb9e6 Match MxControlPresenter::HasTickleStatePassed (#1412) 2025-03-15 14:19:09 -07:00
MS
51fc69e49f Various DirectDraw items (#1411) 2025-03-15 11:12:10 -04:00
Christian Semmler
b0b68052d4 Improve Isle::Enable match (#1410) 2025-03-14 21:45:53 +01:00
Christian Semmler
421a317050 Match Isle::HandleEndAction (#1409) 2025-03-14 21:24:50 +01:00
Christian Semmler
77435427b3 Match Radio::HandleControl (#1408) 2025-03-14 21:24:11 +01:00
MS
3d9c7a8956 Improve performance of entropy build action (#1407)
* Use multiple threads for entropy builds

* Verify builds parameter

* Revert "Verify builds parameter"

This reverts commit 460d3d3b55.

* Use options instead

* Seed fix

* 256 samples on push
2025-03-14 15:05:55 -04:00
MS
d663e26321 Use MxGeometry header (#1399)
* Use MxGeometry header

* Fix comment

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2025-03-11 21:13:13 -04:00
348 changed files with 11551 additions and 7920 deletions

View File

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

View File

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

2
.gitignore vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -90,7 +90,7 @@ public:
// Act3Ammo::`scalar deleting destructor'
private:
MxResult FUN_10053db0(float p_param1, const Matrix4& p_param2);
MxResult FUN_10053db0(float p_param1, Matrix4& p_param2);
static Mx3DPointFloat g_unk0x10104f08;

View File

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

View File

@@ -52,13 +52,13 @@ public:
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
// FUNCTION: BETA10 0x100cd060
RaceSkel* GetSkeleton() { return m_skeleton; }

View File

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

View File

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

View File

@@ -6,7 +6,7 @@
#include "legostate.h"
#include "legoworld.h"
#include "misc.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "radio.h"
class MxNotificationParam;
@@ -18,6 +18,25 @@ class LegoControlManagerNotificationParam;
// SIZE 0x94
class InfocenterState : public LegoState {
public:
enum {
e_playCutscene = 0,
e_introCancelled = 1,
e_notRegistered = 2,
e_newState = 3,
e_selectedSave = 4,
e_selectedCharacterAndDestination = 5,
// e_6 = 6,
// e_7 = 7,
e_exitQueried = 8,
// e_9 = 9,
// e_10 = 10,
e_welcomeAnimation = 11,
e_exiting = 12,
e_playCredits = 13,
e_exitingToIsland = 14,
e_backToInfoAct1 = 15,
};
InfocenterState();
~InfocenterState() override;
@@ -72,17 +91,27 @@ public:
Playlist m_returnDialogue[3]; // 0x20
Playlist m_leaveDialogue[3]; // 0x44
Playlist m_bricksterDialogue; // 0x68
MxU32 m_unk0x74; // 0x74
MxU32 m_state; // 0x74
MxStillPresenter* m_letters[7]; // 0x78
};
// SIZE 0x18
struct InfocenterMapEntry {
enum {
e_infocenter = 3,
e_jetrace = 10,
e_carrace = 11,
e_pizzeria = 12,
e_garage = 13,
e_hospital = 14,
e_police = 15,
};
InfocenterMapEntry();
MxStillPresenter* m_destCtl; // 0x00
undefined4 m_unk0x04; // 0x04
MxRect32 m_area; // 0x08
MxU32 m_target; // 0x04
MxRect<MxS32> m_area; // 0x08
};
// VTABLE: LEGO1 0x100d9338
@@ -154,7 +183,7 @@ private:
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void StopCutscene();
void FUN_10070d10(MxS32 p_x, MxS32 p_y);
void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y);
void StartCredits();
void StopCredits();
@@ -173,12 +202,12 @@ private:
Radio m_radio; // 0x10c
MxStillPresenter* m_dragPresenter; // 0x11c
InfocenterMapEntry m_glowInfo[7]; // 0x120
MxS16 m_unk0x1c8; // 0x1c8
MxS16 m_enabledGlowControl; // 0x1c8
MxStillPresenter* m_frame; // 0x1cc
MxS16 m_infoManDialogueTimer; // 0x1d0
MxS16 m_bookAnimationTimer; // 0x1d2
MxU16 m_unk0x1d4; // 0x1d4
MxS16 m_unk0x1d6; // 0x1d6
MxU16 m_playingMovieCounter; // 0x1d4
MxS16 m_bigInfoBlinkTimer; // 0x1d6
};
#endif // INFOCENTER_H

View File

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

View File

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

View File

@@ -29,12 +29,12 @@ public:
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
void FUN_10016930(MxS32 p_param1, MxS16 p_param2);

View File

@@ -34,6 +34,7 @@ public:
}
// FUNCTION: LEGO1 0x1002d220
// FUNCTION: BETA10 0x10012530
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, LegoActor::ClassName()) || LegoEntity::IsA(p_name);
@@ -43,18 +44,22 @@ public:
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
// FUNCTION: LEGO1 0x10002cc0
// FUNCTION: BETA10 0x1000f3e0
virtual MxFloat GetSoundFrequencyFactor() { return m_frequencyFactor; } // vtable+0x50
// FUNCTION: LEGO1 0x10002cd0
// FUNCTION: BETA10 0x1000f410
virtual void SetSoundFrequencyFactor(MxFloat p_frequencyFactor)
{
m_frequencyFactor = p_frequencyFactor;
} // vtable+0x54
// FUNCTION: LEGO1 0x10002ce0
// FUNCTION: BETA10 0x1000f440
virtual void VTable0x58(MxFloat p_unk0x70) { m_unk0x70 = p_unk0x70; } // vtable+0x58
// FUNCTION: LEGO1 0x10002cf0
// FUNCTION: BETA10 0x1000f470
virtual MxFloat VTable0x5c() { return m_unk0x70; } // vtable+0x5c
// FUNCTION: LEGO1 0x10002d00
@@ -62,6 +67,7 @@ public:
virtual MxU8 GetActorId() { return m_actorId; } // vtable+0x60
// FUNCTION: LEGO1 0x10002d10
// FUNCTION: BETA10 0x1000f4d0
virtual void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; } // vtable+0x64
static const char* GetActorName(MxU8 p_id);
@@ -76,6 +82,7 @@ protected:
};
// SYNTHETIC: LEGO1 0x1002d300
// SYNTHETIC: BETA10 0x1003d900
// LegoActor::`scalar deleting destructor'
#endif // LEGOACTOR_H

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -135,15 +135,15 @@ public:
void FUN_10022f00();
void FUN_10022f30();
void FUN_10023130(MxLong p_x, MxLong p_y);
void FUN_100236d0();
void AddSelectedPartToBuild();
undefined4 FUN_10024250(LegoEventNotificationParam* p_param);
void FUN_100243a0();
undefined4 FUN_10024480(MxActionNotificationParam* p_param);
undefined4 FUN_100244e0(MxLong p_x, MxLong p_y);
undefined4 SelectPartFromMousePosition(MxLong p_x, MxLong p_y);
undefined4 FUN_100246e0(MxLong p_x, MxLong p_y);
MxS32 FUN_10024850(MxLong p_x, MxLong p_y);
undefined4 FUN_10024890(MxParam* p_param);
undefined4 FUN_10024c20(LegoEventNotificationParam* p_param);
undefined4 FUN_10024c20(MxNotificationParam* p_param);
void FUN_10024ef0();
void FUN_10024f30();
void FUN_10024f50();
@@ -161,7 +161,7 @@ public:
MxS32 FUN_10025ee0(undefined4 p_param1);
// FUNCTION: BETA10 0x100735b0
void SetUnknown0x258(LegoCarBuildAnimPresenter* p_unk0x258) { m_unk0x258 = p_unk0x258; }
void SetCarBuildAnimPresenter(LegoCarBuildAnimPresenter* p_animPresenter) { m_animPresenter = p_animPresenter; }
// SYNTHETIC: LEGO1 0x10022a60
// LegoCarBuild::`scalar deleting destructor'
@@ -182,7 +182,7 @@ private:
MxU8 m_unk0x109; // 0x109
MxU16 m_unk0x10a; // 0x10a
DWORD m_unk0x10c; // 0x10c
LegoROI* m_unk0x110; // 0x110
LegoROI* m_selectedPart; // 0x110
BoundingSphere m_unk0x114; // 0x114
MxMatrix m_unk0x12c; // 0x12c
undefined m_unk0x174; // 0x174
@@ -193,17 +193,17 @@ private:
// This is likely a location in pixel space
MxS32 m_unk0x250[2]; // 0x250
LegoCarBuildAnimPresenter* m_unk0x258; // 0x258
MxQuaternionTransformer m_unk0x25c; // 0x25c
LegoCarBuildAnimPresenter* m_animPresenter; // 0x258
MxQuaternionTransformer m_unk0x25c; // 0x25c
// These two are likely locations in pixel space
MxS32 m_unk0x290[2]; // 0x290
MxS32 m_unk0x298[2]; // 0x298
MxFloat m_unk0x2a0; // 0x2a0
Mx4DPointFloat m_unk0x2a4; // 0x2a4
Mx4DPointFloat m_unk0x2bc; // 0x2bc
MxBool m_unk0x2d4; // 0x2d4
MxFloat m_unk0x2a0; // 0x2a0
Mx4DPointFloat m_unk0x2a4; // 0x2a4
Mx4DPointFloat m_unk0x2bc; // 0x2bc
MxBool m_selectedPartIsPlaced; // 0x2d4
// variable names verified by BETA10 0x1006b27a
MxStillPresenter* m_ColorBook_Bitmap; // 0x2dc

View File

@@ -13,6 +13,13 @@ public:
c_bit1 = 0x01
};
enum ShelfState {
e_undefined = -1,
e_selected = 0,
e_stopped = 1,
e_moving = 2
};
// SIZE 0x0c
struct UnknownListEntry {
// FUNCTION: LEGO1 0x100795c0
@@ -69,16 +76,16 @@ public:
void FUN_10079050(MxS16 p_index);
void SwapNodesByName(LegoChar* p_param1, LegoChar* p_param2);
void FUN_10079160();
void FUN_100795d0(LegoChar* p_param);
void FUN_10079680(LegoChar* p_param);
void InitBuildPlatform();
void HideBuildPartByName(LegoChar* p_param);
void ShowBuildPartByName(LegoChar* p_param);
LegoAnimNodeData* FindNodeDataByName(LegoTreeNode* p_treeNode, const LegoChar* p_name);
LegoTreeNode* FindNodeByName(LegoTreeNode* p_treeNode, const LegoChar* p_name);
void FUN_10079790(const LegoChar* p_name);
void AddPartToBuildByName(const LegoChar* p_name);
void RotateAroundYAxis(MxFloat p_angle);
MxBool FUN_10079c30(const LegoChar* p_name);
MxBool PartIsPlaced(const LegoChar* p_name);
void FUN_10079a90();
void MoveShelfForward();
MxBool StringEqualsPlatform(const LegoChar* p_string);
MxBool StringEqualsShelf(const LegoChar* p_string);
MxBool StringEndsOnY(const LegoChar* p_string);
@@ -87,10 +94,10 @@ public:
void SetPartObjectIdByName(const LegoChar* p_name, MxS16 p_objectId);
// FUNCTION: BETA10 0x10070180
void SetUnknown0xbc(undefined2 p_unk0xbc) { m_unk0xbc = p_unk0xbc; }
void SetShelfState(MxU16 p_shelfState) { m_shelfState = p_shelfState; }
// FUNCTION: BETA10 0x100703b0
Matrix4& GetUnknown0xe0() { return m_unk0xe0; }
Matrix4& GetBuildViewMatrix() { return m_buildViewMatrix; }
MxBool StringEndsOnW(LegoChar* p_param);
MxBool StringEndsOnYOrN(const LegoChar* p_string);
@@ -116,7 +123,7 @@ public:
private:
void Beta10Inline0x100733d0();
MxU16 m_unk0xbc; // 0xbc
MxU16 m_shelfState; // 0xbc
// variable name verified by BETA10 0x1007184f
MxS16 m_numberOfParts; // 0xbe
@@ -124,21 +131,21 @@ private:
// name derived from LegoVehicleBuildState, field 0x4f
MxS16 m_placedPartCount; // 0xc0
LegoAnimNodeData* m_unk0xc4; // 0xc4
LegoAnim m_unk0xc8; // 0xc8
MxMatrix m_unk0xe0; // 0xe0
LegoAnimNodeData* m_platformAnimNodeData; // 0xc4
LegoAnim m_platformAnim; // 0xc8
MxMatrix m_buildViewMatrix; // 0xe0
// variable name verified by BETA10 0x100719f0
UnknownListEntry* m_parts; // 0x128
MxFloat m_unk0x12c; // 0x12c
MxFloat m_unk0x130; // 0x130
MxFloat m_unk0x134; // 0x134
MxFloat m_unk0x138; // 0x138
MxULong m_unk0x13c; // 0x13c
LegoEntity* m_unk0x140; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
MxFloat m_shelfFrameBuffer; // 0x12c
MxFloat m_shelfFrame; // 0x130
MxFloat m_shelfFrameMax; // 0x134
MxFloat m_shelfFrameInterval; // 0x138
MxULong m_unk0x13c; // 0x13c
LegoEntity* m_carBuildEntity; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
// name verified by BETA10 0x10070d63
LegoChar* m_mainSourceId; // 0x14c

View File

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

View File

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

View File

@@ -28,7 +28,7 @@ public:
};
enum {
c_altBit1 = 0x01
c_disabled = 0x01
};
LegoEntity() { Init(); }
@@ -68,13 +68,13 @@ public:
// FUNCTION: BETA10 0x10013260
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
virtual void ClickSound(MxBool p_und); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
virtual void ClickSound(MxBool p_basedOnMood); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
void FUN_10010c30();
void SetType(MxU8 p_type);
@@ -83,7 +83,7 @@ public:
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldPosition();
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
MxBool IsInteraction(MxU8 p_flag) { return m_interaction & p_flag; }
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
MxU8 GetFlags() { return m_flags; }
@@ -101,14 +101,14 @@ public:
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
void ClearFlag(MxU8 p_flag) { m_flags &= ~p_flag; }
void SetUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 |= p_flag; }
void ClearUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 &= ~p_flag; }
void SetInteractionFlag(MxU8 p_flag) { m_interaction |= p_flag; }
void ClearInteractionFlag(MxU8 p_flag) { m_interaction &= ~p_flag; }
protected:
void Init();
void SetWorld();
MxU8 m_unk0x10; // 0x10
MxU8 m_interaction; // 0x10
MxU8 m_flags; // 0x11
Mx3DPointFloat m_worldLocation; // 0x14
Mx3DPointFloat m_worldDirection; // 0x28

View File

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

View File

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

View File

@@ -13,8 +13,8 @@ class LegoCameraController;
class LegoControlManager;
class LegoWorld;
extern MxS32 g_unk0x100f31b0;
extern const char* g_unk0x100f31b4;
extern MxS32 g_clickedObjectId;
extern const char* g_clickedAtom;
// VTABLE: LEGO1 0x100d87b8
// class MxCollection<LegoEventNotificationParam>
@@ -74,7 +74,7 @@ public:
c_right = 0x02,
c_up = 0x04,
c_down = 0x08,
c_bit5 = 0x10,
c_ctrl = 0x10,
c_leftOrRight = c_left | c_right,
c_upOrDown = c_up | c_down
@@ -117,6 +117,7 @@ public:
void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; }
void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; }
// FUNCTION: BETA10 0x1002e290
void DisableInputProcessing()
{
m_unk0x88 = TRUE;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,11 +7,11 @@
#include "legoracemap.h"
#include "legostate.h"
#include "legoworld.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "mxtypes.h"
class Act1State;
class LegoEventNotificationParam;
class LegoControlManagerNotificationParam;
class LegoPathActor;
class MxEndActionNotificationParam;
class MxNotificationParam;
@@ -117,7 +117,7 @@ public:
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandleControl(LegoControlManagerNotificationParam&) = 0; // vtable+0x6c
// FUNCTION: LEGO1 0x10015b70
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0x70

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -125,17 +125,17 @@ public:
// LegoWorld::`scalar deleting destructor'
protected:
LegoPathControllerList m_list0x68; // 0x68
MxPresenterList m_animPresenters; // 0x80
LegoCameraController* m_cameraController; // 0x98
LegoEntityList* m_entityList; // 0x9c
LegoCacheSoundList* m_cacheSoundList; // 0xa0
MxBool m_destroyed; // 0xa4
MxCoreSet m_set0xa8; // 0xa8
MxPresenterList m_controlPresenters; // 0xb8
MxCoreSet m_set0xd0; // 0xd0
list<LegoROI*> m_roiList; // 0xe0
LegoOmni::World m_worldId; // 0xec
LegoPathControllerList m_pathControllerList; // 0x68
MxPresenterList m_animPresenters; // 0x80
LegoCameraController* m_cameraController; // 0x98
LegoEntityList* m_entityList; // 0x9c
LegoCacheSoundList* m_cacheSoundList; // 0xa0
MxBool m_destroyed; // 0xa4
MxCoreSet m_set0xa8; // 0xa8
MxPresenterList m_controlPresenters; // 0xb8
MxCoreSet m_set0xd0; // 0xd0
list<LegoROI*> m_roiList; // 0xe0
LegoOmni::World m_worldId; // 0xec
// name verified by BETA10 0x100c7f59
LegoHideAnimPresenter* m_hideAnim; // 0xf0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,6 +16,11 @@ class MxDSAction;
// SIZE 0x10
class PoliceState : public LegoState {
public:
enum {
e_noAnimation = 0,
e_playingAnimation = 1,
};
PoliceState();
~PoliceState() override {}
@@ -38,15 +43,15 @@ public:
// SYNTHETIC: LEGO1 0x1005e920
// PoliceState::`scalar deleting destructor'
undefined4 GetUnknown0x0c() { return m_unk0x0c; }
void SetUnknown0x0c(undefined4 p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
MxS32 GetState() { return m_state; }
void SetState(MxS32 p_state) { m_state = p_state; }
void FUN_1005ea40();
void StartAnimation();
// TODO: Most likely getters/setters are not used according to BETA.
PoliceScript::Script m_policeScript; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxS32 m_state; // 0x0c
};
// VTABLE: LEGO1 0x100d8a80

View File

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

View File

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

View File

@@ -57,39 +57,39 @@ MxBool g_unk0x100f0f28 = FALSE;
// GLOBAL: LEGO1 0x100f0f30
// GLOBAL: BETA10 0x101dbe48
MxS32 g_unk0x100f0f30[] = {2, 23, 32, 66, 71, 72, 73, -1};
MxS32 g_stage0Plants[] = {2, 23, 32, 66, 71, 72, 73, -1};
// GLOBAL: LEGO1 0x100f0f50
// GLOBAL: BETA10 0x101dbe68
MxS32 g_unk0x100f0f50[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1};
MxS32 g_stage1Plants[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1};
// GLOBAL: LEGO1 0x100f0f90
// GLOBAL: BETA10 0x101dbea8
MxS32 g_unk0x100f0f90[] = {12, 19, 24, 48, 60, -1};
MxS32 g_stage2Plants[] = {12, 19, 24, 48, 60, -1};
// GLOBAL: LEGO1 0x100f0fa8
// GLOBAL: BETA10 0x101dbec0
MxS32 g_unk0x100f0fa8[] = {8, 15, 46, -1};
MxS32 g_stage3Plants[] = {8, 15, 46, -1};
// GLOBAL: LEGO1 0x100f0fb8
// GLOBAL: BETA10 0x101dbed0
MxS32 g_unk0x100f0fb8[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1};
MxS32 g_stage4Plants[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1};
// GLOBAL: LEGO1 0x100f0fe8
// GLOBAL: BETA10 0x101dbf00
MxS32 g_unk0x100f0fe8[] = {3, 40, 53, 55, -1};
MxS32 g_stage5Plants[] = {3, 40, 53, 55, -1};
// GLOBAL: LEGO1 0x100f1000
// GLOBAL: BETA10 0x101dbf18
MxS32 g_unk0x100f1000[] = {22, 33, 41, 45, 67, -1};
MxS32 g_stage6Plants[] = {22, 33, 41, 45, 67, -1};
// GLOBAL: LEGO1 0x100f1018
// GLOBAL: BETA10 0x101dbf30
MxS32 g_unk0x100f1018[] = {13, 30, 31, 62, -1};
MxS32 g_stage7Plants[] = {13, 30, 31, 62, -1};
// GLOBAL: LEGO1 0x100f1030
// GLOBAL: BETA10 0x101dbf48
MxS32 g_unk0x100f1030[] = {1, 27, 37, 44, 47, 54, 61, 64, -1};
MxS32 g_stage8Plants[] = {1, 27, 37, 44, 47, 54, 61, 64, -1};
// --- End of indices into g_plantInfo ---
@@ -133,7 +133,6 @@ Act2Actor::Act2Actor()
}
// FUNCTION: LEGO1 0x10018940
// FUNCTION: BETA10 0x1003d65f
void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
{
LegoAnimActor::SetROI(p_roi, p_bool1, p_bool2);
@@ -417,7 +416,7 @@ void Act2Actor::FUN_100192a0(undefined4 p_location)
newPosition,
newDirection,
newBoundary,
LegoUnknown100db7f4::c_bit1,
LegoOrientedEdge::c_bit1,
NULL
);
@@ -611,8 +610,8 @@ MxU32 Act2Actor::FUN_10019700(MxFloat p_param)
MxMatrix matrix = m_roi->GetLocal2World();
matrix[3][1] += 1.0f;
brickstrROI->FUN_100a58f0(matrix);
brickstrROI->VTable0x14();
brickstrROI->SetLocal2World(matrix);
brickstrROI->WrappedUpdateWorldData();
Vector3 col0(matrix[0]);
Vector3 col1(matrix[1]);
@@ -632,7 +631,7 @@ MxU32 Act2Actor::FUN_10019700(MxFloat p_param)
MxFloat time = p_param - (m_unk0x2c - m_shootAnim->GetDuration());
for (MxS32 i = 0; i < root->GetNumChildren(); i++) {
LegoROI::FUN_100a8e80(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap());
LegoROI::ApplyAnimationTransformation(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap());
}
return FALSE;
@@ -719,141 +718,141 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
switch (m_unk0x1d) {
case 0:
if (buildingInfo[12].m_unk0x11) {
if (buildingInfo[12].m_counter) {
result = buildingInfo[12].m_entity;
*p_param = TRUE;
}
else if (buildingInfo[14].m_unk0x11) {
else if (buildingInfo[14].m_counter) {
result = buildingInfo[14].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0f30[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f30[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f30[i]].m_entity;
for (i = 0; g_stage0Plants[i] != -1; i++) {
if (plantInfo[g_stage0Plants[i]].m_counter) {
result = plantInfo[g_stage0Plants[i]].m_entity;
break;
}
}
}
break;
case 1:
if (buildingInfo[13].m_unk0x11) {
if (buildingInfo[13].m_counter) {
result = buildingInfo[13].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0f50[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f50[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f50[i]].m_entity;
for (i = 0; g_stage1Plants[i] != -1; i++) {
if (plantInfo[g_stage1Plants[i]].m_counter) {
result = plantInfo[g_stage1Plants[i]].m_entity;
break;
}
}
}
break;
case 2:
if (buildingInfo[9].m_unk0x11) {
if (buildingInfo[9].m_counter) {
result = buildingInfo[9].m_entity;
*p_param = TRUE;
}
else if (buildingInfo[11].m_unk0x11) {
else if (buildingInfo[11].m_counter) {
result = buildingInfo[11].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0f90[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f90[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0f90[i]].m_entity;
for (i = 0; g_stage2Plants[i] != -1; i++) {
if (plantInfo[g_stage2Plants[i]].m_counter) {
result = plantInfo[g_stage2Plants[i]].m_entity;
break;
}
}
}
break;
case 3:
if (buildingInfo[7].m_unk0x11) {
if (buildingInfo[7].m_counter) {
result = buildingInfo[7].m_entity;
*p_param = TRUE;
}
else if (buildingInfo[8].m_unk0x11) {
else if (buildingInfo[8].m_counter) {
result = buildingInfo[8].m_entity;
*p_param = TRUE;
}
else if (buildingInfo[3].m_unk0x11) {
else if (buildingInfo[3].m_counter) {
result = buildingInfo[3].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0fa8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fa8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fa8[i]].m_entity;
for (i = 0; g_stage3Plants[i] != -1; i++) {
if (plantInfo[g_stage3Plants[i]].m_counter) {
result = plantInfo[g_stage3Plants[i]].m_entity;
break;
}
}
}
break;
case 4:
if (buildingInfo[5].m_unk0x11) {
if (buildingInfo[5].m_counter) {
result = buildingInfo[5].m_entity;
*p_param = TRUE;
}
else if (buildingInfo[10].m_unk0x11) {
else if (buildingInfo[10].m_counter) {
result = buildingInfo[10].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0fb8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fb8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fb8[i]].m_entity;
for (i = 0; g_stage4Plants[i] != -1; i++) {
if (plantInfo[g_stage4Plants[i]].m_counter) {
result = plantInfo[g_stage4Plants[i]].m_entity;
break;
}
}
}
break;
case 5:
if (buildingInfo[4].m_unk0x11) {
if (buildingInfo[4].m_counter) {
result = buildingInfo[4].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f0fe8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fe8[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f0fe8[i]].m_entity;
for (i = 0; g_stage5Plants[i] != -1; i++) {
if (plantInfo[g_stage5Plants[i]].m_counter) {
result = plantInfo[g_stage5Plants[i]].m_entity;
break;
}
}
}
break;
case 6:
if (buildingInfo[2].m_unk0x11) {
if (buildingInfo[2].m_counter) {
result = buildingInfo[2].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f1000[i] != -1; i++) {
if (plantInfo[g_unk0x100f1000[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1000[i]].m_entity;
for (i = 0; g_stage6Plants[i] != -1; i++) {
if (plantInfo[g_stage6Plants[i]].m_counter) {
result = plantInfo[g_stage6Plants[i]].m_entity;
break;
}
}
}
break;
case 7:
if (buildingInfo[6].m_unk0x11) {
if (buildingInfo[6].m_counter) {
result = buildingInfo[6].m_entity;
*p_param = TRUE;
}
else {
for (i = 0; g_unk0x100f1018[i] != -1; i++) {
if (plantInfo[g_unk0x100f1018[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1018[i]].m_entity;
for (i = 0; g_stage7Plants[i] != -1; i++) {
if (plantInfo[g_stage7Plants[i]].m_counter) {
result = plantInfo[g_stage7Plants[i]].m_entity;
break;
}
}
}
break;
case 8:
for (i = 0; g_unk0x100f1030[i] != -1; i++) {
if (plantInfo[g_unk0x100f1030[i]].m_unk0x16) {
result = plantInfo[g_unk0x100f1030[i]].m_entity;
for (i = 0; g_stage8Plants[i] != -1; i++) {
if (plantInfo[g_stage8Plants[i]].m_counter) {
result = plantInfo[g_stage8Plants[i]].m_entity;
break;
}
}
@@ -862,7 +861,7 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
return result;
}
if (buildingInfo[15].m_unk0x11) {
if (buildingInfo[15].m_counter) {
result = buildingInfo[15].m_entity;
*p_param = TRUE;
}

View File

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

View File

@@ -70,7 +70,9 @@ MxResult Act3Ammo::Remove()
// FUNCTION: BETA10 0x1001d8b3
MxResult Act3Ammo::Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index)
{
#ifdef BETA10
assert(m_ammoFlag);
#endif
char name[12];
if (p_isPizza) {
@@ -198,7 +200,7 @@ MxResult Act3Ammo::FUN_10053d30(LegoPathController* p_p, MxFloat p_unk0x19c)
// FUNCTION: LEGO1 0x10053db0
// FUNCTION: BETA10 0x1001e0f0
MxResult Act3Ammo::FUN_10053db0(float p_param1, const Matrix4& p_param2)
MxResult Act3Ammo::FUN_10053db0(float p_param1, Matrix4& p_param2)
{
float local34 = p_param1 * p_param1;
@@ -271,8 +273,8 @@ void Act3Ammo::Animate(float p_time)
positionRef.Clear();
transform.RotateX(0.6);
positionRef = position;
m_roi->FUN_100a58f0(transform);
m_roi->VTable0x14();
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
return;
}
else {
@@ -280,8 +282,8 @@ void Act3Ammo::Animate(float p_time)
m_unk0x158 = 0;
positionRef -= g_unk0x10104f08;
m_roi->FUN_100a58f0(transform);
m_roi->VTable0x14();
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
return;
}
}
@@ -337,7 +339,7 @@ void Act3Ammo::Animate(float p_time)
Vector3 local174(local104[2]);
if (IsPizza()) {
local184 = *m_boundary->GetUnknown0x14();
local184 = *m_boundary->GetUp();
local17c[0] = 1.0f;
local17c[1] = local17c[2] = 0.0f;
local174.EqualsCross(local17c, local184);
@@ -345,7 +347,7 @@ void Act3Ammo::Animate(float p_time)
local17c.EqualsCross(local184, local174);
}
else {
local17c = *m_boundary->GetUnknown0x14();
local17c = *m_boundary->GetUp();
local184[0] = 1.0f;
local184[1] = local184[2] = 0.0f;
local174.EqualsCross(local17c, local184);
@@ -363,8 +365,8 @@ void Act3Ammo::Animate(float p_time)
MxMatrix localb0(local104);
local104.Product(local60, localb0);
m_roi->FUN_100a58f0(local104);
m_roi->VTable0x14();
m_roi->SetLocal2World(local104);
m_roi->WrappedUpdateWorldData();
if (m_BADuration <= m_unk0x7c) {
m_worldSpeed = 0.0f;
@@ -376,12 +378,14 @@ void Act3Ammo::Animate(float p_time)
if (IsBit4()) {
if (IsPizza()) {
m_world->RemovePizza(*this);
m_world->FUN_10072ad0(2);
m_world->TriggerHitSound(2);
}
else {
m_world->RemoveDonut(*this);
m_world->FUN_10072ad0(4);
m_world->TriggerHitSound(4);
}
return;
}
else {
if (IsPizza()) {
@@ -392,89 +396,99 @@ void Act3Ammo::Animate(float p_time)
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("stickdn", NULL, FALSE);
}
}
LegoPathActorSet& plpas = m_boundary->GetActors();
LegoPathActorSet lpas(plpas);
LegoPathActorSet& plpas = m_boundary->GetActors();
LegoPathActorSet lpas(plpas);
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
if (plpas.find(*itpa) != plpas.end() && this != *itpa) {
LegoROI* r = (*itpa)->GetROI();
assert(r);
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
if (plpas.find(*itpa) == plpas.end()) {
continue;
}
if (!strncmp(r->GetName(), "pammo", 5)) {
Mx3DPointFloat local1c8;
Mx3DPointFloat local1b4;
if (this == *itpa) {
continue;
}
local1c8 = r->GetLocal2World()[3];
local1b4 = m_roi->GetLocal2World()[3];
LegoROI* r = (*itpa)->GetROI();
assert(r);
local1b4 -= local1c8;
if (!strncmp(r->GetName(), "pammo", 5)) {
Mx3DPointFloat local1c8;
Mx3DPointFloat local1b4;
float radius = r->GetWorldBoundingSphere().Radius();
if (local1b4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
assert(0);
}
local1c8 = r->GetLocal2World()[3];
local1b4 = m_roi->GetLocal2World()[3];
assert(m_world);
local1b4 -= local1c8;
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
m_world->EatPizza(index);
m_world->m_brickster->FUN_100417c0();
}
if (IsDonut()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
m_world->RemoveDonut(*this);
local14 = TRUE;
break;
}
}
float radius = r->GetWorldBoundingSphere().Radius();
if (local1b4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
assert(0);
}
else if (!strncmp(r->GetName(), "dammo", 5)) {
Mx3DPointFloat local1f8;
Mx3DPointFloat local1e4;
local1f8 = r->GetLocal2World()[3];
local1e4 = m_roi->GetLocal2World()[3];
assert(m_world);
local1e4 -= local1f8;
#ifdef BETA10
m_world->EatPizza(index);
#else
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
m_world->EatPizza(index);
m_world->m_brickster->FUN_100417c0();
}
#endif
float radius = r->GetWorldBoundingSphere().Radius();
if (local1e4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
assert(0);
}
assert(m_world);
m_world->EatDonut(index);
if (IsPizza()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
m_world->RemovePizza(*this);
local14 = TRUE;
break;
}
}
if (IsDonut()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
m_world->RemoveDonut(*this);
local14 = TRUE;
break;
}
}
}
else if (!strncmp(r->GetName(), "dammo", 5)) {
Mx3DPointFloat local1f8;
Mx3DPointFloat local1e4;
if (!local14) {
if (IsPizza()) {
m_world->FUN_10073360(*this, local68);
}
else {
m_world->FUN_10073390(*this, local68);
}
local1f8 = r->GetLocal2World()[3];
local1e4 = m_roi->GetLocal2World()[3];
m_worldSpeed = -1.0f;
local1e4 -= local1f8;
float radius = r->GetWorldBoundingSphere().Radius();
if (local1e4.LenSquared() <= radius * radius) {
MxS32 index = -1;
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
assert(0);
}
assert(m_world);
m_world->EatDonut(index);
if (IsPizza()) {
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
m_world->RemovePizza(*this);
local14 = TRUE;
break;
}
}
}
}
if (!local14) {
if (IsPizza()) {
m_world->FUN_10073360(*this, local68);
}
else {
m_world->FUN_10073390(*this, local68);
}
m_worldSpeed = -1.0f;
}
}
}

View File

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

View File

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

View File

@@ -49,11 +49,11 @@ MxLong InfoCenterEntity::HandleClick(LegoEventNotificationParam& p_param)
}
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->FUN_10033350();
isle->SwitchToInfocenter();
isle->SetDestLocation(LegoGameState::Area::e_infomain);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
act1state->SetUnknown18(0);
act1state->SetState(Act1State::e_none);
break;
}
case LegoGameState::Act::e_act2: {
@@ -80,11 +80,11 @@ MxLong InfoCenterEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: LEGO1 0x100151d0
MxLong GasStationEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
if (state->GetUnknown18() != 8) {
state->SetUnknown18(0);
if (state->GetState() != Act1State::e_towtrack) {
state->SetState(Act1State::e_none);
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) UserActor())->Exit();
@@ -104,11 +104,11 @@ MxLong GasStationEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: LEGO1 0x10015270
MxLong HospitalEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
if (act1State->GetUnknown18() != 10) {
act1State->SetUnknown18(0);
if (act1State->GetState() != Act1State::e_ambulance) {
act1State->SetState(Act1State::e_none);
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) UserActor())->Exit();
@@ -128,11 +128,11 @@ MxLong HospitalEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: LEGO1 0x10015310
MxLong PoliceEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
if (state->GetUnknown18() != 10) {
state->SetUnknown18(0);
if (state->GetState() != Act1State::e_ambulance) {
state->SetState(Act1State::e_none);
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) UserActor())->Exit();
@@ -152,9 +152,9 @@ MxLong PoliceEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: LEGO1 0x100153b0
MxLong BeachHouseEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
state->SetUnknown18(0);
state->SetState(Act1State::e_none);
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) UserActor())->Exit();
@@ -173,9 +173,9 @@ MxLong BeachHouseEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: LEGO1 0x10015450
MxLong RaceStandsEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
state->SetUnknown18(0);
state->SetState(Act1State::e_none);
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) UserActor())->Exit();
@@ -195,7 +195,7 @@ MxLong RaceStandsEntity::HandleClick(LegoEventNotificationParam& p_param)
// FUNCTION: BETA10 0x100256e8
MxLong JailEntity::HandleClick(LegoEventNotificationParam& p_param)
{
if (FUN_1003ef60()) {
if (CanExit()) {
PlayCamAnim(UserActor(), FALSE, 18, TRUE);
}

View File

@@ -45,7 +45,7 @@ MxLong BumpBouy::Notify(MxParam& p_param)
Act1State* isleState = (Act1State*) GameState()->GetState("Act1State");
assert(isleState);
isleState->m_unk0x018 = 5;
isleState->m_state = Act1State::e_transitionToJetski;
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
assert(isle);

View File

@@ -89,24 +89,24 @@ void Doors::Animate(float p_time)
local10.Clear();
local58.RotateY(-local8);
local10 = m_ltDoorLocal[3];
m_ltDoor->FUN_100a58f0(local58);
m_ltDoor->VTable0x14();
m_ltDoor->SetLocal2World(local58);
m_ltDoor->WrappedUpdateWorldData();
local58 = m_rtDoorLocal;
local10.Clear();
local58.RotateY(local8);
local10 = m_rtDoorLocal[3];
m_rtDoor->FUN_100a58f0(local58);
m_rtDoor->VTable0x14();
m_rtDoor->SetLocal2World(local58);
m_rtDoor->WrappedUpdateWorldData();
m_unk0x1f4 = local8;
}
if (m_unk0x158 + g_unk0x100d8e84 < p_time) {
m_ltDoor->FUN_100a58f0(m_ltDoorLocal);
m_rtDoor->FUN_100a58f0(m_rtDoorLocal);
m_ltDoor->VTable0x14();
m_rtDoor->VTable0x14();
m_ltDoor->SetLocal2World(m_ltDoorLocal);
m_rtDoor->SetLocal2World(m_rtDoorLocal);
m_ltDoor->WrappedUpdateWorldData();
m_rtDoor->WrappedUpdateWorldData();
m_unk0x154 = 1;
m_actorState = c_initial;
m_unk0x1f4 = 0;

View File

@@ -88,11 +88,11 @@ void DuneBuggy::Exit()
// FUNCTION: LEGO1 0x10068060
MxLong DuneBuggy::HandleClick()
{
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}
FUN_10015820(TRUE, 0);
Disable(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_dunecar);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@@ -121,11 +121,11 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_DuneCarArms_Ctl:
Exit();
GameState()->m_currentArea = LegoGameState::e_unk66;
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
result = 1;
break;
case IsleScript::c_DuneCarInfo_Ctl:
@@ -137,7 +137,7 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param)
case IsleScript::c_DuneCarHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "DuneCarHorn_Sound");
presenter->Enable(p_param.m_unk0x28);
presenter->Enable(p_param.m_enabledChild);
break;
}
}
@@ -192,8 +192,8 @@ void DuneBuggy::ActivateSceneActions()
PlayMusic(JukeboxScript::c_GarageArea_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@@ -82,7 +82,7 @@ void Helicopter::Exit()
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
SpawnPlayer(
LegoGameState::e_unk40,
LegoGameState::e_helicopterSpawn,
TRUE,
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
);
@@ -121,7 +121,7 @@ void Helicopter::Exit()
// FUNCTION: BETA10 0x1002a3db
MxLong Helicopter::HandleClick()
{
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}
@@ -148,7 +148,7 @@ MxLong Helicopter::HandleClick()
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_copter);
FUN_10015820(TRUE, 0);
Disable(TRUE, 0);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
SetActorState(c_disabled);
PlayMusic(JukeboxScript::c_Jail_Music);
@@ -189,7 +189,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
break;
}
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
MxU32 isPizza = FALSE;
switch (p_param.m_clickedObjectId) {
@@ -203,7 +203,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
}
Exit();
GameState()->m_currentArea = LegoGameState::e_unk66;
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
result = 1;
break;
case IsleScript::c_Helicopter_TakeOff_Ctl: {
@@ -214,7 +214,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
assert(act1State);
if (m_state->m_unk0x08 == 0) {
act1State->m_unk0x018 = 4;
act1State->m_state = Act1State::e_helicopter;
m_state->m_unk0x08 = 1;
m_world->RemoveActor(this);
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterTakeOff_Anim, NULL);
@@ -318,7 +318,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
assert(act1State);
act1State->m_unk0x018 = 4;
act1State->m_state = Act1State::e_helicopter;
SpawnPlayer(
LegoGameState::e_unk42,
TRUE,
@@ -359,7 +359,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
assert(act1State);
act1State->m_unk0x018 = 0;
act1State->m_state = Act1State::e_none;
SpawnPlayer(
LegoGameState::e_unk41,
TRUE,
@@ -391,8 +391,8 @@ void Helicopter::VTable0x74(Matrix4& p_transform)
FUN_10010c30();
}
else {
m_roi->FUN_100a58f0(p_transform);
m_roi->VTable0x14();
m_roi->SetLocal2World(p_transform);
m_roi->WrappedUpdateWorldData();
if (m_cameraFlag) {
FUN_10010c30();
}
@@ -426,7 +426,7 @@ void Helicopter::Animate(float p_time)
v2 *= f2;
v2 += v1;
m_world->GetCameraController()->FUN_100123e0(mat, 0);
m_world->GetCameraController()->TransformPointOfView(mat, 0);
}
else {
if (m_state->m_unk0x08 == 4) {
@@ -455,9 +455,11 @@ void Helicopter::FUN_100042a0(const Matrix4& p_matrix)
Vector3 vec3(m_unk0x1a8[0]); // locala8 // esp+0x20
Vector3 vec4(m_unk0x1a8[1]); // localb8 // esp+0x10
Vector3 vec5(m_unk0x1a8[2]); // EDI
Vector3 vec6(m_unk0x1a8[3]); // locala0 // esp+0x28
m_world->GetCameraController()->FUN_100123b0(local48);
// the typecast makes this function match for unknown reasons
Vector3 vec6((const float*) m_unk0x1a8[3]); // locala0 // esp+0x28
m_world->GetCameraController()->GetPointOfView(local48);
m_unk0x1a8.SetIdentity();
local90 = p_matrix;

View File

@@ -119,11 +119,11 @@ void IslePathActor::Exit()
MxS32 i;
for (i = 0; i < m_boundary->GetNumEdges(); i++) {
LegoUnknown100db7f4* e = (LegoUnknown100db7f4*) m_boundary->GetEdges()[i];
LegoOrientedEdge* e = (LegoOrientedEdge*) m_boundary->GetEdges()[i];
assert(e);
Mx3DPointFloat local20;
e->FUN_1002ddc0(*m_boundary, local20);
e->GetFaceNormal(*m_boundary, local20);
local20 *= m_roi->GetWorldBoundingSphere().Radius();
local20 += GetWorldPosition();
@@ -148,12 +148,12 @@ void IslePathActor::Exit()
}
m_previousActor->SetActorState(c_initial);
GameState()->m_currentArea = LegoGameState::Area::e_unk66;
GameState()->m_currentArea = LegoGameState::Area::e_vehicleExited;
}
FUN_1001b660();
FUN_10010c30();
FUN_1003eda0();
ResetViewVelocity();
}
// GLOBAL: LEGO1 0x10102b28
@@ -199,7 +199,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_Quiet_Audio
);
g_spawnLocations[3] = SpawnLocation(
LegoGameState::e_unk4,
LegoGameState::e_infocenterExited,
g_isleScript,
0,
"int46",
@@ -223,7 +223,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_Beach_Music
);
g_spawnLocations[5] = SpawnLocation(
LegoGameState::e_unk17,
LegoGameState::e_jetskibuildExited,
g_isleScript,
0,
"EDG00_46",
@@ -259,7 +259,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_CentralNorthRoad_Music
);
g_spawnLocations[8] = SpawnLocation(
LegoGameState::e_unk20,
LegoGameState::e_racecarbuildExited,
g_isleScript,
0,
"INT16",
@@ -295,7 +295,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_GarageArea_Music
);
g_spawnLocations[11] = SpawnLocation(
LegoGameState::e_unk28,
LegoGameState::e_garageExited,
g_isleScript,
0,
"INT24",
@@ -319,7 +319,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_Hospital_Music
);
g_spawnLocations[13] = SpawnLocation(
LegoGameState::e_unk31,
LegoGameState::e_hospitalExited,
g_isleScript,
0,
"EDG02_28",
@@ -343,7 +343,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_PoliceStation_Music
);
g_spawnLocations[15] = SpawnLocation(
LegoGameState::e_unk33,
LegoGameState::e_policeExited,
g_isleScript,
0,
"EDG02_64",
@@ -355,7 +355,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_PoliceStation_Music
);
g_spawnLocations[16] = SpawnLocation(
LegoGameState::e_unk40,
LegoGameState::e_helicopterSpawn,
g_isleScript,
0,
"edg02_51",
@@ -379,7 +379,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[18] = SpawnLocation(
LegoGameState::e_unk43,
LegoGameState::e_dunebuggySpawn,
g_isleScript,
0,
"edg02_35",
@@ -391,7 +391,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[19] = SpawnLocation(
LegoGameState::e_unk44,
LegoGameState::e_racecarSpawn,
g_isleScript,
0,
"EDG03_01",
@@ -403,7 +403,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[20] = SpawnLocation(
LegoGameState::e_unk45,
LegoGameState::e_jetskiSpawn,
g_isleScript,
0,
"edg10_70",
@@ -475,7 +475,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[26] = SpawnLocation(
LegoGameState::e_unk52,
LegoGameState::e_towTrackHookedUp,
g_isleScript,
0,
"edg02_19",
@@ -598,7 +598,7 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_enter, MxU8
}
if (m_cameraFlag) {
FUN_1003eda0();
ResetViewVelocity();
}
if (p_flags & c_playMusic && g_spawnLocations[i].m_music != JukeboxScript::c_noneJukebox) {
@@ -630,9 +630,9 @@ void IslePathActor::VTable0xec(MxMatrix p_transform, LegoPathBoundary* p_boundar
m_world->Add(this);
}
m_roi->FUN_100a58f0(p_transform);
m_roi->SetLocal2World(p_transform);
if (m_cameraFlag) {
FUN_1003eda0();
ResetViewVelocity();
FUN_10010c30();
}
}
@@ -648,6 +648,6 @@ void IslePathActor::FUN_1001b660()
up *= -1.0f;
position.EqualsCross(direction, up);
m_roi->FUN_100a58f0(transform);
m_roi->VTable0x14();
m_roi->SetLocal2World(transform);
m_roi->WrappedUpdateWorldData();
}

View File

@@ -67,7 +67,7 @@ void Jetski::Animate(float p_time)
// FUNCTION: LEGO1 0x1007e6f0
void Jetski::Exit()
{
SpawnPlayer(LegoGameState::e_unk45, FALSE, c_spawnBit1 | c_playMusic | c_spawnBit3);
SpawnPlayer(LegoGameState::e_jetskiSpawn, FALSE, c_spawnBit1 | c_playMusic | c_spawnBit3);
IslePathActor::Exit();
GameState()->m_currentArea = LegoGameState::e_jetski;
RemoveFromWorld();
@@ -81,11 +81,11 @@ void Jetski::Exit()
MxLong Jetski::HandleClick()
{
#ifndef BETA10
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}
FUN_10015820(TRUE, 0);
Disable(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_jetski);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@@ -137,13 +137,13 @@ void Jetski::RemoveFromWorld()
// FUNCTION: LEGO1 0x1007e8e0
MxLong Jetski::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1 && CurrentWorld()->IsA("Isle")) {
if (p_param.m_enabledChild == 1 && CurrentWorld()->IsA("Isle")) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_JetskiArms_Ctl:
Exit();
((IslePathActor*) UserActor())
->SpawnPlayer(LegoGameState::e_jetraceExterior, TRUE, c_spawnBit1 | c_playMusic | c_spawnBit3);
GameState()->m_currentArea = LegoGameState::e_unk66;
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
return 1;
case IsleScript::c_JetskiInfo_Ctl:
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
@@ -162,12 +162,12 @@ void Jetski::ActivateSceneActions()
PlayMusic(JukeboxScript::c_JetskiRace_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x018) {
if (act1state->m_unk0x022) {
if (!act1state->m_state) {
if (act1state->m_playedExitExplanation) {
PlayCamAnim(this, FALSE, 68, TRUE);
}
else {
act1state->m_unk0x022 = TRUE;
act1state->m_playedExitExplanation = TRUE;
LegoPathActor* user = UserActor();
if (user != NULL) {

View File

@@ -36,7 +36,7 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param)
MxNotificationParam& param = (MxNotificationParam&) p_param;
if (param.GetNotification() == c_notificationClick) {
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}

View File

@@ -84,11 +84,11 @@ void Motocycle::Exit()
// FUNCTION: LEGO1 0x10035c50
MxLong Motocycle::HandleClick()
{
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}
FUN_10015820(TRUE, 0);
Disable(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_motocycle);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@@ -115,11 +115,11 @@ MxLong Motocycle::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_MotoBikeArms_Ctl:
Exit();
GameState()->m_currentArea = LegoGameState::e_unk66;
GameState()->m_currentArea = LegoGameState::e_vehicleExited;
result = 1;
break;
case IsleScript::c_MotoBikeInfo_Ctl:
@@ -151,8 +151,8 @@ void Motocycle::ActivateSceneActions()
PlayMusic(JukeboxScript::c_PoliceStation_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@@ -136,9 +136,9 @@ Pizza::Pizza()
m_mission = NULL;
m_skateBoard = NULL;
m_act1state = NULL;
m_unk0x8c = IsleScript::c_noneIsle;
m_unk0x98 = FALSE;
m_unk0x90 = INT_MIN;
m_speechAction = IsleScript::c_noneIsle;
m_playedLocationAnimation = FALSE;
m_startTime = INT_MIN;
}
// FUNCTION: LEGO1 0x10038100
@@ -177,42 +177,42 @@ void Pizza::CreateState()
// FUNCTION: LEGO1 0x10038220
// FUNCTION: BETA10 0x100edb81
void Pizza::FUN_10038220(IsleScript::Script p_objectId)
void Pizza::Start(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_10064740(NULL);
m_mission = m_state->GetMission(GameState()->GetActorId());
m_state->m_unk0x0c = 1;
m_act1state->m_unk0x018 = 3;
m_state->m_state = PizzaMissionState::e_introduction;
m_act1state->m_state = Act1State::e_pizza;
m_mission->m_startTime = INT_MIN;
g_isleFlags &= ~Isle::c_playMusic;
AnimationManager()->EnableCamAnims(FALSE);
AnimationManager()->FUN_1005f6d0(FALSE);
PlayAction(p_objectId, FALSE);
m_unk0x8c = IsleScript::c_noneIsle;
m_speechAction = IsleScript::c_noneIsle;
}
// FUNCTION: LEGO1 0x100382b0
// FUNCTION: BETA10 0x100edc9b
void Pizza::FUN_100382b0()
void Pizza::Reset()
{
if (m_state->m_unk0x0c != 8) {
if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x8c, NULL);
if (m_state->m_state != PizzaMissionState::e_transitionToAct2) {
if (m_speechAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_speechAction, NULL);
}
m_act1state->m_unk0x018 = 0;
m_state->m_unk0x0c = 0;
m_act1state->m_state = Act1State::e_none;
m_state->m_state = PizzaMissionState::e_none;
UserActor()->SetActorState(LegoPathActor::c_initial);
g_isleFlags |= Isle::c_playMusic;
AnimationManager()->EnableCamAnims(TRUE);
AnimationManager()->FUN_1005f6d0(TRUE);
m_mission->m_startTime = INT_MIN;
m_mission = NULL;
m_unk0x98 = FALSE;
m_unk0x8c = IsleScript::c_noneIsle;
m_playedLocationAnimation = FALSE;
m_speechAction = IsleScript::c_noneIsle;
BackgroundAudioManager()->RaiseVolume();
TickleManager()->UnregisterClient(this);
m_unk0x90 = INT_MIN;
m_startTime = INT_MIN;
m_skateBoard->EnableScenePresentation(FALSE);
m_skateBoard->SetPizzaVisible(FALSE);
MxTrace("Pizza mission: idle\n");
@@ -237,15 +237,15 @@ void Pizza::StopActions()
// FUNCTION: BETA10 0x100edd10
MxLong Pizza::HandleClick()
{
if (m_state->m_unk0x0c == 1) {
m_state->m_unk0x0c = 2;
if (m_state->m_state == PizzaMissionState::e_introduction) {
m_state->m_state = PizzaMissionState::e_waitAcceptingQuest;
m_mission->m_startTime = Timer()->GetTime();
TickleManager()->RegisterClient(this, 200);
AnimationManager()->FUN_10061010(FALSE);
}
if (m_state->m_unk0x0c == 2) {
m_act1state->m_unk0x018 = 3;
if (m_state->m_state == PizzaMissionState::e_waitAcceptingQuest) {
m_act1state->m_state = Act1State::e_pizza;
if (m_skateBoard == NULL) {
m_skateBoard = (SkateBoard*) m_world->Find(m_atomId, IsleScript::c_SkateBoard_Actor);
@@ -254,7 +254,7 @@ MxLong Pizza::HandleClick()
IsleScript::Script action;
switch (m_state->FUN_10039540()) {
switch (m_state->GetActorState()) {
case 0:
action = m_mission->m_actions[m_mission->m_numActions + 3];
break;
@@ -266,7 +266,7 @@ MxLong Pizza::HandleClick()
}
PlayAction(action, TRUE);
m_state->m_unk0x0c = 3;
m_state->m_state = PizzaMissionState::e_started;
PlayMusic(JukeboxScript::c_PizzaMission_Music);
return 1;
}
@@ -278,13 +278,13 @@ MxLong Pizza::HandleClick()
// FUNCTION: BETA10 0x100ede53
MxLong Pizza::HandlePathStruct(LegoPathStructNotificationParam& p_param)
{
if (m_state->m_unk0x0c == 4) {
if (m_state->m_state == PizzaMissionState::e_delivering) {
MxLong time = Timer()->GetTime() - m_mission->m_startTime;
if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x12e &&
GameState()->GetActorId() == LegoActor::c_pepper) {
m_state->m_unk0x0c = 5;
m_state->SetUnknown0xb0(SndanimScript::c_TRS302_OpenJailDoor);
m_state->m_state = PizzaMissionState::e_arrivedAtDestination;
m_state->SetPlayedAction(SndanimScript::c_TRS302_OpenJailDoor);
if (time < m_mission->GetRedFinishTime()) {
m_mission->UpdateScore(LegoState::e_red);
@@ -325,43 +325,43 @@ MxLong Pizza::HandlePathStruct(LegoPathStructNotificationParam& p_param)
case IsleScript::c_pps025ni_RunAnim:
case IsleScript::c_pps026ni_RunAnim:
case IsleScript::c_pps027ni_RunAnim:
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 3800;
m_startTime = Timer()->GetTime();
m_duration = 3800;
break;
case IsleScript::c_pgs050nu_RunAnim:
case IsleScript::c_pgs051nu_RunAnim:
case IsleScript::c_pgs052nu_RunAnim:
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 6400;
m_startTime = Timer()->GetTime();
m_duration = 6400;
break;
case IsleScript::c_prt072sl_RunAnim:
case IsleScript::c_prt073sl_RunAnim:
case IsleScript::c_prt074sl_RunAnim:
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 7000;
m_startTime = Timer()->GetTime();
m_duration = 7000;
break;
case IsleScript::c_pho104re_RunAnim:
case IsleScript::c_pho105re_RunAnim:
case IsleScript::c_pho106re_RunAnim:
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 6500;
m_startTime = Timer()->GetTime();
m_duration = 6500;
break;
}
m_state->m_unk0x0c = 5;
m_state->m_state = PizzaMissionState::e_arrivedAtDestination;
PlayAction(action, TRUE);
MxTrace("Pizza mission: ending\n");
}
else if (p_param.GetTrigger() == LegoPathStruct::c_w) {
if (p_param.GetData() == 0x15e && GameState()->GetActorId() == LegoActor::c_pepper) {
if (!m_unk0x98) {
m_unk0x98 = TRUE;
if (!m_playedLocationAnimation) {
m_playedLocationAnimation = TRUE;
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns050p1_RunAnim, NULL);
}
}
else if (p_param.GetData() == 0x15f && GameState()->GetActorId() == LegoActor::c_papa && !m_unk0x98) {
m_unk0x98 = TRUE;
else if (p_param.GetData() == 0x15f && GameState()->GetActorId() == LegoActor::c_papa && !m_playedLocationAnimation) {
m_playedLocationAnimation = TRUE;
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_wns050p1_RunAnim, NULL);
}
}
@@ -376,52 +376,52 @@ MxResult Pizza::Tickle()
{
MxLong time = Timer()->GetTime();
if (m_unk0x90 != INT_MIN && m_unk0x94 + m_unk0x90 <= time) {
m_unk0x90 = INT_MIN;
if (m_startTime != INT_MIN && m_duration + m_startTime <= time) {
m_startTime = INT_MIN;
m_skateBoard->EnableScenePresentation(FALSE);
m_skateBoard->SetPizzaVisible(FALSE);
TickleManager()->UnregisterClient(this);
}
if (m_mission != NULL && m_mission->m_startTime != INT_MIN) {
if (m_state->m_unk0x0c == 4) {
if (m_state->m_state == PizzaMissionState::e_delivering) {
assert(m_mission);
if (time > m_mission->m_startTime + m_mission->GetTimeoutTime()) {
StopActions();
m_mission->UpdateScore(LegoState::e_grey);
FUN_100382b0();
Reset();
BackgroundAudioManager()->LowerVolume();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Avo917In_PlayWav, NULL);
MxTrace("Pizza mission: timeout, stop\n");
}
else if (time >= m_mission->m_startTime + 35000 && m_unk0x8c == IsleScript::c_noneIsle) {
else if (time >= m_mission->m_startTime + 35000 && m_speechAction == IsleScript::c_noneIsle) {
switch (GameState()->GetActorId()) {
case LegoActor::c_pepper:
m_unk0x8c = IsleScript::c_Avo914In_PlayWav;
m_speechAction = IsleScript::c_Avo914In_PlayWav;
break;
case LegoActor::c_mama:
m_unk0x8c = IsleScript::c_Avo910In_PlayWav;
m_speechAction = IsleScript::c_Avo910In_PlayWav;
break;
case LegoActor::c_papa:
m_unk0x8c = IsleScript::c_Avo912In_PlayWav;
m_speechAction = IsleScript::c_Avo912In_PlayWav;
break;
case LegoActor::c_nick:
m_unk0x8c = IsleScript::c_Avo911In_PlayWav;
m_speechAction = IsleScript::c_Avo911In_PlayWav;
break;
case LegoActor::c_laura:
m_unk0x8c = IsleScript::c_Avo913In_PlayWav;
m_speechAction = IsleScript::c_Avo913In_PlayWav;
break;
}
BackgroundAudioManager()->LowerVolume();
if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_start, *g_isleScript, m_unk0x8c, NULL);
if (m_speechAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_start, *g_isleScript, m_speechAction, NULL);
}
}
}
else if (m_state->m_unk0x0c == 2) {
else if (m_state->m_state == PizzaMissionState::e_waitAcceptingQuest) {
assert(m_mission);
if (Timer()->GetTime() > m_mission->m_startTime + 5000) {
@@ -429,7 +429,7 @@ MxResult Pizza::Tickle()
m_skateBoard->EnableScenePresentation(FALSE);
TickleManager()->UnregisterClient(this);
m_mission->UpdateScore(LegoState::e_grey);
m_state->m_unk0x0c = 9;
m_state->m_state = PizzaMissionState::e_timeoutAcceptingQuest;
AnimationManager()->FUN_1005f6d0(TRUE);
PlayAction(m_mission->GetUnknownFinishAction(), TRUE);
MxTrace("Pizza mission: timeout, declining\n");
@@ -447,22 +447,22 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam& p_param)
MxLong result = 0;
MxU32 objectId = p_param.GetAction()->GetObjectId();
if (m_unk0x8c == objectId) {
if (m_speechAction == objectId) {
BackgroundAudioManager()->RaiseVolume();
return 1;
}
switch (m_state->m_unk0x0c) {
case 1:
if (m_state->GetUnknown0xb0() == objectId) {
m_state->m_unk0x0c = 2;
switch (m_state->m_state) {
case PizzaMissionState::e_introduction:
if (m_state->GetPlayedAction() == objectId) {
m_state->m_state = PizzaMissionState::e_waitAcceptingQuest;
m_mission->m_startTime = Timer()->GetTime();
TickleManager()->RegisterClient(this, 200);
MxTrace("Pizza mission: proposed\n");
}
break;
case 3:
if (m_state->GetUnknown0xb0() == objectId) {
case PizzaMissionState::e_started:
if (m_state->GetPlayedAction() == objectId) {
m_mission->m_startTime = Timer()->GetTime();
PizzaMissionState::Mission* mission = m_mission;
@@ -470,8 +470,8 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam& p_param)
InvokeAction(Extra::e_start, *g_isleScript, mission->GetActions()[i], NULL);
}
m_state->m_unk0x0c = 4;
m_state->SetUnknown0xb0(IsleScript::c_noneIsle);
m_state->m_state = PizzaMissionState::e_delivering;
m_state->SetPlayedAction(IsleScript::c_noneIsle);
UserActor()->SetActorState(LegoPathActor::c_initial);
m_skateBoard->SetPizzaVisible(TRUE);
m_world->PlaceActor(m_skateBoard, "int37", 2, 0.5, 3, 0.5);
@@ -489,42 +489,42 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam& p_param)
result = 1;
}
break;
case 5:
if (m_state->GetUnknown0xb0() == objectId) {
case PizzaMissionState::e_arrivedAtDestination:
if (m_state->GetPlayedAction() == objectId) {
StopActions();
if (GameState()->GetActorId() == LegoActor::c_pepper) {
IsleScript::Script action = IsleScript::c_noneIsle;
if (!((Isle*) CurrentWorld())->HasHelicopter()) {
switch (m_mission->m_unk0x14) {
switch (m_mission->m_counter) {
case 1:
action = IsleScript::c_pja126br_RunAnim;
m_mission->m_unk0x14++;
m_state->m_unk0x0c = 6;
m_mission->m_counter++;
m_state->m_state = PizzaMissionState::e_suggestHelicopter;
MxTrace("Pizza mission: succeeds\n");
break;
case 2:
action = IsleScript::c_pja129br_RunAnim;
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 500;
m_mission->m_unk0x14++;
m_state->m_unk0x0c = 6;
m_startTime = Timer()->GetTime();
m_duration = 500;
m_mission->m_counter++;
m_state->m_state = PizzaMissionState::e_suggestHelicopter;
MxTrace("Pizza mission: succeeds\n");
break;
case 3:
action = IsleScript::c_pja131br_RunAnim;
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 500;
m_state->m_unk0x0c = 6;
m_startTime = Timer()->GetTime();
m_duration = 500;
m_state->m_state = PizzaMissionState::e_suggestHelicopter;
break;
}
}
else {
action = IsleScript::c_pja132br_RunAnim;
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 2300;
m_state->m_unk0x0c = 8;
m_startTime = Timer()->GetTime();
m_duration = 2300;
m_state->m_state = PizzaMissionState::e_transitionToAct2;
InputManager()->DisableInputProcessing();
InputManager()->SetUnknown336(TRUE);
MxTrace("Pizza mission: go to Act2\n");
@@ -533,42 +533,42 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam& p_param)
PlayAction(action, TRUE);
}
else {
FUN_100382b0();
m_state->m_unk0x0c = 0;
m_state->SetUnknown0xb0(IsleScript::c_noneIsle);
Reset();
m_state->m_state = PizzaMissionState::e_none;
m_state->SetPlayedAction(IsleScript::c_noneIsle);
}
}
break;
case 6:
if (m_state->GetUnknown0xb0() == objectId) {
case PizzaMissionState::e_suggestHelicopter:
if (m_state->GetPlayedAction() == objectId) {
if (objectId == IsleScript::c_pja126br_RunAnim) {
PlayAction(IsleScript::c_pja127br_RunAnim, TRUE);
m_unk0x90 = Timer()->GetTime();
m_unk0x94 = 700;
PlayAction(IsleScript::c_pja127br_RunAnim, TRUE); // build helicopter!
m_startTime = Timer()->GetTime();
m_duration = 700;
}
else if (objectId == IsleScript::c_pja129br_RunAnim) {
PlayAction(IsleScript::c_pja130br_RunAnim, TRUE);
PlayAction(IsleScript::c_pja130br_RunAnim, TRUE); // build helicopter!
}
else {
FUN_100382b0();
m_state->m_unk0x0c = 0;
m_state->SetUnknown0xb0(IsleScript::c_noneIsle);
Reset();
m_state->m_state = PizzaMissionState::e_none;
m_state->SetPlayedAction(IsleScript::c_noneIsle);
}
}
break;
case 8:
if (m_state->GetUnknown0xb0() == objectId) {
m_act1state->m_unk0x018 = 0;
m_state->m_unk0x0c = 0;
case PizzaMissionState::e_transitionToAct2:
if (m_state->GetPlayedAction() == objectId) {
m_act1state->m_state = Act1State::e_none;
m_state->m_state = PizzaMissionState::e_none;
GameState()->m_currentArea = LegoGameState::e_isle;
TickleManager()->UnregisterClient(this);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_act2main);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
break;
case 9:
if (m_state->GetUnknown0xb0() == objectId) {
FUN_100382b0();
case PizzaMissionState::e_timeoutAcceptingQuest:
if (m_state->GetPlayedAction() == objectId) {
Reset();
}
break;
}
@@ -580,10 +580,10 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam& p_param)
// FUNCTION: BETA10 0x100ef520
void Pizza::PlayAction(MxU32 p_objectId, MxBool p_param7)
{
m_state->SetUnknown0xb0(p_objectId);
m_state->SetPlayedAction(p_objectId);
if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x8c, NULL);
if (m_speechAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_speechAction, NULL);
}
AnimationManager()
@@ -594,14 +594,14 @@ void Pizza::PlayAction(MxU32 p_objectId, MxBool p_param7)
// FUNCTION: BETA10 0x100eea25
PizzaMissionState::PizzaMissionState()
{
m_unk0x0c = 0;
m_state = PizzaMissionState::e_none;
m_missions[0] = Mission(LegoActor::c_pepper, 2, g_pepperFinishTimes, g_pepperActions, 4);
m_missions[1] = Mission(LegoActor::c_mama, 2, g_mamaFinishTimes, g_mamaActions, 4);
m_missions[2] = Mission(LegoActor::c_papa, 2, g_papaFinishTimes, g_papaActions, 4);
m_missions[3] = Mission(LegoActor::c_nick, 2, g_nickFinishTimes, g_nickActions, 4);
m_missions[4] = Mission(LegoActor::c_laura, 2, g_lauraFinishTimes, g_lauraActions, 4);
m_pizzeriaState = (PizzeriaState*) GameState()->GetState("PizzeriaState");
m_unk0xb0 = IsleScript::c_noneIsle;
m_playedAction = IsleScript::c_noneIsle;
}
// FUNCTION: LEGO1 0x100393c0
@@ -613,7 +613,7 @@ MxResult PizzaMissionState::Serialize(LegoStorage* p_storage)
if (p_storage->IsReadMode()) {
for (MxS16 i = 0; i < 5; i++) {
p_storage->ReadS16(m_missions[i].m_unk0x06);
p_storage->ReadS16(m_missions[i].m_unk0x14);
p_storage->ReadS16(m_missions[i].m_counter);
p_storage->ReadS16(m_missions[i].m_score);
p_storage->ReadS16(m_missions[i].m_hiScore);
}
@@ -621,7 +621,7 @@ MxResult PizzaMissionState::Serialize(LegoStorage* p_storage)
else if (p_storage->IsWriteMode()) {
for (MxS16 i = 0; i < 5; i++) {
p_storage->WriteS16(m_missions[i].m_unk0x06);
p_storage->WriteS16(m_missions[i].m_unk0x14);
p_storage->WriteS16(m_missions[i].m_counter);
p_storage->WriteS16(m_missions[i].m_score);
p_storage->WriteS16(m_missions[i].m_hiScore);
}
@@ -645,7 +645,7 @@ PizzaMissionState::Mission* PizzaMissionState::GetMission(MxU8 p_actorId)
}
// FUNCTION: LEGO1 0x10039540
MxS16 PizzaMissionState::FUN_10039540()
MxS16 PizzaMissionState::GetActorState()
{
return m_pizzeriaState->FUN_10017d50();
return m_pizzeriaState->GetActorState();
}

View File

@@ -69,7 +69,7 @@ void Pizzeria::CreateState()
// FUNCTION: BETA10 0x100efc91
MxLong Pizzeria::HandleClick()
{
if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) {
if (CanExit() && m_pizzaMissionState->m_state == PizzaMissionState::e_none) {
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
if (!UserActor()->IsA("SkateBoard")) {
((IslePathActor*) UserActor())->Exit();
@@ -79,7 +79,7 @@ MxLong Pizzeria::HandleClick()
AnimationManager()->FUN_10061010(FALSE);
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
pizza->FUN_10038220((IsleScript::Script) m_pizzeriaState->NextAction());
pizza->Start((IsleScript::Script) m_pizzeriaState->NextAction());
}
return 1;
@@ -89,18 +89,18 @@ MxLong Pizzeria::HandleClick()
// FUNCTION: BETA10 0x100efd14
PizzeriaState::PizzeriaState()
{
m_unk0x08[0] = Playlist((MxU32*) g_pepperActions, sizeOfArray(g_pepperActions), Playlist::e_once);
m_unk0x08[1] = Playlist((MxU32*) g_mamaActions, sizeOfArray(g_mamaActions), Playlist::e_once);
m_unk0x08[2] = Playlist((MxU32*) g_papaActions, sizeOfArray(g_papaActions), Playlist::e_once);
m_unk0x08[3] = Playlist((MxU32*) g_nickActions, sizeOfArray(g_nickActions), Playlist::e_once);
m_unk0x08[4] = Playlist((MxU32*) g_lauraActions, sizeOfArray(g_lauraActions), Playlist::e_once);
memset(m_unk0x44, -1, sizeof(m_unk0x44));
m_playerPlaylists[0] = Playlist((MxU32*) g_pepperActions, sizeOfArray(g_pepperActions), Playlist::e_once);
m_playerPlaylists[1] = Playlist((MxU32*) g_mamaActions, sizeOfArray(g_mamaActions), Playlist::e_once);
m_playerPlaylists[2] = Playlist((MxU32*) g_papaActions, sizeOfArray(g_papaActions), Playlist::e_once);
m_playerPlaylists[3] = Playlist((MxU32*) g_nickActions, sizeOfArray(g_nickActions), Playlist::e_once);
m_playerPlaylists[4] = Playlist((MxU32*) g_lauraActions, sizeOfArray(g_lauraActions), Playlist::e_once);
memset(m_states, -1, sizeof(m_states));
}
// FUNCTION: LEGO1 0x10017d50
MxS16 PizzeriaState::FUN_10017d50()
MxS16 PizzeriaState::GetActorState()
{
return m_unk0x44[GameState()->GetActorId() - 1];
return m_states[GameState()->GetActorId() - 1];
}
// FUNCTION: LEGO1 0x10017d70
@@ -109,11 +109,11 @@ MxU32 PizzeriaState::NextAction()
{
MxU8 actorId = GameState()->GetActorId();
if (m_unk0x44[actorId - 1] < 2) {
m_unk0x44[actorId - 1]++;
if (m_states[actorId - 1] < 2) {
m_states[actorId - 1]++;
}
return m_unk0x08[actorId - 1].Next();
return m_playerPlaylists[actorId - 1].Next();
}
// FUNCTION: LEGO1 0x10017da0
@@ -124,12 +124,12 @@ MxResult PizzeriaState::Serialize(LegoStorage* p_storage)
if (p_storage->IsReadMode()) {
for (MxS16 i = 0; i < 5; i++) {
p_storage->ReadS16(m_unk0x08[i].m_nextIndex);
p_storage->ReadS16(m_playerPlaylists[i].m_nextIndex);
}
}
else {
for (MxS16 i = 0; i < 5; i++) {
p_storage->WriteS16(m_unk0x08[i].m_nextIndex);
p_storage->WriteS16(m_playerPlaylists[i].m_nextIndex);
}
}

View File

@@ -40,7 +40,7 @@ MxResult RaceCar::Create(MxDSAction& p_dsAction)
// FUNCTION: LEGO1 0x100284d0
MxLong RaceCar::HandleClick()
{
if (!FUN_1003ef60()) {
if (!CanExit()) {
return 1;
}

View File

@@ -18,7 +18,7 @@ DECOMP_SIZE_ASSERT(Radio, 0x10)
DECOMP_SIZE_ASSERT(RadioState, 0x30)
// GLOBAL: LEGO1 0x100f3218
JukeboxScript::Script g_unk0x100f3218[] = {
JukeboxScript::Script g_jingles[] = {
JukeboxScript::c_sns002ra_Audio,
JukeboxScript::c_sns001ja_Audio,
JukeboxScript::c_snsc01js_Audio,
@@ -28,7 +28,7 @@ JukeboxScript::Script g_unk0x100f3218[] = {
};
// GLOBAL: LEGO1 0x100f3230
JukeboxScript::Script g_unk0x100f3230[] = {
JukeboxScript::Script g_news[] = {
JukeboxScript::c_ham035ra_Audio,
JukeboxScript::c_ham039ra_Audio,
JukeboxScript::c_sns005ra_Audio,
@@ -46,7 +46,7 @@ JukeboxScript::Script g_unk0x100f3230[] = {
};
// GLOBAL: LEGO1 0x100f3268
JukeboxScript::Script g_unk0x100f3268[] = {
JukeboxScript::Script g_songs[] = {
JukeboxScript::c_CentralRoads_Music,
JukeboxScript::c_BeachBlvd_Music,
JukeboxScript::c_ResidentalArea_Music,
@@ -64,7 +64,7 @@ Radio::Radio()
NotificationManager()->Register(this);
ControlManager()->Register(this);
m_unk0x0c = TRUE;
m_enabled = TRUE;
CreateState();
}
@@ -86,7 +86,7 @@ MxLong Radio::Notify(MxParam& p_param)
{
MxLong result = 0;
if (m_unk0x0c) {
if (m_enabled) {
MxNotificationParam& param = (MxNotificationParam&) p_param;
switch (param.GetNotification()) {
case c_notificationEndAction:
@@ -108,7 +108,7 @@ void Radio::Play()
CurrentWorld();
MxDSAction action;
action.SetObjectId(m_state->FUN_1002d090());
action.SetObjectId(m_state->NextPlaylistObjectId());
action.SetAtomId(*g_jukeboxScript);
action.SetLoopCount(1);
@@ -131,7 +131,7 @@ void Radio::Stop()
MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtomId(), IsleScript::c_Radio_Ctl);
if (presenter) {
presenter->VTable0x6c(0);
presenter->UpdateEnabledChild(0);
}
BackgroundAudioManager()->Stop();
@@ -141,12 +141,13 @@ void Radio::Stop()
}
// FUNCTION: LEGO1 0x1002cbc0
// FUNCTION: BETA10 0x100f1ce1
MxLong Radio::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxDSAction action; // Unused
MxS32 objectId = p_param.m_clickedObjectId;
if (objectId == IsleScript::c_Radio_Ctl) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_Radio_Ctl:
if (m_state->IsActive()) {
Stop();
}
@@ -173,11 +174,11 @@ MxLong Radio::HandleControl(LegoControlManagerNotificationParam& p_param)
MxLong Radio::HandleEndAction(MxEndActionNotificationParam& p_param)
{
if (m_state->IsActive() &&
m_state->FUN_1002d0c0(p_param.GetAction()->GetAtomId(), p_param.GetAction()->GetObjectId())) {
m_state->IsRadioObjectId(p_param.GetAction()->GetAtomId(), p_param.GetAction()->GetObjectId())) {
MxDSAction action;
action.SetAtomId(*g_jukeboxScript);
action.SetObjectId(m_state->FUN_1002d090());
action.SetObjectId(m_state->NextPlaylistObjectId());
action.SetLoopCount(1);
BackgroundAudioManager()->PlayMusic(action, 3, MxPresenter::e_repeating);
@@ -190,8 +191,8 @@ MxLong Radio::HandleEndAction(MxEndActionNotificationParam& p_param)
// FUNCTION: LEGO1 0x1002cdc0
void Radio::Initialize(MxBool p_und)
{
if (m_unk0x0c != p_und) {
m_unk0x0c = p_und;
if (m_enabled != p_und) {
m_enabled = p_und;
CreateState();
}
}
@@ -215,39 +216,39 @@ RadioState::RadioState()
srand(Timer()->GetTime());
MxS32 random = rand();
m_unk0x2c = random % 3;
m_activePlaylist = random % 3;
m_unk0x08[0] = Playlist((MxU32*) g_unk0x100f3218, sizeOfArray(g_unk0x100f3218), Playlist::e_loop);
m_unk0x08[0].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3218));
m_playlists[0] = Playlist((MxU32*) g_jingles, sizeOfArray(g_jingles), Playlist::e_loop);
m_playlists[0].m_nextIndex = (rand() % sizeOfArray(g_jingles));
m_unk0x08[1] = Playlist((MxU32*) g_unk0x100f3230, sizeOfArray(g_unk0x100f3230), Playlist::e_loop);
m_unk0x08[1].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3230));
m_playlists[1] = Playlist((MxU32*) g_news, sizeOfArray(g_news), Playlist::e_loop);
m_playlists[1].m_nextIndex = (rand() % sizeOfArray(g_news));
m_unk0x08[2] = Playlist((MxU32*) g_unk0x100f3268, sizeOfArray(g_unk0x100f3268), Playlist::e_loop);
m_unk0x08[2].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3268));
m_playlists[2] = Playlist((MxU32*) g_songs, sizeOfArray(g_songs), Playlist::e_loop);
m_playlists[2].m_nextIndex = (rand() % sizeOfArray(g_songs));
m_active = FALSE;
}
// FUNCTION: LEGO1 0x1002d090
MxU32 RadioState::FUN_1002d090()
MxU32 RadioState::NextPlaylistObjectId()
{
if (m_unk0x2c == 2) {
m_unk0x2c = 0;
if (m_activePlaylist == 2) {
m_activePlaylist = 0;
}
else {
m_unk0x2c++;
m_activePlaylist++;
}
return m_unk0x08[m_unk0x2c].Next();
return m_playlists[m_activePlaylist].Next();
}
// FUNCTION: LEGO1 0x1002d0c0
MxBool RadioState::FUN_1002d0c0(const MxAtomId& p_atom, MxU32 p_objectId)
MxBool RadioState::IsRadioObjectId(const MxAtomId& p_atom, MxU32 p_objectId)
{
if (*g_jukeboxScript == p_atom) {
for (MxS16 i = 0; i < 3; i++) {
if (m_unk0x08[i].Contains(p_objectId)) {
if (m_playlists[i].Contains(p_objectId)) {
return TRUE;
}
}

View File

@@ -56,10 +56,10 @@ MxResult SkateBoard::Create(MxDSAction& p_dsAction)
// FUNCTION: LEGO1 0x10010050
void SkateBoard::Exit()
{
if (m_act1state->m_unk0x018 == 3) {
if (m_act1state->m_state == Act1State::e_pizza) {
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
pizza->StopActions();
pizza->FUN_100382b0();
pizza->Reset();
m_pizzaVisible = FALSE;
}
@@ -75,11 +75,11 @@ MxLong SkateBoard::HandleClick()
{
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
if (!FUN_1003ef60() && state->m_unk0x018 != 3) {
if (!CanExit() && state->m_state != Act1State::e_pizza) {
return 1;
}
FUN_10015820(TRUE, 0);
Disable(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_skateboard);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@@ -110,9 +110,9 @@ MxLong SkateBoard::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxU32 result = 0;
if (p_param.m_unk0x28 == 1 && p_param.m_clickedObjectId == IsleScript::c_SkateArms_Ctl) {
if (p_param.m_enabledChild == 1 && p_param.m_clickedObjectId == IsleScript::c_SkateArms_Ctl) {
Exit();
GameState()->m_currentArea = LegoGameState::Area::e_unk66;
GameState()->m_currentArea = LegoGameState::Area::e_vehicleExited;
result = 1;
}
@@ -148,11 +148,11 @@ MxLong SkateBoard::HandleNotification0()
// FUNCTION: LEGO1 0x10010510
void SkateBoard::ActivateSceneActions()
{
if (m_act1state->m_unk0x018 != 3) {
if (m_act1state->m_state != Act1State::e_pizza) {
PlayMusic(JukeboxScript::c_BeachBlvd_Music);
if (!m_act1state->m_unk0x022) {
m_act1state->m_unk0x022 = TRUE;
if (!m_act1state->m_playedExitExplanation) {
m_act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5);

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