Move strings to proper location in define.cpp (#922)

This commit is contained in:
Christian Semmler 2024-05-14 10:43:06 -04:00 committed by GitHub
parent e32e06321a
commit e4a899350e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 92 additions and 75 deletions

View file

@ -12,6 +12,38 @@ const char* g_strANIMATION = "ANIMATION";
// STRING: LEGO1 0x10102024 // STRING: LEGO1 0x10102024
const char* g_strATTACH_CAMERA = "ATTACH_CAMERA"; const char* g_strATTACH_CAMERA = "ATTACH_CAMERA";
// GLOBAL: LEGO1 0x10102054
// STRING: LEGO1 0x10102018
const char* g_strAUTO_CREATE = "AUTO_CREATE";
// GLOBAL: LEGO1 0x1010205c
// STRING: LEGO1 0x10102000
const char* g_strBOTTOM_TO_TOP = "BOTTOM_TO_TOP";
// GLOBAL: LEGO1 0x10102064
// STRING: LEGO1 0x10101fec
const char* g_strSTYLE = "STYLE";
// GLOBAL: LEGO1 0x10102068
// STRING: LEGO1 0x10101fe4
const char* g_strGRID = "GRID";
// GLOBAL: LEGO1 0x1010206c
// STRING: LEGO1 0x10101fe0
const char* g_strMAP = "MAP";
// GLOBAL: LEGO1 0x10102074
// STRING: LEGO1 0x10101fd0
const char* g_strTOGGLE = "TOGGLE";
// GLOBAL: LEGO1 0x10102078
// STRING: LEGO1 0x10101fc4
const char* g_strDB_CREATE = "DB_CREATE";
// GLOBAL: LEGO1 0x1010207c
// STRING: LEGO1 0x10101fb4
const char* g_strFILLER_INDEX = "FILLER_INDEX";
// GLOBAL: LEGO1 0x10102080 // GLOBAL: LEGO1 0x10102080
// STRING: LEGO1 0x100f4368 // STRING: LEGO1 0x100f4368
const char* g_strFROM_PARENT = "FROM_PARENT"; const char* g_strFROM_PARENT = "FROM_PARENT";
@ -20,6 +52,14 @@ const char* g_strFROM_PARENT = "FROM_PARENT";
// STRING: LEGO1 0x10101fa4 // STRING: LEGO1 0x10101fa4
const char* g_strHIDE_ON_STOP = "HIDE_ON_STOP"; const char* g_strHIDE_ON_STOP = "HIDE_ON_STOP";
// GLOBAL: LEGO1 0x10102088
// STRING: LEGO1 0x10101f94
const char* g_strLEFT_TO_RIGHT = "LEFT_TO_RIGHT";
// GLOBAL: LEGO1 0x10102094
// STRING: LEGO1 0x10101f70
const char* g_strTYPE = "TYPE";
// GLOBAL: LEGO1 0x10102098 // GLOBAL: LEGO1 0x10102098
// STRING: LEGO1 0x10101f60 // STRING: LEGO1 0x10101f60
const char* g_strMUST_SUCCEED = "MUST_SUCCEED"; const char* g_strMUST_SUCCEED = "MUST_SUCCEED";
@ -32,6 +72,10 @@ const char* g_strOBJECT = "OBJECT";
// STRING: LEGO1 0x10101f38 // STRING: LEGO1 0x10101f38
const char* g_strPTATCAM = "PTATCAM"; const char* g_strPTATCAM = "PTATCAM";
// GLOBAL: LEGO1 0x101020ac
// STRING: LEGO1 0x10101f28
const char* g_strRIGHT_TO_LEFT = "RIGHT_TO_LEFT";
// GLOBAL: LEGO1 0x101020b0 // GLOBAL: LEGO1 0x101020b0
// STRING: LEGO1 0x10101f20 // STRING: LEGO1 0x10101f20
const char* g_strSOUND = "SOUND"; const char* g_strSOUND = "SOUND";
@ -48,6 +92,18 @@ const char* g_strSPEED = "SPEED";
// STRING: LEGO1 0x10101f10 // STRING: LEGO1 0x10101f10
const char* g_strSUBST = "SUBST"; const char* g_strSUBST = "SUBST";
// GLOBAL: LEGO1 0x101020c0
// STRING: LEGO1 0x10101f00
const char* g_strTOP_TO_BOTTOM = "TOP_TO_BOTTOM";
// GLOBAL: LEGO1 0x101020c4
// STRING: LEGO1 0x10101ef0
const char* g_strTRIGGERS_SOURCE = "TRIGGERS_SOURCE";
// GLOBAL: LEGO1 0x101020c8
// STRING: LEGO1 0x10101ee4
const char* g_strVARIABLE = "VARIABLE";
// GLOBAL: LEGO1 0x101020cc // GLOBAL: LEGO1 0x101020cc
// STRING: LEGO1 0x100f3808 // STRING: LEGO1 0x100f3808
const char* g_strVISIBILITY = "VISIBILITY"; const char* g_strVISIBILITY = "VISIBILITY";
@ -60,6 +116,10 @@ const char* g_strWORLD = "WORLD";
// STRING: LEGO1 0x10101ed0 // STRING: LEGO1 0x10101ed0
const char* g_strANIMMAN_ID = "ANIMMAN_ID"; const char* g_strANIMMAN_ID = "ANIMMAN_ID";
// GLOBAL: LEGO1 0x101020e0
// STRING: LEGO1 0x10101eb0
const char* g_strBMP_ISMAP = "BMP_ISMAP";
// GLOBAL: LEGO1 0x101020e4 // GLOBAL: LEGO1 0x101020e4
// STRING: LEGO1 0x10101eac // STRING: LEGO1 0x10101eac
const char* g_parseExtraTokens = ":;"; const char* g_parseExtraTokens = ":;";

View file

@ -18,6 +18,21 @@ extern const char* g_strFROM_PARENT;
extern const char* g_strHIDE_ON_STOP; extern const char* g_strHIDE_ON_STOP;
extern const char* g_strMUST_SUCCEED; extern const char* g_strMUST_SUCCEED;
extern const char* g_strSUBST; extern const char* g_strSUBST;
extern const char* g_strTRIGGERS_SOURCE;
extern const char* g_strPTATCAM; extern const char* g_strPTATCAM;
extern const char* g_strTOGGLE;
extern const char* g_strMAP;
extern const char* g_strGRID;
extern const char* g_strSTYLE;
extern const char* g_strTYPE;
extern const char* g_strLEFT_TO_RIGHT;
extern const char* g_strRIGHT_TO_LEFT;
extern const char* g_strBOTTOM_TO_TOP;
extern const char* g_strTOP_TO_BOTTOM;
extern const char* g_strFILLER_INDEX;
extern const char* g_strVARIABLE;
extern const char* g_strBMP_ISMAP;
extern const char* g_strAUTO_CREATE;
extern const char* g_strDB_CREATE;
#endif // DEFINE_H #endif // DEFINE_H

View file

@ -11,22 +11,6 @@
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// GLOBAL: LEGO1 0x10102064
// STRING: LEGO1 0x10101fec
const char* g_style = "STYLE";
// GLOBAL: LEGO1 0x10102068
// STRING: LEGO1 0x10101fe4
const char* g_grid = "GRID";
// GLOBAL: LEGO1 0x1010206c
// STRING: LEGO1 0x10101fe0
const char* g_map = "MAP";
// GLOBAL: LEGO1 0x10102074
// STRING: LEGO1 0x10101fd0
const char* g_toggle = "TOGGLE";
// FUNCTION: LEGO1 0x10043f50 // FUNCTION: LEGO1 0x10043f50
MxControlPresenter::MxControlPresenter() MxControlPresenter::MxControlPresenter()
{ {
@ -266,18 +250,18 @@ void MxControlPresenter::ParseExtra()
extraCopy[extraLength & MAXWORD] = '\0'; extraCopy[extraLength & MAXWORD] = '\0';
char output[256]; char output[256];
if (KeyValueStringParse(output, g_style, extraCopy)) { if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) {
char* str = strtok(output, g_parseExtraTokens); char* str = strtok(output, g_parseExtraTokens);
if (!strcmpi(str, g_toggle)) { if (!strcmpi(str, g_strTOGGLE)) {
m_unk0x4c = 1; m_unk0x4c = 1;
} }
else if (!strcmpi(str, g_grid)) { else if (!strcmpi(str, g_strGRID)) {
m_unk0x4c = 2; m_unk0x4c = 2;
m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens));
m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens)); m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens));
} }
else if (!strcmpi(str, g_map)) { else if (!strcmpi(str, g_strMAP)) {
m_unk0x4c = 3; m_unk0x4c = 3;
str = strtok(NULL, g_parseExtraTokens); str = strtok(NULL, g_parseExtraTokens);

View file

@ -1,40 +1,13 @@
#include "legometerpresenter.h" #include "legometerpresenter.h"
#include "decomp.h" #include "decomp.h"
#include "define.h"
#include "mxbitmap.h" #include "mxbitmap.h"
#include "mxdsaction.h" #include "mxdsaction.h"
#include "mxutilities.h" #include "mxutilities.h"
DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94) DECOMP_SIZE_ASSERT(LegoMeterPresenter, 0x94)
// GLOBAL: LEGO1 0x1010207c
// STRING: LEGO1 0x10101fb4
const char* g_filterIndex = "FILLER_INDEX";
// GLOBAL: LEGO1 0x10102094
// STRING: LEGO1 0x10101f70
const char* g_type = "TYPE";
// GLOBAL: LEGO1 0x10102088
// STRING: LEGO1 0x10101f94
const char* g_leftToRight = "LEFT_TO_RIGHT";
// GLOBAL: LEGO1 0x101020ac
// STRING: LEGO1 0x10101f28
const char* g_rightToLeft = "RIGHT_TO_LEFT";
// GLOBAL: LEGO1 0x1010205c
// STRING: LEGO1 0x10102000
const char* g_bottomToTop = "BOTTOM_TO_TOP";
// GLOBAL: LEGO1 0x101020c0
// STRING: LEGO1 0x10101f00
const char* g_topToBottom = "TOP_TO_BOTTOM";
// GLOBAL: LEGO1 0x101020c8
// STRING: LEGO1 0x10101ee4
const char* g_variable = "VARIABLE";
// FUNCTION: LEGO1 0x10043430 // FUNCTION: LEGO1 0x10043430
LegoMeterPresenter::LegoMeterPresenter() LegoMeterPresenter::LegoMeterPresenter()
{ {
@ -66,26 +39,26 @@ void LegoMeterPresenter::ParseExtra()
extraCopy[extraLength & MAXWORD] = '\0'; extraCopy[extraLength & MAXWORD] = '\0';
char output[256]; char output[256];
if (KeyValueStringParse(extraCopy, g_type, output)) { if (KeyValueStringParse(extraCopy, g_strTYPE, output)) {
if (!strcmpi(output, g_leftToRight)) { if (!strcmpi(output, g_strLEFT_TO_RIGHT)) {
m_layout = 0; m_layout = 0;
} }
else if (!strcmpi(output, g_rightToLeft)) { else if (!strcmpi(output, g_strRIGHT_TO_LEFT)) {
m_layout = 1; m_layout = 1;
} }
else if (!strcmpi(output, g_bottomToTop)) { else if (!strcmpi(output, g_strBOTTOM_TO_TOP)) {
m_layout = 2; m_layout = 2;
} }
else if (!strcmpi(output, g_topToBottom)) { else if (!strcmpi(output, g_strTOP_TO_BOTTOM)) {
m_layout = 3; m_layout = 3;
} }
} }
if (KeyValueStringParse(extraCopy, g_filterIndex, output)) { if (KeyValueStringParse(extraCopy, g_strFILLER_INDEX, output)) {
m_type = atoi(output); m_type = atoi(output);
} }
if (KeyValueStringParse(extraCopy, g_variable, output)) { if (KeyValueStringParse(extraCopy, g_strVARIABLE, output)) {
m_variable = output; m_variable = output;
} }
else { else {

View file

@ -1,5 +1,6 @@
#include "legopathpresenter.h" #include "legopathpresenter.h"
#include "define.h"
#include "legopathcontroller.h" #include "legopathcontroller.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "legoworld.h" #include "legoworld.h"
@ -10,10 +11,6 @@
DECOMP_SIZE_ASSERT(LegoPathPresenter, 0x54) DECOMP_SIZE_ASSERT(LegoPathPresenter, 0x54)
// STRING: LEGO1 0x10101ef0
// GLOBAL: LEGO1 0x101020c4
const char* g_triggersSource = "TRIGGERS_SOURCE";
// FUNCTION: LEGO1 0x100448d0 // FUNCTION: LEGO1 0x100448d0
LegoPathPresenter::LegoPathPresenter() LegoPathPresenter::LegoPathPresenter()
{ {
@ -132,7 +129,7 @@ void LegoPathPresenter::ParseExtra()
strupr(extraCopy); strupr(extraCopy);
if (KeyValueStringParse(output, g_triggersSource, extraCopy) != FALSE) { if (KeyValueStringParse(output, g_strTRIGGERS_SOURCE, extraCopy) != FALSE) {
m_trigger = MxAtomId(output, e_lowerCase2); m_trigger = MxAtomId(output, e_lowerCase2);
} }
} }

View file

@ -24,14 +24,6 @@ DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c)
// GLOBAL: LEGO1 0x100f7ae0 // GLOBAL: LEGO1 0x100f7ae0
MxS32 g_modelPresenterConfig = 1; MxS32 g_modelPresenterConfig = 1;
// GLOBAL: LEGO1 0x10102054
// STRING: LEGO1 0x10102018
char* g_autoCreate = "AUTO_CREATE";
// GLOBAL: LEGO1 0x10102078
// STRING: LEGO1 0x10101fc4
char* g_dbCreate = "DB_CREATE";
// FUNCTION: LEGO1 0x1000cca0 // FUNCTION: LEGO1 0x1000cca0
void LegoModelPresenter::Destroy() void LegoModelPresenter::Destroy()
{ {
@ -310,7 +302,7 @@ void LegoModelPresenter::ParseExtra()
memcpy(extraCopy, extraData, extraLength & MAXWORD); memcpy(extraCopy, extraData, extraLength & MAXWORD);
extraCopy[extraLength & MAXWORD] = '\0'; extraCopy[extraLength & MAXWORD] = '\0';
if (KeyValueStringParse(output, g_autoCreate, extraCopy) != 0) { if (KeyValueStringParse(output, g_strAUTO_CREATE, extraCopy) != 0) {
char* token = strtok(output, g_parseExtraTokens); char* token = strtok(output, g_parseExtraTokens);
if (m_roi == NULL) { if (m_roi == NULL) {
@ -318,7 +310,7 @@ void LegoModelPresenter::ParseExtra()
m_addedToView = FALSE; m_addedToView = FALSE;
} }
} }
else if (KeyValueStringParse(output, g_dbCreate, extraCopy) != 0 && m_roi == NULL) { else if (KeyValueStringParse(output, g_strDB_CREATE, extraCopy) != 0 && m_roi == NULL) {
LegoWorld* currentWorld = CurrentWorld(); LegoWorld* currentWorld = CurrentWorld();
list<LegoROI*>& roiList = currentWorld->GetROIList(); list<LegoROI*>& roiList = currentWorld->GetROIList();

View file

@ -14,10 +14,6 @@
DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c);
// GLOBAL: LEGO1 0x101020e0
// STRING: LEGO1 0x10101eb0
const char* g_strBmpIsmap = "BMP_ISMAP";
// FUNCTION: LEGO1 0x100b9c70 // FUNCTION: LEGO1 0x100b9c70
void MxStillPresenter::Destroy(MxBool p_fromDestructor) void MxStillPresenter::Destroy(MxBool p_fromDestructor)
{ {
@ -218,7 +214,7 @@ void MxStillPresenter::ParseExtra()
} }
} }
if (KeyValueStringParse(output, g_strBmpIsmap, extraCopy)) { if (KeyValueStringParse(output, g_strBMP_ISMAP, extraCopy)) {
SetBit4(TRUE); SetBit4(TRUE);
SetBit1(FALSE); SetBit1(FALSE);
SetBit2(FALSE); SetBit2(FALSE);