-
Notifications
You must be signed in to change notification settings - Fork 0
/
RDT.h
230 lines (187 loc) · 4.86 KB
/
RDT.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
#ifndef RDT_H
#define RDT_H
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
/******************************************************
** Resident Evil 1 RDT Support **
*******************************************************/
typedef struct RDT_RE1_PART_T {
int unk_pos_x;
int unk_pos_y;
int unk_pos_z;
unsigned int unk0[2];
} RDT_RE1_PART_T;
typedef struct RDT_RE1_HEADER_T {
char unk0;
char num_cameras;
char num_sound_banks;
char unk1[3];
unsigned short unk2[3];
RDT_RE1_PART_T unk3[3];
} RDT_RE1_HEADER_T;
typedef struct RDT_RE1_CAMERA_POS_T {
signed int mask_offset;
signed int tim_mask_offset;
signed int positionX;
signed int positionY;
signed int positionZ;
signed int targetX;
signed int targetY;
signed int targetZ;
signed int unk[3];
} RDT_RE1_CAMERA_POS_T;
typedef struct RDT_RE1_CAMERA_SWITCH_T {
unsigned short to;
unsigned short from;
signed short x1;
signed short z1;
signed short x2;
signed short z2;
signed short x3;
signed short z3;
signed short x4;
signed short z4;
} RDT_RE1_CAMERA_SWITCH_T;
typedef struct RDT_RE1_SCA_HEADER_T {
unsigned short cx;
unsigned short cy;
unsigned int counts[5];
} RDT_RE1_SCA_HEADER_T;
typedef struct RDT_RE1_SCA_OBJ_T {
unsigned short x1;
unsigned short z1;
unsigned short x2; // W
unsigned short z2; // D
unsigned char type;
unsigned char id;
unsigned short floor;
} RDT_RE1_SCA_OBJ_T;
/* Scenario Data */
/* Door set script: Macros and Typedef */
#define STAGE(x) (x >> 5)
#define ROOM(x) (x & 0x1F)
typedef struct script_door_set_re1 {
unsigned char opcode;
unsigned char id;
unsigned short x;
unsigned short y;
unsigned short w;
unsigned short h;
unsigned char unk0[5];
unsigned char next_stage_and_room;
unsigned short next_x;
unsigned short next_y;
unsigned short next_z;
unsigned short next_dir;
unsigned short unk1;
} script_door_set_re1;
/******************************************************
** Resident Evil 1.5 and Resident Evil 2 RDT Support **
*******************************************************/
typedef struct RDT_HEADER_T {
unsigned char nSprite;
unsigned char nCut; // Quantidade de cameras
unsigned char nOmodel;
unsigned char nItem;
unsigned char nDoor;
unsigned char nRoom_at;
unsigned char Reverb_lv;
unsigned char nSprite_max;
} RDT_HEADER_T;
typedef struct RDT_CAMERA_POS_T {
unsigned short endFlag;
unsigned short viewR;
signed int positionX;
signed int positionY;
signed int positionZ;
signed int targetX;
signed int targetY;
signed int targetZ;
unsigned int pSprite;
} RDT_CAMERA_POS_T;
typedef struct RDT_COLI_HEADER_T {
signed short cx;
signed short cz;
unsigned int arraySum; // five 4 bytes will be plus, the total is the total of
// collision, the total of colission will be (arraySum - 1)
} RDT_COLI_HEADER_T;
typedef struct RDT_OFFSET6ELT_T {
signed short X;
signed short Z;
unsigned short W;
unsigned short H;
unsigned short id;
unsigned short type;
unsigned int floor;
} RDT_OFFSET6ELT_T;
typedef struct RDT_LIGHT_COLOR_T {
unsigned char R;
unsigned char G;
unsigned char B;
} RDT_LIGHT_COLOR_T;
typedef struct RDT_LIGHT_POS_T {
short X;
short Y;
short Z;
} RDT_LIGH_POS_T;
typedef struct RDT_LIGHT_T {
unsigned short lightType[2];
RDT_LIGHT_COLOR_T colorLight[3];
RDT_LIGHT_COLOR_T colorAmbient;
RDT_LIGHT_POS_T lightPos[3];
unsigned short brightNess[3];
} RDT_LIGHT_T;
typedef struct RDT_coli_1_5 {
unsigned short W;
unsigned short D;
signed short X;
signed short Z;
unsigned short id;
unsigned short Floor;
} RDT_coli_1_5;
typedef struct RDT_CAMERA_SWITCH_T {
unsigned char beFlag;
unsigned char nFloor;
unsigned char cam0;
unsigned char cam1;
signed short x1;
signed short z1;
signed short x2;
signed short z2;
signed short x3;
signed short z3;
signed short x4;
signed short z4;
} RDT_CAMERA_SWITCH_T;
class RDT {
public:
RDT();
~RDT();
void rdtRE1_sca();
void rdtLoadFile(std::string fileName);
void rdtRE1LoadFile(std::string fileName);
RDT_CAMERA_POS_T *rdtCameraPos;
RDT_HEADER_T rdtHeader;
RDT_LIGHT_T *rdtLight;
RDT_COLI_HEADER_T rdtColisionHeader;
RDT_coli_1_5 *rdtColissionArray;
std::vector<RDT_CAMERA_SWITCH_T> rdtCameraSwitch;
RDT_RE1_HEADER_T rdtRE1Header;
RDT_RE1_CAMERA_POS_T *rdtRE1CameraPos;
RDT_RE1_SCA_HEADER_T rdtRE1ColisionHeader;
std::vector<RDT_RE1_SCA_OBJ_T> rdtRE1ColissionArray;
std::vector<RDT_RE1_CAMERA_SWITCH_T> rdtRE1CameraSwitch;
unsigned char *RDT_RE1_SCD_DATA;
unsigned short scdSize;
unsigned int door_set_len;
script_door_set_re1 door_set_re1[0x10];
private:
unsigned char *rdtBuffer;
unsigned int rdtObjectList[22];
unsigned int rdtSize;
unsigned short *rdtSCD;
};
#endif