Frontend, Peds & logic and overflow fixes

This commit is contained in:
eray orçunus
2019-11-09 18:17:54 +03:00
committed by Filip Gawin
parent 5f92e74086
commit be7d1d1a63
15 changed files with 821 additions and 358 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,10 @@
#define MENUHEADER_WIDTH 0.84f
#define MENUHEADER_HEIGHT 1.6f
#define MENUACTION_POS_X 20.0f
#define MENUACTION_POS_X 40.0f
#define MENUACTION_POS_Y 37.5f
#define MENUACTION_WIDTH 0.675f
#define MENUACTION_HEIGHT 0.81f
#define MENUACTION_WIDTH 0.405f
#define MENUACTION_HEIGHT 0.63f
#define MENUCOLUMN_POS_X MENUHEADER_POS_X + 16.0f
#define MENUCOLUMN_MAX_Y 149.0f
@ -466,9 +466,13 @@ public:
static bool &m_bStartUpFrontEndRequested;
static bool &m_bShutDownFrontEndRequested;
static bool &m_PrefsAllowNastyGame;
static float &headingYStart;
static float &unkX;
static float &unkY;
public:
void BuildStatLine(char *text, float *stat, bool aFloat, float* stat2);
static void BuildStatLine(char *text, void *stat, uint8 aFloat, void *stat2);
static void CentreMousePointer();
int CheckCodesForControls(int32);
bool CheckHover(int x1, int x2, int y1, int y2);

View File

@ -36,7 +36,7 @@ CKeyboardState &CPad::OldKeyState = *(CKeyboardState*)0x6F1E70;
CKeyboardState &CPad::NewKeyState = *(CKeyboardState*)0x6E60D0;
CKeyboardState &CPad::TempKeyState = *(CKeyboardState*)0x774DE8;
char CPad::KeyBoardCheatString[18];
char CPad::KeyBoardCheatString[20];
CMouseControllerState &CPad::OldMouseControllerState = *(CMouseControllerState*)0x8472A0;
CMouseControllerState &CPad::NewMouseControllerState = *(CMouseControllerState*)0x8809F0;
@ -427,7 +427,7 @@ void CPad::StartShake_Train(float fX, float fY)
void CPad::AddToPCCheatString(char c)
{
for ( int32 i = ARRAY_SIZE(KeyBoardCheatString); i >= 0; i-- )
for ( int32 i = ARRAY_SIZE(KeyBoardCheatString) - 2; i >= 0; i-- )
KeyBoardCheatString[i + 1] = KeyBoardCheatString[i];
KeyBoardCheatString[0] = c;

View File

@ -166,7 +166,7 @@ public:
static CKeyboardState &OldKeyState;
static CKeyboardState &NewKeyState;
static CKeyboardState &TempKeyState;
static char KeyBoardCheatString[18];
static char KeyBoardCheatString[20];
static CMouseControllerState &OldMouseControllerState;
static CMouseControllerState &NewMouseControllerState;
static CMouseControllerState &PCTempMouseControllerState;

View File

@ -29,12 +29,10 @@ void **rwengine = *(void***)0x5A10E1;
DebugMenuAPI gDebugMenuAPI;
WRAPPER void *gtanew(uint32 sz) { EAXJMP(0x5A0690); }
WRAPPER void gtadelete(void *p) { EAXJMP(0x5A07E0); }
// overload our own new/delete with GTA's functions
void *operator new(size_t sz) { return gtanew(sz); }
void operator delete(void *ptr) noexcept { gtadelete(ptr); }
STARTPATCHES
InjectHook(0x5A07E0, (void (*)(void*)) &operator delete, PATCH_JUMP);
InjectHook(0x5A0690, (void* (*)(size_t)) &operator new, PATCH_JUMP);
ENDPATCHES
#ifdef USE_PS2_RAND
unsigned __int64 myrand_seed = 1;