2014-05-26 06:34:49 +02:00
|
|
|
#ifndef INGAMESTATE_HPP
|
|
|
|
#define INGAMESTATE_HPP
|
|
|
|
|
|
|
|
#include "State.hpp"
|
|
|
|
|
2014-08-12 22:15:26 +02:00
|
|
|
class PlayerController;
|
2014-05-26 06:34:49 +02:00
|
|
|
|
|
|
|
class IngameState : public State
|
|
|
|
{
|
2015-05-09 00:53:56 +02:00
|
|
|
enum CameraMode
|
|
|
|
{
|
|
|
|
CAMERA_CLOSE = 0,
|
|
|
|
CAMERA_NORMAL = 1,
|
|
|
|
CAMERA_FAR = 2,
|
|
|
|
CAMERA_TOPDOWN = 3,
|
|
|
|
/** Used for counting - not a valid camera mode */
|
|
|
|
CAMERA_MAX
|
|
|
|
};
|
|
|
|
|
2015-04-03 02:26:20 +02:00
|
|
|
bool started;
|
2015-07-03 03:52:43 +02:00
|
|
|
std::string save;
|
2015-05-03 06:22:03 +02:00
|
|
|
bool newgame;
|
2014-08-12 22:15:26 +02:00
|
|
|
ViewCamera _look;
|
2015-04-01 06:05:21 +02:00
|
|
|
/** Player input */
|
2014-05-26 06:34:49 +02:00
|
|
|
glm::vec3 _movement;
|
2015-05-04 05:35:22 +02:00
|
|
|
glm::vec3 cameraPosition;
|
2015-05-09 00:53:56 +02:00
|
|
|
/** Timer to hold user camera position */
|
2014-12-15 00:21:30 +01:00
|
|
|
float autolookTimer;
|
2015-05-09 00:53:56 +02:00
|
|
|
CameraMode camMode;
|
2016-05-21 20:06:37 +02:00
|
|
|
|
|
|
|
/// Current camera yaw and pitch
|
|
|
|
glm::vec2 m_cameraAngles;
|
2014-05-26 06:34:49 +02:00
|
|
|
public:
|
2015-07-03 03:52:43 +02:00
|
|
|
/**
|
|
|
|
* @brief IngameState
|
|
|
|
* @param game
|
|
|
|
* @param newgame
|
|
|
|
* @param game An empty string, a save game to load, or the string "test".
|
|
|
|
*/
|
|
|
|
IngameState(RWGame* game, bool newgame = true, const std::string& save = "");
|
2014-05-26 06:34:49 +02:00
|
|
|
|
2014-07-24 00:57:21 +02:00
|
|
|
void startTest();
|
2015-04-03 02:26:20 +02:00
|
|
|
void startGame();
|
2014-05-26 06:34:49 +02:00
|
|
|
|
|
|
|
virtual void enter();
|
|
|
|
virtual void exit();
|
|
|
|
|
|
|
|
virtual void tick(float dt);
|
2015-02-07 23:55:06 +01:00
|
|
|
virtual void draw(GameRenderer* r);
|
2014-05-26 06:34:49 +02:00
|
|
|
|
|
|
|
virtual void handleEvent(const sf::Event& event);
|
2015-05-18 01:33:06 +02:00
|
|
|
virtual void handlePlayerInput(const sf::Event& event);
|
2015-04-03 16:38:24 +02:00
|
|
|
|
|
|
|
virtual bool shouldWorldUpdate();
|
2014-08-12 22:15:26 +02:00
|
|
|
|
|
|
|
const ViewCamera& getCamera();
|
2014-05-26 06:34:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INGAMESTATE_HPP
|