TombEngine/TR5Main/Game/spotcam.h

68 lines
1.9 KiB
C
Raw Normal View History

2020-12-21 13:16:29 -03:00
#pragma once
2021-12-22 16:23:57 +03:00
#include "Specific/phd_global.h"
2020-12-21 13:16:29 -03:00
2021-09-14 16:34:58 +03:00
constexpr auto MAX_SPOTCAMS = 256;
constexpr auto SPOTCAM_CINEMATIC_BARS_HEIGHT = 16.0f / 256.0f;
constexpr auto SPOTCAM_CINEMATIC_BARS_SPEED = 1.0f / 256.0f;
2021-09-14 16:34:58 +03:00
2020-12-21 13:16:29 -03:00
struct QUAKE_CAMERA
{
GAME_VECTOR spos;
GAME_VECTOR epos;
};
struct SPOTCAM
2020-12-21 13:16:29 -03:00
{
int x;
int y;
int z;
int tx;
int ty;
int tz;
unsigned char sequence;
unsigned char camera;
short fov;
short roll;
short timer;
short speed;
short flags;
short roomNumber;
short pad;
};
2021-12-01 18:12:04 +03:00
enum SPOTCAM_FLAGS
2020-12-21 13:16:29 -03:00
{
SCF_CUT_PAN = (1 << 0), // 0x0001 cut without panning smoothly
2021-07-31 03:47:56 +03:00
SCF_UNUSED = (1 << 1), // 0x0002
2020-12-21 13:16:29 -03:00
SCF_LOOP_SEQUENCE = (1 << 2), // 0x0004
SCF_TRACKING_CAM = (1 << 3), // 0x0008
SCF_HIDE_LARA = (1 << 4), // 0x0010
SCF_FOCUS_LARA_HEAD = (1 << 5), // 0x0020
SCF_PAN_TO_LARA_CAM = (1 << 6), // 0x0040
SCF_CUT_TO_CAM = (1 << 7), // 0x0080
SCF_STOP_MOVEMENT = (1 << 8), // 0x0100 stops movement for a given time (cf. `Timer` field)
SCF_DISABLE_BREAKOUT = (1 << 9), // 0x0200 disables breaking out from cutscene using Look key
SCF_DISABLE_LARA_CONTROLS = (1 << 10), // 0x0400 also adds widescreen bars
SCF_REENABLE_LARA_CONTROLS = (1 << 11), // 0x0800 use with 0x0400, keeps widescreen bars
SCF_SCREEN_FADE_IN = (1 << 12), // 0x1000
SCF_SCREEN_FADE_OUT = (1 << 13), // 0x2000
SCF_ACTIVATE_HEAVY_TRIGGERS = (1 << 14), // 0x4000 when camera is moving above heavy trigger sector, it'll be activated
SCF_CAMERA_ONE_SHOT = (1 << 15), // 0x8000
};
2021-09-14 16:34:58 +03:00
extern SPOTCAM SpotCam[MAX_SPOTCAMS];
2021-09-16 01:12:19 +03:00
extern byte SpotCamRemap[MAX_SPOTCAMS];
extern byte CameraCnt[MAX_SPOTCAMS];
2022-01-11 15:16:24 +03:00
extern int LastSpotCamSequence;
2020-12-21 13:16:29 -03:00
extern int NumberSpotcams;
extern int UseSpotCam;
extern int SpotcamDontDrawLara;
extern int SpotcamOverlay;
extern int TrackCameraInit;
2020-12-21 13:16:29 -03:00
2021-09-14 16:34:58 +03:00
void ClearSpotCamSequences();
2020-12-21 13:16:29 -03:00
void InitSpotCamSequences();
void InitialiseSpotCam(short sequence);
void CalculateSpotCameras();
int Spline(int x, int* knots, int nk);