Merge branch 'master' of github.com:GTAmodding/re3

This commit is contained in:
aap 2019-06-11 08:58:14 +02:00
commit a600fa9976
10 changed files with 1147 additions and 111 deletions

View File

@ -34,6 +34,7 @@ project "re3"
targetdir "bin/%{cfg.buildcfg}"
targetextension ".dll"
characterset ("MBCS")
linkoptions "/SAFESEH:NO"
filter "configurations:Debug"
defines { "DEBUG" }

View File

@ -17,6 +17,7 @@ WRAPPER void CControllerConfigManager::MakeControllerActionsBlank() { EAXJMP(0x5
WRAPPER void CControllerConfigManager::InitDefaultControlConfiguration() { EAXJMP(0x58B930); }
WRAPPER void CControllerConfigManager::InitDefaultControlConfigMouse(CMouseControllerState const &mousestate) { EAXJMP(0x58BD00); }
WRAPPER Int32 CControllerConfigManager::GetJoyButtonJustDown() { EAXJMP(0x58B7D0); }
WRAPPER void CControllerConfigManager::InitDefaultControlConfigJoyPad(unsigned int buttons) { EAXJMP(0x58BD90); }
void CControllerConfigManager::LoadSettings(Int32 file)
{

View File

@ -45,6 +45,7 @@ public:
void MakeControllerActionsBlank();
void InitDefaultControlConfiguration();
void InitDefaultControlConfigMouse(CMouseControllerState const &mousestate);
void InitDefaultControlConfigJoyPad(unsigned int buttons);
};

View File

@ -10,7 +10,7 @@
#include <stdint.h>
#include <math.h>
#include <assert.h>
//#include <assert.h>
#include <new>
#ifdef WITHD3D
@ -125,7 +125,7 @@ inline float sq(float x) { return x*x; }
#define DEGTORAD(x) ((x) * PI / 180.0f)
#define RADTODEG(x) ((x) * 180.0f / PI)
#if USE_PS2_RAND == TRUE
#ifdef USE_PS2_RAND
#define MYRAND_MAX 65535
#else
#define MYRAND_MAX 32767
@ -134,8 +134,15 @@ inline float sq(float x) { return x*x; }
int myrand(void);
void mysrand(unsigned int seed);
#define debug(f, ...) printf("[DBG]: " f "\n", __VA_ARGS__)
#define DEV(f, ...) printf("[DEV]: " f "", __VA_ARGS__)
void re3_debug(char *format, ...);
void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...);
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func);
#define debug(f, ...) re3_debug("[DBG]: " f, __VA_ARGS__)
#define DEV(f, ...) re3_debug("[DEV]: " f, __VA_ARGS__)
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, __VA_ARGS__)
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#define ASSERT assert
#define _TODO(x)

View File

@ -57,7 +57,10 @@ enum Config {
NUMPOINTLIGHTS = 32
};
#define GTA3_1_1_PATCH FALSE
#define USE_PS2_RAND FALSE
#define GTA3_1_1_PATCH
#define USE_PS2_RAND
#define RANDOMSPLASH
#define CHATTYSPLASH
//#define FIX_BUGS
//#define NO_CDCHECK
#define NO_MOVIES

View File

@ -1,4 +1,5 @@
#include <direct.h>
#include <csignal>
#include <Windows.h>
#include "common.h"
#include "patcher.h"
@ -20,7 +21,7 @@ WRAPPER void gtadelete(void *p) { EAXJMP(0x5A07E0); }
void *operator new(size_t sz) { return gtanew(sz); }
void operator delete(void *ptr) noexcept { gtadelete(ptr); }
#if USE_PS2_RAND == TRUE
#ifdef USE_PS2_RAND
unsigned __int64 myrand_seed = 1;
#else
unsigned long int myrand_seed = 1;
@ -29,7 +30,7 @@ unsigned long int myrand_seed = 1;
int
myrand(void)
{
#if USE_PS2_RAND == TRUE
#ifdef USE_PS2_RAND
// Use our own implementation of rand, stolen from PS2
myrand_seed = 0x5851F42D4C957F2D * myrand_seed + 1;
return ((myrand_seed >> 32) & 0x7FFFFFFF);
@ -136,6 +137,79 @@ HeadlightsFix_DontLimit:
}
}
const int re3_buffsize = 1024;
static char re3_buff[re3_buffsize];
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func)
{
int nCode;
strcpy_s(re3_buff, re3_buffsize, "Assertion failed!" );
strcat_s(re3_buff, re3_buffsize, "\n" );
strcat_s(re3_buff, re3_buffsize, "File: ");
strcat_s(re3_buff, re3_buffsize, filename );
strcat_s(re3_buff, re3_buffsize, "\n" );
strcat_s(re3_buff, re3_buffsize, "Line: " );
_itoa_s( lineno, re3_buff + strlen(re3_buff), re3_buffsize - strlen(re3_buff), 10 );
strcat_s(re3_buff, re3_buffsize, "\n");
strcat_s(re3_buff, re3_buffsize, "Function: ");
strcat_s(re3_buff, re3_buffsize, func );
strcat_s(re3_buff, re3_buffsize, "\n" );
strcat_s(re3_buff, re3_buffsize, "Expression: ");
strcat_s(re3_buff, re3_buffsize, expr);
strcat_s(re3_buff, re3_buffsize, "\n");
strcat_s(re3_buff, re3_buffsize, "\n" );
strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)");
nCode = ::MessageBoxA(NULL, re3_buff, "RE3 Assertion Failed!",
MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
if (nCode == IDABORT)
{
raise(SIGABRT);
_exit(3);
}
if (nCode == IDRETRY)
{
__debugbreak();
return;
}
if (nCode == IDIGNORE)
return;
abort();
}
void re3_debug(char *format, ...)
{
va_list va;
va_start(va, format);
vsprintf_s(re3_buff, re3_buffsize, format, va);
va_end(va);
printf("%s\n", re3_buff);
}
void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...)
{
char buff[re3_buffsize *2];
va_list va;
va_start(va, format);
vsprintf_s(re3_buff, re3_buffsize, format, va);
va_end(va);
sprintf_s(buff, re3_buffsize * 2, "[%s.%s:%d]: %s", filename, func, lineno, re3_buff);
OutputDebugStringA(buff);
}
void
patch()

View File

@ -587,7 +587,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_SMOKE_FILES; i++ )
{
RwTextureDestroy(gpSmokeTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpSmokeTex[i] = NULL;
#endif
}
@ -595,7 +595,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_SMOKE2_FILES; i++ )
{
RwTextureDestroy(gpSmoke2Tex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpSmoke2Tex[i] = NULL;
#endif
}
@ -603,7 +603,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_RUBBER_FILES; i++ )
{
RwTextureDestroy(gpRubberTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpRubberTex[i] = NULL;
#endif
}
@ -611,7 +611,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_RAINSPLASH_FILES; i++ )
{
RwTextureDestroy(gpRainSplashTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpRainSplashTex[i] = NULL;
#endif
}
@ -619,7 +619,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_WATERSPRAY_FILES; i++ )
{
RwTextureDestroy(gpWatersprayTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpWatersprayTex[i] = NULL;
#endif
}
@ -627,7 +627,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_EXPLOSIONMEDIUM_FILES; i++ )
{
RwTextureDestroy(gpExplosionMediumTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpExplosionMediumTex[i] = NULL;
#endif
}
@ -635,7 +635,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_GUNFLASH_FILES; i++ )
{
RwTextureDestroy(gpGunFlashTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpGunFlashTex[i] = NULL;
#endif
}
@ -643,7 +643,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_RAINDROP_FILES; i++ )
{
RwTextureDestroy(gpRainDropTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpRainDropTex[i] = NULL;
#endif
}
@ -651,7 +651,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_RAINSPLASHUP_FILES; i++ )
{
RwTextureDestroy(gpRainSplashupTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpRainSplashupTex[i] = NULL;
#endif
}
@ -659,7 +659,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_BIRDFRONT_FILES; i++ )
{
RwTextureDestroy(gpBirdfrontTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpBirdfrontTex[i] = NULL;
#endif
}
@ -667,7 +667,7 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_CARDEBRIS_FILES; i++ )
{
RwTextureDestroy(gpCarDebrisTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpCarDebrisTex[i] = NULL;
#endif
}
@ -675,78 +675,78 @@ void CParticle::Shutdown()
for ( Int32 i = 0; i < MAX_CARSPLASH_FILES; i++ )
{
RwTextureDestroy(gpCarSplashTex[i]);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpCarSplashTex[i] = NULL;
#endif
}
RwTextureDestroy(gpFlame1Tex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpFlame1Tex = NULL;
#endif
RwTextureDestroy(gpFlame5Tex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpFlame5Tex = NULL;
#endif
RwTextureDestroy(gpRainDropSmallTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpRainDropSmallTex = NULL;
#endif
RwTextureDestroy(gpBloodTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpBloodTex = NULL;
#endif
RwTextureDestroy(gpLeafTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpLeafTex = NULL;
#endif
RwTextureDestroy(gpCloudTex1);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpCloudTex1 = NULL;
#endif
RwTextureDestroy(gpCloudTex4);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpCloudTex4 = NULL;
#endif
RwTextureDestroy(gpBloodSmallTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpBloodSmallTex = NULL;
#endif
RwTextureDestroy(gpGungeTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpGungeTex = NULL;
#endif
RwTextureDestroy(gpCollisionSmokeTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpCollisionSmokeTex = NULL;
#endif
RwTextureDestroy(gpBulletHitTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpBulletHitTex = NULL;
#endif
RwTextureDestroy(gpGunShellTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpGunShellTex = NULL;
#endif
RwTextureDestroy(gpWakeOldTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpWakeOldTex = NULL;
#endif
RwTextureDestroy(gpPointlightTex);
#if GTA3_1_1_PATCH == TRUE
#ifdef GTA3_1_1_PATCH
gpPointlightTex = NULL;
#endif

View File

@ -654,7 +654,6 @@ HandleKeyUp(RsKeyStatus *keyStatus)
if ( c < 255 )
{
CPad::TempKeyState.VK_KEYS[c] = 0;
pad0->AddToPCCheatString(c);
}
break;
}

View File

@ -190,7 +190,6 @@ typedef struct RsPadButtonStatus RsPadButtonStatus;
struct RsPadButtonStatus
{
RwInt32 padID;
RwUInt32 padButtons;
};
enum RsPadButtons

File diff suppressed because it is too large Load Diff