isle/LEGO1/legoentity.cpp

149 lines
2.4 KiB
C++
Raw Normal View History

#include "legoentity.h"
2023-10-24 19:38:27 -04:00
#include "define.h"
#include "legoomni.h"
#include "legoutil.h"
DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
// OFFSET: LEGO1 0x1000c290
LegoEntity::~LegoEntity()
{
2023-10-24 19:38:27 -04:00
Destroy(TRUE);
}
// OFFSET: LEGO1 0x100114f0 STUB
2023-10-24 19:38:27 -04:00
MxLong LegoEntity::Notify(MxParam& p)
{
2023-10-24 19:38:27 -04:00
// TODO
2023-10-24 19:38:27 -04:00
return 0;
}
2023-10-01 09:06:29 -04:00
// OFFSET: LEGO1 0x100105f0
void LegoEntity::Reset()
{
2023-10-24 19:38:27 -04:00
m_vec1.Fill(0);
m_vec2.Fill(0);
m_unk50 = 0;
m_unk54 = 0;
m_unk58 = 0;
m_actionArgString = NULL;
m_unk10 = 0;
m_unk11 = 0;
m_actionType = ExtraActionType_unknown;
m_actionArgNumber = -1;
m_unk59 = 4;
2023-10-01 09:06:29 -04:00
}
// OFFSET: LEGO1 0x100107e0
2023-10-24 19:38:27 -04:00
MxResult LegoEntity::InitFromMxDSObject(MxDSObject& p_dsObject)
{
2023-10-24 19:38:27 -04:00
m_mxEntityId = p_dsObject.GetObjectId();
m_atom = p_dsObject.GetAtomId();
AddToCurrentWorld();
return SUCCESS;
}
// OFFSET: LEGO1 0x10010810 STUB
void LegoEntity::Destroy(MxBool p_fromDestructor)
{
2023-10-24 19:38:27 -04:00
if (m_unk54) {
// TODO
}
2023-10-01 09:06:29 -04:00
2023-10-24 19:38:27 -04:00
delete[] m_actionArgString;
Reset();
}
// OFFSET: LEGO1 0x10010880 STUB
void LegoEntity::AddToCurrentWorld()
{
2023-10-24 19:38:27 -04:00
LegoWorld* world = GetCurrentWorld();
if (world != NULL && world != (LegoWorld*) this) {
// TODO: world->vtable58(this);
}
}
// OFFSET: LEGO1 0x10010e10
2023-10-24 19:38:27 -04:00
void LegoEntity::ParseAction(char* p_extra)
{
2023-10-24 19:38:27 -04:00
char copy[1024];
char actionValue[1024];
strcpy(copy, p_extra);
2023-10-24 19:38:27 -04:00
if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens));
2023-10-24 19:38:27 -04:00
if (m_actionType != ExtraActionType_exit) {
char* token = strtok(NULL, g_parseExtraTokens);
2023-10-24 19:38:27 -04:00
m_actionArgString = new char[strlen(token) + 1];
strcpy(m_actionArgString, token);
2023-10-24 19:38:27 -04:00
if (m_actionType != ExtraActionType_run) {
m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens));
}
}
}
}
// OFFSET: LEGO1 0x100108a0 STUB
void LegoEntity::VTable0x24()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10010790 STUB
void LegoEntity::VTable0x28()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10010650 STUB
void LegoEntity::VTable0x2c()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10010f10 STUB
void LegoEntity::VTable0x34()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10011070 STUB
void LegoEntity::VTable0x38()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10011300 STUB
void LegoEntity::VTable0x3c()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10011360 STUB
void LegoEntity::VTable0x40()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x100113c0 STUB
void LegoEntity::VTable0x44()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10011420 STUB
void LegoEntity::VTable0x48()
{
2023-10-24 19:38:27 -04:00
// TODO
}
// OFFSET: LEGO1 0x10011470 STUB
void LegoEntity::VTable0x4c()
{
2023-10-24 19:38:27 -04:00
// TODO
}