修改渲染底层,新增场景摄像机逻辑,地图可行区域逻辑

This commit is contained in:
2025-10-08 23:58:15 +08:00
parent df2cacdb92
commit 1b011b9b68
23 changed files with 5350 additions and 40 deletions

View File

@@ -4,16 +4,16 @@
Debug_Actor::Debug_Actor()
{
m_debugFont = TTF_OpenFont("Fonts/GasinamuNew.ttf", 16);
m_debugFont = TTF_OpenFont("Fonts/VonwaonBitmap-12px.ttf", 12);
if (m_debugFont == nullptr)
{
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to load debug font: %s", TTF_GetError());
}
FPS_Text = new Text("Current FPS:", m_debugFont, SDL_Color{255, 255, 255, 255});
DT_Text = new Text("DeltaTime :", m_debugFont, SDL_Color{255, 255, 255, 255});
RC_Text = new Text("Render Calls:", m_debugFont, SDL_Color{255, 255, 255, 255});
FPS_Text = new Text("当 前 帧 数 :", m_debugFont, SDL_Color{255, 255, 255, 255});
DT_Text = new Text("帧 时 间 :", m_debugFont, SDL_Color{255, 255, 255, 255});
RC_Text = new Text("渲 染 调 用 次 数:", m_debugFont, SDL_Color{255, 255, 255, 255});
if (FPS_Text != nullptr)
{
SDL_Point Pos{26, 26};
@@ -50,11 +50,11 @@ void Debug_Actor::Update(float deltaTime)
if (FPS_Text != nullptr)
{
std::string fpsText = "Current FPS: " + std::to_string(FPS);
std::string fpsText = "当前帧数 : " + std::to_string(FPS);
FPS_Text->SetText(fpsText);
std::string dtText = "DeltaTime: " + std::to_string((int)(deltaTime * 1000));
std::string dtText = "帧时间 : " + std::to_string((int)(deltaTime * 1000));
DT_Text->SetText(dtText);
std::string rcText = "Render Calls: " + std::to_string(RenderCount);
std::string rcText = "渲染调用次数 : " + std::to_string(RenderCount);
RC_Text->SetText(rcText);
}
}