39 lines
876 B
C++
39 lines
876 B
C++
#include "GameMapLayer.h"
|
|
#include "EngineCore/Game.h"
|
|
|
|
|
|
void GameMapLayer::Render()
|
|
{
|
|
|
|
Actor::Render();
|
|
// RenderManager *renderer = Game::GetInstance().GetRenderer();
|
|
|
|
// // 自身坐标
|
|
// float Xpos = GetIterationPos().x + GetPos().x;
|
|
// float Ypos = GetIterationPos().y + GetPos().y;
|
|
// for (auto &info : this->FeasibleAreaInfoList)
|
|
// {
|
|
// SDL_Rect buf;
|
|
// buf.x = info.x + Xpos;
|
|
// buf.y = info.y + Ypos;
|
|
// buf.w = info.w;
|
|
// buf.h = info.h;
|
|
// //TODO: 渲染可行区域
|
|
// }
|
|
}
|
|
|
|
void GameMapLayer::AddDebugFeasibleAreaInfo(Vec2 pos, VecSize size)
|
|
{
|
|
SDL_Rect info;
|
|
info.x = pos.x;
|
|
info.y = pos.y;
|
|
info.w = size.width;
|
|
info.h = size.height;
|
|
this->FeasibleAreaInfoList.push_back(info);
|
|
}
|
|
|
|
void GameMapLayer::AddObject(RefPtr<Actor> obj)
|
|
{
|
|
this->AddChild(obj);
|
|
}
|