mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Decompiled UpdateCameraElevation()
This commit is contained in:
parent
efeb8e6889
commit
cf13d92e4a
2 changed files with 40 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <d3dx9.h>
|
||||
#include <stdio.h>
|
||||
#include "draw.h"
|
||||
#include "lara.h"
|
||||
|
||||
struct OLD_CAMERA
|
||||
{
|
||||
|
@ -342,6 +343,40 @@ void MoveCamera(GAME_VECTOR* ideal, int speed)
|
|||
}
|
||||
}
|
||||
|
||||
void ChaseCamera(ITEM_INFO* item)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UpdateCameraElevation()
|
||||
{
|
||||
PHD_VECTOR pos;
|
||||
PHD_VECTOR pos1;
|
||||
|
||||
if (Camera.laraNode != -1)
|
||||
{
|
||||
pos.z = 0;
|
||||
pos.y = 0;
|
||||
pos.x = 0;
|
||||
GetLaraJointPosition(&pos, Camera.laraNode);
|
||||
|
||||
pos1.x = 0;
|
||||
pos1.y = -256;
|
||||
pos1.z = 2048;
|
||||
GetLaraJointPosition(&pos1, Camera.laraNode);
|
||||
|
||||
pos.z = pos1.z - pos.z;
|
||||
pos.x = pos1.x - pos.x;
|
||||
Camera.actualAngle = Camera.targetAngle + ATAN(pos.z, pos.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
Camera.actualAngle = LaraItem->pos.yRot + Camera.targetAngle;
|
||||
}
|
||||
|
||||
Camera.actualElevation += (Camera.targetElevation - Camera.actualElevation) >> 3;
|
||||
}
|
||||
|
||||
void Inject_Camera()
|
||||
{
|
||||
INJECT(0x0048EDC0, AlterFOV);
|
||||
|
@ -349,4 +384,6 @@ void Inject_Camera()
|
|||
INJECT(0x0040FA70, mgLOS);
|
||||
INJECT(0x0040C7A0, MoveCamera);
|
||||
INJECT(0x0040C690, InitialiseCamera);
|
||||
INJECT(0x004107C0, UpdateCameraElevation);
|
||||
//INJECT(0x0040D150, ChaseCamera);
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
//#define InitialiseCamera ((void (__cdecl*)()) 0x0040C690)
|
||||
//#define MoveCamera ((int(__cdecl*)(GAME_VECTOR*,int)) 0x0040C7A0)
|
||||
#define ChaseCamera ((int(__cdecl*)(ITEM_INFO*)) 0x0040D150)
|
||||
//#define ChaseCamera ((int(__cdecl*)(ITEM_INFO*)) 0x0040D150)
|
||||
#define CombatCamera ((int(__cdecl*)(ITEM_INFO*)) 0x0040D640)
|
||||
#define LookCamera ((void(__cdecl*)(ITEM_INFO*)) 0x0040DC10)
|
||||
#define FixedCamera ((void(__cdecl*)()) 0x0040E890)
|
||||
|
@ -30,5 +30,7 @@ void AlterFOV(int value);
|
|||
int mgLOS(GAME_VECTOR* start, GAME_VECTOR* target, int push);
|
||||
void InitialiseCamera();
|
||||
void MoveCamera(GAME_VECTOR* ideal, int speed);
|
||||
void ChaseCamera(ITEM_INFO* item);
|
||||
void UpdateCameraElevation();
|
||||
|
||||
void Inject_Camera();
|
Loading…
Add table
Add a link
Reference in a new issue