From c99950c21537f9c890e4eac6d077c0ec6f31b7aa Mon Sep 17 00:00:00 2001 From: truebrain Date: Mon, 19 Dec 2011 20:55:56 +0000 Subject: (svn r23606) -Add: GameScanner, to auto-detect game scripts, and wire it in the console --- src/game/game_instance.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/game_instance.cpp') 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) -- cgit v1.2.3-70-g09d2