|
@ -19,8 +19,6 @@ |
|
|
|
|
|
|
|
|
#include "game.hpp"
|
|
|
#include "game.hpp"
|
|
|
#include "resources/string-table.hpp"
|
|
|
#include "resources/string-table.hpp"
|
|
|
#include "states/game-state.hpp"
|
|
|
|
|
|
#include "states/sandbox-state.hpp"
|
|
|
|
|
|
#include "filesystem.hpp"
|
|
|
#include "filesystem.hpp"
|
|
|
#include "timestamp.hpp"
|
|
|
#include "timestamp.hpp"
|
|
|
#include "ui/ui.hpp"
|
|
|
#include "ui/ui.hpp"
|
|
@ -70,7 +68,6 @@ |
|
|
#include "debug/ansi-escape-codes.hpp"
|
|
|
#include "debug/ansi-escape-codes.hpp"
|
|
|
|
|
|
|
|
|
Game::Game(int argc, char* argv[]): |
|
|
Game::Game(int argc, char* argv[]): |
|
|
currentState(nullptr), |
|
|
|
|
|
window(nullptr) |
|
|
window(nullptr) |
|
|
{ |
|
|
{ |
|
|
// Determine application name
|
|
|
// Determine application name
|
|
@ -110,8 +107,6 @@ Game::Game(int argc, char* argv[]): |
|
|
eventDispatcher.subscribe<ScheduledFunctionEvent>(this); |
|
|
eventDispatcher.subscribe<ScheduledFunctionEvent>(this); |
|
|
toggleFullscreenDisabled = false; |
|
|
toggleFullscreenDisabled = false; |
|
|
|
|
|
|
|
|
sandboxState = new SandboxState(this); |
|
|
|
|
|
|
|
|
|
|
|
float3x3 m1; |
|
|
float3x3 m1; |
|
|
float3x3 m2; |
|
|
float3x3 m2; |
|
|
float3x3 m3 = m1 + m2; |
|
|
float3x3 m3 = m1 + m2; |
|
@ -129,20 +124,6 @@ Game::~Game() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Game::changeState(GameState* state) |
|
|
|
|
|
{ |
|
|
|
|
|
if (currentState != nullptr) |
|
|
|
|
|
{ |
|
|
|
|
|
currentState->exit(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
currentState = state; |
|
|
|
|
|
if (currentState != nullptr) |
|
|
|
|
|
{ |
|
|
|
|
|
currentState->enter(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::string Game::getString(const std::string& name, std::optional<std::size_t> languageIndex) const |
|
|
std::string Game::getString(const std::string& name, std::optional<std::size_t> languageIndex) const |
|
|
{ |
|
|
{ |
|
|
std::string value; |
|
|
std::string value; |
|
@ -639,20 +620,12 @@ void Game::setup() |
|
|
StateMachine::changeState(&splashState); |
|
|
StateMachine::changeState(&splashState); |
|
|
#endif
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//changeState(sandboxState);
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Game::update(float t, float dt) |
|
|
void Game::update(float t, float dt) |
|
|
{ |
|
|
{ |
|
|
this->time = t; |
|
|
this->time = t; |
|
|
|
|
|
|
|
|
// Execute current state
|
|
|
|
|
|
if (currentState != nullptr) |
|
|
|
|
|
{ |
|
|
|
|
|
currentState->execute(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Update systems
|
|
|
// Update systems
|
|
|
systemManager->update(t, dt); |
|
|
systemManager->update(t, dt); |
|
|
|
|
|
|
|
|