mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Pass Script engine by reference.
parent
72ca962b84
commit
341cdbc16b
|
@ -345,7 +345,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
|||
string(APPEND SQUIRREL_EXPORT "\n")
|
||||
|
||||
# Then do the registration functions of the class.
|
||||
string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel *engine)")
|
||||
string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel &engine)")
|
||||
string(APPEND SQUIRREL_EXPORT "\n{")
|
||||
string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
|
||||
if("${SUPER_CLS}" STREQUAL "Text")
|
||||
|
|
|
@ -19,7 +19,7 @@ endif()
|
|||
file(READ "${API_FILES}" SCRIPT_API_BINARY_FILES)
|
||||
|
||||
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
|
||||
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")
|
||||
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel &engine\\)$")
|
||||
if(LINES)
|
||||
string(REGEX REPLACE ".*api/${APILC}/(.*)" "#include \"\\1\"" FILE "${FILE}")
|
||||
list(APPEND SQUIRREL_INCLUDES "${FILE}")
|
||||
|
@ -28,7 +28,7 @@ foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
|
|||
continue()
|
||||
endif()
|
||||
string(REGEX REPLACE "^.*void " " " LINE "${LINE}")
|
||||
string(REGEX REPLACE "Squirrel \\*" "" LINE "${LINE}")
|
||||
string(REGEX REPLACE "Squirrel &" "" LINE "${LINE}")
|
||||
list(APPEND SQUIRREL_REGISTER "${LINE}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
|
|
@ -29,7 +29,7 @@ static bool CheckAPIVersion(const std::string &api_version)
|
|||
|
||||
template <> SQInteger PushClassName<AIInfo, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AIInfo", -1); return 1; }
|
||||
|
||||
/* static */ void AIInfo::RegisterAPI(Squirrel *engine)
|
||||
/* static */ void AIInfo::RegisterAPI(Squirrel &engine)
|
||||
{
|
||||
/* Create the AIInfo class, and add the RegisterAI function */
|
||||
DefSQClass<AIInfo, ScriptType::AI> SQAIInfo("AIInfo");
|
||||
|
@ -50,8 +50,8 @@ template <> SQInteger PushClassName<AIInfo, ScriptType::AI>(HSQUIRRELVM vm) { sq
|
|||
SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::InGame}.base(), "AICONFIG_INGAME");
|
||||
|
||||
SQAIInfo.PostRegister(engine);
|
||||
engine->AddMethod("RegisterAI", &AIInfo::Constructor, "tx");
|
||||
engine->AddMethod("RegisterDummyAI", &AIInfo::DummyConstructor, "tx");
|
||||
engine.AddMethod("RegisterAI", &AIInfo::Constructor, "tx");
|
||||
engine.AddMethod("RegisterDummyAI", &AIInfo::DummyConstructor, "tx");
|
||||
}
|
||||
|
||||
/* static */ SQInteger AIInfo::Constructor(HSQUIRRELVM vm)
|
||||
|
@ -125,12 +125,12 @@ bool AIInfo::CanLoadFromVersion(int version) const
|
|||
}
|
||||
|
||||
|
||||
/* static */ void AILibrary::RegisterAPI(Squirrel *engine)
|
||||
/* static */ void AILibrary::RegisterAPI(Squirrel &engine)
|
||||
{
|
||||
/* Create the AILibrary class, and add the RegisterLibrary function */
|
||||
engine->AddClassBegin("AILibrary");
|
||||
engine->AddClassEnd();
|
||||
engine->AddMethod("RegisterLibrary", &AILibrary::Constructor, "tx");
|
||||
engine.AddClassBegin("AILibrary");
|
||||
engine.AddClassEnd();
|
||||
engine.AddMethod("RegisterLibrary", &AILibrary::Constructor, "tx");
|
||||
}
|
||||
|
||||
/* static */ SQInteger AILibrary::Constructor(HSQUIRRELVM vm)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
/**
|
||||
* Register the functions of this class.
|
||||
*/
|
||||
static void RegisterAPI(Squirrel *engine);
|
||||
static void RegisterAPI(Squirrel &engine);
|
||||
|
||||
/**
|
||||
* Create an AI, using this AIInfo as start-template.
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
/**
|
||||
* Register the functions of this class.
|
||||
*/
|
||||
static void RegisterAPI(Squirrel *engine);
|
||||
static void RegisterAPI(Squirrel &engine);
|
||||
|
||||
/**
|
||||
* Create an AI, using this AIInfo as start-template.
|
||||
|
|
|
@ -43,7 +43,7 @@ void AIInstance::Initialize(AIInfo *info)
|
|||
this->api_version = info->GetAPIVersion();
|
||||
|
||||
/* Register the AIController (including the "import" command) */
|
||||
SQAIController_Register(this->engine);
|
||||
SQAIController_Register(*this->engine);
|
||||
|
||||
ScriptInstance::Initialize(info->GetMainScript(), info->GetInstanceName(), _current_company);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ void AIInstance::RegisterAPI()
|
|||
ScriptInstance::RegisterAPI();
|
||||
|
||||
/* Register all classes */
|
||||
SQAI_RegisterAll(this->engine);
|
||||
SQAI_RegisterAll(*this->engine);
|
||||
|
||||
if (!this->LoadCompatibilityScripts(AI_DIR, AIInfo::ApiVersions)) this->Died();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ std::string AIScannerInfo::GetScriptName(ScriptInfo *info)
|
|||
return info->GetName();
|
||||
}
|
||||
|
||||
void AIScannerInfo::RegisterAPI(class Squirrel *engine)
|
||||
void AIScannerInfo::RegisterAPI(class Squirrel &engine)
|
||||
{
|
||||
AIInfo::RegisterAPI(engine);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ std::string AIScannerLibrary::GetScriptName(ScriptInfo *info)
|
|||
return fmt::format("{}.{}", library->GetCategory(), library->GetInstanceName());
|
||||
}
|
||||
|
||||
void AIScannerLibrary::RegisterAPI(class Squirrel *engine)
|
||||
void AIScannerLibrary::RegisterAPI(class Squirrel &engine)
|
||||
{
|
||||
AILibrary::RegisterAPI(engine);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
|||
std::string_view GetFileName() const override { return PATHSEP "info.nut"; }
|
||||
Subdirectory GetDirectory() const override { return AI_DIR; }
|
||||
std::string_view GetScannerName() const override { return "AIs"; }
|
||||
void RegisterAPI(class Squirrel *engine) override;
|
||||
void RegisterAPI(class Squirrel &engine) override;
|
||||
|
||||
private:
|
||||
AIInfo *info_dummy; ///< The dummy AI.
|
||||
|
@ -67,7 +67,7 @@ protected:
|
|||
std::string_view GetFileName() const override { return PATHSEP "library.nut"; }
|
||||
Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; }
|
||||
std::string_view GetScannerName() const override { return "AI Libraries"; }
|
||||
void RegisterAPI(class Squirrel *engine) override;
|
||||
void RegisterAPI(class Squirrel &engine) override;
|
||||
};
|
||||
|
||||
#endif /* AI_SCANNER_HPP */
|
||||
|
|
|
@ -27,7 +27,7 @@ static bool CheckAPIVersion(const std::string &api_version)
|
|||
|
||||
template <> SQInteger PushClassName<GameInfo, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSInfo", -1); return 1; }
|
||||
|
||||
/* static */ void GameInfo::RegisterAPI(Squirrel *engine)
|
||||
/* static */ void GameInfo::RegisterAPI(Squirrel &engine)
|
||||
{
|
||||
/* Create the GSInfo class, and add the RegisterGS function */
|
||||
DefSQClass<GameInfo, ScriptType::GS> SQGSInfo("GSInfo");
|
||||
|
@ -42,7 +42,7 @@ template <> SQInteger PushClassName<GameInfo, ScriptType::GS>(HSQUIRRELVM vm) {
|
|||
SQGSInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::Developer}.base(), "CONFIG_DEVELOPER");
|
||||
|
||||
SQGSInfo.PostRegister(engine);
|
||||
engine->AddMethod("RegisterGS", &GameInfo::Constructor, "tx");
|
||||
engine.AddMethod("RegisterGS", &GameInfo::Constructor, "tx");
|
||||
}
|
||||
|
||||
/* static */ SQInteger GameInfo::Constructor(HSQUIRRELVM vm)
|
||||
|
@ -95,12 +95,12 @@ bool GameInfo::CanLoadFromVersion(int version) const
|
|||
}
|
||||
|
||||
|
||||
/* static */ void GameLibrary::RegisterAPI(Squirrel *engine)
|
||||
/* static */ void GameLibrary::RegisterAPI(Squirrel &engine)
|
||||
{
|
||||
/* Create the GameLibrary class, and add the RegisterLibrary function */
|
||||
engine->AddClassBegin("GSLibrary");
|
||||
engine->AddClassEnd();
|
||||
engine->AddMethod("RegisterLibrary", &GameLibrary::Constructor, "tx");
|
||||
engine.AddClassBegin("GSLibrary");
|
||||
engine.AddClassEnd();
|
||||
engine.AddMethod("RegisterLibrary", &GameLibrary::Constructor, "tx");
|
||||
}
|
||||
|
||||
/* static */ SQInteger GameLibrary::Constructor(HSQUIRRELVM vm)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
/**
|
||||
* Register the functions of this class.
|
||||
*/
|
||||
static void RegisterAPI(Squirrel *engine);
|
||||
static void RegisterAPI(Squirrel &engine);
|
||||
|
||||
/**
|
||||
* Create an Game, using this GameInfo as start-template.
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
/**
|
||||
* Register the functions of this class.
|
||||
*/
|
||||
static void RegisterAPI(Squirrel *engine);
|
||||
static void RegisterAPI(Squirrel &engine);
|
||||
|
||||
/**
|
||||
* Create an GSLibrary, using this GSInfo as start-template.
|
||||
|
|
|
@ -38,7 +38,7 @@ void GameInstance::Initialize(GameInfo *info)
|
|||
this->api_version = info->GetAPIVersion();
|
||||
|
||||
/* Register the GameController */
|
||||
SQGSController_Register(this->engine);
|
||||
SQGSController_Register(*this->engine);
|
||||
|
||||
ScriptInstance::Initialize(info->GetMainScript(), info->GetInstanceName(), OWNER_DEITY);
|
||||
}
|
||||
|
@ -48,9 +48,9 @@ void GameInstance::RegisterAPI()
|
|||
ScriptInstance::RegisterAPI();
|
||||
|
||||
/* Register all classes */
|
||||
SQGS_RegisterAll(this->engine);
|
||||
SQGS_RegisterAll(*this->engine);
|
||||
|
||||
RegisterGameTranslation(this->engine);
|
||||
RegisterGameTranslation(*this->engine);
|
||||
|
||||
if (!this->LoadCompatibilityScripts(GAME_DIR, GameInfo::ApiVersions)) this->Died();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ std::string GameScannerInfo::GetScriptName(ScriptInfo *info)
|
|||
return info->GetName();
|
||||
}
|
||||
|
||||
void GameScannerInfo::RegisterAPI(class Squirrel *engine)
|
||||
void GameScannerInfo::RegisterAPI(class Squirrel &engine)
|
||||
{
|
||||
GameInfo::RegisterAPI(engine);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ std::string GameScannerLibrary::GetScriptName(ScriptInfo *info)
|
|||
return fmt::format("{}.{}", library->GetCategory(), library->GetInstanceName());
|
||||
}
|
||||
|
||||
void GameScannerLibrary::RegisterAPI(class Squirrel *engine)
|
||||
void GameScannerLibrary::RegisterAPI(class Squirrel &engine)
|
||||
{
|
||||
GameLibrary::RegisterAPI(engine);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ protected:
|
|||
std::string_view GetFileName() const override { return PATHSEP "info.nut"; }
|
||||
Subdirectory GetDirectory() const override { return GAME_DIR; }
|
||||
std::string_view GetScannerName() const override { return "Game Scripts"; }
|
||||
void RegisterAPI(class Squirrel *engine) override;
|
||||
void RegisterAPI(class Squirrel &engine) override;
|
||||
};
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ protected:
|
|||
std::string_view GetFileName() const override { return PATHSEP "library.nut"; }
|
||||
Subdirectory GetDirectory() const override { return GAME_LIBRARY_DIR; }
|
||||
std::string_view GetScannerName() const override { return "GS Libraries"; }
|
||||
void RegisterAPI(class Squirrel *engine) override;
|
||||
void RegisterAPI(class Squirrel &engine) override;
|
||||
};
|
||||
|
||||
#endif /* GAME_SCANNER_HPP */
|
||||
|
|
|
@ -356,12 +356,12 @@ const std::string &GetGameStringName(StringIndexInTab id)
|
|||
* Register the current translation to the Squirrel engine.
|
||||
* @param engine The engine to update/
|
||||
*/
|
||||
void RegisterGameTranslation(Squirrel *engine)
|
||||
void RegisterGameTranslation(Squirrel &engine)
|
||||
{
|
||||
_current_gamestrings_data = LoadTranslations();
|
||||
if (_current_gamestrings_data == nullptr) return;
|
||||
|
||||
HSQUIRRELVM vm = engine->GetVM();
|
||||
HSQUIRRELVM vm = engine.GetVM();
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, "GSText", -1);
|
||||
if (SQ_FAILED(sq_get(vm, -2))) return;
|
||||
|
|
|
@ -33,7 +33,7 @@ using StringParamsList = std::vector<StringParams>;
|
|||
std::string_view GetGameStringPtr(StringIndexInTab id);
|
||||
const StringParams &GetGameStringParams(StringIndexInTab id);
|
||||
const std::string &GetGameStringName(StringIndexInTab id);
|
||||
void RegisterGameTranslation(class Squirrel *engine);
|
||||
void RegisterGameTranslation(class Squirrel &engine);
|
||||
void ReconsiderGameScriptLanguage();
|
||||
|
||||
/** Container for the raw (unencoded) language strings of a language. */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
template <> SQInteger PushClassName<ScriptController, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AIController", -1); return 1; }
|
||||
|
||||
void SQAIController_Register(Squirrel *engine)
|
||||
void SQAIController_Register(Squirrel &engine)
|
||||
{
|
||||
DefSQClass<ScriptController, ScriptType::AI> SQAIController("AIController");
|
||||
SQAIController.PreRegister(engine);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
template <> SQInteger PushClassName<ScriptController, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSController", -1); return 1; }
|
||||
|
||||
void SQGSController_Register(Squirrel *engine)
|
||||
void SQGSController_Register(Squirrel &engine)
|
||||
{
|
||||
DefSQClass<ScriptController, ScriptType::GS> SQGSController("GSController");
|
||||
SQGSController.PreRegister(engine);
|
||||
|
|
|
@ -21,7 +21,7 @@ static SQInteger ${APIUC}ObjectCloned(HSQUIRRELVM)
|
|||
throw Script_FatalError("This instance is not cloneable");
|
||||
}
|
||||
|
||||
void SQ${APIUC}_RegisterAll(Squirrel *engine)
|
||||
void SQ${APIUC}_RegisterAll(Squirrel &engine)
|
||||
{
|
||||
DefSQClass<ScriptObject, ScriptType::${APIUC}> SQ${APIUC}Object("${APIUC}Object");
|
||||
SQ${APIUC}Object.PreRegister(engine);
|
||||
|
|
|
@ -53,7 +53,7 @@ void ScriptScanner::ResetEngine()
|
|||
{
|
||||
this->engine->Reset();
|
||||
this->engine->SetGlobalPointer(this);
|
||||
this->RegisterAPI(this->engine);
|
||||
this->RegisterAPI(*this->engine);
|
||||
}
|
||||
|
||||
void ScriptScanner::Initialize(std::string_view name)
|
||||
|
|
|
@ -115,7 +115,7 @@ protected:
|
|||
/**
|
||||
* Register the API for this ScriptInfo.
|
||||
*/
|
||||
virtual void RegisterAPI(class Squirrel *engine) = 0;
|
||||
virtual void RegisterAPI(class Squirrel &engine) = 0;
|
||||
|
||||
/**
|
||||
* Get the type of the script, in plural.
|
||||
|
|
|
@ -30,20 +30,20 @@ public:
|
|||
* This defines a method inside a class for Squirrel.
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQMethod(Squirrel *engine, Func function_proc, std::string_view function_name)
|
||||
void DefSQMethod(Squirrel &engine, Func function_proc, std::string_view function_name)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, {}, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, {}, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
/**
|
||||
* This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!).
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQAdvancedMethod(Squirrel *engine, Func function_proc, std::string_view function_name)
|
||||
void DefSQAdvancedMethod(Squirrel &engine, Func function_proc, std::string_view function_name)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func, ST>, {}, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func, ST>, {}, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,30 +53,30 @@ public:
|
|||
* of the code, but without it calling your function will fail!
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQMethod(Squirrel *engine, Func function_proc, std::string_view function_name, std::string_view params)
|
||||
void DefSQMethod(Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, params, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, params, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
/**
|
||||
* This defines a static method inside a class for Squirrel.
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQStaticMethod(Squirrel *engine, Func function_proc, std::string_view function_name)
|
||||
void DefSQStaticMethod(Squirrel &engine, Func function_proc, std::string_view function_name)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQStaticCallback<CL, Func>, {}, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQStaticCallback<CL, Func>, {}, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
/**
|
||||
* This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts only!).
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQAdvancedStaticMethod(Squirrel *engine, Func function_proc, std::string_view function_name)
|
||||
void DefSQAdvancedStaticMethod(Squirrel &engine, Func function_proc, std::string_view function_name)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQAdvancedStaticCallback<CL, Func>, {}, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQAdvancedStaticCallback<CL, Func>, {}, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,44 +86,44 @@ public:
|
|||
* of the code, but without it calling your function will fail!
|
||||
*/
|
||||
template <typename Func>
|
||||
void DefSQStaticMethod(Squirrel *engine, Func function_proc, std::string_view function_name, std::string_view params)
|
||||
void DefSQStaticMethod(Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod(function_name, DefSQStaticCallback<CL, Func>, params, &function_proc, sizeof(function_proc));
|
||||
engine.AddMethod(function_name, DefSQStaticCallback<CL, Func>, params, &function_proc, sizeof(function_proc));
|
||||
}
|
||||
|
||||
template <typename Var>
|
||||
void DefSQConst(Squirrel *engine, Var value, std::string_view var_name)
|
||||
void DefSQConst(Squirrel &engine, Var value, std::string_view var_name)
|
||||
{
|
||||
engine->AddConst(var_name, value);
|
||||
engine.AddConst(var_name, value);
|
||||
}
|
||||
|
||||
void PreRegister(Squirrel *engine)
|
||||
void PreRegister(Squirrel &engine)
|
||||
{
|
||||
engine->AddClassBegin(this->classname);
|
||||
engine.AddClassBegin(this->classname);
|
||||
}
|
||||
|
||||
void PreRegister(Squirrel *engine, std::string_view parent_class)
|
||||
void PreRegister(Squirrel &engine, std::string_view parent_class)
|
||||
{
|
||||
engine->AddClassBegin(this->classname, parent_class);
|
||||
engine.AddClassBegin(this->classname, parent_class);
|
||||
}
|
||||
|
||||
template <typename Func, int Tnparam>
|
||||
void AddConstructor(Squirrel *engine, std::string_view params)
|
||||
void AddConstructor(Squirrel &engine, std::string_view params)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod("constructor", DefSQConstructorCallback<CL, Func, Tnparam>, params);
|
||||
engine.AddMethod("constructor", DefSQConstructorCallback<CL, Func, Tnparam>, params);
|
||||
}
|
||||
|
||||
void AddSQAdvancedConstructor(Squirrel *engine)
|
||||
void AddSQAdvancedConstructor(Squirrel &engine)
|
||||
{
|
||||
using namespace SQConvert;
|
||||
engine->AddMethod("constructor", DefSQAdvancedConstructorCallback<CL>);
|
||||
engine.AddMethod("constructor", DefSQAdvancedConstructorCallback<CL>);
|
||||
}
|
||||
|
||||
void PostRegister(Squirrel *engine)
|
||||
void PostRegister(Squirrel &engine)
|
||||
{
|
||||
engine->AddClassEnd();
|
||||
engine.AddClassEnd();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue