refactor(渲染器): 优化相机切换时的渲染批处理 feat(调试工具): 新增游戏调试UI场景和九宫格面板组件 fix(动画系统): 跳过缺失的动画资源加载并记录日志 perf(资源加载): 使用BinaryFileStreamReader优化NPK文件解析 feat(地图系统): 支持多边形可行走区域调试显示 style(代码格式): 清理多余空格和统一文件编码 docs(注释): 补充关键类和方法的文档说明 test(启动跟踪): 添加启动过程性能跟踪工具 chore(依赖): 添加SDL2_ttf库支持
77 lines
1.7 KiB
C++
77 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <frostbite2D/types/type_math.h>
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace frostbite2D::game {
|
|
|
|
struct AreaConfig {
|
|
std::string mapPath;
|
|
std::string mapType;
|
|
Vec2 generatePos = Vec2(-1.0f, -1.0f);
|
|
};
|
|
|
|
struct TownConfig {
|
|
std::string townName;
|
|
std::string enteringTitle;
|
|
std::string enteringCutscene;
|
|
int needQuestId = -1;
|
|
int needLevel = -1;
|
|
std::map<int, AreaConfig> areas;
|
|
};
|
|
|
|
struct BackgroundAnimationConfig {
|
|
std::string filename;
|
|
std::string layer;
|
|
std::string order;
|
|
};
|
|
|
|
struct MapAnimationConfig {
|
|
std::string filename;
|
|
std::string layer;
|
|
int xPos = 0;
|
|
int yPos = 0;
|
|
int zPos = 0;
|
|
};
|
|
|
|
struct MoveAreaTarget {
|
|
int town = -2;
|
|
int area = -2;
|
|
};
|
|
|
|
struct TileInfo {
|
|
std::string spritePath;
|
|
int spriteIndex = 0;
|
|
};
|
|
|
|
struct MapConfig {
|
|
std::string name;
|
|
std::string mapPath;
|
|
std::string mapDir;
|
|
int backgroundPos = 0;
|
|
Vec2 tilePos = Vec2::Zero();
|
|
int farSightScroll = 100;
|
|
bool hasCameraLimit = false;
|
|
int cameraLimitMinX = -1;
|
|
int cameraLimitMaxX = -1;
|
|
int cameraLimitMinY = -1;
|
|
int cameraLimitMaxY = -1;
|
|
std::vector<std::string> tilePaths;
|
|
std::vector<std::string> extendedTilePaths;
|
|
std::vector<BackgroundAnimationConfig> backgroundAnimations;
|
|
std::vector<MapAnimationConfig> mapAnimations;
|
|
std::vector<std::string> soundIds;
|
|
std::vector<Vec2> virtualMovablePolygon;
|
|
std::vector<Rect> townMovableAreas;
|
|
std::vector<MoveAreaTarget> townMovableAreaTargets;
|
|
};
|
|
|
|
std::map<int, std::string> loadTownList();
|
|
bool loadTownConfig(const std::string& townPath, TownConfig& outConfig);
|
|
bool loadMapConfig(const std::string& mapPath, MapConfig& outConfig);
|
|
bool loadTileInfo(const std::string& path, TileInfo& outInfo);
|
|
|
|
} // namespace frostbite2D::game
|