diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-07-24 18:55:43 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-07-24 18:55:43 +0200 |
commit | b4ecb3e3dad654e01d0ceb4c359721650dda425b (patch) | |
tree | 27cfc6fb58ec53080d9c4850f13b8b97ad681b13 /src/core | |
parent | Merge pull request #1 from GTAmodding/master (diff) | |
download | re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar.gz re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar.bz2 re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar.lz re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar.xz re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.tar.zst re3-b4ecb3e3dad654e01d0ceb4c359721650dda425b.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.cpp | 9 | ||||
-rw-r--r-- | src/core/Camera.h | 1 | ||||
-rw-r--r-- | src/core/Game.cpp | 17 | ||||
-rw-r--r-- | src/core/Pad.h | 16 | ||||
-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 | 2 | ||||
-rw-r--r-- | src/core/re3.cpp | 67 |
9 files changed, 393 insertions, 14 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index c06ee48b..166928c1 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -41,6 +41,13 @@ CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat } bool +CCamera::IsSphereVisible(const CVector ¢er, float radius) +{ + CMatrix mat = m_cameraMatrix; + return IsSphereVisible(center, radius, &mat); +} + +bool CCamera::IsPointVisible(const CVector ¢er, const CMatrix *mat) { RwV3d c; @@ -1290,7 +1297,7 @@ CCam::GetWeaponFirstPersonOn() } STARTPATCHES - InjectHook(0x42C760, &CCamera::IsSphereVisible, PATCH_JUMP); + InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP); InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP); InjectHook(0x46FD40, &CCamera::SetMotionBlur, PATCH_JUMP); diff --git a/src/core/Camera.h b/src/core/Camera.h index c0309b5f..10554601 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -445,6 +445,7 @@ int m_iModeObbeCamIsInForCar; CVector &GetGameCamPosition(void) { return m_vecGameCamPos; } bool IsPointVisible(const CVector ¢er, const CMatrix *mat); bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat); + bool IsSphereVisible(const CVector ¢er, float radius); bool IsBoxVisible(RwV3d *box, const CMatrix *mat); int GetLookDirection(void); 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 30cdb8df..62585377 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -354,10 +354,18 @@ 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; } }; VALIDATE_SIZE(CPad, 0xFC); diff --git a/src/core/common.h b/src/core/common.h index 4b7bcb0a..71c27492 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -178,3 +178,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 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
\ No newline at end of file diff --git a/src/core/config.h b/src/core/config.h index b1efd4b6..2dbfc95f 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, @@ -113,7 +114,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 ffde80bb..7fcc7ec9 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(); @@ -473,9 +473,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(); } @@ -871,6 +999,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 dabc0f7b..9f27e05e 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,3 +27,4 @@ void LoadingIslandScreen(const char *levelName); CSprite2d *LoadSplash(const char *name); char *GetLevelSplashScreen(int level); char *GetRandomSplashScreen(void); +void ValidateVersion();
\ No newline at end of file diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 8bb9caee..bea5763c 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -17,6 +17,7 @@ #include "debugmenu_public.h" #include <vector> +#include <list> std::vector<int32> usedAddresses; @@ -167,9 +168,71 @@ FixCar(void) ((CAutomobile*)veh)->Fix(); } +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; +} + +//inline DebugMenuEntry * DebugMenuAddVar (const char *path , name, ptr, trig, step, lowerBound, upperBound, const char **strings) +/* +inline DebugMenuEntry * +DebugMenuAddVar + +(const char *path, +const char *name, +int8_t *ptr, +TriggerFunc triggerFunc, +int8_t step, +int8_t lowerBound, +int8_t upperBound, +const char **strings) +*/ + +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) -{ +{ if(DebugMenuLoad()){ static const char *weathers[] = { "Sunny", "Cloudy", "Rainy", "Foggy" @@ -223,6 +286,8 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); + + CTweakVars::AddDBG("Debug"); } } |