22 #ifndef CHEWY_GLOBALS_H 23 #define CHEWY_GLOBALS_H 25 #include "common/array.h" 26 #include "common/rect.h" 27 #include "chewy/chewy.h" 28 #include "chewy/types.h" 29 #include "chewy/atds.h" 30 #include "chewy/room.h" 31 #include "chewy/movclass.h" 32 #include "chewy/timer.h" 33 #include "chewy/barriers.h" 34 #include "chewy/text.h" 35 #include "chewy/object.h" 36 #include "chewy/effect.h" 41 #define MAX_RAND_NO_USE 6 42 #define R45_MAX_PERSON 9 44 extern const uint8 RAND_NO_USE[MAX_RAND_NO_USE];
56 w = pitch = SCREEN_WIDTH;
60 CurrentScreen &operator=(byte *p) {
76 int16 _ani_invent_anf[3] = { 38, 39, 21 };
77 int16 _ani_invent_delay[3][2] = {
78 { 12, 12 }, { 10, 10 }, { 11, 11 }
80 int16 _ani_count[3] = { 38, 39, 21 };
81 int16 _timer_nr[MAX_TIMER_OBJ] = { 0 };
83 CurrentScreen _currentScreen;
87 int16 _pfeil_delay = 0;
90 int16 _zoom_horizont = 0;
91 int16 _zoom_mov_fak = 0;
95 int16 _mouseLeftClick = 0;
97 bool _stopAutoMove[3] = {
false };
98 bool _e_streifen =
false;
100 int16 _r56koch_flug = 0;
102 int16 _r62TalkAni = 0;
103 int16 _r64TalkAni = 0;
104 int16 _r63ChewyAni = 0;
105 int16 _r63Schalter = 0;
106 int16 _r63RunDia = 0;
107 int16 _r65tmp_scrollx = 0;
108 int16 _r65tmp_scrolly = 0;
109 int16 _r65tmp_ch_x = 0;
110 int16 _r65tmp_ch_y = 0;
111 int16 _r65tmp_ho_x = 0;
112 int16 _r65tmp_ho_y = 0;
113 int16 _r68HohesC = 0;
116 const uint8 *_chewy_ph_nr;
117 const uint8 *_chewy_ph;
118 byte *_pal =
nullptr;
119 int16 _scr_width = 0;
120 BlendMode _fx_blend = BLEND_NONE;
121 void (*_SetUpScreenFunc)() =
nullptr;
123 int16 _FrameSpeed = 0;
124 int16 _FrameSpeedTmp = 0;
126 byte **_ablage =
nullptr;
127 byte *_workpage =
nullptr;
128 byte *_workptr =
nullptr;
129 byte *_spblende =
nullptr;
130 char **_dialogCloseupItemPtr =
nullptr;
132 int16 _ads_dia_nr = 0;
133 int16 _ads_item_nr = 0;
134 int16 _ads_blk_nr = 0;
137 int16 _ads_tmp_dsp = 0;
138 int8 _menu_display = 0;
139 int16 _menu_lauflicht = 0;
140 int16 _menu_item = 0;
141 int16 _menu_item_vorwahl = 0;
142 int16 _maus_old_x = 0;
143 int16 _maus_old_y = 0;
144 int16 _inventoryNr = 0;
145 int16 _invent_cur_mode = 0;
146 byte *_inv_spr[MAX_MOV_OBJ] = {
nullptr };
147 int16 _person_tmp_hide[MAX_PERSON] = { 0 };
148 int16 _person_tmp_room[MAX_PERSON] = { 0 };
150 int16 _talk_start_ani = -1;
151 int16 _talk_hide_static = -1;
152 bool _savegameFlag =
false;
153 int _timer_action_ctr = 0;
155 AutoMov _auto_mov[MAX_AUTO_MOV];
156 int16 _HowardMov = 0;
160 int16 _spz_spr_nr[MAX_SPZ_PHASEN] = { 0 };
161 int16 _spz_start = 0;
162 int16 _spz_akt_id = 0;
165 int16 _spz_delay[MAX_PERSON] = { 0 };
166 int16 _spz_count = 0;
167 int16 _spz_ani[MAX_PERSON] = { 0 };
169 int16 _AkChewyTaf = 0;
170 int16 _PersonAni[MAX_PERSON] = { 0 };
171 TafSeqInfo *_PersonTaf[MAX_PERSON] = {
nullptr };
172 uint8 _PersonSpr[MAX_PERSON][8] = {{ 0 }};
181 Text *_txt =
nullptr;
182 Room *_room =
nullptr;
184 Timer *_uhr =
nullptr;
190 ObjMov _moveState[MAX_PERSON];
191 SprInfo _spr_info[MAX_PROG_ANI];
192 MovInfo _spieler_mi[MAX_PERSON];
193 ObjMov _auto_mov_vector[MAX_OBJ_MOV];
194 MovInfo _auto_mov_obj[MAX_OBJ_MOV];
196 MovLine _mov_line[MAX_OBJ_MOV][5];
198 int16 _person_end_phase[MAX_PERSON] = { 0 };
199 int16 _ani_stand_count[MAX_PERSON] = { 0 };
200 bool _ani_stand_flag[MAX_PERSON] = {
false };
204 Flags _flags = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0 };
206 byte *_tempArea =
nullptr;
208 bool _disableScreen =
false;
210 int16 _r45_pinfo[R45_MAX_PERSON][4] = {
211 { 0, 4, 1490, 1500 },
223 bool _inv_disp_ok = 0;
224 int16 _txt_aus_click = 0;
225 int16 _txt_nummer = 0;
226 int16 _tmp_menu_item = 0;
227 int16 _cur_ausgang_flag = 0;
228 int16 _room_start_nr = 0;
229 int16 _TmpFrameSpeed = 0;
236 int16 _scroll_delay = 0;
239 int _spriteWidth = 0;
242 int16 _gcurx = 0, _gcury = 0;
247 int16 _show_invent_menu = 0;
251 ZObjSort _z_obj_sort[MAX_ZOBJ];
252 char _new_vector =
false;
255 bool _timer_int =
false;
256 int _timer_count = 0;
257 bool _timer_suspend =
false;
262 { 10, 150, 32, 175 },
263 { 36, 64, 310, 188 },
269 { 36, 64, 310, 128 },
270 { 16, 143, 76, 193 },
271 { 78, 143, 130, 193 },
272 { 132, 143, 178, 193 },
273 { 180, 143, 228, 193 },
274 { 232, 143, 310, 193 },
281 { 213, 25, 243, 39 },
282 { 253, 25, 283, 39 },
283 { 21, 45, 283, 135 },
284 { 257, 151, 307, 165 },
285 { 257, 171, 307, 185 },
290 { 112, 61, 130, 76 },
291 { 82, 104, 144, 139 },
292 { 164, 93, 194, 115 },
293 { 198, 80, 206, 115 },
294 { 210, 55, 302, 138 },
295 { 126, 146, 210, 198 },
304 #define _G(FIELD) g_globals->_##FIELD 306 void cursorChoice(int16 nr);
312 void alloc_buffers();
314 bool mainLoop(int16 mode);
316 void setupScreen(SetupScreenMode mode);
318 void kb_mov(int16 mode);
320 void kb_cur_action(int16 key, int16 mode);
323 void evaluateObj(int16 objectId, int16 txt_nr);
325 void swap_if_l(int16 *x1, int16 *x2);
327 void printShadowed(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 shadowFgCol,
328 int16 scrWidth,
const char *txtPtr);
330 bool autoMove(int16 movNr, int16 playerNum);
331 void get_user_key(int16 mode);
332 void clear_prog_ani();
334 void set_ani_screen();
336 void delInventory(int16 nr);
338 bool isCurInventory(int16 nr);
340 void setShadowPalette(int16 palIdx,
bool setPartialPalette);
342 void get_scroll_off(int16 x, int16 y, int16 pic_x, int16 pic_y,
343 int16 *sc_x, int16 *sc_y);
345 void calc_scroll(int16 x, int16 y, int16 pic_x, int16 pic_y,
346 int16 *sc_x, int16 *sc_y);
348 void auto_scroll(int16 scrx, int16 scry);
350 int16 calc_mouse_mov_obj(int16 *auto_nr);
352 void check_mouse_ausgang(int16 x, int16 y);
354 void calcExit(int16 x, int16 y);
356 void goAutoXy(int16 x, int16 y, int16 personNum, int16 mode);
360 void disable_timer();
364 int16 is_mouse_person(int16 x, int16 y);
366 void calc_mouse_person(int16 x, int16 y);
372 void save_person_rnr();
374 void set_person_rnr();
376 bool is_chewy_busy();
378 void standard_init();
388 void register_cutscene(
int cutsceneNum);
393 void buildMenu(int16 x, int16 y, int16 xNr, int16 yNr, int16 col, int16 mode);
395 void autoMenu(int16 *x, int16 *y, int16 lineNr, int16 zeilen_hoehe,
396 char *txt, int16 mode);
398 void cur_2_inventory();
400 void inventory_2_cur(int16 nr);
402 void new_invent_2_cur(int16 inv_nr);
404 void invent_2_slot(int16 nr);
406 int16 del_invent_slot(int16 nr);
408 void remove_inventory(int16 nr);
410 void getDisplayCoord(int16 *x, int16 *y, int16 nr);
411 void calcTxtXy(int16 *x, int16 *y,
char *txtAdr, int16 txtNr);
413 void handleDialogCloseupMenu();
415 void stopDialogCloseupDialog();
417 void play_scene_ani(int16 nr, int16 direction);
419 void timer_action(int16 t_nr);
421 void check_ged_action(int16 index);
423 void enter_room(int16 eib_nr);
425 void exit_room(int16 eib_nr);
427 void flic_cut(int16 nr);
429 int16 sib_event_no_inv(int16 sib_nr);
431 void sib_event_inv(int16 sib_nr);
433 uint16 exit_flip_flop(int16 ani_nr, int16 eib_nr1, int16 eib_nr2,
434 int16 ats_nr1, int16 ats_nr2, int16 sib_nr,
435 int16 spr_nr1, int16 spr_nr2, int16 flag);
437 void loadDialogCloseup(int16 diaNr);
441 int16 atsAction(int16 txtNr, int16 txtMode, int16 MODE);
443 void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr);
445 void endDialogCloseup(int16 diaNr, int16 blkNr, int16 strEndNr);
447 void atdsStringStart(int16 diaNr, int16 strNr, int16 personNr,
449 void useItemWithInvItem(int16 itemId);
450 bool calc_inv_no_use(int16 test_nr, int16 mode);
451 int16 calc_person_txt(int16 p_nr);
452 int16 calc_person_click(int16 p_nr);
453 void calc_person_dia(int16 p_nr);
458 void startAniBlock(int16 nr,
const AniBlock *ab);
460 void startSetAILWait(int16 aniNr, int16 rep, int16 mode);
462 void startDetailFrame(int16 aniNr, int16 rep, int16 mode,
465 void waitDetail(int16 detNr);
467 void waitShowScreen(int16 frames);
471 void calc_zoom(int16 y, int16 zoomFactorX, int16 zoomFactorY,
474 bool startAtsWait(int16 txtNr, int16 txtMode, int16 col, int16 mode);
475 void startAadWait(int16 diaNr);
477 void start_aad(int16 diaNr);
478 void aadWait(int16 strNr);
479 void startDialogCloseupWait(int16 diaNr);
480 void start_aad(int16 diaNr, int16 ssiNr,
bool continueWhenSpeechEnds =
false);
481 void wait_auto_obj(int16 nr);
483 void stop_auto_obj(int16 nr);
485 void continue_auto_obj(int16 nr, int16 repeat);
487 void new_auto_line(int16 nr);
488 void init_auto_obj(int16 auto_nr,
const int16 *phasen, int16 lines,
491 int16 mouse_auto_obj(int16 nr, int16 xoff, int16 yoff);
493 int16 auto_obj_status(int16 nr);
495 int16 mouse_on_prog_ani();
497 void set_spz_delay(int16 delay);
499 void start_spz_wait(int16 ani_id, int16 count,
bool reverse, int16 p_nr);
501 bool start_spz(int16 ani_id, int16 count,
bool reverse, int16 p_nr);
505 void calc_person_spz_ani(
ObjMov *om);
507 void setPersonPos(int16 x, int16 y, int16 personNr, int16 direction);
509 void setPersonSpr(int16 nr, int16 personNr);
511 void stopPerson(int16 personNr);
515 void calc_person_end_ani(
ObjMov *om, int16 p_nr);
519 void get_lr_phase(
ObjMov *om, int16 obj_mode);
521 void load_person_ani(int16 ani_id, int16 p_nr);
523 void calc_person_ani();
Definition: movclass.h:107
Definition: movclass.h:71
Definition: ngstypes.h:29
Definition: movclass.h:53
Definition: ngstypes.h:42
Definition: atari-cursor.h:38
Definition: mcga_graphics.h:29
Definition: movclass.h:38
Definition: ngstypes.h:36
Definition: barriers.h:27
const void * getPixels() const
Definition: surface.h:108