From 00cac42094bea56d739901dfb2498812ccf681cc Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 15 Oct 2015 14:19:12 +0200 Subject: [PATCH] Added video options to config --- assets/Config.ini | 9 +++++++-- include/Core/Engine.h | 14 ++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/assets/Config.ini b/assets/Config.ini index c880469..8b61d35 100755 --- a/assets/Config.ini +++ b/assets/Config.ini @@ -1,6 +1,11 @@ [Debug] -SkipStory=0 +SkipStory=false [Audio] SFXVolume=0.5 -BGMVolume=0.5 \ No newline at end of file +BGMVolume=0.5 + +[Video] +Fullscreen=false +Width=675 +Height=1080 \ No newline at end of file diff --git a/include/Core/Engine.h b/include/Core/Engine.h index 364e218..ebafdc2 100755 --- a/include/Core/Engine.h +++ b/include/Core/Engine.h @@ -86,19 +86,25 @@ class Engine public: Engine(int argc, char* argv[]) { + auto config = ResourceManager::Load("Config.ini"); + m_EventBroker = std::make_shared(); m_Renderer = std::make_shared(); - m_Renderer->SetFullscreen(false); - //m_Renderer->SetResolution(Rectangle(0, 0, 1920, 1080)); - m_Renderer->SetResolution(Rectangle(0, 0, 675, 1080)); + m_Renderer->SetFullscreen(config->GetValue("Video.Fullscreen", false)); + m_Renderer->SetResolution(Rectangle( + 0, + 0, + config->GetValue("Video.Width", 675), + config->GetValue("Video.Height", 1080) + )); m_Renderer->Initialize(); m_FrameStack = new GUI::Frame(m_EventBroker.get()); m_FrameStack->Width = 675; m_FrameStack->Height = 1080; - if (ResourceManager::Load("Config.ini")->GetValue("Debug.SkipStory", 0) == 1) { + if (config->GetValue("Debug.SkipStory", false)) { Events::GameStart e; m_EventBroker->Publish(e); auto hud = new GUI::HUD(m_FrameStack, "HUD");