1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 00:00:44 +00:00
oot/tools/ZAPD/ZAPD/GameConfig.h
Dragorn421 bdee3d33b4
No longer use asm-processor (#1824)
* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "b3bfa14cf"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "b3bfa14cf"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

* use CS_FLOAT

* update csdis

* update committed csdata

* finish updating csdis.py

* add script to reextract committed csdata

* dont use asm-processor, use iconv for reencoding utf8 to eucjp

* remove asm-processor csdata usage remnants

* --cs-float hex

* delete tempfile at end of reencode.sh (may want to rm even if compilation fails though?)

* comment reencode.sh

* comment CMD_F

* do not break permuter guessing compile command, by not reencode.sh-wrapping compilation under PERMUTER (thanks anghelo)

* fix the permuter fix

* pad -> sBssDummyNeg1

* reencode.sh: rm tempfile on script exit (including on error)

* renumber sBssDummy vars in zcolchk from 0

* Revert "--cs-float hex"

This reverts commit 85267dc348.

* Revert BSS changes

* Add linemarker to reencoded files for better error message

* fix audio/general.c bss

* make reencode.sh work on macOS

* touch up csdis, csdis_re

---------

Co-authored-by: cadmic <cadmic24@gmail.com>
2024-03-01 16:12:22 -05:00

97 lines
3 KiB
C++

#pragma once
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include "Utils/Directory.h"
#include "tinyxml2.h"
struct TexturePoolEntry
{
fs::path path = ""; // Path to Shared Texture
};
class ExternalFile
{
public:
fs::path xmlPath, outPath;
ExternalFile(fs::path nXmlPath, fs::path nOutPath);
};
// Stores data from the XML file, the integer is the index (via ATOI) and the string is the value
class EnumData
{
public:
// Common
std::map<uint16_t, std::string> cutsceneCmd;
std::map<uint16_t, std::string> miscType;
std::map<uint16_t, std::string> fadeOutSeqPlayer;
std::map<uint16_t, std::string> transitionType;
std::map<uint16_t, std::string> naviQuestHintType;
std::map<uint16_t, std::string> ocarinaSongActionId;
std::map<uint16_t, std::string> seqId;
// OoT
std::map<uint16_t, std::string> textType;
std::map<uint16_t, std::string> destination;
std::map<uint16_t, std::string> playerCueId;
// MM
std::map<uint16_t, std::string> modifySeqType;
std::map<uint16_t, std::string> chooseCreditsSceneType;
std::map<uint16_t, std::string> destinationType;
std::map<uint16_t, std::string> motionBlurType;
std::map<uint16_t, std::string> transitionGeneralType;
std::map<uint16_t, std::string> rumbleType;
std::map<uint8_t, std::string> spawnFlag;
std::map<uint8_t, std::string> endSfx;
std::map<uint8_t, std::string> interpType;
std::map<uint16_t, std::string> relTo;
};
class ZFile;
class GameConfig
{
public:
std::string configFilePath;
std::map<int32_t, std::vector<ZFile*>> segmentRefFiles;
std::map<uint32_t, std::string> symbolMap;
std::vector<std::string> actorList;
std::vector<std::string> objectList;
std::vector<std::string> entranceList;
std::vector<std::string> specialEntranceList;
std::map<uint32_t, TexturePoolEntry> texturePool; // Key = CRC
EnumData enumData;
// ZBackground
uint32_t bgScreenWidth = 320, bgScreenHeight = 240;
bool useScreenWidthHeightConstants = true; // If true, ZBackground's will be declared with
// SCREEN_WIDTH * SCREEN_HEIGHT in the C file
// ExternalFile
fs::path externalXmlFolder;
std::vector<ExternalFile> externalFiles;
GameConfig() = default;
~GameConfig();
void ReadTexturePool(const fs::path& texturePoolXmlPath);
void GenSymbolMap(const fs::path& symbolMapPath);
void ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element);
void ConfigFunc_ActorList(const tinyxml2::XMLElement& element);
void ConfigFunc_ObjectList(const tinyxml2::XMLElement& element);
void ConfigFunc_EntranceList(const tinyxml2::XMLElement& element);
void ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element);
void ConfigFunc_TexturePool(const tinyxml2::XMLElement& element);
void ConfigFunc_BGConfig(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element);
void ConfigFunc_EnumData(const tinyxml2::XMLElement& element);
void ReadConfigFile(const fs::path& configFilePath);
};