22 #ifndef CHAMBER_ROOM_H 23 #define CHAMBER_ROOM_H 27 #define SPOTFLG_1 0x01 28 #define SPOTFLG_2 0x02 29 #define SPOTFLG_8 0x08 30 #define SPOTFLG_10 0x10 31 #define SPOTFLG_20 0x20 32 #define SPOTFLG_40 0x40 33 #define SPOTFLG_80 0x80 37 #include "common/pack-start.h" 47 #include "common/pack-end.h" 49 #define PERSFLAGS 0xF0 50 #define PERSFLG_10 0x10 51 #define PERSFLG_20 0x20 52 #define PERSFLG_40 0x40 53 #define PERSFLG_80 0x80 57 #include "common/pack-start.h" 65 #include "common/pack-end.h" 67 #define ANIMFLG_USESPOT 0x80 93 extern byte scratch_mem1[8010];
94 extern byte *scratch_mem2;
96 extern rect_t room_bounds_rect;
98 extern byte last_object_hint;
99 extern byte object_hint;
100 extern byte command_hint;
101 extern byte last_command_hint;
103 extern uint16 next_protozorqs_ticks;
104 extern uint16 next_vorts_ticks;
105 extern uint16 next_vorts_cmd;
106 extern uint16 next_turkey_ticks;
107 extern uint16 next_turkey_cmd;
109 #define MAX_SPRITES 16 111 extern byte *sprites_list[MAX_SPRITES];
115 extern byte *doors_list[MAX_DOORS];
117 extern byte zone_palette;
119 extern spot_t *zone_spots;
120 extern spot_t *zone_spots_end;
121 extern spot_t *zone_spots_cur;
128 extern pers_t *aspirant_ptr;
129 extern spot_t *aspirant_spot;
130 extern spot_t *found_spot;
131 extern byte **spot_sprite;
133 extern byte *lutin_mem;
135 extern byte skip_zone_transition;
137 extern byte in_de_profundis;
139 extern byte zone_name;
140 extern byte room_hint_bar_width;
141 extern byte zone_spr_index;
142 extern byte zone_obj_count;
143 extern byte room_hint_bar_coords_x;
144 extern byte room_hint_bar_coords_y;
146 extern uint16 drops_cleanup_time;
148 extern const byte patrol_route[];
149 extern const byte *timed_seq_ptr;
161 int16 isInRect(byte x, byte y,
rect_t *rect);
162 int16 isCursorInRect(
rect_t *rect);
163 void selectSpotCursor(
void);
165 void checkHotspots(byte m, byte v);
168 byte *loadPuzzlToScratch(byte index);
170 void drawObjectHint(
void);
171 void showObjectHint(byte *target);
172 void drawCommandHint(
void);
173 void showCommandHint(byte *target);
175 void drawCharacterSprite(byte spridx, byte x, byte y, byte *target);
176 char drawZoneAniSprite(
rect_t *rect, uint16 index, byte *target);
178 void drawHintsAndCursor(byte *target);
180 void drawTheWallDoors(
void);
181 void mergeSpritesData(byte *target, uint16 pitch, byte *source, uint16 w, uint16 h);
182 void mergeSpritesDataFlip(byte *target, uint16 pitch, byte *source, uint16 w, uint16 h);
184 void refreshSpritesData(
void);
185 void blitSpritesToBackBuffer(
void);
186 byte *backupSpotImage(
spot_t *spot, byte **spotback, byte *buffer);
187 void backupSpotsImages(
void);
189 void selectPalette(
void);
190 void selectSpecificPalette(byte index);
192 byte findSpotByFlags(byte mask, byte value);
193 byte selectPerson(byte offset);
195 void findPerson(
void);
197 void beforeChangeZone(byte index);
198 void drawRoomItemsIndicator(
void);
199 void drawRoomStaticObject(byte *aptr, byte *rx, byte *ry, byte *rw, byte *rh);
200 void drawRoomStatics(
void);
201 void redrawRoomStatics(byte index, byte y_step);
202 void drawPersons(
void);
203 void refreshZone(
void);
204 void changeZone(byte index);
206 void drawSpots(byte *target);
207 void animateSpots(byte *target);
209 byte findInitialSpot(
void);
210 void animRoomDoorOpen(byte index);
211 void animRoomDoorClose(byte index);
213 uint16 getPuzzlSprite(byte index, byte x, byte y, uint16 *w, uint16 *h, uint16 *ofs);
215 void bounceCurrentItem(byte flags, byte y);
217 void backupScreenOfSpecialRoom(
void);
218 void restoreScreenOfSpecialRoom(
void);
220 void theWallPhase3_DoorOpen1(
void);
221 void theWallPhase0_DoorOpen2(
void);
222 void theWallPhase1_DoorClose1(
void);
223 void theWallPhase2_DoorClose2(
void);
225 void prepareAspirant(
void);
226 void prepareVorts(
void);
227 void prepareTurkey(
void);
229 void updateProtozorqs(
void);
230 void checkGameTimeLimit(
void);
231 void cleanupDroppedItems(
void);
233 void resetAllPersons(
void);