|
|
|
@ -15,9 +15,12 @@
|
|
|
|
|
const sf::Time TIME_PER_FRAME = sf::seconds(1.f / 90.f);
|
|
|
|
|
|
|
|
|
|
Application::Application() :
|
|
|
|
|
_game_window({1280, 720}, "Test", sf::Style::Default),
|
|
|
|
|
_game(std::make_unique<ClassicGame>(std::make_unique<ClassicGraphicsManager>(_game_window), std::make_unique<MusicSFML>()))
|
|
|
|
|
_game_window({1280, 720}, "Test", sf::Style::Default)
|
|
|
|
|
{
|
|
|
|
|
_font_holder.load(Fonts::Id::GUI, "SourceCodePro-Regular.ttf");
|
|
|
|
|
|
|
|
|
|
_game = std::make_unique<ClassicGame>(std::make_unique<ClassicGraphicsManager>(_game_window), std::make_unique<MusicSFML>());
|
|
|
|
|
|
|
|
|
|
_game_window.setFramerateLimit(60);
|
|
|
|
|
_game_window.setKeyRepeatEnabled(false);
|
|
|
|
|
_game_window.setMouseCursorGrabbed(false);
|
|
|
|
@ -26,9 +29,9 @@ Application::Application() :
|
|
|
|
|
MainMenu::Callbacks callbacks = {[&](){ pushState(GUIState::Tag::EDITOR); }};
|
|
|
|
|
Editor::Callbacks editor_callbacks = {[&](){ popState(); }};
|
|
|
|
|
|
|
|
|
|
const auto main_menu = std::make_shared<MainMenu>(_game_window, std::move(callbacks));
|
|
|
|
|
const auto main_menu = std::make_shared<MainMenu>(_game_window, std::move(callbacks), _font_holder);
|
|
|
|
|
const auto game_state = std::make_shared<GameState>(_game_window, _game, GameState::Callbacks());
|
|
|
|
|
const auto editor = std::make_shared<Editor>(_game_window, std::move(editor_callbacks), std::make_unique<MusicSFML>());
|
|
|
|
|
const auto editor = std::make_shared<Editor>(_game_window, std::move(editor_callbacks), std::make_unique<MusicSFML>(), _font_holder);
|
|
|
|
|
_states[GUIState::Tag::MAIN_MENU] = main_menu;
|
|
|
|
|
_states[GUIState::Tag::GAME] = game_state;
|
|
|
|
|
_states[GUIState::Tag::EDITOR] = editor;
|
|
|
|
|