diff options
author | aap <aap@papnet.eu> | 2019-07-24 23:06:58 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-24 23:06:58 +0200 |
commit | ecf03d0f54850005efdcea682a9728c0613325de (patch) | |
tree | 1018843e4d41101e759e5c91112d991fd8270049 /src/core/re3.cpp | |
parent | fixed buoyancy; implemented CAutomobile::ProcessBuoyancy (diff) | |
parent | Merge branch 'master' into master (diff) | |
download | re3-ecf03d0f54850005efdcea682a9728c0613325de.tar re3-ecf03d0f54850005efdcea682a9728c0613325de.tar.gz re3-ecf03d0f54850005efdcea682a9728c0613325de.tar.bz2 re3-ecf03d0f54850005efdcea682a9728c0613325de.tar.lz re3-ecf03d0f54850005efdcea682a9728c0613325de.tar.xz re3-ecf03d0f54850005efdcea682a9728c0613325de.tar.zst re3-ecf03d0f54850005efdcea682a9728c0613325de.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/re3.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 851baeaf..a0032bc6 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -18,6 +18,7 @@ #include "debugmenu_public.h" #include <vector> +#include <list> std::vector<int32> usedAddresses; @@ -177,6 +178,53 @@ static const char *carnames[] = { "yankee", "escape", "borgnine", "toyz", "ghost", }; +static std::list<CTweakVar *> TweakVarsList; +static bool bAddTweakVarsNow = false; +static const char *pTweakVarsDefaultPath = NULL; + +void CTweakVars::Add(CTweakVar *var) +{ + TweakVarsList.push_back(var); + + if ( bAddTweakVarsNow ) + var->AddDBG(pTweakVarsDefaultPath); +} + +void CTweakVars::AddDBG(const char *path) +{ + pTweakVarsDefaultPath = path; + + for(auto i = TweakVarsList.begin(); i != TweakVarsList.end(); ++i) + (*i)->AddDBG(pTweakVarsDefaultPath); + + bAddTweakVarsNow = true; +} + +void CTweakSwitch::AddDBG(const char *path) +{ + DebugMenuEntry *e = DebugMenuAddVar(m_pPath == NULL ? path : m_pPath, m_pVarName, (int32_t *)m_pIntVar, m_pFunc, 1, m_nMin, m_nMax, m_aStr); + DebugMenuEntrySetWrap(e, true); +} + +void CTweakFunc::AddDBG (const char *path) { DebugMenuAddCmd (m_pPath == NULL ? path : m_pPath, m_pVarName, m_pFunc); } +void CTweakBool::AddDBG (const char *path) { DebugMenuAddVarBool8(m_pPath == NULL ? path : m_pPath, m_pVarName, (int8_t *)m_pBoolVar, NULL); } +void CTweakInt8::AddDBG (const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (int8_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakUInt8::AddDBG (const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (uint8_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakInt16::AddDBG (const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (int16_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakUInt16::AddDBG(const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (uint16_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakInt32::AddDBG (const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (int32_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakUInt32::AddDBG(const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (uint32_t *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound, NULL); } +void CTweakFloat::AddDBG (const char *path) { DebugMenuAddVar (m_pPath == NULL ? path : m_pPath, m_pVarName, (float *)m_pIntVar, NULL, m_nStep, m_nLoawerBound, m_nUpperBound); } + +/* +static const char *wt[] = { + "Sunny", "Cloudy", "Rainy", "Foggy" + }; + +SETTWEAKPATH("TEST"); +TWEAKSWITCH(CWeather::NewWeatherType, 0, 3, wt, NULL); +*/ + void DebugMenuPopulate(void) { @@ -266,6 +314,8 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); + + CTweakVars::AddDBG("Debug"); } } |