diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2019-07-24 19:59:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 19:59:16 +0200 |
commit | b79f77634dbb33627c390243d7cf2e7611d35d0a (patch) | |
tree | d836f70678f2ce7b5d86a6745f34b45232ff71d0 /src/core | |
parent | implemented cBuoyancy (diff) | |
parent | update (diff) | |
download | re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar.gz re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar.bz2 re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar.lz re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar.xz re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.tar.zst re3-b79f77634dbb33627c390243d7cf2e7611d35d0a.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.h | 2 | ||||
-rw-r--r-- | src/core/Game.cpp | 17 | ||||
-rw-r--r-- | src/core/Pad.h | 17 | ||||
-rw-r--r-- | src/core/common.h | 117 | ||||
-rw-r--r-- | src/core/config.h | 3 | ||||
-rw-r--r-- | src/core/main.cpp | 175 | ||||
-rw-r--r-- | src/core/main.h | 3 | ||||
-rw-r--r-- | src/core/re3.cpp | 50 |
8 files changed, 373 insertions, 11 deletions
diff --git a/src/core/Camera.h b/src/core/Camera.h index d890db84..1a2aae79 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -442,7 +442,7 @@ int m_iModeObbeCamIsInForCar; static bool &m_bUseMouse3rdPerson; bool Get_Just_Switched_Status() { return m_bJust_Switched; } - CMatrix &GetCameraMatrix(void) { return m_cameraMatrix; } + inline const CMatrix GetCameraMatrix(void) { return m_cameraMatrix; } CVector &GetGameCamPosition(void) { return m_vecGameCamPos; } bool IsPointVisible(const CVector ¢er, const CMatrix *mat); bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat); diff --git a/src/core/Game.cpp b/src/core/Game.cpp index cbd55c48..e07106ce 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -1,6 +1,9 @@ #include "common.h" #include "patcher.h" #include "Game.h" +#include "Main.h" +#include "CdStream.h" +#include "FileMgr.h" eLevelName &CGame::currLevel = *(eLevelName*)0x941514; bool &CGame::bDemoMode = *(bool*)0x5F4DD0; @@ -11,9 +14,21 @@ bool &CGame::noProstitutes = *(bool*)0x95CDCF; bool &CGame::playingIntro = *(bool*)0x95CDC2; char *CGame::aDatFile = (char*)0x773A48; + +bool +CGame::InitialiseOnceBeforeRW(void) +{ + CFileMgr::Initialise(); + CdStreamInit(MAX_CDCHANNELS); + ValidateVersion(); + return true; +} + WRAPPER void CGame::Initialise(const char *datFile) { EAXJMP(0x48BED0); } WRAPPER void CGame::Process(void) { EAXJMP(0x48C850); } -WRAPPER bool CGame::InitialiseOnceBeforeRW(void) { EAXJMP(0x48BB80); } + + + WRAPPER bool CGame::InitialiseRenderWare(void) { EAXJMP(0x48BBA0); } WRAPPER void CGame::ShutdownRenderWare(void) { EAXJMP(0x48BCB0); } WRAPPER void CGame::FinalShutdown(void) { EAXJMP(0x48BEC0); } diff --git a/src/core/Pad.h b/src/core/Pad.h index e15399dd..4f129e85 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -369,12 +369,27 @@ public: bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); } bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); } +/* int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; } int32 GetLeftShoulder2(void) { return NewState.LeftShoulder2; } int32 GetRightShoulder1(void) { return NewState.RightShoulder1; } int32 GetRightShoulder2(void) { return NewState.RightShoulder2; } +*/ + + bool GetTriangle() { return !!NewState.Triangle; } + bool GetCircle() { return !!NewState.Circle; } + bool GetCross() { return !!NewState.Cross; } + bool GetSquare() { return !!NewState.Square; } + bool GetDPadUp() { return !!NewState.DPadUp; } + bool GetDPadDown() { return !!NewState.DPadDown; } + bool GetDPadLeft() { return !!NewState.DPadLeft; } + bool GetDPadRight() { return !!NewState.DPadRight; } + bool GetLeftShoulder1(void) { return !!NewState.LeftShoulder1; } + bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; } + bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; } + bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; } - bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; } + bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; } }; VALIDATE_SIZE(CPad, 0xFC); extern CPad *Pads; //[2] diff --git a/src/core/common.h b/src/core/common.h index 2ca64c1b..9a5683c6 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -180,3 +180,120 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(a) (((a) < 0) ? (-a) : (a)) + + +#define STRINGIFY(x) #x +#define STR(x) STRINGIFY(x) +#define CONCAT_(x,y) x##y +#define CONCAT(x,y) CONCAT_(x,y) + +// Tweaking stuff for debugmenu +#define TWEAKPATH ___tw___TWEAKPATH +#define SETTWEAKPATH(path) static const char *___tw___TWEAKPATH = path; +#define TWEAKFUNC(v) static CTweakFunc CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), TWEAKPATH); +#define TWEAKFUNCN(v, name) static CTweakFunc CONCAT(___tw___tweak, __COUNTER__)(&v, name, TWEAKPATH); +#define TWEAKBOOL(v) static CTweakBool CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), TWEAKPATH); +#define TWEAKBOOLN(v, name) static CTweakBool CONCAT(___tw___tweak, __COUNTER__)(&v, name, TWEAKPATH); +#define TWEAKINT32(v, lower, upper, step) static CTweakInt32 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKINT32N(v, lower, upper, step, name) static CTweakInt32 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKUINT32(v, lower, upper, step) static CTweakUInt32 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKUINT32N(v, lower, upper, step, name) static CTweakUInt32 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKINT16(v, lower, upper, step) static CTweakInt16 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKINT16N(v, lower, upper, step, name) static CTweakInt16 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKUINT16(v, lower, upper, step) static CTweakUInt16 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKUINT16N(v, lower, upper, step, name) static CTweakUInt16 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKINT8(v, lower, upper, step) static CTweakInt8 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKINT8N(v, lower, upper, step, name) static CTweakInt8 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKUINT8(v, lower, upper, step) static CTweakUInt8 CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKUINT8N(v, lower, upper, step, name) static CTweakUInt8 CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKFLOAT(v, lower, upper, step) static CTweakFloat CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, step, TWEAKPATH); +#define TWEAKFLOATN(v, lower, upper, step, name) static CTweakFloat CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, step, TWEAKPATH); +#define TWEAKSWITCH(v, lower, upper, str, f) static CTweakSwitch CONCAT(___tw___tweak, __COUNTER__)(&v, STR(v), lower, upper, str, f, TWEAKPATH); +#define TWEAKSWITCHN(v, lower, upper, str, f, name) static CTweakSwitch CONCAT(___tw___tweak, __COUNTER__)(&v, name, lower, upper, str, f, TWEAKPATH); + +// interface +class CTweakVar +{ +public: + virtual void AddDBG(const char *path) = 0; +}; + +class CTweakVars +{ +public: + static void Add(CTweakVar *var); + static void AddDBG(const char *path); +}; + +class CTweakFunc : public CTweakVar +{ + const char *m_pPath, *m_pVarName; + void (*m_pFunc)(); +public: + CTweakFunc(void (*pFunc)(), const char *strName, const char *strPath) : + m_pFunc(pFunc), m_pVarName(strName), m_pPath(strPath) + { + CTweakVars::Add(this); + } + + void AddDBG(const char *path); +}; + +class CTweakBool : public CTweakVar +{ + const char *m_pPath, *m_pVarName; + bool *m_pBoolVar; +public: + CTweakBool(bool *pBool, const char *strName, const char *strPath) : + m_pBoolVar(pBool), m_pVarName(strName), m_pPath(strPath) + { + CTweakVars::Add(this); + } + + void AddDBG(const char *path); +}; + +class CTweakSwitch : public CTweakVar +{ + const char *m_pPath, *m_pVarName; + void *m_pIntVar; + int32 m_nMin, m_nMax; + const char **m_aStr; + void (*m_pFunc)(); +public: + CTweakSwitch(void *pInt, const char *strName, int32 nMin, int32 nMax, const char **aStr, void (*pFunc)(), const char *strPath) : + m_pVarName(strName), m_pPath(strPath), + m_aStr(aStr), m_pIntVar(pInt), m_nMin(nMin), m_nMax(nMax) + { + CTweakVars::Add(this); + } + + void AddDBG(const char *path); +}; + +#define _TWEEKCLASS(name, type) \ +class name : public CTweakVar \ +{ \ +public: \ + const char *m_pPath, *m_pVarName; \ + type *m_pIntVar, m_nLoawerBound, m_nUpperBound, m_nStep; \ + \ + name(type *pInt, const char *strName, type nLower, type nUpper, type nStep, const char *strPath) : \ + m_pIntVar(pInt), m_nLoawerBound(nLower), m_nUpperBound(nUpper), m_nStep(nStep), \ + m_pVarName(strName), m_pPath(strPath) \ + { \ + CTweakVars::Add(this); \ + } \ + \ + void AddDBG(const char *path); \ +}; + +_TWEEKCLASS(CTweakInt8, int8); +_TWEEKCLASS(CTweakUInt8, uint8); +_TWEEKCLASS(CTweakInt16, int16); +_TWEEKCLASS(CTweakUInt16, uint16); +_TWEEKCLASS(CTweakInt32, int32); +_TWEEKCLASS(CTweakUInt32, uint32); +_TWEEKCLASS(CTweakFloat, float); + +#undef _TWEEKCLASS diff --git a/src/core/config.h b/src/core/config.h index 0736d343..892a06b6 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -3,6 +3,7 @@ enum Config { NUMCDIMAGES = 12, // gta3.img duplicates (not used on PC) MAX_CDIMAGES = 8, // additional cdimages + MAX_CDCHANNELS = 5, MODELINFOSIZE = 5500, TXDSTORESIZE = 850, @@ -114,7 +115,7 @@ enum Config { # define CHATTYSPLASH // print what the game is loading #endif -#define FIX_BUGS // fix bugs in the game, TODO: use this more +//#define FIX_BUGS // fix bugs in the game, TODO: use this more #define KANGAROO_CHEAT #define ASPECT_RATIO_SCALE #define USE_DEBUG_SCRIPT_LOADER
\ No newline at end of file diff --git a/src/core/main.cpp b/src/core/main.cpp index 1083adc3..04fee197 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -66,6 +66,12 @@ wchar *gUString2 = (wchar*)0x6EDD70; bool &b_FoundRecentSavedGameWantToLoad = *(bool*)0x95CDA8; +char version_name[64]; + +float FramesPerSecond = 30.0f; + +bool gbPrintShite = false; + bool DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); void DoRWStuffEndOfFrame(void); @@ -173,9 +179,6 @@ Idle(void *arg) } RenderMenus(); -#ifndef FINAL - PrintGameVersion(); -#endif DoFade(); Render2dStuffAfterFade(); CCredits::Render(); @@ -211,9 +214,6 @@ FrontendIdle(void) DefinedState(); RenderMenus(); -#ifndef FINAL - PrintGameVersion(); -#endif DoFade(); Render2dStuffAfterFade(); CFont::DrawFonts(); @@ -475,9 +475,137 @@ DoFade(void) } } +float FramesPerSecondCounter; +int32 FrameSamples; + +struct tZonePrint +{ + char name[12]; + CRect rect; +}; + +tZonePrint ZonePrint[] = +{ + { "suburban", CRect(-1639.4f, 1014.3f, -226.23f, -1347.9f) }, + { "comntop", CRect(-223.52f, 203.62f, 616.79f, -413.6f) }, + { "comnbtm", CRect(-227.24f, -413.6f, 620.51f, -911.84f) }, + { "comse", CRect( 200.35f, -911.84f, 620.51f, -1737.3f) }, + { "comsw", CRect(-223.52f, -911.84f, 200.35f, -1737.3f) }, + { "industsw", CRect( 744.05f, -473.0f, 1067.5f, -1331.5f) }, + { "industne", CRect( 1067.5f, 282.19f, 1915.3f, -473.0f) }, + { "industnw", CRect( 744.05f, 324.95f, 1067.5f, -473.0f) }, + { "industse", CRect( 1070.3f, -473.0f, 1918.1f, -1331.5f) }, + { "no zone", CRect( 0.0f, 0.0f, 0.0f, 0.0f) } +}; + +#ifndef MASTER +void +DisplayGameDebugText() +{ + static bool bDisplayPosn = false; + static bool bDisplayRate = false; + + { + SETTWEAKPATH("GameDebugText"); + TWEAKBOOL(bDisplayPosn); + TWEAKBOOL(bDisplayRate); + } + + + char str[200]; + wchar ustr[200]; + wchar ver[200]; + + AsciiToUnicode(version_name, ver); + + CFont::SetPropOn(); + CFont::SetBackgroundOff(); + CFont::SetFontStyle(FONT_BANK); + CFont::SetScale(SCREEN_STRETCH_X(0.5f), SCREEN_STRETCH_Y(0.5f)); + CFont::SetCentreOff(); + CFont::SetRightJustifyOff(); + CFont::SetWrapx(SCREEN_WIDTH); + CFont::SetJustifyOff(); + CFont::SetBackGroundOnlyTextOff(); + CFont::SetColor(CRGBA(255, 108, 0, 255)); + CFont::PrintString(10.0f, 10.0f, ver); + + FrameSamples++; + FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f); + FramesPerSecond = FramesPerSecondCounter / FrameSamples; + + if ( FrameSamples > 30 ) + { + FramesPerSecondCounter = 0.0f; + FrameSamples = 0; + } + + if ( !TheCamera.WorldViewerBeingUsed + && CPad::GetPad(1)->GetSquare() + && CPad::GetPad(1)->GetTriangle() + && CPad::GetPad(1)->GetLeftShoulder2JustDown() ) + { + bDisplayPosn = !bDisplayPosn; + } + + if ( CPad::GetPad(1)->GetSquare() + && CPad::GetPad(1)->GetTriangle() + && CPad::GetPad(1)->GetRightShoulder2JustDown() ) + { + bDisplayRate = !bDisplayRate; + } + + if ( bDisplayPosn || bDisplayRate ) + { + CVector pos = FindPlayerCoors(); + int32 ZoneId = ARRAY_SIZE(ZonePrint)-1; // no zone + + for ( int32 i = 0; i < ARRAY_SIZE(ZonePrint)-1; i++ ) + { + if ( pos.x > ZonePrint[i].rect.left + && pos.x < ZonePrint[i].rect.right + && pos.y > ZonePrint[i].rect.bottom + && pos.y < ZonePrint[i].rect.top ) + { + ZoneId = i; + } + } + + //NOTE: fps should be 30, but its 29 due to different fp2int conversion + if ( bDisplayRate ) + sprintf(str, "X:%5.1f, Y:%5.1f, Z:%5.1f, F-%d, %s", pos.x, pos.y, pos.z, (int32)FramesPerSecond, ZonePrint[ZoneId].name); + else + sprintf(str, "X:%5.1f, Y:%5.1f, Z:%5.1f, %s", pos.x, pos.y, pos.z, ZonePrint[ZoneId].name); + + AsciiToUnicode(str, ustr); + + CFont::SetPropOff(); + CFont::SetBackgroundOff(); + CFont::SetScale(0.7f, 1.5f); + CFont::SetCentreOff(); + CFont::SetRightJustifyOff(); + CFont::SetJustifyOff(); + CFont::SetBackGroundOnlyTextOff(); + CFont::SetWrapx(640.0f); + CFont::SetFontStyle(FONT_HEADING); + + CFont::SetColor(CRGBA(0, 0, 0, 255)); + CFont::PrintString(42.0f, 42.0f, ustr); + + CFont::SetColor(CRGBA(255, 108, 0, 255)); + CFont::PrintString(40.0f, 40.0f, ustr); + } +} +#endif + void Render2dStuffAfterFade(void) { +#ifndef MASTER + DisplayGameDebugText(); + //PrintGameVersion(); +#endif + CHud::DrawAfterFade(); CFont::DrawFonts(); } @@ -873,6 +1001,41 @@ void PrintGameVersion() CFont::PrintString(SCREEN_SCALE_X(10.5f), SCREEN_SCALE_Y(8.0f), gUString); } +void +ValidateVersion() +{ + int32 file = CFileMgr::OpenFile("models\\coll\\peds.col", "rb"); + char buff[128]; + + if ( file != -1 ) + { + CFileMgr::Seek(file, 100, SEEK_SET); + + for ( int i = 0; i < 128; i++ ) + { + CFileMgr::Read(file, &buff[i], sizeof(char)); + buff[i] -= 23; + if ( buff[i] == '\0' ) + break; + CFileMgr::Seek(file, 99, SEEK_CUR); + } + + if ( !strncmp(buff, "grandtheftauto3", 15) ) + { + strncpy(version_name, &buff[15], 64); + CFileMgr::CloseFile(file); + return; + } + } + + LoadingScreen("Invalid version", NULL, NULL); + + while(true) + { + ; + } +} + STARTPATCHES InjectHook(0x48E480, Idle, PATCH_JUMP); InjectHook(0x48E700, FrontendIdle, PATCH_JUMP); diff --git a/src/core/main.h b/src/core/main.h index c546d085..9b3c27f5 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -17,6 +17,7 @@ extern char *gString2; extern wchar *gUString; extern wchar *gUString2; extern bool &b_FoundRecentSavedGameWantToLoad; +extern bool gbPrintShite; class CSprite2d; @@ -26,5 +27,5 @@ void LoadingIslandScreen(const char *levelName); CSprite2d *LoadSplash(const char *name); char *GetLevelSplashScreen(int level); char *GetRandomSplashScreen(void); - void LittleTest(void); +void ValidateVersion(); 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"); } } |