Fix model manager. It's version stable for model manager

This commit is contained in:
Jiga228
2025-10-18 14:48:33 +07:00
parent 0ec86e3de8
commit cafad47679
6 changed files with 105 additions and 15 deletions
+12 -2
View File
@@ -1,7 +1,11 @@
#include "StaticMesh.hpp"
#include "Core/CoreInstance.hpp"
#include "Core/RenderEngine/RenderEngine.hpp"
#include "Game/GameInstance.hpp"
#include "Log/Log.hpp"
#include "Game/SaveMap/SaveMap.hpp"
#include "Game/World/World.hpp"
StaticMesh::StaticMesh()
{
@@ -20,7 +24,13 @@ void StaticMesh::load(std::shared_ptr<SaveMap> save)
void StaticMesh::load_model(const std::string& model_name)
{
model_name_ = model_name;
SetModelName(model_name);
// TODO
Message("Load mesh: " + model_name);
model_ = GetWorld()->GetGameInstance().GetCore().GetRenderEngine()->GetActiveModelManager()->LoadModel(model_name);
}
void StaticMesh::OnDestroy()
{
Mesh::OnDestroy();
GetWorld()->GetGameInstance().GetCore().GetRenderEngine()->GetActiveModelManager()->FreeModel(model_name_);
}