Implemented the splash screen and config file

This commit is contained in:
Kayne Ruse
2013-05-12 02:33:08 +10:00
parent 6a19d0a312
commit cc00129542
6 changed files with 104 additions and 53 deletions
+16 -1
View File
@@ -1,5 +1,8 @@
#include "scene_manager.hpp"
#include "singleton.hpp"
#include "config_utility.hpp"
#include <stdexcept>
//-------------------------
@@ -36,7 +39,19 @@ void SceneManager::Init() {
if (SDL_Init(SDL_INIT_VIDEO))
throw(std::runtime_error("Failed to initialize SDL"));
BaseScene::SetScreen(800, 600);
GetSingletonPtr<ConfigUtility>()->Load("rsc\\config.cfg");
//set the screen from the config file
int flags = SDL_HWSURFACE|SDL_DOUBLEBUF;
if (GetSingletonPtr<ConfigUtility>()->Boolean("screen.f")) {
flags |= SDL_FULLSCREEN;
}
BaseScene::SetScreen(
GetSingletonPtr<ConfigUtility>()->Integer("screen.w"),
GetSingletonPtr<ConfigUtility>()->Integer("screen.h"),
0,
flags
);
}
void SceneManager::Proc() {