Files
UwU-Engine/UwURenderEngine/Game/Actors/Mesh/StaticMesh.cpp
T

39 lines
876 B
C++

#include "StaticMesh.hpp"
#include "Core/CoreInstance.hpp"
#include "Game/GameInstance.hpp"
#include "Game/SaveMap/SaveMap.hpp"
#include "Game/World/World.hpp"
#include "../../../RenderEngine/UwURenderEngine.hpp"
StaticMesh::StaticMesh()
{
SetType(Classes::StaticMesh);
}
std::shared_ptr<SaveMap> StaticMesh::save()
{
std::shared_ptr<SaveMap> save = std::make_shared<SaveMap>("StaticMesh");
save->connect_to(Mesh::save());
return 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;
model_ = GET_RENDER_ENGINE->GetModelManager()->LoadModel(model_name);
SetModelName(model_name);
}
void StaticMesh::OnDestroy()
{
Mesh::OnDestroy();
GET_RENDER_ENGINE->GetModelManager()->FreeModel(model_name_);
}