Move classes Mesh and StaticMesh to UwURenderEngine project. Because they depended from UwURenderEngine

This commit is contained in:
Jiga228
2025-10-25 23:20:28 +07:00
parent 1f88e0f0b9
commit 740c80e8c7
13 changed files with 9 additions and 76 deletions
@@ -0,0 +1,34 @@
#include "StaticMesh.hpp"
#include "Core/CoreInstance.hpp"
#include "Game/GameInstance.hpp"
#include "Game/SaveMap/SaveMap.hpp"
#include "Game/World/World.hpp"
StaticMesh::StaticMesh()
{
SetType(Classes::StaticMesh);
}
std::shared_ptr<SaveMap> StaticMesh::save()
{
return std::make_shared<SaveMap>("StaticMesh")->connect_to(Mesh::save());
}
void StaticMesh::load(std::shared_ptr<SaveMap> save)
{
Mesh::load(save->getParent());
}
void StaticMesh::load_model(const std::string& model_name)
{
model_name_ = model_name;
SetModelName(model_name);
model_ = GetWorld()->GetGameInstance().GetCurrentModelManager()->LoadModel(model_name);
}
void StaticMesh::OnDestroy()
{
Mesh::OnDestroy();
GetWorld()->GetGameInstance().GetCurrentModelManager()->FreeModel(model_name_);
}