Torch
Loading...
Searching...
No Matches
PaintingFactory.h
1// struct Painting ttm_slide_painting = {
2// /* id */ 0x0000,
3// /* Image Count */ 0x02,
4// /* Texture Type */ PAINTING_IMAGE,
5// /* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
6// /* Ripple Status */ 0x00,
7// /* Rotation */ 0.0f, 90.0f,
8// /* Position */ 3072.0f, 921.6f, -819.2f,
9// /* curr passive entry */
10// /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
11// /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
12// /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
13// /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
14// /* Curr Ripple Timer */ 0.0f,
15// /* Curr Ripple x, y */ 0.0f, 0.0f,
16// /* Normal DList */ ttm_seg7_painting_dl_07012E98,
17// /* Texture Maps */ ttm_seg7_painting_texture_maps_07012E88,
18// /* Textures */ ttm_seg7_painting_textures_07012EF8,
19// /* Texture w, h */ 64, 32,
20// /* Ripple DList */ ttm_seg7_painting_dl_07012430,
21// /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
22// /* Alpha */ 0xFF,
23// /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
24// /* Size */ 460.8f,
25// };
26
27#pragma once
28
29#include "factories/BaseFactory.h"
30
31#define PAINTING_IMAGE 0
32#define PAINTING_ENV_MAP 1
33
34#define RIPPLE_TRIGGER_PROXIMITY 10
35#define RIPPLE_TRIGGER_CONTINUOUS 20
36
37namespace SM64 {
38
39class Painting : public IParsedData {
40public:
41 int16_t id;
42 int8_t imageCount;
43 int8_t textureType;
44 int8_t lastFloor;
45 int8_t currFloor;
46 int8_t floorEntered;
47 int8_t state;
48 float pitch;
49 float yaw;
50 float posX;
51 float posY;
52 float posZ;
53 float currRippleMag;
54 float passiveRippleMag;
55 float entryRippleMag;
56 float rippleDecay;
57 float passiveRippleDecay;
58 float entryRippleDecay;
59 float currRippleRate;
60 float passiveRippleRate;
61 float entryRippleRate;
62 float dispersionFactor;
63 float passiveDispersionFactor;
64 float entryDispersionFactor;
65 float rippleTimer;
66 float rippleX;
67 float rippleY;
68 uint32_t normalDisplayList;
69 uint32_t textureMaps;
70 uint32_t textureArray;
71 int16_t textureWidth;
72 int16_t textureHeight;
73 uint32_t rippleDisplayList;
74 int8_t rippleTrigger;
75 uint8_t alpha;
76 int8_t marioWasUnder;
77 int8_t marioIsUnder;
78 int8_t marioWentUnder;
79 float size;
80
81 Painting(
82 int16_t id,
83 int8_t imageCount,
84 int8_t textureType,
85 int8_t lastFloor, int8_t currFloor, int8_t floorEntered,
86 int8_t state,
87 float pitch, float yaw,
88 float posX, float posY, float posZ,
89 float currRippleMag, float passiveRippleMag, float entryRippleMag,
90 float rippleDecay, float passiveRippleDecay, float entryRippleDecay,
91 float currRippleRate, float passiveRippleRate, float entryRippleRate,
92 float dispersionFactor, float passiveDispersionFactor, float entryDispersionFactor,
93 float rippleTimer,
94 float rippleX, float rippleY,
95 uint32_t normalDisplayList,
96 uint32_t textureMaps,
97 uint32_t textureArray,
98 int16_t textureWidth, int16_t textureHeight,
99 uint32_t rippleDisplayList,
100 int8_t rippleTrigger,
101 uint8_t alpha,
102 int8_t marioWasUnder, int8_t marioIsUnder, int8_t marioWentUnder,
103 float size
104 ) :
105 id(id),
106 imageCount(imageCount),
107 textureType(textureType),
108 lastFloor(lastFloor), currFloor(currFloor), floorEntered(floorEntered),
109 state(state),
110 pitch(pitch), yaw(yaw),
111 posX(posX), posY(posY), posZ(posZ),
112 currRippleMag(currRippleMag), passiveRippleMag(passiveRippleMag), entryRippleMag(entryRippleMag),
113 rippleDecay(rippleDecay), passiveRippleDecay(passiveRippleDecay), entryRippleDecay(entryRippleDecay),
114 currRippleRate(currRippleRate), passiveRippleRate(passiveRippleRate), entryRippleRate(entryRippleRate),
115 dispersionFactor(dispersionFactor), passiveDispersionFactor(passiveDispersionFactor), entryDispersionFactor(entryDispersionFactor),
116 rippleTimer(rippleTimer),
117 rippleX(rippleX), rippleY(rippleY),
118 normalDisplayList(normalDisplayList),
119 textureMaps(textureMaps),
120 textureArray(textureArray),
121 textureWidth(textureWidth), textureHeight(textureHeight),
122 rippleDisplayList(rippleDisplayList),
123 rippleTrigger(rippleTrigger),
124 alpha(alpha),
125 marioWasUnder(marioWasUnder), marioIsUnder(marioIsUnder), marioWentUnder(marioWentUnder),
126 size(size)
127 {}
128};
129
131 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
132};
133
135 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
136};
137
139 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement) override;
140};
141
143public:
144 std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
145 inline std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
146 return {
147 REGISTER(Code, PaintingCodeExporter)
148 REGISTER(Header, PaintingHeaderExporter)
149 REGISTER(Binary, PaintingBinaryExporter)
150 };
151 }
152};
153}
Definition BaseFactory.h:88
Definition BaseFactory.h:94
Definition BaseFactory.h:80
Definition PaintingFactory.h:134
Definition PaintingFactory.h:138
Definition PaintingFactory.h:142
Definition PaintingFactory.h:130