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
7 changed files with 92 additions and 75 deletions

View File

@@ -11,22 +11,6 @@
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
MxControlPresenter::MxControlPresenter()
{
@@ -266,18 +250,18 @@ void MxControlPresenter::ParseExtra()
extraCopy[extraLength & MAXWORD] = '\0';
char output[256];
if (KeyValueStringParse(output, g_style, extraCopy)) {
if (KeyValueStringParse(output, g_strSTYLE, extraCopy)) {
char* str = strtok(output, g_parseExtraTokens);
if (!strcmpi(str, g_toggle)) {
if (!strcmpi(str, g_strTOGGLE)) {
m_unk0x4c = 1;
}
else if (!strcmpi(str, g_grid)) {
else if (!strcmpi(str, g_strGRID)) {
m_unk0x4c = 2;
m_unk0x52 = 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;
str = strtok(NULL, g_parseExtraTokens);

View File

@@ -1,40 +1,13 @@
#include "legometerpresenter.h"
#include "decomp.h"
#include "define.h"
#include "mxbitmap.h"
#include "mxdsaction.h"
#include "mxutilities.h"
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
LegoMeterPresenter::LegoMeterPresenter()
{
@@ -66,26 +39,26 @@ void LegoMeterPresenter::ParseExtra()
extraCopy[extraLength & MAXWORD] = '\0';
char output[256];
if (KeyValueStringParse(extraCopy, g_type, output)) {
if (!strcmpi(output, g_leftToRight)) {
if (KeyValueStringParse(extraCopy, g_strTYPE, output)) {
if (!strcmpi(output, g_strLEFT_TO_RIGHT)) {
m_layout = 0;
}
else if (!strcmpi(output, g_rightToLeft)) {
else if (!strcmpi(output, g_strRIGHT_TO_LEFT)) {
m_layout = 1;
}
else if (!strcmpi(output, g_bottomToTop)) {
else if (!strcmpi(output, g_strBOTTOM_TO_TOP)) {
m_layout = 2;
}
else if (!strcmpi(output, g_topToBottom)) {
else if (!strcmpi(output, g_strTOP_TO_BOTTOM)) {
m_layout = 3;
}
}
if (KeyValueStringParse(extraCopy, g_filterIndex, output)) {
if (KeyValueStringParse(extraCopy, g_strFILLER_INDEX, output)) {
m_type = atoi(output);
}
if (KeyValueStringParse(extraCopy, g_variable, output)) {
if (KeyValueStringParse(extraCopy, g_strVARIABLE, output)) {
m_variable = output;
}
else {

View File

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

View File

@@ -24,14 +24,6 @@ DECOMP_SIZE_ASSERT(LegoModelPresenter, 0x6c)
// GLOBAL: LEGO1 0x100f7ae0
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
void LegoModelPresenter::Destroy()
{
@@ -310,7 +302,7 @@ void LegoModelPresenter::ParseExtra()
memcpy(extraCopy, extraData, extraLength & MAXWORD);
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);
if (m_roi == NULL) {
@@ -318,7 +310,7 @@ void LegoModelPresenter::ParseExtra()
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();
list<LegoROI*>& roiList = currentWorld->GetROIList();