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
enum ExtraActionType {
ExtraActionType_none = 0,
ExtraActionType_opendisk = 1,
ExtraActionType_openram = 2,
ExtraActionType_close = 3,
ExtraActionType_start = 4,
ExtraActionType_stop = 5,
ExtraActionType_run = 6,
ExtraActionType_exit = 7,
ExtraActionType_enable = 8,
ExtraActionType_disable = 9,
ExtraActionType_notify = 10,
ExtraActionType_unknown = 11,
struct Extra {
enum ActionType {
e_none = 0,
e_opendisk,
e_openram,
e_close,
e_start,
e_stop,
e_run,
e_exit,
e_enable,
e_disable,
e_notify,
e_unknown,
};
};
#endif // EXTRA_H

View File

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

View File

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

View File

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

View File

@ -10,8 +10,8 @@
class MxAtomId;
class LegoEntity;
ExtraActionType MatchActionString(const char*);
void InvokeAction(ExtraActionType p_actionId, MxAtomId& p_pAtom, int p_targetEntityId, LegoEntity* p_sender);
Extra::ActionType MatchActionString(const char*);
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);
MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool);

View File

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

View File

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

View File

@ -40,11 +40,11 @@ void LegoActionControlPresenter::RepeatingTickle()
#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);
}
#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
ProgressTickleState(TickleState_Done);
}
@ -92,11 +92,11 @@ void LegoActionControlPresenter::ParseExtra()
char output[1024];
if (KeyValueStringParse(output, g_strACTION, buf)) {
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));
m_unk0x54 = buf;
m_unk0x54.ToLowerCase();
if (m_unk0x50 != ExtraActionType_run) {
if (m_unk0x50 != Extra::ActionType::e_run) {
m_unk0x64 = atoi(strtok(NULL, g_parseExtraTokens));
}
}

View File

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

View File

@ -106,7 +106,7 @@
// FUNCTION: LEGO1 0x10006e40
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)
#undef X
}
@ -114,7 +114,7 @@ LegoObjectFactory::LegoObjectFactory()
// FUNCTION: LEGO1 0x10009a90
MxCore* LegoObjectFactory::Create(const char* p_name)
{
MxAtomId atom(p_name, LookupMode_Exact);
MxAtomId atom(p_name, MxAtomId::e_exact);
#define X(V) \
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);
modeString[0] = '\0';
if (p_mode & ReadBit) {
if (p_mode & c_readBit) {
m_mode = LEGOSTREAM_MODE_READ;
strcat(modeString, "r");
}
if (p_mode & WriteBit) {
if (p_mode & c_writeBit) {
if (m_mode != LEGOSTREAM_MODE_READ)
m_mode = LEGOSTREAM_MODE_WRITE;
strcat(modeString, "w");
}
if ((p_mode & 4) != 0)
if ((p_mode & c_binaryBit) != 0)
strcat(modeString, "b");
else
strcat(modeString, "t");

View File

@ -11,30 +11,30 @@
#include <string.h>
// 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))
result = ExtraActionType_openram;
result = Extra::ActionType::e_openram;
else if (!strcmpi("opendisk", p_str))
result = ExtraActionType_opendisk;
result = Extra::ActionType::e_opendisk;
else if (!strcmpi("close", p_str))
result = ExtraActionType_close;
result = Extra::ActionType::e_close;
else if (!strcmpi("start", p_str))
result = ExtraActionType_start;
result = Extra::ActionType::e_start;
else if (!strcmpi("stop", p_str))
result = ExtraActionType_stop;
result = Extra::ActionType::e_stop;
else if (!strcmpi("run", p_str))
result = ExtraActionType_run;
result = Extra::ActionType::e_run;
else if (!strcmpi("exit", p_str))
result = ExtraActionType_exit;
result = Extra::ActionType::e_exit;
else if (!strcmpi("enable", p_str))
result = ExtraActionType_enable;
result = Extra::ActionType::e_enable;
else if (!strcmpi("disable", p_str))
result = ExtraActionType_disable;
result = Extra::ActionType::e_disable;
else if (!strcmpi("notify", p_str))
result = ExtraActionType_notify;
result = Extra::ActionType::e_notify;
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);
// 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;
action.SetAtomId(p_pAtom);
action.SetObjectId(p_targetEntityId);
switch (p_actionId) {
case ExtraActionType_opendisk:
case Extra::ActionType::e_opendisk:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_DiskStream);
Start(&action);
}
break;
case ExtraActionType_openram:
case Extra::ActionType::e_openram:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Streamer()->Open(p_pAtom.GetInternal(), MxStreamer::e_RAMStream);
Start(&action);
}
break;
case ExtraActionType_close:
case Extra::ActionType::e_close:
action.SetUnknown24(-2);
DeleteObject(action);
Streamer()->Close(p_pAtom.GetInternal());
break;
case ExtraActionType_start:
case Extra::ActionType::e_start:
if (!CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId)) {
Start(&action);
}
break;
case ExtraActionType_stop:
case Extra::ActionType::e_stop:
action.SetUnknown24(-2);
if (!FUN_1003ee00(p_pAtom, p_targetEntityId)) {
DeleteObject(action);
}
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);
break;
case ExtraActionType_exit:
case Extra::ActionType::e_exit:
Lego()->SetExit(TRUE);
break;
case ExtraActionType_enable:
case Extra::ActionType::e_enable:
CheckIfEntityExists(TRUE, p_pAtom.GetInternal(), p_targetEntityId);
break;
case ExtraActionType_disable:
case Extra::ActionType::e_disable:
CheckIfEntityExists(FALSE, p_pAtom.GetInternal(), p_targetEntityId);
break;
case ExtraActionType_notify:
case Extra::ActionType::e_notify:
NotifyEntity(p_pAtom.GetInternal(), p_targetEntityId, p_sender);
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)
{
LegoWorld* world =
(LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, LookupMode_LowerCase2), p_entityId);
(LegoWorld*) FindEntityByAtomIdOrEntityId(MxAtomId(p_filename, MxAtomId::e_lowerCase2), p_entityId);
if (world) {
world->VTable0x68(p_enable);
return TRUE;

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
Destroy();
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();
}
@ -71,11 +71,11 @@ MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode)
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str);
switch (p_mode) {
case LookupMode_LowerCase:
case LookupMode_LowerCase2:
case e_lowerCase:
case e_lowerCase2:
counter->GetKey()->ToLowerCase();
break;
case LookupMode_UpperCase:
case e_upperCase:
counter->GetKey()->ToUpperCase();
break;
}

View File

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

View File

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