Isle
Loading...
Searching...
No Matches
legoutils.h
Go to the documentation of this file.
1#ifndef LEGOUTILS_H
2#define LEGOUTILS_H
3
4#include "actionsfwd.h"
5#include "decomp.h"
6#include "extra.h"
7#include "mxtypes.h"
8
9#include <windows.h>
10
11#define WM_ISLE_SETCURSOR 0x5400
12
16#define DS_NOT_A_STREAM -1
17
22enum Cursor {
35};
36
37class BoundingSphere;
38class MxAtomId;
39class LegoEntity;
41class LegoNamedTexture;
42class LegoPathActor;
43class LegoROI;
44class LegoStorage;
45class LegoTreeNode;
46
47extern MxAtomId* g_isleScript;
48
56
63LegoROI* PickROI(MxLong p_x, MxLong p_y);
64
72
78void RotateY(LegoROI* p_roi, MxFloat p_angle);
79
85MxBool SpheresIntersect(const BoundingSphere& p_sphere1, const BoundingSphere& p_sphere2);
86
94MxBool FUN_1003ded0(MxFloat p_param1[2], MxFloat p_param2[3], MxFloat p_param3[3]);
95
102MxBool TransformWorldToScreen(const MxFloat p_world[3], MxFloat p_screen[4]);
103
110
117LegoTreeNode* GetTreeNode(LegoTreeNode* p_node, MxU32 p_index);
118
123void FUN_1003e050(LegoAnimPresenter* p_presenter);
124
131
139void InvokeAction(Extra::ActionType p_actionId, const MxAtomId& p_pAtom, MxS32 p_streamId, LegoEntity* p_sender);
140
145
155void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
156
164void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool);
165
169void FUN_1003eda0();
170
177MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
178
183void EnableAnimations(MxBool p_enable);
184
189void SetAppCursor(Cursor p_cursor);
190
196
205MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);
206
213
218void SetLightPosition(MxS32 p_index);
219
226
232void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name);
233
239void WriteNamedTexture(LegoStorage* p_storage, LegoNamedTexture* p_namedTexture);
240
245void FUN_1003f930(LegoNamedTexture* p_namedTexture);
246
254MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_entityId);
255
262void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender);
263
268inline void StartIsleAction(IsleScript::Script p_objectId)
269{
270 if (p_objectId != (IsleScript::Script) -1) {
272 }
273}
274
275// SYNTHETIC: LEGO1 0x10034b40
276// LegoTexture::`scalar deleting destructor'
277
278#endif // LEGOUTILS_H
[AI] Represents a bounding sphere in 3D space with center and radius.
Definition: roi.h:56
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
[AI] Associates a named string with a LegoTexture instance, allowing textures to be referenced symbol...
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
[AI] Represents a node within a general, N-ary tree structure.
Definition: legotree.h:44
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
void EnableAnimations(MxBool p_enable)
[AI] Enables or disables animation playback globally.
Definition: legoutils.cpp:554
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
Definition: legoutils.cpp:271
MxBool RemoveFromWorld(MxAtomId &p_entityAtom, MxS32 p_entityId, MxAtomId &p_worldAtom, MxS32 p_worldEntityId)
[AI] Removes a game object referenced by atom/id from a specific world, handling presenters and EndAc...
Definition: legoutils.cpp:524
LegoNamedTexture * ReadNamedTexture(LegoStorage *p_storage)
[AI] Reads a named texture and its associated image data from storage.
Definition: legoutils.cpp:665
MxBool TransformWorldToScreen(const MxFloat p_world[3], MxFloat p_screen[4])
[AI] Projects a world-space point into normalized screen coordinates.
Definition: legoutils.cpp:130
MxBool CheckIfEntityExists(MxBool p_enable, const char *p_filename, MxS32 p_entityId)
[AI] Parses a string for entity existence and enables/disables it accordingly.
Definition: legoutils.cpp:343
MxBool RemoveFromCurrentWorld(const MxAtomId &p_atomId, MxS32 p_id)
[AI] Removes an entity or presenter with specified AtomId and ID from the current world; triggers End...
Definition: legoutils.cpp:495
LegoROI * PickROI(MxLong p_x, MxLong p_y)
[AI] Picks the ROI (Renderable Object Instance) at screen coordinates.
Definition: legoutils.cpp:39
MxBool FUN_1003ef60()
[AI] Determines if the current actor can exit their area, based on state/zone/vehicle.
Definition: legoutils.cpp:572
LegoTreeNode * GetTreeNode(LegoTreeNode *p_node, MxU32 p_index)
[AI] Retrieves the nth node in tree traversal order (preorder) from a LegoTreeNode root.
Definition: legoutils.cpp:151
MxS32 UpdateLightPosition(MxS32 p_increase)
[AI] Steps or resets the in-game light position; wraps and saves in global variables; updates lightin...
Definition: legoutils.cpp:599
void FUN_1003eda0()
[AI] Updates sound listener position to follow the view ROI's transform.
Definition: legoutils.cpp:476
void SetCameraControllerFromIsle()
[AI] Updates the current camera controller to the main ISLE camera specified in the global script.
Definition: legoutils.cpp:382
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float *p_rOut, float *p_bOut, float *p_gOut)
[AI] Converts HSV color (hue/saturation/value) to RGB (red/green/blue).
Definition: legoutils.cpp:388
LegoEntity * PickEntity(MxLong p_x, MxLong p_y)
[AI] Picks the LEGO entity root at the given screen coordinates.
Definition: legoutils.cpp:62
Extra::ActionType MatchActionString(const char *)
[AI] Parses an action string to determine the corresponding action type.
Definition: legoutils.cpp:228
void PlayCamAnim(LegoPathActor *p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool)
[AI] Initiates a camera animation for a specific path actor, or falls back to default animation trigg...
Definition: legoutils.cpp:459
void NotifyEntity(const char *p_filename, MxS32 p_entityId, LegoEntity *p_sender)
[AI] Sends a notification to the specified entity in all known worlds.
Definition: legoutils.cpp:358
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
Definition: legoutils.cpp:566
void RotateY(LegoROI *p_roi, MxFloat p_angle)
[AI] Rotates the given ROI around the Y axis in world space.
Definition: legoutils.cpp:75
LegoROI * PickRootROI(MxLong p_x, MxLong p_y)
[AI] Picks the root ROI at the given screen coordinates by traversing up the ROI parent tree.
Definition: legoutils.cpp:48
void FUN_1003f930(LegoNamedTexture *p_namedTexture)
[AI] Applies the image bits of a named texture to its associated texture info container entry.
Definition: legoutils.cpp:768
void StartIsleAction(IsleScript::Script p_objectId)
[AI] Helper to invoke a 'start' action for an Isle script object by its script ID.
Definition: legoutils.h:268
MxS16 CountTotalTreeNodes(LegoTreeNode *p_node)
[AI] Recursively counts the number of nodes (including the root) in a tree hierarchy rooted at the sp...
Definition: legoutils.cpp:138
void FUN_1003e050(LegoAnimPresenter *p_presenter)
[AI] Repositions the camera and updates the view matrix using a LegoAnimPresenter's animation nodes n...
Definition: legoutils.cpp:176
MxBool SpheresIntersect(const BoundingSphere &p_sphere1, const BoundingSphere &p_sphere2)
[AI] Tests if two bounding spheres in the 3D world intersect.
Definition: legoutils.cpp:93
Cursor
[AI] Enum representing cursor icons usable within the LEGO Island engine for custom cursor management...
Definition: legoutils.h:22
@ e_cursorUnused3
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:26
@ e_cursorUnused5
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:28
@ e_cursorUnused7
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:30
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
Definition: legoutils.h:24
@ e_cursorNone
[AI] No cursor (invisible or hidden). [AI]
Definition: legoutils.h:34
@ e_cursorUnused10
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:33
@ e_cursorUnused8
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:31
@ e_cursorArrow
[AI] Standard arrow cursor. [AI]
Definition: legoutils.h:23
@ e_cursorUnused9
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:32
@ e_cursorUnused4
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:27
@ e_cursorUnused6
[AI] Reserved slot. Not used. [AI]
Definition: legoutils.h:29
@ e_cursorNo
[AI] 'Not allowed' cursor. [AI]
Definition: legoutils.h:25
void WriteDefaultTexture(LegoStorage *p_storage, const char *p_name)
[AI] Writes a default texture by name (and its image/palette) to storage for serialization.
Definition: legoutils.cpp:690
void WriteNamedTexture(LegoStorage *p_storage, LegoNamedTexture *p_namedTexture)
[AI] Writes a LegoNamedTexture and its associated image to storage.
Definition: legoutils.cpp:761
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
Definition: scripts.cpp:32
MxBool FUN_1003ded0(MxFloat p_param1[2], MxFloat p_param2[3], MxFloat p_param3[3])
[AI] Calculates a ray starting at a screen location and outputs its world origin and direction.
Definition: legoutils.cpp:102
void SetLightPosition(MxS32 p_index)
[AI] Sets the world space position and direction of the in-game directional light,...
Definition: legoutils.cpp:628
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
float MxFloat
[AI]
Definition: mxtypes.h:68
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
ActionType
[AI] Enumerates the possible operation types that may appear as actions in the "Extra" key-value stri...
Definition: extra.h:25
@ e_start
[AI] Start an activity or playback [AI]
Definition: extra.h:30