From 0b9c9824c99135b43d7dd3c9dba4de7fcd1d0371 Mon Sep 17 00:00:00 2001 From: disinvite Date: Wed, 27 Sep 2023 15:10:53 -0400 Subject: [PATCH] Move global strings to new define.cpp file --- CMakeLists.txt | 1 + LEGO1/define.cpp | 10 ++++++++++ LEGO1/define.h | 8 ++++++++ LEGO1/legoentity.cpp | 4 +--- LEGO1/legoomni.cpp | 2 +- LEGO1/legoomni.h | 2 +- LEGO1/mxpresenter.cpp | 7 +------ LEGO1/mxpresenter.h | 1 - 8 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 LEGO1/define.cpp create mode 100644 LEGO1/define.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d62c2b2b..6c408d65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(lego1 SHARED LEGO1/buildingentity.cpp LEGO1/bumpbouy.cpp LEGO1/carrace.cpp + LEGO1/define.cpp LEGO1/dllmain.cpp LEGO1/dunebuggy.cpp LEGO1/elevatorbottom.cpp diff --git a/LEGO1/define.cpp b/LEGO1/define.cpp new file mode 100644 index 00000000..84073b9d --- /dev/null +++ b/LEGO1/define.cpp @@ -0,0 +1,10 @@ +#include "define.h" + +// 0x10101eac +const char *g_parseExtraTokens = ":;"; + +// 0x10101edc +const char *g_strWORLD = "WORLD"; + +// 0x10102040 +const char *g_strACTION = "ACTION"; diff --git a/LEGO1/define.h b/LEGO1/define.h new file mode 100644 index 00000000..ec41943e --- /dev/null +++ b/LEGO1/define.h @@ -0,0 +1,8 @@ +#ifndef DEFINE_H +#define DEFINE_H + +extern const char *g_parseExtraTokens; +extern const char *g_strWORLD; +extern const char *g_strACTION; + +#endif // DEFINE_H \ No newline at end of file diff --git a/LEGO1/legoentity.cpp b/LEGO1/legoentity.cpp index f34cd4f5..d2062946 100644 --- a/LEGO1/legoentity.cpp +++ b/LEGO1/legoentity.cpp @@ -2,12 +2,10 @@ #include "legoomni.h" #include "legoutil.h" +#include "define.h" DECOMP_SIZE_ASSERT(LegoEntity, 0x68) -// 0x10102040 -char *g_strACTION = "ACTION"; - // OFFSET: LEGO1 0x1000c290 LegoEntity::~LegoEntity() { diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 0c84395e..bbc8258b 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -58,7 +58,7 @@ void MakeSourceName(char *p_output, const char *p_input) } // OFFSET: LEGO1 0x100b7050 -MxBool KeyValueStringParse(char *p_outputValue, char *p_key, char *p_source) +MxBool KeyValueStringParse(char *p_outputValue, const char *p_key, const char *p_source) { MxBool didMatch = FALSE; diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index be289769..a9cce9cf 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -113,6 +113,6 @@ __declspec(dllexport) MxLong Start(MxDSAction *a); LegoBuildingManager* BuildingManager(); Isle* GetIsle(); LegoPlantManager* PlantManager(); -MxBool KeyValueStringParse(char *, char *, char *); +MxBool KeyValueStringParse(char *, const char *, const char *); #endif // LEGOOMNI_H diff --git a/LEGO1/mxpresenter.cpp b/LEGO1/mxpresenter.cpp index 940248a0..b57af821 100644 --- a/LEGO1/mxpresenter.cpp +++ b/LEGO1/mxpresenter.cpp @@ -7,15 +7,10 @@ #include #include "decomp.h" +#include "define.h" DECOMP_SIZE_ASSERT(MxPresenter, 0x40); -// 0x10101eac -char *g_parseExtraTokens = ":;"; - -// 0x10101edc -char *g_strWORLD = "WORLD"; - // OFFSET: LEGO1 0x100b4d50 void MxPresenter::Init() { diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index 3dfcb664..1537d2d3 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -85,6 +85,5 @@ class MxPresenter : public MxCore }; char *PresenterNameDispatch(const MxDSAction &); -extern char *g_parseExtraTokens; #endif // MXPRESENTER_H