2014-07-25 04:30:44 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef _GAMESTATE_HPP_
|
|
|
|
#define _GAMESTATE_HPP_
|
|
|
|
#include <glm/glm.hpp>
|
2014-07-27 01:38:01 +02:00
|
|
|
#include <string>
|
2014-07-30 14:44:25 +02:00
|
|
|
#include <map>
|
2014-07-30 16:48:51 +02:00
|
|
|
#include <vector>
|
2014-07-25 04:30:44 +02:00
|
|
|
|
2014-12-17 01:39:52 +01:00
|
|
|
class GameObject;
|
2014-07-25 04:30:44 +02:00
|
|
|
class PlayerController;
|
2014-08-11 18:58:43 +02:00
|
|
|
struct CutsceneData;
|
2014-07-25 04:30:44 +02:00
|
|
|
|
2014-07-30 16:48:51 +02:00
|
|
|
struct TextDisplayData
|
|
|
|
{
|
|
|
|
// This is set by the final display text command.
|
|
|
|
std::string text;
|
|
|
|
glm::vec2 position;
|
|
|
|
|
|
|
|
glm::vec4 colourFG;
|
|
|
|
glm::vec4 colourBG;
|
|
|
|
};
|
|
|
|
|
2014-12-16 20:17:22 +01:00
|
|
|
struct OnscreenText
|
|
|
|
{
|
2014-12-17 01:39:52 +01:00
|
|
|
std::string id;
|
2014-12-16 20:17:22 +01:00
|
|
|
std::string osTextString;
|
|
|
|
float osTextStart;
|
|
|
|
float osTextTime;
|
|
|
|
unsigned short osTextStyle;
|
|
|
|
};
|
|
|
|
|
2014-12-16 00:56:47 +01:00
|
|
|
/**
|
|
|
|
* Stores information about where the game can generate vehicles.
|
|
|
|
*/
|
|
|
|
struct VehicleGenerator
|
|
|
|
{
|
|
|
|
glm::vec3 position;
|
|
|
|
float heading;
|
|
|
|
/** ID of the vehicle to spawn, or -1 for random. */
|
|
|
|
int vehicleID;
|
|
|
|
int colourFG;
|
|
|
|
int colourBG;
|
|
|
|
bool alwaysSpawn;
|
|
|
|
short alarmThreshold;
|
|
|
|
short lockedThreshold;
|
|
|
|
|
|
|
|
int minDelay;
|
|
|
|
int maxDelay;
|
|
|
|
/** Incrementing timer (in ms), will only spawn a vehicle when minDelay < spawnTimer and will always spawn if maxDelay < spawnTimer */
|
|
|
|
int lastSpawnTime;
|
|
|
|
|
|
|
|
/** Number of vehicles left to spawn 0-100, 101 = never decrement. */
|
|
|
|
int remainingSpawns;
|
|
|
|
};
|
|
|
|
|
2014-07-25 04:30:44 +02:00
|
|
|
struct GameState
|
|
|
|
{
|
|
|
|
unsigned int maxProgress;
|
|
|
|
unsigned int numMissions;
|
|
|
|
unsigned int numHiddenPackages;
|
2014-07-27 01:38:01 +02:00
|
|
|
unsigned int numHiddenPackagesDiscovered;
|
2014-07-25 04:30:44 +02:00
|
|
|
unsigned int numUniqueJumps;
|
|
|
|
unsigned int numRampages;
|
|
|
|
unsigned int maxWantedLevel;
|
|
|
|
PlayerController* player;
|
|
|
|
|
2014-07-27 01:38:01 +02:00
|
|
|
unsigned int currentWeather;
|
|
|
|
|
2014-07-25 04:30:44 +02:00
|
|
|
/**
|
|
|
|
* @brief Stores a pointer to script global that stores the on-mission state.
|
|
|
|
*/
|
|
|
|
unsigned int *scriptOnMissionFlag;
|
|
|
|
|
2014-07-28 03:27:55 +02:00
|
|
|
bool fadeOut;
|
2014-07-27 01:38:01 +02:00
|
|
|
float fadeStart;
|
2014-07-25 04:30:44 +02:00
|
|
|
float fadeTime;
|
2014-07-27 01:38:01 +02:00
|
|
|
bool fadeSound;
|
2014-07-28 03:27:55 +02:00
|
|
|
glm::u16vec3 fadeColour;
|
|
|
|
|
2014-08-01 23:03:00 +02:00
|
|
|
std::string currentSplash;
|
|
|
|
|
2014-12-17 01:39:52 +01:00
|
|
|
bool skipCutscene;
|
2014-07-25 04:30:44 +02:00
|
|
|
bool isIntroPlaying;
|
2014-07-28 03:27:55 +02:00
|
|
|
CutsceneData* currentCutscene;
|
2014-07-27 01:38:01 +02:00
|
|
|
float cutsceneStartTime;
|
2014-12-16 20:17:22 +01:00
|
|
|
/** Flag for rendering cutscene letterbox */
|
|
|
|
bool isCinematic;
|
2014-07-27 01:38:01 +02:00
|
|
|
|
|
|
|
short hour;
|
|
|
|
short minute;
|
2014-12-16 20:17:22 +01:00
|
|
|
|
|
|
|
|
2014-07-30 14:44:25 +02:00
|
|
|
/// Stores the "special" character and cutscene model indices.
|
|
|
|
std::map<unsigned short, std::string> specialCharacters;
|
|
|
|
std::map<unsigned short, std::string> specialModels;
|
|
|
|
|
2014-12-16 20:17:22 +01:00
|
|
|
std::vector<OnscreenText> text;
|
|
|
|
|
2014-07-30 16:48:51 +02:00
|
|
|
TextDisplayData nextText;
|
|
|
|
std::vector<TextDisplayData> texts;
|
|
|
|
|
2014-08-12 22:15:26 +02:00
|
|
|
/** The camera near value currently set by the script */
|
|
|
|
float cameraNear;
|
2014-12-16 20:17:22 +01:00
|
|
|
bool cameraFixed;
|
|
|
|
glm::vec3 cameraPosition;
|
|
|
|
glm::quat cameraRotation;
|
2014-12-16 00:56:47 +01:00
|
|
|
|
2014-12-17 01:39:52 +01:00
|
|
|
GameObject* cameraTarget;
|
|
|
|
|
2014-12-16 00:56:47 +01:00
|
|
|
std::vector<VehicleGenerator> vehicleGenerators;
|
2014-08-12 22:15:26 +02:00
|
|
|
|
2014-07-27 01:38:01 +02:00
|
|
|
GameState() :
|
|
|
|
maxProgress(1),
|
|
|
|
numMissions(0),
|
|
|
|
numHiddenPackages(0),
|
|
|
|
numHiddenPackagesDiscovered(0),
|
|
|
|
numUniqueJumps(0),
|
|
|
|
numRampages(0),
|
|
|
|
maxWantedLevel(0),
|
|
|
|
player(nullptr),
|
|
|
|
currentWeather(0),
|
|
|
|
scriptOnMissionFlag(nullptr),
|
2014-08-01 23:03:00 +02:00
|
|
|
fadeOut(true),
|
2014-07-27 01:38:01 +02:00
|
|
|
fadeStart(0.f),
|
|
|
|
fadeTime(0.f),
|
|
|
|
fadeSound(false),
|
2014-12-17 01:39:52 +01:00
|
|
|
skipCutscene(false),
|
2014-07-27 01:38:01 +02:00
|
|
|
isIntroPlaying(false),
|
2014-07-28 03:27:55 +02:00
|
|
|
currentCutscene(nullptr),
|
|
|
|
cutsceneStartTime(-1.f),
|
2014-12-16 20:17:22 +01:00
|
|
|
isCinematic(false),
|
2014-07-27 01:38:01 +02:00
|
|
|
hour(0),
|
|
|
|
minute(0),
|
2014-12-16 20:17:22 +01:00
|
|
|
cameraNear(0.1f),
|
2014-12-17 01:39:52 +01:00
|
|
|
cameraFixed(false),
|
|
|
|
cameraTarget(nullptr)
|
2014-07-27 01:38:01 +02:00
|
|
|
{}
|
2014-07-25 04:30:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|