feat(场景管理): 添加UIScene支持并重构场景管理器

refactor(渲染器): 优化相机切换时的渲染批处理

feat(调试工具): 新增游戏调试UI场景和九宫格面板组件

fix(动画系统): 跳过缺失的动画资源加载并记录日志

perf(资源加载): 使用BinaryFileStreamReader优化NPK文件解析

feat(地图系统): 支持多边形可行走区域调试显示

style(代码格式): 清理多余空格和统一文件编码

docs(注释): 补充关键类和方法的文档说明

test(启动跟踪): 添加启动过程性能跟踪工具

chore(依赖): 添加SDL2_ttf库支持
This commit is contained in:
2026-04-06 01:18:21 +08:00
parent 6cd1b42fef
commit bcc285eed6
36 changed files with 2675 additions and 513 deletions

View File

@@ -63,7 +63,7 @@ struct MapConfig {
std::vector<BackgroundAnimationConfig> backgroundAnimations;
std::vector<MapAnimationConfig> mapAnimations;
std::vector<std::string> soundIds;
std::vector<Rect> virtualMovableAreas;
std::vector<Vec2> virtualMovablePolygon;
std::vector<Rect> townMovableAreas;
std::vector<MoveAreaTarget> townMovableAreaTargets;
};

View File

@@ -49,6 +49,7 @@ public:
Rect GetMovablePositionArea(size_t index) const;
int GetBackgroundRepeatWidth() const { return backgroundRepeatWidth_; }
bool IsDebugModeEnabled() const { return debugMode_; }
private:
/// 初始化固定图层。图层名字与 DNF 地图层概念保持一致。
@@ -75,14 +76,14 @@ private:
/// bottom 层里的专用地板容器,固定放在该层最底部,避免地图动画被地板压住。
RefPtr<Actor> tileRoot_;
/// 角色可行走矩形区域。
std::vector<Rect> movableArea_;
std::vector<Vec2> movablePolygon_;
/// 进入后会触发切图/传送的矩形区域。
std::vector<Rect> moveArea_;
/// 地板铺设后推导出的横向覆盖宽度,用于背景动画横向平铺。
int backgroundRepeatWidth_ = 0;
/// 地图配置里的整体 Y 偏移;既影响层位置,也影响地板校准。
int mapOffsetY_ = 0;
bool debugMode_ = false;
bool debugMode_ = true;
/// 当前地图正在播放的背景音乐。
Ptr<Music> currentMusic_;
};

View File

@@ -9,11 +9,14 @@ class GameMapLayer : public Actor {
public:
void Render() override;
void AddDebugFeasibleAreaInfo(const Rect& rect, int type);
void SetDebugFeasibleAreaPolygon(const std::vector<Vec2>& polygon);
void AddDebugMoveAreaInfo(const Rect& rect);
void ClearDebugAreaInfo();
void AddObject(RefPtr<Actor> obj);
private:
std::vector<Rect> feasibleAreaInfoList_;
std::vector<Vec2> feasibleAreaPolygon_;
std::vector<Rect> feasibleAreaFillRects_;
std::vector<Rect> moveAreaInfoList_;
};