2023-06-29 04:10:08 -04:00
|
|
|
#include "legoentity.h"
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "define.h"
|
2023-09-27 15:16:46 -04:00
|
|
|
#include "legoomni.h"
|
|
|
|
#include "legoutil.h"
|
2023-10-30 09:15:43 -04:00
|
|
|
#include "legoworld.h"
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-08-03 14:10:54 -04:00
|
|
|
DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1000c290
|
2023-06-29 04:10:08 -04:00
|
|
|
LegoEntity::~LegoEntity()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Destroy(TRUE);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100105f0
|
2023-10-25 16:51:59 -04:00
|
|
|
void LegoEntity::Init()
|
2023-10-01 09:06:29 -04:00
|
|
|
{
|
2023-10-25 16:51:59 -04:00
|
|
|
m_worldLocation.Fill(0);
|
|
|
|
m_worldDirection.Fill(0);
|
|
|
|
m_worldSpeed = 0;
|
|
|
|
m_roi = NULL;
|
|
|
|
m_cameraFlag = 0;
|
2023-10-24 19:38:27 -04:00
|
|
|
m_actionArgString = NULL;
|
2023-12-13 05:48:14 -05:00
|
|
|
m_unk0x10 = 0;
|
|
|
|
m_unk0x11 = 0;
|
2023-10-24 19:38:27 -04:00
|
|
|
m_actionType = ExtraActionType_unknown;
|
|
|
|
m_actionArgNumber = -1;
|
2023-12-13 05:48:14 -05:00
|
|
|
m_unk0x59 = 4;
|
2023-10-01 09:06:29 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10010650
|
2023-10-25 16:51:59 -04:00
|
|
|
void LegoEntity::ResetWorldTransform(MxBool p_inVehicle)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10010790
|
2023-11-19 09:38:07 -05:00
|
|
|
void LegoEntity::SetWorldTransform(Vector3Impl& p_loc, Vector3Impl& p_dir, Vector3Impl& p_up)
|
2023-10-25 16:51:59 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100107e0
|
2023-11-18 10:08:49 -05:00
|
|
|
MxResult LegoEntity::Create(MxDSObject& p_dsObject)
|
2023-09-27 15:16:46 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
m_mxEntityId = p_dsObject.GetObjectId();
|
|
|
|
m_atom = p_dsObject.GetAtomId();
|
2023-10-25 16:51:59 -04:00
|
|
|
Init();
|
2023-10-24 19:38:27 -04:00
|
|
|
return SUCCESS;
|
2023-09-27 15:16:46 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10010810
|
2023-10-13 12:43:45 -04:00
|
|
|
void LegoEntity::Destroy(MxBool p_fromDestructor)
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2023-10-25 16:51:59 -04:00
|
|
|
if (m_roi) {
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
|
|
|
}
|
2023-10-01 09:06:29 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
delete[] m_actionArgString;
|
2023-10-25 16:51:59 -04:00
|
|
|
Init();
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10010880
|
2023-10-25 16:51:59 -04:00
|
|
|
void LegoEntity::SetWorld()
|
2023-10-11 18:15:36 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoWorld* world = GetCurrentWorld();
|
|
|
|
if (world != NULL && world != (LegoWorld*) this) {
|
2023-10-30 09:15:43 -04:00
|
|
|
world->VTable0x58(this);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-10-11 18:15:36 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100108a0
|
2023-10-25 16:51:59 -04:00
|
|
|
void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10010e10
|
2023-10-24 19:38:27 -04:00
|
|
|
void LegoEntity::ParseAction(char* p_extra)
|
2023-09-27 15:16:46 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
char copy[1024];
|
|
|
|
char actionValue[1024];
|
|
|
|
strcpy(copy, p_extra);
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
|
|
|
|
m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens));
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_actionType != ExtraActionType_exit) {
|
|
|
|
char* token = strtok(NULL, g_parseExtraTokens);
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
m_actionArgString = new char[strlen(token) + 1];
|
|
|
|
strcpy(m_actionArgString, token);
|
2023-09-27 15:16:46 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_actionType != ExtraActionType_run) {
|
|
|
|
m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-09-27 15:16:46 -04:00
|
|
|
}
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10010f10
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x34()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10011070
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x38()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10011300
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x3c()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10011360
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x40()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100113c0
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x44()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10011420
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x48()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10011470
|
2023-10-23 07:16:21 -04:00
|
|
|
void LegoEntity::VTable0x4c()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-10-25 14:51:59 -04:00
|
|
|
}
|
2023-10-25 16:51:59 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100114f0
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong LegoEntity::Notify(MxParam& p_param)
|
2023-10-25 16:51:59 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|