diff options
| author | inspectredc <inspectredc@gmail.com> | 2024-04-03 12:19:17 +0100 |
|---|---|---|
| committer | Lywx <kiritodev01@gmail.com> | 2024-04-03 11:31:27 -0600 |
| commit | 9b7b9f69e4323e63f2b08dc35a4e1e1c6513da72 (patch) | |
| tree | 82550b22507621c49c9f4aeb745e19f7cb06bcb6 | |
| parent | 8f19a5e52b2e515e3e8fb86231b2886ad51fd3f6 (diff) | |
CollisionFactory Parse and Code Export fixes
| -rw-r--r-- | src/factories/sm64/CollisionFactory.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/factories/sm64/CollisionFactory.cpp b/src/factories/sm64/CollisionFactory.cpp index ee0f5ff..41fa0b1 100644 --- a/src/factories/sm64/CollisionFactory.cpp +++ b/src/factories/sm64/CollisionFactory.cpp @@ -2,7 +2,7 @@ #include "Companion.h" #include "spdlog/spdlog.h" -#define FORMAT_HEX(x) std::hex << x << std::dec +#define FORMAT_HEX(x) std::hex << "0x" << std::uppercase << x << std::nouppercase << std::dec std::unordered_map<int16_t, SpecialPresetTypes> specialPresetMap = { { 0x00, SpecialPresetTypes::SPTYPE_YROT_NO_PARAMS }, @@ -220,6 +220,7 @@ ExportResult SM64::CollisionCodeExporter::Export(std::ostream &write, std::share } for (auto &envRegionBox : collision->mEnvRegionBoxes) { write << fourSpaceTab; + write << "COL_WATER_BOX("; write << envRegionBox.id << ", "; write << envRegionBox.x1 << ", "; write << envRegionBox.z1 << ", "; @@ -412,9 +413,11 @@ std::optional<std::shared_ptr<IParsedData>> SM64::CollisionFactory::parse(std::v switch (type) { case SpecialPresetTypes::SPTYPE_YROT_NO_PARAMS: extraParams.emplace_back(reader.ReadInt16()); + break; case SpecialPresetTypes::SPTYPE_PARAMS_AND_YROT: extraParams.emplace_back(reader.ReadInt16()); extraParams.emplace_back(reader.ReadInt16()); + break; case SpecialPresetTypes::SPTYPE_UNKNOWN: extraParams.emplace_back(reader.ReadInt16()); extraParams.emplace_back(reader.ReadInt16()); |
