Update enums

This commit is contained in:
Christian Semmler 2024-01-17 09:56:04 -05:00
parent 56c3a03c6c
commit bf2c4ce6d5
19 changed files with 116 additions and 113 deletions

View File

@ -3,19 +3,21 @@
// Items related to the Extra string of key-value pairs found in MxOb // Items related to the Extra string of key-value pairs found in MxOb
enum ExtraActionType { struct Extra {
ExtraActionType_none = 0, enum ActionType {
ExtraActionType_opendisk = 1, e_none = 0,
ExtraActionType_openram = 2, e_opendisk,
ExtraActionType_close = 3, e_openram,
ExtraActionType_start = 4, e_close,
ExtraActionType_stop = 5, e_start,
ExtraActionType_run = 6, e_stop,
ExtraActionType_exit = 7, e_run,
ExtraActionType_enable = 8, e_exit,
ExtraActionType_disable = 9, e_enable,
ExtraActionType_notify = 10, e_disable,
ExtraActionType_unknown = 11, e_notify,
e_unknown,
};
}; };
#endif // EXTRA_H #endif // EXTRA_H

View File

@ -9,7 +9,7 @@
// SIZE 0x68 // SIZE 0x68
class LegoActionControlPresenter : public MxMediaPresenter { class LegoActionControlPresenter : public MxMediaPresenter {
public: public:
inline LegoActionControlPresenter() { m_unk0x50 = ExtraActionType_none; } inline LegoActionControlPresenter() { m_unk0x50 = Extra::ActionType::e_none; }
virtual ~LegoActionControlPresenter() override { Destroy(TRUE); }; // vtable+0x00 virtual ~LegoActionControlPresenter() override { Destroy(TRUE); }; // vtable+0x00
// FUNCTION: LEGO1 0x1000d0e0 // FUNCTION: LEGO1 0x1000d0e0
@ -32,9 +32,9 @@ class LegoActionControlPresenter : public MxMediaPresenter {
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x5c virtual void Destroy(MxBool p_fromDestructor); // vtable+0x5c
private: private:
ExtraActionType m_unk0x50; // 0x50 Extra::ActionType m_unk0x50; // 0x50
MxString m_unk0x54; // 0x54 MxString m_unk0x54; // 0x54
undefined4 m_unk0x64; // 0x64 undefined4 m_unk0x64; // 0x64
}; };
// SYNTHETIC: LEGO1 0x1000d1d0 // SYNTHETIC: LEGO1 0x1000d1d0

View File

@ -78,9 +78,9 @@ class LegoEntity : public MxEntity {
undefined m_unk0x59; // 0x59 undefined m_unk0x59; // 0x59
// For tokens from the extra string that look like this: // For tokens from the extra string that look like this:
// "Action:openram;\lego\scripts\Race\CarRaceR;0" // "Action:openram;\lego\scripts\Race\CarRaceR;0"
ExtraActionType m_actionType; // 0x5c Extra::ActionType m_actionType; // 0x5c
char* m_actionArgString; // 0x60 char* m_actionArgString; // 0x60
MxS32 m_actionArgNumber; // 0x64 MxS32 m_actionArgNumber; // 0x64
}; };
// SYNTHETIC: LEGO1 0x1000c3b0 // SYNTHETIC: LEGO1 0x1000c3b0

View File

@ -30,9 +30,9 @@ class LegoStream {
virtual MxBool IsReadMode(); virtual MxBool IsReadMode();
enum OpenFlags { enum OpenFlags {
ReadBit = 1, c_readBit = 1,
WriteBit = 2, c_writeBit = 2,
BinaryBit = 4, c_binaryBit = 4,
}; };
static MxResult __stdcall WriteVariable(LegoStream* p_stream, MxVariableTable* p_from, const char* p_variableName); static MxResult __stdcall WriteVariable(LegoStream* p_stream, MxVariableTable* p_from, const char* p_variableName);

View File

@ -10,8 +10,8 @@
class MxAtomId; class MxAtomId;
class LegoEntity; class LegoEntity;
ExtraActionType MatchActionString(const char*); Extra::ActionType MatchActionString(const char*);
void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender); void InvokeAction(Extra::ActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender);
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut); void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id); MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool); void FUN_1003ef00(MxBool);

View File

@ -32,7 +32,7 @@ class MxTransitionManager : public MxCore {
virtual MxResult GetDDrawSurfaceFromVideoManager(); // vtable+0x14 virtual MxResult GetDDrawSurfaceFromVideoManager(); // vtable+0x14
enum TransitionType { enum TransitionType {
e_notTransitioning, e_notTransitioning = 0,
e_noAnimation, e_noAnimation,
e_dissolve, e_dissolve,
e_pixelation, e_pixelation,

View File

@ -112,7 +112,7 @@ MxU32 Helicopter::VTable0xcc()
break; break;
} }
VTable0xe0(); VTable0xe0();
InvokeAction(ExtraActionType_start, m_script, 0x15, NULL); InvokeAction(Extra::ActionType::e_start, m_script, 0x15, NULL);
GetCurrentAction().SetObjectId(-1); GetCurrentAction().SetObjectId(-1);
ControlManager()->Register(this); ControlManager()->Register(this);
return 1; return 1;
@ -155,7 +155,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
state->SetUnknown18(4); state->SetUnknown18(4);
m_state->SetUnknown8(1); m_state->SetUnknown8(1);
m_world->FUN_1001fc80(this); m_world->FUN_1001fc80(this);
InvokeAction(ExtraActionType_start, script, 0x20, NULL); InvokeAction(Extra::ActionType::e_start, script, 0x20, NULL);
SetUnknownDC(0); SetUnknownDC(0);
} }
ret = 1; ret = 1;
@ -167,7 +167,7 @@ MxU32 Helicopter::VTable0xd4(MxType17NotificationParam& p_param)
if (m_state->GetUnkown8() == 2) { if (m_state->GetUnkown8() == 2) {
m_state->SetUnknown8(3); m_state->SetUnknown8(3);
m_world->FUN_1001fc80(this); m_world->FUN_1001fc80(this);
InvokeAction(ExtraActionType_start, script, 0x21, NULL); InvokeAction(Extra::ActionType::e_start, script, 0x21, NULL);
SetUnknownDC(4); SetUnknownDC(4);
} }
ret = 1; ret = 1;

View File

@ -40,11 +40,11 @@ void LegoActionControlPresenter::RepeatingTickle()
#ifdef COMPAT_MODE #ifdef COMPAT_MODE
{ {
MxAtomId atom(m_unk0x54.GetData(), LookupMode_LowerCase2); MxAtomId atom(m_unk0x54.GetData(), MxAtomId::e_lowerCase2);
InvokeAction(m_unk0x50, atom, m_unk0x64, NULL); InvokeAction(m_unk0x50, atom, m_unk0x64, NULL);
} }
#else #else
InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), LookupMode_LowerCase2), m_unk0x64, NULL); InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), MxAtomId::e_lowerCase2), m_unk0x64, NULL);
#endif #endif
ProgressTickleState(TickleState_Done); ProgressTickleState(TickleState_Done);
} }
@ -92,11 +92,11 @@ void LegoActionControlPresenter::ParseExtra()
char output[1024]; char output[1024];
if (KeyValueStringParse(output, g_strACTION, buf)) { if (KeyValueStringParse(output, g_strACTION, buf)) {
m_unk0x50 = MatchActionString(strtok(output, g_parseExtraTokens)); m_unk0x50 = MatchActionString(strtok(output, g_parseExtraTokens));
if (m_unk0x50 != ExtraActionType_exit) { if (m_unk0x50 != Extra::ActionType::e_exit) {
MakeSourceName(buf, strtok(NULL, g_parseExtraTokens)); MakeSourceName(buf, strtok(NULL, g_parseExtraTokens));
m_unk0x54 = buf; m_unk0x54 = buf;
m_unk0x54.ToLowerCase(); m_unk0x54.ToLowerCase();
if (m_unk0x50 != ExtraActionType_run) { if (m_unk0x50 != Extra::ActionType::e_run) {
m_unk0x64 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x64 = atoi(strtok(NULL, g_parseExtraTokens));
} }
} }

View File

@ -100,6 +100,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
{ {
MxResult result; MxResult result;
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState"); InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == 0) if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == 0)
result = SUCCESS; result = SUCCESS;
else { else {
@ -108,7 +109,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
MxString savePath; MxString savePath;
GetFileSavePath(&savePath, p_slot); GetFileSavePath(&savePath, p_slot);
LegoFileStream fileStream; LegoFileStream fileStream;
if (fileStream.Open(savePath.GetData(), LegoStream::WriteBit) != FAILURE) { if (fileStream.Open(savePath.GetData(), LegoStream::c_writeBit) != FAILURE) {
MxU32 maybeVersion = 0x1000C; MxU32 maybeVersion = 0x1000C;
fileStream.Write(&maybeVersion, 4); fileStream.Write(&maybeVersion, 4);
fileStream.Write(&m_unk0x24, 2); fileStream.Write(&m_unk0x24, 2);
@ -219,7 +220,7 @@ void LegoGameState::HandleAction(MxU32 p_area)
// TODO: implement other cases // TODO: implement other cases
} }
InvokeAction(ExtraActionType_opendisk, *script, 0, NULL); InvokeAction(Extra::ActionType::e_opendisk, *script, 0, NULL);
} }
// FUNCTION: LEGO1 0x1003bac0 // FUNCTION: LEGO1 0x1003bac0
@ -313,7 +314,7 @@ void LegoGameState::SerializeScoreHistory(MxS16 p_flags)
savePath += "\\"; savePath += "\\";
savePath += g_historyGSI; savePath += g_historyGSI;
if (p_flags == LegoStream::WriteBit) { if (p_flags == LegoStream::c_writeBit) {
m_unk0xa6.WriteScoreHistory(); m_unk0xa6.WriteScoreHistory();
} }

View File

@ -106,7 +106,7 @@
// FUNCTION: LEGO1 0x10006e40 // FUNCTION: LEGO1 0x10006e40
LegoObjectFactory::LegoObjectFactory() LegoObjectFactory::LegoObjectFactory()
{ {
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact); #define X(V) this->m_id##V = MxAtomId(#V, MxAtomId::e_exact);
FOR_LEGOOBJECTFACTORY_OBJECTS(X) FOR_LEGOOBJECTFACTORY_OBJECTS(X)
#undef X #undef X
} }
@ -114,7 +114,7 @@ LegoObjectFactory::LegoObjectFactory()
// FUNCTION: LEGO1 0x10009a90 // FUNCTION: LEGO1 0x10009a90
MxCore* LegoObjectFactory::Create(const char* p_name) MxCore* LegoObjectFactory::Create(const char* p_name)
{ {
MxAtomId atom(p_name, LookupMode_Exact); MxAtomId atom(p_name, MxAtomId::e_exact);
#define X(V) \ #define X(V) \
if (this->m_id##V == atom) { \ if (this->m_id##V == atom) { \

View File

@ -166,18 +166,18 @@ MxResult LegoFileStream::Open(const char* p_filename, OpenFlags p_mode)
fclose(m_hFile); fclose(m_hFile);
modeString[0] = '\0'; modeString[0] = '\0';
if (p_mode & ReadBit) { if (p_mode & c_readBit) {
m_mode = LEGOSTREAM_MODE_READ; m_mode = LEGOSTREAM_MODE_READ;
strcat(modeString, "r"); strcat(modeString, "r");
} }
if (p_mode & WriteBit) { if (p_mode & c_writeBit) {
if (m_mode != LEGOSTREAM_MODE_READ) if (m_mode != LEGOSTREAM_MODE_READ)
m_mode = LEGOSTREAM_MODE_WRITE; m_mode = LEGOSTREAM_MODE_WRITE;
strcat(modeString, "w"); strcat(modeString, "w");
} }
if ((p_mode & 4) != 0) if ((p_mode & c_binaryBit) != 0)
strcat(modeString, "b"); strcat(modeString, "b");
else else
strcat(modeString, "t"); strcat(modeString, "t");

View File

@ -11,30 +11,30 @@
#include <string.h> #include <string.h>
// FUNCTION: LEGO1 0x1003e300 // FUNCTION: LEGO1 0x1003e300
ExtraActionType MatchActionString(const char* p_str) Extra::ActionType MatchActionString(const char* p_str)
{ {
ExtraActionType result = ExtraActionType_unknown; Extra::ActionType result = Extra::ActionType::e_unknown;
if (!strcmpi("openram", p_str)) if (!strcmpi("openram", p_str))
result = ExtraActionType_openram; result = Extra::ActionType::e_openram;
else if (!strcmpi("opendisk", p_str)) else if (!strcmpi("opendisk", p_str))
result = ExtraActionType_opendisk; result = Extra::ActionType::e_opendisk;
else if (!strcmpi("close", p_str)) else if (!strcmpi("close", p_str))
result = ExtraActionType_close; result = Extra::ActionType::e_close;
else if (!strcmpi("start", p_str)) else if (!strcmpi("start", p_str))
result = ExtraActionType_start; result = Extra::ActionType::e_start;
else if (!strcmpi("stop", p_str)) else if (!strcmpi("stop", p_str))
result = ExtraActionType_stop; result = Extra::ActionType::e_stop;
else if (!strcmpi("run", p_str)) else if (!strcmpi("run", p_str))
result = ExtraActionType_run; result = Extra::ActionType::e_run;
else if (!strcmpi("exit", p_str)) else if (!strcmpi("exit", p_str))
result = ExtraActionType_exit; result = Extra::ActionType::e_exit;
else if (!strcmpi("enable", p_str)) else if (!strcmpi("enable", p_str))
result = ExtraActionType_enable; result = Extra::ActionType::e_enable;
else if (!strcmpi("disable", p_str)) else if (!strcmpi("disable", p_str))
result = ExtraActionType_disable; result = Extra::ActionType::e_disable;
else if (!strcmpi("notify", p_str)) else if (!strcmpi("notify", p_str))
result = ExtraActionType_notify; result = Extra::ActionType::e_notify;
return result; return result;
} }
@ -43,54 +43,54 @@ MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_enti
void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender); void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender);
// FUNCTION: LEGO1 0x1003e430 // FUNCTION: LEGO1 0x1003e430
void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender) void InvokeAction(Extra::ActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender)
{ {
MxDSAction action; MxDSAction action;
action.SetAtomId(p_pAtom); action.SetAtomId(p_pAtom);
action.SetObjectId(p_targetEntityId); action.SetObjectId(p_targetEntityId);
switch (p_actionId) { switch (p_actionId) {
case ExtraActionType_opendisk: case Extra::ActionType::e_opendisk:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_DiskStream); Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_DiskStream);
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_openram: case Extra::ActionType::e_openram:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_RAMStream); Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_RAMStream);
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_close: case Extra::ActionType::e_close:
action.SetUnknown24(-2); action.SetUnknown24(-2);
DeleteObject(action); DeleteObject(action);
Streamer()->Close(p_pAtom.GetInternal()); Streamer()->Close(p_pAtom.GetInternal());
break; break;
case ExtraActionType_start: case Extra::ActionType::e_start:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) { if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Start(&action); Start(&action);
} }
break; break;
case ExtraActionType_stop: case Extra::ActionType::e_stop:
action.SetUnknown24(-2); action.SetUnknown24(-2);
if (!FUN_1003ee00(p_pAtom, p_targetEntityId)) { if (!FUN_1003ee00(p_pAtom, p_targetEntityId)) {
DeleteObject(action); DeleteObject(action);
} }
break; break;
case ExtraActionType_run: case Extra::ActionType::e_run:
_spawnl(0, "\\lego\\sources\\main\\main.exe", "\\lego\\sources\\main\\main.exe", "/script", &p_pAtom, 0); _spawnl(0, "\\lego\\sources\\main\\main.exe", "\\lego\\sources\\main\\main.exe", "/script", &p_pAtom, 0);
break; break;
case ExtraActionType_exit: case Extra::ActionType::e_exit:
Lego()->SetExit(TRUE); Lego()->SetExit(TRUE);
break; break;
case ExtraActionType_enable: case Extra::ActionType::e_enable:
CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId); CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId);
break; break;
case ExtraActionType_disable: case Extra::ActionType::e_disable:
CheckIfEntityExists(FALSE, p_pAtom.GetInternal(), p_targetEntityId); CheckIfEntityExists(FALSE, p_pAtom.GetInternal(), p_targetEntityId);
break; break;
case ExtraActionType_notify: case Extra::ActionType::e_notify:
NotifyEntity(p_pAtom.GetInternal(), p_targetEntityId, p_sender); NotifyEntity(p_pAtom.GetInternal(), p_targetEntityId, p_sender);
break; break;
} }
@ -100,7 +100,7 @@ void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEnt
MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_entityId) MxBool CheckIfEntityExists(MxBool p_enable, const char* p_filename, MxS32 p_entityId)
{ {
LegoWorld* world = LegoWorld* world =
(LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, LookupMode_LowerCase2), p_entityId); (LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, MxAtomId::e_lowerCase2), p_entityId);
if (world) { if (world) {
world->VTable0x68(p_enable); world->VTable0x68(p_enable);
return TRUE; return TRUE;

View File

@ -20,7 +20,7 @@ void LegoEntity::Init()
m_actionArgString = NULL; m_actionArgString = NULL;
m_unk0x10 = 0; m_unk0x10 = 0;
m_flags = 0; m_flags = 0;
m_actionType = ExtraActionType_unknown; m_actionType = Extra::ActionType::e_unknown;
m_actionArgNumber = -1; m_actionArgNumber = -1;
m_unk0x59 = 4; m_unk0x59 = 4;
} }
@ -108,13 +108,13 @@ void LegoEntity::ParseAction(char* p_extra)
if (KeyValueStringParse(actionValue, g_strACTION, copy)) { if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens)); m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens));
if (m_actionType != ExtraActionType_exit) { if (m_actionType != Extra::ActionType::e_exit) {
char* token = strtok(NULL, g_parseExtraTokens); char* token = strtok(NULL, g_parseExtraTokens);
m_actionArgString = new char[strlen(token) + 1]; m_actionArgString = new char[strlen(token) + 1];
strcpy(m_actionArgString, token); strcpy(m_actionArgString, token);
if (m_actionType != ExtraActionType_run) { if (m_actionType != Extra::ActionType::e_run) {
m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens)); m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens));
} }
} }

View File

@ -455,7 +455,7 @@ void Infocenter::PlayCutscene(IntroScript p_entityId, MxBool p_scale)
if (m_currentIntroScript >= e_badEndMovie && m_currentIntroScript <= e_goodEndMovie) { if (m_currentIntroScript >= e_badEndMovie && m_currentIntroScript <= e_goodEndMovie) {
FUN_10070e90(); FUN_10070e90();
} }
InvokeAction(ExtraActionType_opendisk, *g_introScript, m_currentIntroScript, NULL); InvokeAction(Extra::ActionType::e_opendisk, *g_introScript, m_currentIntroScript, NULL);
} }
} }
@ -463,7 +463,7 @@ void Infocenter::PlayCutscene(IntroScript p_entityId, MxBool p_scale)
void Infocenter::StopCutscene() void Infocenter::StopCutscene()
{ {
if (m_currentIntroScript != e_noIntro) { if (m_currentIntroScript != e_noIntro) {
InvokeAction(ExtraActionType_close, *g_introScript, m_currentIntroScript, NULL); InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentIntroScript, NULL);
} }
VideoManager()->EnableFullScreenMovie(FALSE); VideoManager()->EnableFullScreenMovie(FALSE);

View File

@ -298,34 +298,34 @@ LegoEntity* PickEntity(MxLong, MxLong)
// FUNCTION: LEGO1 0x100528e0 // FUNCTION: LEGO1 0x100528e0
void RegisterScripts() void RegisterScripts()
{ {
g_copterScript = new MxAtomId("\\lego\\scripts\\build\\copter", LookupMode_LowerCase2); g_copterScript = new MxAtomId("\\lego\\scripts\\build\\copter", MxAtomId::e_lowerCase2);
g_dunecarScript = new MxAtomId("\\lego\\scripts\\build\\dunecar", LookupMode_LowerCase2); g_dunecarScript = new MxAtomId("\\lego\\scripts\\build\\dunecar", MxAtomId::e_lowerCase2);
g_jetskiScript = new MxAtomId("\\lego\\scripts\\build\\jetski", LookupMode_LowerCase2); g_jetskiScript = new MxAtomId("\\lego\\scripts\\build\\jetski", MxAtomId::e_lowerCase2);
g_racecarScript = new MxAtomId("\\lego\\scripts\\build\\racecar", LookupMode_LowerCase2); g_racecarScript = new MxAtomId("\\lego\\scripts\\build\\racecar", MxAtomId::e_lowerCase2);
g_carraceScript = new MxAtomId("\\lego\\scripts\\race\\carrace", LookupMode_LowerCase2); g_carraceScript = new MxAtomId("\\lego\\scripts\\race\\carrace", MxAtomId::e_lowerCase2);
g_carracerScript = new MxAtomId("\\lego\\scripts\\race\\carracer", LookupMode_LowerCase2); g_carracerScript = new MxAtomId("\\lego\\scripts\\race\\carracer", MxAtomId::e_lowerCase2);
g_jetraceScript = new MxAtomId("\\lego\\scripts\\race\\jetrace", LookupMode_LowerCase2); g_jetraceScript = new MxAtomId("\\lego\\scripts\\race\\jetrace", MxAtomId::e_lowerCase2);
g_jetracerScript = new MxAtomId("\\lego\\scripts\\race\\jetracer", LookupMode_LowerCase2); g_jetracerScript = new MxAtomId("\\lego\\scripts\\race\\jetracer", MxAtomId::e_lowerCase2);
g_isleScript = new MxAtomId("\\lego\\scripts\\isle\\isle", LookupMode_LowerCase2); g_isleScript = new MxAtomId("\\lego\\scripts\\isle\\isle", MxAtomId::e_lowerCase2);
g_elevbottScript = new MxAtomId("\\lego\\scripts\\infocntr\\elevbott", LookupMode_LowerCase2); g_elevbottScript = new MxAtomId("\\lego\\scripts\\infocntr\\elevbott", MxAtomId::e_lowerCase2);
g_infodoorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infodoor", LookupMode_LowerCase2); g_infodoorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infodoor", MxAtomId::e_lowerCase2);
g_infomainScript = new MxAtomId("\\lego\\scripts\\infocntr\\infomain", LookupMode_LowerCase2); g_infomainScript = new MxAtomId("\\lego\\scripts\\infocntr\\infomain", MxAtomId::e_lowerCase2);
g_infoscorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infoscor", LookupMode_LowerCase2); g_infoscorScript = new MxAtomId("\\lego\\scripts\\infocntr\\infoscor", MxAtomId::e_lowerCase2);
g_regbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\regbook", LookupMode_LowerCase2); g_regbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\regbook", MxAtomId::e_lowerCase2);
g_histbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\histbook", LookupMode_LowerCase2); g_histbookScript = new MxAtomId("\\lego\\scripts\\infocntr\\histbook", MxAtomId::e_lowerCase2);
g_hospitalScript = new MxAtomId("\\lego\\scripts\\hospital\\hospital", LookupMode_LowerCase2); g_hospitalScript = new MxAtomId("\\lego\\scripts\\hospital\\hospital", MxAtomId::e_lowerCase2);
g_policeScript = new MxAtomId("\\lego\\scripts\\police\\police", LookupMode_LowerCase2); g_policeScript = new MxAtomId("\\lego\\scripts\\police\\police", MxAtomId::e_lowerCase2);
g_garageScript = new MxAtomId("\\lego\\scripts\\garage\\garage", LookupMode_LowerCase2); g_garageScript = new MxAtomId("\\lego\\scripts\\garage\\garage", MxAtomId::e_lowerCase2);
g_act2mainScript = new MxAtomId("\\lego\\scripts\\act2\\act2main", LookupMode_LowerCase2); g_act2mainScript = new MxAtomId("\\lego\\scripts\\act2\\act2main", MxAtomId::e_lowerCase2);
g_act3Script = new MxAtomId("\\lego\\scripts\\act3\\act3", LookupMode_LowerCase2); g_act3Script = new MxAtomId("\\lego\\scripts\\act3\\act3", MxAtomId::e_lowerCase2);
g_jukeboxScript = new MxAtomId("\\lego\\scripts\\isle\\jukebox", LookupMode_LowerCase2); g_jukeboxScript = new MxAtomId("\\lego\\scripts\\isle\\jukebox", MxAtomId::e_lowerCase2);
g_pz5Script = new MxAtomId("\\lego\\scripts\\isle\\pz5", LookupMode_LowerCase2); g_pz5Script = new MxAtomId("\\lego\\scripts\\isle\\pz5", MxAtomId::e_lowerCase2);
g_introScript = new MxAtomId("\\lego\\scripts\\intro", LookupMode_LowerCase2); g_introScript = new MxAtomId("\\lego\\scripts\\intro", MxAtomId::e_lowerCase2);
g_testScript = new MxAtomId("\\lego\\scripts\\test\\test", LookupMode_LowerCase2); g_testScript = new MxAtomId("\\lego\\scripts\\test\\test", MxAtomId::e_lowerCase2);
g_jukeboxwScript = new MxAtomId("\\lego\\scripts\\isle\\jukeboxw", LookupMode_LowerCase2); g_jukeboxwScript = new MxAtomId("\\lego\\scripts\\isle\\jukeboxw", MxAtomId::e_lowerCase2);
g_sndAnimScript = new MxAtomId("\\lego\\scripts\\sndanim", LookupMode_LowerCase2); g_sndAnimScript = new MxAtomId("\\lego\\scripts\\sndanim", MxAtomId::e_lowerCase2);
g_creditsScript = new MxAtomId("\\lego\\scripts\\credits", LookupMode_LowerCase2); g_creditsScript = new MxAtomId("\\lego\\scripts\\credits", MxAtomId::e_lowerCase2);
g_nocdSourceName = new MxAtomId("\\lego\\scripts\\nocd", LookupMode_LowerCase2); g_nocdSourceName = new MxAtomId("\\lego\\scripts\\nocd", MxAtomId::e_lowerCase2);
} }
// FUNCTION: LEGO1 0x100530c0 // FUNCTION: LEGO1 0x100530c0
@ -638,7 +638,7 @@ MxEntity* LegoOmni::FindWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p
{ {
LegoWorld* foundEntity = NULL; LegoWorld* foundEntity = NULL;
if (strcmpi(p_id, g_current)) { if (strcmpi(p_id, g_current)) {
foundEntity = (LegoWorld*) FindByEntityIdOrAtomId(MxAtomId(p_id, LookupMode_LowerCase2), p_entityId); foundEntity = (LegoWorld*) FindByEntityIdOrAtomId(MxAtomId(p_id, MxAtomId::e_lowerCase2), p_entityId);
} }
else { else {
foundEntity = this->m_currentWorld; foundEntity = this->m_currentWorld;

View File

@ -4,16 +4,16 @@
#include "mxatomidcounter.h" #include "mxatomidcounter.h"
#include "mxtypes.h" #include "mxtypes.h"
enum LookupMode {
LookupMode_Exact = 0,
LookupMode_LowerCase = 1,
LookupMode_UpperCase = 2,
LookupMode_LowerCase2 = 3
};
// SIZE 0x04 // SIZE 0x04
class MxAtomId { class MxAtomId {
public: public:
enum LookupMode {
e_exact = 0,
e_lowerCase,
e_upperCase,
e_lowerCase2,
};
__declspec(dllexport) MxAtomId(const char*, LookupMode); __declspec(dllexport) MxAtomId(const char*, LookupMode);
__declspec(dllexport) MxAtomId& operator=(const MxAtomId& p_atomId); __declspec(dllexport) MxAtomId& operator=(const MxAtomId& p_atomId);
__declspec(dllexport) ~MxAtomId(); __declspec(dllexport) ~MxAtomId();

View File

@ -55,7 +55,7 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
Destroy(); Destroy();
if (p_atomId.m_internal && MxOmni::GetInstance() && AtomIdCounterSet()) { if (p_atomId.m_internal && MxOmni::GetInstance() && AtomIdCounterSet()) {
MxAtomIdCounter* counter = GetCounter(p_atomId.m_internal, LookupMode_Exact); MxAtomIdCounter* counter = GetCounter(p_atomId.m_internal, e_exact);
counter->Inc(); counter->Inc();
} }
@ -71,11 +71,11 @@ MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode)
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str); MxAtomIdCounter* counter = new MxAtomIdCounter(p_str);
switch (p_mode) { switch (p_mode) {
case LookupMode_LowerCase: case e_lowerCase:
case LookupMode_LowerCase2: case e_lowerCase2:
counter->GetKey()->ToLowerCase(); counter->GetKey()->ToLowerCase();
break; break;
case LookupMode_UpperCase: case e_upperCase:
counter->GetKey()->ToUpperCase(); counter->GetKey()->ToUpperCase();
break; break;
} }

View File

@ -19,7 +19,7 @@ DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db
// FUNCTION: LEGO1 0x100b0d80 // FUNCTION: LEGO1 0x100b0d80
MxObjectFactory::MxObjectFactory() MxObjectFactory::MxObjectFactory()
{ {
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact); #define X(V) this->m_id##V = MxAtomId(#V, MxAtomId::e_exact);
FOR_MXOBJECTFACTORY_OBJECTS(X) FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X #undef X
} }
@ -28,7 +28,7 @@ MxObjectFactory::MxObjectFactory()
MxCore* MxObjectFactory::Create(const char* p_name) MxCore* MxObjectFactory::Create(const char* p_name)
{ {
MxCore* object = NULL; MxCore* object = NULL;
MxAtomId atom(p_name, LookupMode_Exact); MxAtomId atom(p_name, MxAtomId::e_exact);
if (0) { if (0) {
} }

View File

@ -82,7 +82,7 @@ MxResult MxStreamController::Open(const char* p_filename)
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
MakeSourceName(sourceName, p_filename); MakeSourceName(sourceName, p_filename);
this->m_atom = MxAtomId(sourceName, LookupMode_LowerCase2); this->m_atom = MxAtomId(sourceName, MxAtomId::e_lowerCase2);
return SUCCESS; return SUCCESS;
} }