mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-30 08:34:59 +00:00
stuff
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "script_engine_service.hpp"
|
||||
|
||||
#include "../../script/lua_bindings.hpp"
|
||||
#include "../../script/script_engine.hpp"
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
@@ -8,8 +9,14 @@ namespace sdl3cpp::services::impl {
|
||||
|
||||
ScriptEngineService::ScriptEngineService(const std::filesystem::path& scriptPath,
|
||||
std::shared_ptr<ILogger> logger,
|
||||
std::shared_ptr<IMeshService> meshService,
|
||||
std::shared_ptr<IAudioCommandService> audioCommandService,
|
||||
std::shared_ptr<IPhysicsBridgeService> physicsBridgeService,
|
||||
bool debugEnabled)
|
||||
: logger_(std::move(logger)),
|
||||
meshService_(std::move(meshService)),
|
||||
audioCommandService_(std::move(audioCommandService)),
|
||||
physicsBridgeService_(std::move(physicsBridgeService)),
|
||||
scriptPath_(scriptPath),
|
||||
debugEnabled_(debugEnabled) {
|
||||
}
|
||||
@@ -26,7 +33,12 @@ void ScriptEngineService::Initialize() {
|
||||
}
|
||||
logger_->TraceFunction(__func__);
|
||||
|
||||
engine_ = std::make_unique<script::ScriptEngine>(scriptPath_, debugEnabled_);
|
||||
bindingContext_ = std::make_shared<script::LuaBindingContext>();
|
||||
bindingContext_->meshService = meshService_;
|
||||
bindingContext_->audioCommandService = audioCommandService_;
|
||||
bindingContext_->physicsBridgeService = physicsBridgeService_;
|
||||
|
||||
engine_ = std::make_unique<script::ScriptEngine>(scriptPath_, bindingContext_.get(), debugEnabled_);
|
||||
initialized_ = true;
|
||||
|
||||
logger_->Info("Script engine service initialized");
|
||||
|
||||
Reference in New Issue
Block a user