rename rest of the Tomb1M* functions

This commit is contained in:
rr- 2021-02-22 21:41:45 +01:00
parent a43ccdb4a0
commit 71d7266082
6 changed files with 26 additions and 19 deletions

View file

@ -12,7 +12,8 @@
#include "config.h" #include "config.h"
#include "util.h" #include "util.h"
void Tomb1MLookLeftRight() #ifdef TOMB1M_FEAT_GAMEPLAY
void LookLeftRight()
{ {
Camera.type = CAM_LOOK; Camera.type = CAM_LOOK;
if (Input & IN_LEFT) { if (Input & IN_LEFT) {
@ -31,7 +32,7 @@ void Tomb1MLookLeftRight()
} }
} }
void __cdecl Tomb1MLookUpDown() void __cdecl LookUpDown()
{ {
Camera.type = CAM_LOOK; Camera.type = CAM_LOOK;
if (Input & IN_FORWARD) { if (Input & IN_FORWARD) {
@ -50,7 +51,7 @@ void __cdecl Tomb1MLookUpDown()
} }
} }
void Tomb1MResetLook() void ResetLook()
{ {
if (Camera.type == CAM_LOOK) { if (Camera.type == CAM_LOOK) {
return; return;
@ -69,6 +70,7 @@ void Tomb1MResetLook()
} }
Lara.torso_y_rot = Lara.head_y_rot; Lara.torso_y_rot = Lara.head_y_rot;
} }
#endif
void __cdecl LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll) void __cdecl LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll)
{ {
@ -87,9 +89,9 @@ void __cdecl LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll)
#ifdef TOMB1M_FEAT_GAMEPLAY #ifdef TOMB1M_FEAT_GAMEPLAY
if (T1MConfig.enable_enhanced_look && item->hit_points > 0) { if (T1MConfig.enable_enhanced_look && item->hit_points > 0) {
if (Input & IN_LOOK) { if (Input & IN_LOOK) {
Tomb1MLookLeftRight(); LookLeftRight();
} else { } else {
Tomb1MResetLook(); ResetLook();
} }
} }
#endif #endif

View file

@ -193,10 +193,15 @@ void __cdecl undraw_pistol_mesh_right(int32_t weapon_type);
void __cdecl PistolHandler(int32_t weapon_type); void __cdecl PistolHandler(int32_t weapon_type);
void __cdecl AnimatePistols(int32_t weapon_type); void __cdecl AnimatePistols(int32_t weapon_type);
void Tomb1MLookLeftRight(); #ifdef TOMB1M_FEAT_GAMEPLAY
void Tomb1MLookUpDown(); void LookLeftRight();
void Tomb1MResetLook(); void LookUpDown();
void Tomb1MLaraCheatGetStuff(); void ResetLook();
#endif
#ifdef TOMB1M_FEAT_CHEATS
void LaraCheatGetStuff();
#endif
void T1MInjectGameLara(); void T1MInjectGameLara();
void T1MInjectGameLaraMisc(); void T1MInjectGameLaraMisc();

View file

@ -21,7 +21,7 @@ void __cdecl LaraControl(int16_t item_num)
#ifdef TOMB1M_FEAT_CHEATS #ifdef TOMB1M_FEAT_CHEATS
if (Input & IN_STUFFCHEAT) { if (Input & IN_STUFFCHEAT) {
Tomb1MLaraCheatGetStuff(); LaraCheatGetStuff();
} }
if (Lara.water_status != LWS_CHEAT && (Input & IN_DOZYCHEAT)) { if (Lara.water_status != LWS_CHEAT && (Input & IN_DOZYCHEAT)) {
@ -569,7 +569,7 @@ void __cdecl LaraInitialiseMeshes(int32_t level_num)
} }
} }
void Tomb1MLaraCheatGetStuff() void LaraCheatGetStuff()
{ {
if (CurrentLevel == LV_GYM) { if (CurrentLevel == LV_GYM) {
return; return;

View file

@ -27,9 +27,9 @@ void __cdecl LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll)
#ifdef TOMB1M_FEAT_GAMEPLAY #ifdef TOMB1M_FEAT_GAMEPLAY
if (T1MConfig.enable_enhanced_look && item->hit_points > 0) { if (T1MConfig.enable_enhanced_look && item->hit_points > 0) {
if (Input & IN_LOOK) { if (Input & IN_LOOK) {
Tomb1MLookLeftRight(); LookLeftRight();
} else { } else {
Tomb1MResetLook(); ResetLook();
} }
} }
#endif #endif
@ -163,7 +163,7 @@ void __cdecl LaraAsTread(ITEM_INFO* item, COLL_INFO* coll)
#ifdef TOMB1M_FEAT_GAMEPLAY #ifdef TOMB1M_FEAT_GAMEPLAY
if (T1MConfig.enable_enhanced_look) { if (T1MConfig.enable_enhanced_look) {
if (Input & IN_LOOK) { if (Input & IN_LOOK) {
Tomb1MLookUpDown(); LookUpDown();
} }
} }
#endif #endif

View file

@ -4,7 +4,7 @@
#include <windows.h> #include <windows.h>
#include <dbghelp.h> #include <dbghelp.h>
void Tomb1MTraceFunc( void T1MTraceFunc(
const char* file, int line, const char* func, const char* fmt, ...) const char* file, int line, const char* func, const char* fmt, ...)
{ {
va_list va; va_list va;
@ -31,7 +31,7 @@ void T1MInjectFunc(void* from, void* to)
//((JMP*)(from))->offset = (DWORD)(to) - ((DWORD)(from) + sizeof(JMP)); //((JMP*)(from))->offset = (DWORD)(to) - ((DWORD)(from) + sizeof(JMP));
} }
void Tomb1MPrintStackTrace() void T1MPrintStackTrace()
{ {
const size_t MaxNameLen = 255; const size_t MaxNameLen = 255;
BOOL result; BOOL result;

View file

@ -11,15 +11,15 @@ typedef struct {
} JMP; } JMP;
#pragma pack(pop) #pragma pack(pop)
#define TRACE(...) Tomb1MTraceFunc(__FILE__, __LINE__, __func__, __VA_ARGS__) #define TRACE(...) T1MTraceFunc(__FILE__, __LINE__, __func__, __VA_ARGS__)
#define VAR_U_(address, type) (*(type*)(address)) #define VAR_U_(address, type) (*(type*)(address))
#define VAR_I_(address, type, value) (*(type*)(address)) #define VAR_I_(address, type, value) (*(type*)(address))
#define ARRAY_(address, type, length) (*(type(*) length)(address)) #define ARRAY_(address, type, length) (*(type(*) length)(address))
void Tomb1MTraceFunc( void T1MTraceFunc(
const char* file, int line, const char* func, const char* fmt, ...); const char* file, int line, const char* func, const char* fmt, ...);
void T1MInjectFunc(void* from, void* to); void T1MInjectFunc(void* from, void* to);
void Tomb1MPrintStackTrace(); void T1MPrintStackTrace();
#define INJECT(from, to) \ #define INJECT(from, to) \
{ \ { \