-
Notifications
You must be signed in to change notification settings - Fork 3
/
CKGraphical.h
464 lines (389 loc) · 14.3 KB
/
CKGraphical.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
#pragma once
#include "KObject.h"
#include <vector>
#include "rw.h"
#include "KLocalObject.h"
#include "CKUtils.h"
#include "IKRenderable.h"
#include "Shape.h"
#include "Events.h"
struct CClone;
struct CSGBranch;
struct CKSceneNode;
struct CKGraphical : CKCategory<13> {
};
struct CKReflectableGraphical : CKMRSubclass<CKReflectableGraphical, CKMemberReflectable<CKGraphical>, 0x1AAB> {
void reflectMembers2(MemberListener& r, KEnvironment* kenv) {}
};
template <int I> using CKGraphicalRenderable = CKSubclass<IKRenderable, I, 13>;
struct CKReflectableRenderable : CKMRSubclass<CKReflectableRenderable, CKMemberReflectable<CKGraphicalRenderable<0x1AAD>>, 0x1AAE> {
void reflectMembers2(MemberListener& r, KEnvironment* kenv) {
IKRenderable::reflectMembers2(r, kenv);
}
};
struct CCloneManager : CKGraphicalRenderable<3> {
uint32_t _numClones = 0, _unk1, _unk2, _unk3, _unk4;
std::vector<kobjref<CSGBranch>> _clones;
RwTeamDictionary _teamDict;
RwTeam _team;
std::vector<std::array<float, 4>> flinfos;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CSectorAnimation : CKSubclass<CKGraphical, 55> {
struct Animation {
RwAnimAnimation rwAnim;
std::array<float, 4> x2AnimVals;
std::array<int32_t, 4> arAnimValues;
KPostponedRef<CKObject> spObjRef;
};
std::vector<Animation> anims;
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
};
struct CAnimationManager : CKSubclass<CKGraphical, 8> {
CSectorAnimation commonAnims; // XXL1/2
std::vector<KPostponedRef<CSectorAnimation>> arSectors; // Arthur+
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
void onLevelLoaded(KEnvironment* kenv) override;
void deserializeGlobal(KEnvironment* kenv, File* file, size_t length) override {}
int32_t addAnimation(RwAnimAnimation& rwAnim, int sectorIndex = 0);
};
struct CScene2d;
struct CMessageBox2d;
struct CMenuManager;
struct CText2d;
struct CBillboard2d;
struct CColorTextButton2d;
struct CElement2d : CKSubclass<CKGraphical, 9> {
uint8_t e2dUnk1, e2dUnk2, e2dUnk3 = 1, e2dUnk4 = 1;
kobjref<CScene2d> scene;
kobjref<CElement2d> previous, next;
float e2dUnk5 = 0.0f, e2dUnk6 = 0.0f, e2dUnk7 = 0.0f;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CManager2d : CKGraphicalRenderable<16> {
// Global
uint32_t numFonts;
// Level
kobjref<CMenuManager> menuManager;
kobjref<CScene2d> scene1, scene2, x2scene3, ogscene4;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
void deserializeGlobal(KEnvironment* kenv, File* file, size_t length) override;
void serializeGlobal(KEnvironment* kenv, File* file) override;
};
struct CMenuManager : CKSubclass<CKGraphical, 17> {
kobjref<CScene2d> scene;
kobjref<CMessageBox2d> messageBox;
uint8_t cmm2dVal = 1;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CContainer2d : CKSubclass<CElement2d, 19> {
std::string name;
kobjref<CScene2d> scene1, scene2;
uint8_t cctr2dVal = 0;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CScene2d : CKGraphicalRenderable<20> {
kobjref<CElement2d> first, last;
uint32_t numElements = 0;
uint8_t cs2dVal = 1;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CMessageBox2d : CKSubclass<CElement2d, 21> {
kobjref<CContainer2d> container;
uint32_t msgboxUnk = 0;
kobjref<CText2d> text;
kobjref<CBillboard2d> billboard;
kobjref<CColorTextButton2d> button1, button2, button3;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CText2d : CKSubclass<CElement2d, 23> {
kobjref<CKObject> locManager;
float ce2dUnk1 = 0.1f, ce2dUnk2 = 0.1f;
uint32_t ce2dUnk3 = 2;
uint32_t ce2dUnk4 = 0xFFFFFFFF; // Removed in OG
std::wstring text;
uint32_t ce2dUnk5 = 0;
RwBrush2D brush;
std::array<uint32_t, 7> ce2dUnk6;
uint8_t ce2dUnk7 = 1, ce2dUnk8 = 1, ce2dUnk9 = 0;
float ce2dUnkA = 1.0f;
// OG:
kobjref<CKObject> ogLocTextAccessor;
kobjref<CKObject> ogText2d_1;
kobjref<CKObject> ogText2d_2;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CColorTextButton2d : CKSubclass<CText2d, 12> {
uint32_t ccolor = 0xFF00FF;
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CBillboard2d : CKSubclass<CElement2d, 15> {
RwBrush2D brush;
std::string texture;
uint32_t color1 = 0xFFFFFFFF, color2 = 0xCDCDCDCD;
float flt1 = 1.0f, flt2 = 1.0f;
uint8_t bb1 = 1, bb2 = 0;
std::array<float, 8> fltarr = { 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f };
// XXL+2: (maybe x2Byte and arByte are the same?)
uint8_t x2Byte = 1;
uint8_t arByte = 1;
kobjref<CKObject> arUnkObject;
std::array<int32_t, 5> spIntArray = { 0,0,0,1,1 };
void deserialize(KEnvironment* kenv, File *file, size_t length) override;
void serialize(KEnvironment* kenv, File *file) override;
};
struct CBillboard2dList : CKSubclass<CElement2d, 22> {
struct Bill {
int32_t cblUnk1;
RwBrush2D brush;
uint8_t cblUnk4;
std::array<float, 8> cblUnk5;
};
//int32_t cblUnk0;
std::vector<Bill> cblBills;
uint32_t cblUnk10;
//int32_t cblUnk17;
std::vector<std::string> cblTextures;
std::array<float, 2> cblUnk33;
uint8_t cblUnk34;
float cblUnk35;
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
};
struct CBillboardButton2d : CKSubclass<CBillboard2d, 25> {
uint32_t billButtonColor;
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
};
//
struct CBlurData : CKMRSubclass<CBlurData, CKReflectableGraphical, 10> {
int32_t cbdUnk0;
uint8_t cbdUnk1;
float cbdUnk2;
float cbdUnk3;
float cbdUnk4;
float cbdUnk5;
float cbdUnk6;
float cbdUnk7;
float cbdUnk8;
float cbdUnk9;
float cbdUnk10;
uint8_t cbdUnk11;
int32_t cbdUnk12;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKPBuffer : CKMRSubclass<CKPBuffer, CKReflectableRenderable, 13> {
std::string ogString;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CDistortionScreenFx;
struct CPostRenderingFx : CKMRSubclass<CPostRenderingFx, CKReflectableRenderable, 14> {
kobjref<CKPBuffer> cprfUnk0;
kobjref<CDistortionScreenFx> cprfUnk1;
int32_t cprfUnk2;
int32_t cprfUnk3;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CHDRData : CKMRSubclass<CHDRData, CKReflectableGraphical, 21> {
int32_t chdrdUnk0;
int32_t chdrdUnk1;
int32_t chdrdUnk2;
uint8_t chdrdUnk3;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKSpawnPoolParams : CKMRSubclass<CKSpawnPoolParams, CKReflectableGraphical, 24> {
float cksppUnk0;
float cksppUnk1;
float cksppUnk2;
int32_t cksppUnk3;
float cksppUnk4;
// OG
kobjref<CKObject> ogQuakeCpnt;
uint32_t ogFlags;
std::vector<kobjref<CKObject>> ogQCUpdaters;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CBackgroundManager : CKMRSubclass<CBackgroundManager, CKReflectableRenderable, 26> {
//uint8_t cbmUnk0; // num sectors
struct SectorBackground {
KPostponedRef<CKSceneNode> node;
std::array<float, 5> values = { 1.0f, 0.0f, 0.33f, 0.0f, 10000.0f };
};
std::vector<SectorBackground> sectorBackgrounds;
uint8_t cbmUnk2;
uint8_t cbmUnk3;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
void onLevelLoaded(KEnvironment* kenv) override;
};
struct CKFlashAnimation;
struct CKFlashText;
struct CKFlashMessageIn;
struct CKFlashMessageOut;
struct CFlashHotSpot;
struct CKSoundDictionaryID;
struct CKSector;
struct CKFlashUI : CKMRSubclass<CKFlashUI, CKReflectableGraphical, 27> {
std::vector<kobjref<CKFlashAnimation>> ckfuiAnims;
std::vector<kobjref<CKFlashText>> ckfuiTexts;
std::vector<kobjref<CKFlashMessageIn>> ckfuiMsgIns;
std::vector<kobjref<CKFlashMessageOut>> ckfuiMsgOuts;
std::vector<kobjref<CKObject>> ckfuiUsers;
kobjref<CKSoundDictionaryID> ckfuiSndDict;
int32_t ckfuiUnk24;
std::vector<kobjref<CFlashHotSpot>> ckfuiHotSpots;
std::vector<int32_t> ckfuiUnk28; // count 16 for XXL2, 40 for OG
int32_t ckfuiUnk29;
std::vector<uint8_t> rwMaestroData;
// OG
kobjref<CKObject> ogUnkObj;
int32_t ogEnd1;
kobjref<CKSector> ogSector;
int32_t ogEnd2;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
};
struct CKFlashManager : CKMRSubclass<CKFlashManager, CKReflectableGraphical, 28> {
//int32_t ckfmUnk0;
std::vector<kobjref<CKFlashUI>> ckfmFlashUI;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKFlashBase : CKMRSubclass<CKFlashBase, CKReflectableGraphical, 29> {
std::string ckfaUnk0;
kobjref<CKFlashUI> ckfaUnk1;
int32_t ckfaUnk2;
int8_t ckfaOgUnk = 1;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKFlashAnimation : CKMRSubclass<CKFlashAnimation, CKFlashBase, 30> {
std::vector<std::pair<uint8_t, std::string>> ckfaUnk5;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKFlashText : CKMRSubclass<CKFlashText, CKFlashBase, 31> {
int32_t ckftUnk3;
uint8_t ckftUnk4;
float ckftUnk5;
int32_t ckftUnk6;
int32_t ckftUnk7;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKFlashPlaySoundEvent;
struct CKFlashMessageIn : CKMRSubclass<CKFlashMessageIn, CKFlashBase, 33> {
//int32_t ckfmiUnk0;
std::vector<kobjref<CKFlashPlaySoundEvent>> ckfmiUnk1;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CKFlashMessageOut : CKMRSubclass<CKFlashMessageOut, CKFlashBase, 34> {
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CLightSet;
struct CLightManager : CKGraphicalRenderable<36> {
std::vector<kobjref<CLightSet>> lightSets;
std::vector<kobjref<CKObject>> spHDStuff; // used on HD platforms (PS3/X360), empty on previous gen platforms
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
};
struct CLightSet : CKSubclass<CKGraphical, 37> {
int32_t ogSector = 0;
int32_t clsUnk0;
AABoundingBox bbox;
KPostponedRef<CKSceneNode> sceneNode;
int32_t spUnkInt = -1;
std::array<kobjref<CKObject>, 5> lightComponents;
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
void onLevelLoaded(KEnvironment* kenv) override;
};
struct CColorizedScreenFx;
struct CVideoManager : CKGraphicalRenderable<39> {
// Global
std::vector<kobjref<CKObject>> videos;
float vmFloat1, vmFloat2;
// OG LVL:
kobjref<CColorizedScreenFx> ogColorizedScreenFx;
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
void deserializeGlobal(KEnvironment* kenv, File* file, size_t length) override;
void serializeGlobal(KEnvironment* kenv, File* file) override;
};
struct CKVideo : CKSubclass<CKGraphical, 40> {
// game
uint32_t vidUnk1;
std::string vidUnk2;
uint32_t vidUnk3;
float vidUnk4;
// level
EventNode vidEventNode;
std::string vidStreamTexture;
void reflectGame(MemberListener& ml, KEnvironment* kenv);
void reflectLevel(MemberListener& ml, KEnvironment* kenv);
void deserialize(KEnvironment* kenv, File* file, size_t length) override;
void serialize(KEnvironment* kenv, File* file) override;
void deserializeLvlSpecific(KEnvironment* kenv, File* file, size_t length) override;
void serializeLvlSpecific(KEnvironment* kenv, File* file) override;
};
struct WIN32_CKVideo : CKSubclass<CKVideo, 41> {};
struct CKSpawnPool;
struct CSpawnManager : CKMRSubclass<CSpawnManager, CKReflectableRenderable, 46> {
std::vector<kobjref<CKSpawnPool>> spawnPools;
std::vector<kobjref<CKSpawnPoolParams>> spParams;
// OG
std::vector<kobjref<CKObject>> ogRenderParams;
std::vector<kobjref<CKSceneNode>> ogNodes;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
void deserializeGlobal(KEnvironment* kenv, File* file, size_t length) override {}
void serializeGlobal(KEnvironment* kenv, File* file) override {}
};
struct CKSpawnPool : CKMRSubclass<CKSpawnPool, CKReflectableGraphical, 47> {
//int32_t ckspUnk0;
std::vector<kobjref<CKSpawnPoolParams>> ckspUnk1;
uint32_t ckspUnk8;
std::vector<std::tuple<uint32_t, std::shared_ptr<RwFrameList>, float>> ckspUnk9;
// OG
std::vector<kobjref<CKObject>> ogRenderParams;
std::vector<kobjref<CKSceneNode>> ogNodes;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CFlashHotSpot : CKMRSubclass<CFlashHotSpot, CKReflectableGraphical, 48> {
std::vector<std::tuple<kobjref<CKGraphical>, std::array<float, 2>, int32_t>> fhs2DList;
std::vector<std::tuple<kobjref<CKSceneNode>, Vector3, int32_t>> fhs3DList;
kobjref<CKGraphical> cfhsUnk5;
kobjref<CKFlashUI> cfhsUnk6;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CDistortionScreenFx : CKGraphicalRenderable<49> {};
struct CDistortionScreenData : CKMRSubclass<CDistortionScreenData, CKReflectableGraphical, 50> {
uint8_t cdsdUnk0;
float cdsdUnk1;
float cdsdUnk2;
float cdsdUnk3;
int32_t cdsdUnk4;
//int32_t cdsdUnk5;
std::vector<std::array<float, 2>> cdsdUnk6;
std::array<float, 3> cdsdUnk7;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};
struct CColorizedScreenFx : CKGraphicalRenderable<51> {};
struct CFlashMessageBox2d : CKMRSubclass<CFlashMessageBox2d, CKReflectableGraphical, 52> {
kobjref<CKFlashUI> cfmbUnk0;
kobjref<CFlashHotSpot> cfmbUnk1;
kobjref<CKFlashAnimation> cfmbUnk2;
kobjref<CKFlashAnimation> cfmbUnk3;
std::array<kobjref<CKFlashMessageOut>, 7> cfmbUnk4;
std::array<std::pair<kobjref<CKFlashText>, kobjref<CKFlashMessageIn>>, 3> cfmbUnk12;
kobjref<CText2d> cfmbUnk17;
// OG
kobjref<CKObject> ogMenuMessageBox;
void reflectMembers2(MemberListener& r, KEnvironment* kenv);
};