Move classes Mesh and StaticMesh to UwURenderEngine project. Because they depended from UwURenderEngine
This commit is contained in:
@@ -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_);
|
||||
}
|
||||
Reference in New Issue
Block a user