Torch
Loading...
Searching...
No Matches
OoTSceneFactory.h
1#pragma once
2
3#include "factories/BaseFactory.h"
4#include <vector>
5#include <string>
6#include <optional>
7#include <set>
8
9namespace OoT {
10
11// Scene command IDs (matching OoT's RoomCommand enum)
12enum SceneCmdID : uint32_t {
13 SetStartPositionList = 0x00,
14 SetActorList = 0x01,
15 SetCsCamera = 0x02,
16 SetCollisionHeader = 0x03,
17 SetRoomList = 0x04,
18 SetWind = 0x05,
19 SetEntranceList = 0x06,
20 SetSpecialObjects = 0x07,
21 SetRoomBehavior = 0x08,
22 // 0x09 = Unused
23 SetMesh = 0x0A,
24 SetObjectList = 0x0B,
25 SetLightList = 0x0C,
26 SetPathways = 0x0D,
27 SetTransitionActorList = 0x0E,
28 SetLightingSettings = 0x0F,
29 SetTimeSettings = 0x10,
30 SetSkyboxSettings = 0x11,
31 SetSkyboxModifier = 0x12,
32 SetExitList = 0x13,
33 EndMarker = 0x14,
34 SetSoundSettings = 0x15,
35 SetEchoSettings = 0x16,
36 SetCutscenes = 0x17,
37 SetAlternateHeaders = 0x18,
38 SetCameraSettings = 0x19,
39};
40
41// Deferred alternate header entry, processed after primary commands.
43 uint32_t seg;
44 std::string symbol;
45};
46
47// A single scene/room command as parsed from ROM
49 uint32_t cmdID;
50 std::vector<uint8_t> data; // serialized binary data for the command body
51};
52
53// Parsed scene/room data
54class OoTSceneData : public IParsedData {
55public:
56 std::vector<SceneCommand> commands;
57};
58
60 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName,
61 YAML::Node& node, std::string* replacement) override;
62};
63
65public:
66 std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
67 std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
68 return {
69 REGISTER(Binary, OoTSceneBinaryExporter)
70 };
71 }
72
73private:
74 std::set<uint32_t> CollectKnownAddresses(const std::vector<std::pair<uint32_t, uint32_t>>& rawCmds,
75 std::vector<uint8_t>& buffer);
76};
77
78} // namespace OoT
Definition BaseFactory.h:96
Definition BaseFactory.h:102
Definition BaseFactory.h:88
Definition OoTSceneFactory.h:59
Definition OoTSceneFactory.h:54
Definition OoTSceneFactory.h:64
Definition OoTSceneFactory.h:42
Definition OoTSceneFactory.h:48