27 #ifndef ICB_PC_PROPS_H 28 #define ICB_PC_PROPS_H 30 #include "engines/icb/common/px_staticlayers.h" 31 #include "engines/icb/common/px_types.h" 35 #define PCPROP_SCHEMA 3 36 #define PCPROP_ID MKTAG('p', 'o', 'r', 'P') 38 #define PCINTERACTIBLE_SCHEMA 2 39 #define PCINTERACTIBLE_ID MKTAG('k', 'c', 'a', 'T') 41 #define PCSETFILE_ID_ICB MKTAG('t', 'n', 'i', 'm') 42 #define PCSETFILE_ID_ELDORADO MKTAG('t', 'n', 'i', 'p') 50 uint32 backgroundOffset;
51 uint32 interactiblesOffset;
65 uint8 *ptr = interactiblePtr;
67 memcpy(name, ptr, 32);
70 width = (int32)READ_LE_U32(ptr);
73 height = (int32)READ_LE_U32(ptr);
76 x = (int32)READ_LE_U32(ptr);
79 y = (int32)READ_LE_U32(ptr);
95 pcInteractibleFile() : id(PCINTERACTIBLE_ID), schema(PCINTERACTIBLE_SCHEMA), mapping(0), quantity(0), interactibles(
nullptr) {}
98 uint8 *ptr = interactibleData;
100 id = READ_LE_U32(ptr);
103 schema = READ_LE_U32(ptr);
106 mapping = READ_LE_U32(ptr);
109 quantity = READ_LE_U32(ptr);
113 for (uint32 i = 0; i < quantity; i++) {
114 interactibles[i] =
new pcInteractible(interactibleData + READ_LE_U32(ptr));
120 for (uint32 i = 0; i < quantity; i++) {
121 delete interactibles[i];
123 delete[] interactibles;
127 uint32 GetID() {
return id; }
128 void SetId(uint32 i) {
id = i; }
129 uint32 GetQty() {
return quantity; }
130 void SetQty(uint32 q) { quantity = q; }
132 void SetSchema(uint32 s) { schema = s; }
133 uint32 GetSchema()
const {
134 if (
id != PCINTERACTIBLE_ID)
143 uint16 *zPtrs[TILE_COUNT];
144 uint16 *semiPtrs[TILE_COUNT];
150 uint16 bgLRSurfaceWidth;
151 uint16 bgLRSurfaceHeight;
152 uint16 fgLRSurfaceWidth;
153 uint16 fgLRSurfaceHeight;
154 uint16 bgHRSurfaceWidth;
155 uint16 bgHRSurfaceHeight;
156 uint16 fgHRSurfaceWidth;
157 uint16 fgHRSurfaceHeight;
158 uint8 *bgLRRleDataPtr;
159 uint8 *fgLRRleDataPtr;
160 uint8 *bgHRRleDataPtr;
161 uint8 *fgHRRleDataPtr;
165 uint8 *ptr = propBasePtr + dataOffset;
167 for (int32 i = 0; i < TILE_COUNT; i++) {
169 if (uint32 offset = READ_LE_U32(ptr)) {
170 zPtrs[i] = (uint16 *)(propBasePtr + offset);
175 for (int32 i = 0; i < TILE_COUNT; i++) {
177 if (uint32 offset = READ_LE_U32(ptr)) {
178 semiPtrs[i] = (uint16 *)(propBasePtr + offset);
183 nLRBgTiles = READ_LE_U16(ptr);
186 nLRFgTiles = READ_LE_U16(ptr);
189 nHRBgTiles = READ_LE_U16(ptr);
192 nHRFgTiles = READ_LE_U16(ptr);
195 palettePtr = (uint32 *)(propBasePtr + READ_LE_U32(ptr));
198 bgLRSurfaceWidth = READ_LE_U16(ptr);
201 bgLRSurfaceHeight = READ_LE_U16(ptr);
204 fgLRSurfaceWidth = READ_LE_U16(ptr);
207 fgLRSurfaceHeight = READ_LE_U16(ptr);
210 bgHRSurfaceWidth = READ_LE_U16(ptr);
213 bgHRSurfaceHeight = READ_LE_U16(ptr);
216 fgHRSurfaceWidth = READ_LE_U16(ptr);
219 fgHRSurfaceHeight = READ_LE_U16(ptr);
222 bgLRRleDataPtr = propBasePtr + READ_LE_U32(ptr);
225 fgLRRleDataPtr = propBasePtr + READ_LE_U32(ptr);
228 bgHRRleDataPtr = propBasePtr + READ_LE_U32(ptr);
231 fgHRRleDataPtr = propBasePtr + READ_LE_U32(ptr);
234 tileRects = (
LRECT *)ptr;
237 uint16 *GetZTileTable(int32 t) {
return zPtrs[t]; }
238 uint16 *GetSemiTileTable(int32 t) {
return semiPtrs[t]; }
239 uint16 GetLRBgTileQty() {
return nLRBgTiles; }
240 uint16 GetLRFgTileQty() {
return nLRFgTiles; }
241 uint16 GetHRBgTileQty() {
return nHRBgTiles; }
242 uint16 GetHRFgTileQty() {
return nHRFgTiles; }
243 uint32 *GetPalette() {
return palettePtr; }
244 uint16 GetLRBgSurfaceWidth() {
return bgLRSurfaceWidth; }
245 uint16 GetLRBgSurfaceHeight() {
return bgLRSurfaceHeight; }
246 uint16 GetLRFgSurfaceWidth() {
return fgLRSurfaceWidth; }
247 uint16 GetLRFgSurfaceHeight() {
return fgLRSurfaceHeight; }
248 uint16 GetHRBgSurfaceWidth() {
return bgHRSurfaceWidth; }
249 uint16 GetHRBgSurfaceHeight() {
return bgHRSurfaceHeight; }
250 uint16 GetHRFgSurfaceWidth() {
return fgHRSurfaceWidth; }
251 uint16 GetHRFgSurfaceHeight() {
return fgHRSurfaceHeight; }
252 uint8 *GetLRBgRlePtr() {
return bgLRRleDataPtr; }
253 uint8 *GetLRFgRlePtr() {
return fgLRRleDataPtr; }
254 uint8 *GetHRBgRlePtr() {
return bgHRRleDataPtr; }
255 uint8 *GetHRFgRlePtr() {
return fgHRRleDataPtr; }
256 LRECT *GetTileRects() {
return tileRects; }
266 pcPropRGB(uint8 *propBasePtr, uint32 dataOffset) {
267 uint8 *ptr = propBasePtr + dataOffset;
269 memcpy(name, ptr, 32);
272 stateQty = READ_LE_U32(ptr);
276 for (uint32 i = 0; i < stateQty; i++) {
283 for (uint32 i = 0; i < stateQty; i++) {
290 const char *GetName()
const {
return name; }
291 uint32 GetStateQty()
const {
return stateQty; }
305 uint8 *ptr = propData;
307 id = READ_LE_U32(ptr);
310 schema = READ_LE_U32(ptr);
313 mapping = READ_LE_U32(ptr);
316 propQty = READ_LE_U32(ptr);
320 for (uint32 i = 0; i < propQty; i++) {
321 props[i] =
new pcPropRGB(propData, READ_LE_U32(ptr));
327 for (uint32 i = 0; i < propQty; i++) {
334 uint32 GetId()
const {
return id; }
335 uint32 GetPropQty()
const {
return propQty; }
336 pcPropRGB *GetProp(uint32 p) {
return props[p]; }
337 uint32 GetSchema()
const {
347 #endif // #ifndef PC_PROPS_H Definition: pc_props.h:86
Definition: pc_props.h:259
Definition: pc_props.h:141
Definition: pc_props.h:295
Definition: px_types.h:32
Definition: pc_props.h:54