diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 20:55:56 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 20:55:56 +0000 |
commit | c99950c21537f9c890e4eac6d077c0ec6f31b7aa (patch) | |
tree | c130b8aa9cf12c7c3a1c9ef014bb35df3f53035f /src/game/game_instance.cpp | |
parent | b4f832f29f44dcd48e8f0806d47ce78b1963d639 (diff) | |
download | openttd-c99950c21537f9c890e4eac6d077c0ec6f31b7aa.tar.xz |
(svn r23606) -Add: GameScanner, to auto-detect game scripts, and wire it in the console
Diffstat (limited to 'src/game/game_instance.cpp')
-rw-r--r-- | src/game/game_instance.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index ed30062e1..4668f5436 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -16,6 +16,8 @@ #include "../script/squirrel_class.hpp" #include "../script/script_storage.hpp" +#include "game_config.hpp" +#include "game_info.hpp" #include "game_instance.hpp" #include "game.hpp" @@ -35,12 +37,12 @@ GameInstance::GameInstance() : ScriptInstance("GS") {} -void GameInstance::Initialize() +void GameInstance::Initialize(GameInfo *info) { /* Register the GameController */ SQGSController_Register(this->engine); - ScriptInstance::Initialize("test/main.nut", "TestGame"); + ScriptInstance::Initialize(info->GetMainScript(), info->GetInstanceName()); } void GameInstance::RegisterAPI() @@ -61,7 +63,7 @@ void GameInstance::RegisterAPI() int GameInstance::GetSetting(const char *name) { - return NULL; + return GameConfig::GetConfig()->GetSetting(name); } ScriptInfo *GameInstance::FindLibrary(const char *library, int version) |