Isle
Loading...
Searching...
No Matches
legocarbuild.h
Go to the documentation of this file.
1#ifndef LEGOCARBUILD_H
2#define LEGOCARBUILD_H
3
4#include "legogamestate.h"
5#include "legostate.h"
6#include "legoworld.h"
8
16
17// VTABLE: LEGO1 0x100d66e0
18// VTABLE: BETA10 0x101bb910
19// SIZE 0x50
25public:
35 e_exiting = 6
36 };
37
42 LegoVehicleBuildState(const char* p_classType);
43
48 const char* ClassName() const override; // vtable+0x0c
49
55 MxBool IsA(const char* p_name) const override; // vtable+0x10
56
62 MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
63
65
70
75
80};
81
89
90// VTABLE: LEGO1 0x100d6658
91// VTABLE: BETA10 0x101bb880
92// SIZE 0x34c
97class LegoCarBuild : public LegoWorld {
98public:
110 };
111
117 c_unknown8 = 8
118 };
119
123 LegoCarBuild();
124
128 ~LegoCarBuild() override;
129
134 MxBool VTable0x5c() override;
135
140 const char* ClassName() const override;
141
147 MxLong Notify(MxParam& p_param) override;
148
153 MxResult Tickle() override;
154
160 MxBool IsA(const char* p_name) const override;
161
167 MxResult Create(MxDSAction& p_dsAction) override;
168
172 void ReadyWorld() override;
173
178 MxBool Escape() override;
179
184 void Enable(MxBool p_enable) override;
185
189 virtual void VTable0x6c();
190
194 virtual void VTable0x70();
195
201 virtual void VTable0x74(MxFloat p_param1[2], MxFloat p_param2[3]);
202
208 virtual void VTable0x78(MxFloat p_param1[2], MxFloat p_param2[3]);
209
215 virtual void VTable0x7c(MxFloat p_param1[2], MxFloat p_param2[3]);
216
224 virtual void VTable0x80(
225 MxFloat p_param1[2],
226 MxFloat p_param2[2],
227 MxFloat p_param3,
228 MxFloat p_param4[2]
229 );
230
236
241 void SetPlacedPartCount(MxU8 p_placedPartCount);
242
246 void InitPresenters();
247
251 void FUN_10022f00();
252
256 void FUN_10022f30();
257
263 void FUN_10023130(MxLong p_x, MxLong p_y);
264
268 void FUN_100236d0();
269
276
280 void FUN_100243a0();
281
288
296
304
312
319
326
330 void FUN_10024ef0();
331
335 void FUN_10024f30();
336
340 void FUN_10024f50();
341
346 void FUN_10024f70(MxBool p_enabled);
347
352 void SetPresentersEnabled(MxBool p_enabled);
353
358
363 void FUN_100250e0(MxBool p_param);
364
369 void FUN_10025350(MxS32 p_objectId);
370
374 void FUN_10025450();
375
380 void FUN_10025720(undefined4 p_param1);
381
386 void FUN_10025d10(MxS32 p_param);
387
393
399 void FUN_10025db0(const char* p_param1, undefined4 p_param2);
400
404 void FUN_10025e40();
405
411 MxS32 FUN_10025ee0(undefined4 p_param1);
412
417 void SetUnknown0x258(LegoCarBuildAnimPresenter* p_unk0x258) { m_unk0x258 = p_unk0x258; }
418
419private:
424 MxU32 Beta0x10070520();
425
429 void StopActionIn0x344();
430
431 Unknown0xf8 m_unk0xf8;
432 MxS16 m_unk0xfc;
433 MxS32 m_unk0x100;
434 undefined4 m_unk0x104;
435
436 MxS8 m_numAnimsRun;
437
438 MxU8 m_unk0x109;
439 MxU16 m_unk0x10a;
440 DWORD m_unk0x10c;
441 LegoROI* m_unk0x110;
442 BoundingSphere m_unk0x114;
443 MxMatrix m_unk0x12c;
444 undefined m_unk0x174;
445 MxMatrix m_unk0x178;
446 MxMatrix m_unk0x1c0;
447 MxMatrix m_unk0x208;
448
449 MxS32 m_unk0x250[2];
450
451 LegoCarBuildAnimPresenter* m_unk0x258;
452
453 MxQuaternionTransformer m_unk0x25c;
454
455 MxS32 m_unk0x290[2];
456 MxS32 m_unk0x298[2];
457
458 MxFloat m_unk0x2a0;
459 Mx4DPointFloat m_unk0x2a4;
460 Mx4DPointFloat m_unk0x2bc;
461 MxBool m_unk0x2d4;
462
463 // Main presenters for color/decal tools and feedback
464
465 MxStillPresenter* m_ColorBook_Bitmap;
466 MxControlPresenter* m_Yellow_Ctl;
467 MxControlPresenter* m_Red_Ctl;
468 MxControlPresenter* m_Blue_Ctl;
469 MxControlPresenter* m_Green_Ctl;
470 MxControlPresenter* m_Gray_Ctl;
471 MxControlPresenter* m_Black_Ctl;
472 MxSoundPresenter* m_Shelf_Sound;
473 MxSoundPresenter* m_PlaceBrick_Sound;
474 MxSoundPresenter* m_GetBrick_Sound;
475 MxSoundPresenter* m_Paint_Sound;
476 MxSoundPresenter* m_Decal_Sound;
477 MxStillPresenter* m_Decal_Bitmap;
478 MxControlPresenter* m_Decals_Ctl;
479 MxControlPresenter* m_Decals_Ctl1;
480 MxControlPresenter* m_Decals_Ctl2;
481 MxControlPresenter* m_Decals_Ctl3;
482 MxControlPresenter* m_Decals_Ctl4;
483 MxControlPresenter* m_Decals_Ctl5;
484 MxControlPresenter* m_Decals_Ctl6;
485 MxControlPresenter* m_Decals_Ctl7;
486
487 LegoVehicleBuildState* m_buildState;
488
489 undefined4 m_carId;
490
491 LegoGameState::Area m_destLocation;
492
493 MxPresenter* m_unk0x338;
494 MxControlPresenter* m_unk0x33c;
495 undefined4 m_unk0x340;
496 undefined4 m_unk0x344;
497 MxU8 m_presentersEnabled;
498
502 static MxS16 g_unk0x100f11cc;
503
507 static MxFloat g_unk0x100d65a4;
508
512 static MxFloat g_rotationAngleStepYAxis;
513
517 static LookupTableActions g_unk0x100d65b0[];
518};
519
520#endif // LEGOCARBUILD_H
[AI] Represents a bounding sphere in 3D space with center and radius.
Definition: roi.h:56
[AI] Handles the logic and animation presentation for the LEGO Island car-building activity,...
[AI] World implementation for the LEGO vehicle builder (Racecar, Copter, Dune Car,...
Definition: legocarbuild.h:97
MxS16 GetPlacedPartCount()
[AI] Gets number of parts currently placed in build progress.
void FUN_10022f00()
[AI] Internal: handles transition when moving a placed part, possibly triggering state change.
MxResult Create(MxDSAction &p_dsAction) override
[AI] Creates world from script action; initializes build and assigns state according to area/car type...
MxS32 FUN_10025d70()
[AI] Gets next animation/cutscene ID depending on current build stage value.
void FUN_100243a0()
[AI] Handles the transition to the next act/location when building is complete.
LegoCarBuild()
[AI] Constructs a new LegoCarBuild world and initializes all references/UI.
MxBool IsA(const char *p_name) const override
[AI] Checks run-time type compatibility.
MxResult Tickle() override
[AI] Tickle function (called every frame/tick); processes build logic and part animation.
void FUN_10024f30()
[AI] Internal: Logic for the shelf-up UI animation/response.
virtual void VTable0x7c(MxFloat p_param1[2], MxFloat p_param2[3])
[AI] Adjusts transformation for part manipulation above the "default" reference.
virtual void VTable0x70()
[AI] Computes screen-projected coordinates for picking/placing parts and updates internal pixel locat...
void SetUnknown0x258(LegoCarBuildAnimPresenter *p_unk0x258)
[AI] Directly sets the animation presenter for this build world.
Definition: legocarbuild.h:417
void FUN_10025350(MxS32 p_objectId)
[AI] Handles color/decal actions by object ID, mapping click to appropriate color or updating variabl...
void FUN_10025720(undefined4 p_param1)
[AI] Initiates the next world/cutscene/animation step, based on internal build progress and car ID.
void ReadyWorld() override
[AI] Prepares UI and scripting when world is ready.
undefined4 FUN_100244e0(MxLong p_x, MxLong p_y)
[AI] Handles mouse click/button down notifications to pick parts or trigger color/decal tools.
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications (input, state, animation, world events) for the build world.
undefined4 FUN_10024c20(LegoEventNotificationParam *p_param)
[AI] Handles the core event when the build is completed and creation should be finalized.
MxBool Escape() override
[AI] Escapes from the build UI (initiates transition to outside world/menu).
void FUN_10024f50()
[AI] Internal: Handles part rotation/y-axis interaction.
virtual void VTable0x78(MxFloat p_param1[2], MxFloat p_param2[3])
[AI] Adjusts transformation for part manipulation when within the vertical bounds of the reference po...
virtual void VTable0x6c()
[AI] Internal logic, used during part drag/drop and animation (possibly for placing or updating a par...
virtual void VTable0x74(MxFloat p_param1[2], MxFloat p_param2[3])
[AI] Adjusts transformation for part manipulation based on mouse/drag locations below the "default" p...
void FUN_10022f30()
[AI] Internal: logic for finalizing or dropping a part at build location, updates sound and UI.
undefined4 FUN_10024250(LegoEventNotificationParam *p_param)
[AI] Handles keyboard event notifications, most notably the Space key for canceling animations or sou...
undefined4 FUN_10024890(MxParam *p_param)
[AI] Handles UI input/control presenter notifications.
const char * ClassName() const override
[AI] Returns the type string for this object.
void SetPlacedPartCount(MxU8 p_placedPartCount)
[AI] Sets the number of placed parts in the build state.
void InitPresenters()
[AI] Finds and initializes all presenters (UI and sound) used in the car build area.
void FUN_10025e40()
[AI] Re-applies enabled/disabled flags on presenters, resetting the last-toggled presenter if needed.
virtual void VTable0x80(MxFloat p_param1[2], MxFloat p_param2[2], MxFloat p_param3, MxFloat p_param4[2])
[AI] Used for conversions between projected and real pixel/world space.
Unknown0xf8
[AI] Special constants for internal state tracking of the build world.
Definition: legocarbuild.h:115
@ c_unknownminusone
[AI] Default/uninitialized
Definition: legocarbuild.h:116
@ c_unknown8
[AI] Internal marker
Definition: legocarbuild.h:117
void FUN_100250e0(MxBool p_param)
[AI] Enables/Disables only the presenter set related to current part, using name pattern.
~LegoCarBuild() override
[AI] Cleans up presenters, unregisters input/notification handlers, and resets world build state.
MxBool VTable0x5c() override
[AI] Always returns TRUE; signals that this world can be entered.
void FUN_100236d0()
[AI] Internal: launches the finalization of all parts if build is completed; triggers further game pr...
undefined4 FUN_100246e0(MxLong p_x, MxLong p_y)
[AI] Handles mouse button up events; initiates part-finalization or validated placement.
void FUN_10025450()
[AI] Updates part transformation matrices and records old/new world/projected positions for drag/drop...
void FUN_10024f70(MxBool p_enabled)
[AI] Enables/Disables color/decal presenters depending on selected part and part name.
void TogglePresentersEnabled()
[AI] Toggles enabled/disabled state for all main presenters (color/decal tools).
MxS32 FUN_10025ee0(undefined4 p_param1)
[AI] Gets the appropriate jukebox/music action ID for the current car type, used when leaving the bui...
void Enable(MxBool p_enable) override
[AI] Enables or disables the world, handling both visual and audio states and input registration.
undefined4 FUN_10024480(MxActionNotificationParam *p_param)
[AI] Handles animation end notification action (e.g., volume restoration, state reset,...
void FUN_10025db0(const char *p_param1, undefined4 p_param2)
[AI] Controls global UI presentations actions (such as blinking or activation), based on progress in ...
MxS32 FUN_10024850(MxLong p_x, MxLong p_y)
[AI] Handles mouse move notifications for drag-to-place part.
void FUN_10025d10(MxS32 p_param)
[AI] Starts/stops an animation action for the specified parameter (e.g., cutscene transition,...
void FUN_10023130(MxLong p_x, MxLong p_y)
[AI] Internal: handles interaction when dragging part along projected axis.
void FUN_10024ef0()
[AI] Starts the cutscene or music intro for the build with necessary state adjustment.
void SetPresentersEnabled(MxBool p_enabled)
[AI] Controls common set of UI presenters' enabled state at once.
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
Area
Enumeration of all major in-game locations ("areas") for area/scene management and serialization.
Definition: legogamestate.h:92
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the...
Definition: legostate.h:17
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
[AI] Represents the persistent state of the LEGO vehicle build world, tracking animation and part pla...
Definition: legocarbuild.h:24
MxBool m_unk0x4d
[AI] Persists transition or completion flag across world reloads.
Definition: legocarbuild.h:77
AnimationState m_animationState
[AI] Current animation state within the build area.
Definition: legocarbuild.h:74
AnimationState
[AI] Enumerates the possible animation states for the build process.
Definition: legocarbuild.h:29
@ e_exiting
[AI] Build area is in the process of ending/exiting.
Definition: legocarbuild.h:35
@ e_entering
[AI] Transition/Entering the build area.
Definition: legocarbuild.h:31
@ e_unknown4
[AI] Indicates transition to exit (possibly ready for world exit or next act).
Definition: legocarbuild.h:34
@ e_cutscene
[AI] Indicates that the build is in a cutscene (camera or instructions animation).
Definition: legocarbuild.h:33
@ e_unknown0
[AI] Default/uninitialized state. Meaning unclear.
Definition: legocarbuild.h:30
@ e_unknown2
[AI] Likely a 'ready' or transitional state before a cutscene.
Definition: legocarbuild.h:32
Playlist m_unk0x08[4]
[AI] Unused/unknown playlists per build? [AI_SUGGESTED_NAME: m_playlists] Unclear,...
Definition: legocarbuild.h:64
MxResult Serialize(LegoStorage *p_storage) override
[AI] Serialize or deserialize the build state to/from a storage object for save/load.
MxBool m_unk0x4e
[AI] Unknown. Flag—purpose unclear.
Definition: legocarbuild.h:78
MxString m_className
[AI] Class name string ("LegoRaceCarBuildState", etc), used for identifying the build state type.
Definition: legocarbuild.h:69
const char * ClassName() const override
[AI] Returns the class name (run-time type string) for this object.
MxU8 m_placedPartCount
[AI] Number of parts (bricks) placed during the build.
Definition: legocarbuild.h:79
MxBool IsA(const char *p_name) const override
[AI] Checks if the provided type name matches this class or any base class.
MxU8 m_unk0x4c
[AI] Number of completed actions or animation steps, incremented through build progress.
Definition: legocarbuild.h:76
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
[AI] 4D point class for floating point values.
Definition: mxgeometry4d.h:18
[AI] Notification parameter class that contains information about an MxDSAction, used for inter-objec...
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
Quaternion interpolation utility for 4D transformations, supporting quaternion start/end points and s...
Definition: mxquaternion.h:14
[AI] Concrete presenter for sound playback and control within the LEGO Island engine.
[AI] Presenter for single still image/bitmap media sources in the game.
Mindscape custom string class for managing dynamic C-strings within the game engine.
Definition: mxstring.h:14
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
unsigned int undefined4
Definition: decomp.h:28
unsigned char undefined
Definition: decomp.h:26
LegoVehicleBuildState LegoRaceCarBuildState
[AI] Typedefs to support all vehicle variants using a single base build state class.
Definition: legocarbuild.h:85
LegoVehicleBuildState LegoDuneCarBuildState
Definition: legocarbuild.h:87
LegoVehicleBuildState LegoJetskiBuildState
Definition: legocarbuild.h:88
LegoVehicleBuildState LegoCopterBuildState
Definition: legocarbuild.h:86
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
float MxFloat
[AI]
Definition: mxtypes.h:68
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
[AI] Lookup table for animation/action IDs for vehicle types.
Definition: legocarbuild.h:102
undefined4 m_unk0x18
[AI] Script/action ID for animation 6.
Definition: legocarbuild.h:109
undefined4 m_unk0x10
[AI] Script/action ID for animation 4.
Definition: legocarbuild.h:107
undefined4 m_unk0x00
[AI] Script/action ID for animation 0.
Definition: legocarbuild.h:103
undefined4 m_unk0x08
[AI] Script/action ID for animation 2.
Definition: legocarbuild.h:105
undefined4 m_unk0x0c
[AI] Script/action ID for animation 3.
Definition: legocarbuild.h:106
undefined4 m_unk0x04
[AI] Script/action ID for animation 1.
Definition: legocarbuild.h:104
undefined4 m_unk0x14
[AI] Script/action ID for animation 5.
Definition: legocarbuild.h:108
[AI] Playlist structure representing an indexed list of object IDs with next-item selection strategie...
Definition: legostate.h:36