Implemented the splash screen and config file
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user