From d9c6188922fffb2fa8b311b5965c9adbeb8f9476 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Feb 2022 17:32:26 -0800 Subject: [PATCH] CHEWY: Move spz globals to Globals --- engines/chewy/dialogs/main_menu.cpp | 10 ++-- engines/chewy/global.cpp | 20 ------- engines/chewy/global.h | 37 ++++++------ engines/chewy/inits.cpp | 14 ++--- engines/chewy/main.cpp | 14 ++--- engines/chewy/r_event.cpp | 10 ++-- engines/chewy/room.cpp | 4 +- engines/chewy/rooms/room45.cpp | 6 +- engines/chewy/rooms/room46.cpp | 2 +- engines/chewy/rooms/room50.cpp | 4 +- engines/chewy/rooms/room51.cpp | 4 +- engines/chewy/rooms/room85.cpp | 2 +- engines/chewy/rooms/room87.cpp | 4 +- engines/chewy/rooms/room90.cpp | 12 ++-- engines/chewy/rooms/room95.cpp | 2 +- engines/chewy/rooms/room96.cpp | 2 +- engines/chewy/rooms/room97.cpp | 8 +-- engines/chewy/sprite.cpp | 92 ++++++++++++++--------------- 18 files changed, 114 insertions(+), 133 deletions(-) diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp index b97bc46311e..f07df3a25fe 100644 --- a/engines/chewy/dialogs/main_menu.cpp +++ b/engines/chewy/dialogs/main_menu.cpp @@ -145,7 +145,7 @@ void MainMenu::animate() { if (ani_timer->TimeFlag) { uhr->reset_timer(0, 0); _G(spieler).DelaySpeed = _G(FrameSpeed) / _G(spieler).FramesPerSecond; - spieler_vector->Delay = _G(spieler).DelaySpeed + spz_delay[0]; + spieler_vector->Delay = _G(spieler).DelaySpeed + _G(spz_delay)[0]; _G(FrameSpeed) = 0; det->set_global_delay(_G(spieler).DelaySpeed); } @@ -279,11 +279,11 @@ void MainMenu::playGame() { void MainMenu::savePersonAni() { for (int i = 0; i < MAX_PERSON; ++i) { - _personAni[i] = PersonAni[i]; - PersonAni[i] = -1; + _personAni[i] = _G(PersonAni)[i]; + _G(PersonAni)[i] = -1; - delete PersonTaf[i]; - PersonTaf[i] = nullptr; + delete _G(PersonTaf)[i]; + _G(PersonTaf)[i] = nullptr; } } diff --git a/engines/chewy/global.cpp b/engines/chewy/global.cpp index e04b7efb67e..39f7469aa63 100644 --- a/engines/chewy/global.cpp +++ b/engines/chewy/global.cpp @@ -114,25 +114,5 @@ Atdsys *atds; Flic *flc; MovClass *mov; -AutoMov auto_mov[MAX_AUTO_MOV]; - -int16 HowardMov; - -taf_seq_info *spz_tinfo; -int16 SpzDelay; -int16 spz_spr_nr[MAX_SPZ_PHASEN]; -int16 spz_start; -int16 spz_akt_id; - -int16 spz_p_nr; -int16 spz_delay[MAX_PERSON]; -int16 spz_count; -int16 spz_ani[MAX_PERSON]; - -int16 AkChewyTaf; - -int16 PersonAni[MAX_PERSON]; -taf_seq_info *PersonTaf[MAX_PERSON]; -uint8 PersonSpr[MAX_PERSON][8]; } // namespace Chewy diff --git a/engines/chewy/global.h b/engines/chewy/global.h index 47051883290..1b57082575d 100644 --- a/engines/chewy/global.h +++ b/engines/chewy/global.h @@ -188,6 +188,25 @@ public: int16 _EndOfPool = 0; int _timer_action_ctr = 0; + AutoMov _auto_mov[MAX_AUTO_MOV]; + int16 _HowardMov = 0; + + taf_seq_info *_spz_tinfo = nullptr; + int16 _SpzDelay = 0; + int16 _spz_spr_nr[MAX_SPZ_PHASEN] = { 0 }; + int16 _spz_start = 0; + int16 _spz_akt_id = 0; + + int16 _spz_p_nr = 0; + int16 _spz_delay[MAX_PERSON] = { 0 }; + int16 _spz_count = 0; + int16 _spz_ani[MAX_PERSON] = { 0 }; + + int16 _AkChewyTaf = 0; + int16 _PersonAni[MAX_PERSON] = { 0 }; + taf_seq_info *_PersonTaf[MAX_PERSON] = { nullptr }; + uint8 _PersonSpr[MAX_PERSON][8] = { 0 }; + // main.cpp int16 _menu_flag = 0; bool _inv_disp_ok = 0; @@ -299,24 +318,6 @@ extern Atdsys *atds; extern Flic *flc; extern MovClass *mov; -extern AutoMov auto_mov[MAX_AUTO_MOV]; -extern int16 HowardMov; -extern int16 AkChewyTaf; - -extern int16 PersonAni[MAX_PERSON]; -extern taf_seq_info *PersonTaf[MAX_PERSON]; -extern uint8 PersonSpr[MAX_PERSON][8]; - -extern int16 SpzDelay; -extern taf_seq_info *spz_tinfo; -extern int16 spz_spr_nr[MAX_SPZ_PHASEN]; -extern int16 spz_start; -extern int16 spz_akt_id; - -extern int16 spz_count; -extern int16 spz_delay[MAX_PERSON]; -extern int16 spz_p_nr; -extern int16 spz_ani[MAX_PERSON]; void cursor_wahl(int16 nr); diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp index 69e4ddc2f78..5192bf2ab88 100644 --- a/engines/chewy/inits.cpp +++ b/engines/chewy/inits.cpp @@ -151,12 +151,12 @@ void var_init() { spieler_mi[P_NICHELLE].Mode = true; for (int16 i = 0; i < MAX_PERSON; i++) { - PersonAni[i] = -1; - PersonTaf[i] = 0; + _G(PersonAni)[i] = -1; + _G(PersonTaf)[i] = 0; spieler_mi[i].Mode = false; ani_stand_flag[i] = false; - spz_delay[i] = 0; + _G(spz_delay)[i] = 0; _G(spieler).PersonRoomNr[i] = -1; _G(spieler).PersonDia[i] = -1; } @@ -275,7 +275,7 @@ void new_game() { for (int16 i = 0; i < obj->spieler_invnr[0]; i++) _G(spieler).InventSlot[i] = obj->spieler_invnr[i + 1]; - AkChewyTaf = 0; + _G(AkChewyTaf) = 0; load_chewy_taf(CHEWY_NORMAL); } @@ -304,11 +304,11 @@ static void font_load() { } void init_load() { - AkChewyTaf = 0; + _G(AkChewyTaf) = 0; load_chewy_taf(CHEWY_NORMAL); - spz_akt_id = -1; - spz_tinfo = nullptr; + _G(spz_akt_id) = -1; + _G(spz_tinfo) = nullptr; set_spz_delay(3); menutaf = _G(mem)->taf_adr(MENUTAF); diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp index e1171c0a0a4..17361786b71 100644 --- a/engines/chewy/main.cpp +++ b/engines/chewy/main.cpp @@ -81,8 +81,8 @@ void alloc_buffers() { void free_buffers() { det->del_dptr(); for (int16 i = 0; i < MAX_PERSON; i++) - free((char *)PersonTaf[i]); - free((char *)spz_tinfo); + free((char *)_G(PersonTaf)[i]); + free((char *)_G(spz_tinfo)); free(_G(font6x8)); free(_G(font8x8)); free(_G(spblende)); @@ -533,7 +533,7 @@ void set_up_screen(SetupScreenMode mode) { if (ani_timer[0].TimeFlag) { uhr->reset_timer(0, 0); _G(spieler).DelaySpeed = _G(FrameSpeed) / _G(spieler).FramesPerSecond; - spieler_vector[P_CHEWY].Delay = _G(spieler).DelaySpeed + spz_delay[P_CHEWY]; + spieler_vector[P_CHEWY].Delay = _G(spieler).DelaySpeed + _G(spz_delay)[P_CHEWY]; _G(FrameSpeed) = 0; det->set_global_delay(_G(spieler).DelaySpeed); } @@ -1523,7 +1523,7 @@ int16 is_mouse_person(int16 x, int16 y) { check = false; else { check = true;; - if (!spz_ani[i]) { + if (!_G(spz_ani)[i]) { switch (i) { case P_CHEWY: xy = (int16 @@ -1535,12 +1535,12 @@ int16 is_mouse_person(int16 x, int16 y) { if (_G(spieler).PersonRoomNr[i] != _G(spieler).PersonRoomNr[P_CHEWY]) check = false; - xy = (int16 *)PersonTaf[i]->image[PersonSpr[i][spieler_vector[i].PhNr]]; + xy = (int16 *)_G(PersonTaf)[i]->image[_G(PersonSpr)[i][spieler_vector[i].PhNr]]; break; } } else - xy = (int16 *)spz_tinfo->image[spz_spr_nr[spieler_vector[i].PhNr]]; + xy = (int16 *)_G(spz_tinfo)->image[_G(spz_spr_nr)[spieler_vector[i].PhNr]]; if (check) { if (x + _G(spieler).scrollx >= spieler_vector[i].Xypos[0] && x + _G(spieler).scrollx <= spieler_vector[i].Xypos[0] + xy[0] + spieler_vector[i].Xzoom && @@ -2032,7 +2032,7 @@ int16 is_chewy_busy() { if (!mov->auto_go_status()) { if (!spieler_vector[P_CHEWY].Count) { if (!flags.ExitMov) { - if (!spz_ani[P_CHEWY]) { + if (!_G(spz_ani)[P_CHEWY]) { ret = false; } } diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp index 9566a19a5c4..84d5d66f0ac 100644 --- a/engines/chewy/r_event.cpp +++ b/engines/chewy/r_event.cpp @@ -153,7 +153,7 @@ void check_ged_action(int16 index) { case 45: case 46: if (!index && flags.ExitMov) - HowardMov = 1; + _G(HowardMov) = 1; break; GED_ACTION(49); @@ -328,7 +328,7 @@ void enter_room(int16 eib_nr) { uhr->reset_timer(0, 0); flags.AutoAniPlay = false; _G(SetUpScreenFunc) = nullptr; - HowardMov = 0; + _G(HowardMov) = 0; _G(cur_hide_flag) = false; #define ENTRY(NUM) case NUM: Room##NUM::entry(); break @@ -672,20 +672,20 @@ void exit_room(int16 eib_nr) { case 84: x = spieler_vector[P_CHEWY].Xypos[0] - 70; y = spieler_vector[P_CHEWY].Xypos[1] - 50; - HowardMov = 1; + _G(HowardMov) = 1; break; case 85: x = spieler_vector[P_CHEWY].Xypos[0] + 70; y = spieler_vector[P_CHEWY].Xypos[1]; - HowardMov = 1; + _G(HowardMov) = 1; break; case 86: det->show_static_spr(0); x = spieler_vector[P_CHEWY].Xypos[0] - 44; y = spieler_vector[P_CHEWY].Xypos[1]; - HowardMov = 2; + _G(HowardMov) = 2; break; case 90: diff --git a/engines/chewy/room.cpp b/engines/chewy/room.cpp index a4d1e5743e3..f860e1c60ee 100644 --- a/engines/chewy/room.cpp +++ b/engines/chewy/room.cpp @@ -501,7 +501,7 @@ void Room::set_ablage_info(int16 ablagenr, int16 bildnr, uint32 pic_size) { } void load_chewy_taf(int16 taf_nr) { - if (AkChewyTaf != taf_nr) { + if (_G(AkChewyTaf) != taf_nr) { if (chewy) { free((char *)chewy); chewy = nullptr; @@ -560,7 +560,7 @@ void load_chewy_taf(int16 taf_nr) { } if (fname_ != NULL) { _G(spieler).ChewyAni = taf_nr; - AkChewyTaf = taf_nr; + _G(AkChewyTaf) = taf_nr; chewy = _G(mem)->taf_adr(fname_); chewy_kor = chewy->korrektur; } diff --git a/engines/chewy/rooms/room45.cpp b/engines/chewy/rooms/room45.cpp index 9ccbb3093ad..ed6eea98ffd 100644 --- a/engines/chewy/rooms/room45.cpp +++ b/engines/chewy/rooms/room45.cpp @@ -141,7 +141,7 @@ void Room45::setup_func() { --_G(r45_delay); } - if (_G(spieler).PersonRoomNr[P_HOWARD] == 45 && HowardMov != 2) { + if (_G(spieler).PersonRoomNr[P_HOWARD] == 45 && _G(HowardMov) != 2) { calc_person_look(); const int16 ch_x = spieler_vector[P_CHEWY].Xypos[0]; @@ -155,7 +155,7 @@ void Room45::setup_func() { y = 130; - if (HowardMov && flags.ExitMov) { + if (_G(HowardMov) && flags.ExitMov) { x = 56; y = 122; } @@ -209,7 +209,7 @@ void Room45::talk_taxi(int16 aad_nr) { } void Room45::taxi_mov() { - HowardMov = 2; + _G(HowardMov) = 2; room->set_timer_status(12, TIMER_STOP); det->del_static_ani(12); g_engine->_sound->playSound(15, 1); diff --git a/engines/chewy/rooms/room46.cpp b/engines/chewy/rooms/room46.cpp index db5757c4ec8..41789706550 100644 --- a/engines/chewy/rooms/room46.cpp +++ b/engines/chewy/rooms/room46.cpp @@ -88,7 +88,7 @@ void Room46::setup_func() { x = 120; } - if (HowardMov && flags.ExitMov) { + if (_G(HowardMov) && flags.ExitMov) { x = 160; y = 200; } diff --git a/engines/chewy/rooms/room50.cpp b/engines/chewy/rooms/room50.cpp index c7738d06bf4..fd855c8d6d3 100644 --- a/engines/chewy/rooms/room50.cpp +++ b/engines/chewy/rooms/room50.cpp @@ -268,9 +268,9 @@ void Room50::setup_func() { y = 115; } - if (HowardMov && flags.ExitMov) { + if (_G(HowardMov) && flags.ExitMov) { _G(SetUpScreenFunc) = nullptr; - HowardMov = 0; + _G(HowardMov) = 0; auto_move(4, P_HOWARD); } else { go_auto_xy(x, y, P_HOWARD, ANI_GO); diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp index 999e01ecbcb..e9315500dab 100644 --- a/engines/chewy/rooms/room51.cpp +++ b/engines/chewy/rooms/room51.cpp @@ -195,9 +195,9 @@ void Room51::setup_func() { y = 118; } - if (HowardMov && flags.ExitMov) { + if (_G(HowardMov) && flags.ExitMov) { _G(SetUpScreenFunc) = nullptr; - HowardMov = 0; + _G(HowardMov) = 0; auto_move(9, P_HOWARD); } else { go_auto_xy(x, y, P_HOWARD, ANI_GO); diff --git a/engines/chewy/rooms/room85.cpp b/engines/chewy/rooms/room85.cpp index 77374c7736f..618c64edece 100644 --- a/engines/chewy/rooms/room85.cpp +++ b/engines/chewy/rooms/room85.cpp @@ -142,7 +142,7 @@ void Room85::setup_func() { nicDestX = 128; } - if (HowardMov == 1) { + if (_G(HowardMov) == 1) { howDestX = 98; nicDestX = 128; } diff --git a/engines/chewy/rooms/room87.cpp b/engines/chewy/rooms/room87.cpp index 601ed98bbe0..4d7dda53bdc 100644 --- a/engines/chewy/rooms/room87.cpp +++ b/engines/chewy/rooms/room87.cpp @@ -72,7 +72,7 @@ void Room87::setup_func() { nicDestY = 110; } - if (HowardMov == 1) { + if (_G(HowardMov) == 1) { howDestX = 11; howDestY = 70; nicDestX = -3; @@ -90,7 +90,7 @@ void Room87::xit(int16 eib_nr) { spieler_mi[P_CHEWY].Mode = true; _G(zoom_horizont) = 0; room->set_zoom(25); - HowardMov = 1; + _G(HowardMov) = 1; flags.ZoomMov = true; _G(zoom_mov_fak) = 2; go_auto_xy(20, 56, P_CHEWY, ANI_WAIT); diff --git a/engines/chewy/rooms/room90.cpp b/engines/chewy/rooms/room90.cpp index fd643a008d5..ec3d47a2f34 100644 --- a/engines/chewy/rooms/room90.cpp +++ b/engines/chewy/rooms/room90.cpp @@ -62,7 +62,7 @@ void Room90::entry(int16 eib_nr) { } hide_cur(); - HowardMov = 1; + _G(HowardMov) = 1; if (_G(spieler).flags34_40 && !_G(spieler).flags33_40) { det->set_detail_pos(12, 329, 15); @@ -100,7 +100,7 @@ void Room90::entry(int16 eib_nr) { start_aad_wait(520, -1); } - HowardMov = 0; + _G(HowardMov) = 0; show_cur(); } @@ -158,7 +158,7 @@ void Room90::setup_func() { } } - if (_G(spieler).PersonRoomNr[P_HOWARD] != 90 || HowardMov == 1) + if (_G(spieler).PersonRoomNr[P_HOWARD] != 90 || _G(HowardMov) == 1) return; calc_person_look(); @@ -174,7 +174,7 @@ void Room90::setup_func() { else destX = 18; - if (HowardMov == 2) + if (_G(HowardMov) == 2) destX = 18; go_auto_xy(destX, 132, P_HOWARD, ANI_GO); @@ -285,7 +285,7 @@ int Room90::shootControlUnit() { hide_cur(); del_inventar(_G(spieler).AkInvent); - HowardMov = 2; + _G(HowardMov) = 2; flags.ZoomMov = false; auto_move(5, P_CHEWY); spieler_mi[P_CHEWY].Mode = true; @@ -306,7 +306,7 @@ int Room90::shootControlUnit() { _G(fx_blend) = BLEND3; spieler_mi[P_CHEWY].Mode = false; flags.NoScroll = false; - HowardMov = 0; + _G(HowardMov) = 0; _G(spieler).flags33_40 = true; det->stop_detail(12); atds->set_steuer_bit(519, ATS_AKTIV_BIT, ATS_DATEI); diff --git a/engines/chewy/rooms/room95.cpp b/engines/chewy/rooms/room95.cpp index bc7b44e5119..8baed124dc1 100644 --- a/engines/chewy/rooms/room95.cpp +++ b/engines/chewy/rooms/room95.cpp @@ -79,7 +79,7 @@ void Room95::setup_func() { else destX = 536; - if (HowardMov == 1) { + if (_G(HowardMov) == 1) { destX = 473; destY = 83; } diff --git a/engines/chewy/rooms/room96.cpp b/engines/chewy/rooms/room96.cpp index 75e52821daf..4c177a28a49 100644 --- a/engines/chewy/rooms/room96.cpp +++ b/engines/chewy/rooms/room96.cpp @@ -65,7 +65,7 @@ void Room96::setup_func() { else destX = 93; - if (HowardMov == 1) { + if (_G(HowardMov) == 1) { destX = 49; destY = 60; } diff --git a/engines/chewy/rooms/room97.cpp b/engines/chewy/rooms/room97.cpp index 4fb7ce06bc9..ca398f9462a 100644 --- a/engines/chewy/rooms/room97.cpp +++ b/engines/chewy/rooms/room97.cpp @@ -231,7 +231,7 @@ void Room97::setup_func() { destY = 112; } - if (HowardMov != 1) + if (_G(HowardMov) != 1) go_auto_xy(destX, destY, P_HOWARD, ANI_GO); } @@ -298,7 +298,7 @@ void Room97::proc3() { go_auto_xy(588, 129, P_CHEWY, ANI_WAIT); } else { _G(spieler).flags36_1 = true; - HowardMov = 1; + _G(HowardMov) = 1; go_auto_xy(572, 139, P_CHEWY, ANI_WAIT); Sdi[6].z_ebene = 6; Sdi[24].z_ebene = 6; @@ -348,7 +348,7 @@ void Room97::proc4() { } det->show_static_spr(2); - HowardMov = 1; + _G(HowardMov) = 1; go_auto_xy(967, 111, P_CHEWY, ANI_WAIT); go_auto_xy(1008, 93, P_CHEWY, ANI_WAIT); @@ -370,7 +370,7 @@ void Room97::proc4() { spieler_mi[P_CHEWY].Mode = false; start_spz(CH_TALK5, 255, false, P_CHEWY); start_aad_wait(553, -1); - HowardMov = 0; + _G(HowardMov) = 0; show_cur(); } diff --git a/engines/chewy/sprite.cpp b/engines/chewy/sprite.cpp index ce49346c9a3..f7b5419b233 100644 --- a/engines/chewy/sprite.cpp +++ b/engines/chewy/sprite.cpp @@ -158,7 +158,7 @@ void sprite_engine() { case ZOBJ_CHEWY: if (!_G(spieler).PersonHide[P_CHEWY]) { - if (!spz_ani[P_CHEWY]) { + if (!_G(spz_ani)[P_CHEWY]) { spr_nr = _G(chewy_ph)[spieler_vector[P_CHEWY].Phase * 8 + spieler_vector[P_CHEWY].PhNr]; x = spieler_mi[P_CHEWY].XyzStart[0] + chewy_kor[spr_nr * 2] - _G(spieler).scrollx; y = spieler_mi[P_CHEWY].XyzStart[1] + chewy_kor[spr_nr * 2 + 1] - _G(spieler).scrolly; @@ -170,17 +170,17 @@ void sprite_engine() { spieler_vector[P_CHEWY].Yzoom, _G(scr_width)); } else { - spr_nr = spz_spr_nr[spieler_vector[P_CHEWY].PhNr]; - x = spieler_mi[P_CHEWY].XyzStart[0] + spz_tinfo->korrektur[spr_nr * 2] - + spr_nr = _G(spz_spr_nr)[spieler_vector[P_CHEWY].PhNr]; + x = spieler_mi[P_CHEWY].XyzStart[0] + _G(spz_tinfo)->korrektur[spr_nr * 2] - _G(spieler).scrollx; - y = spieler_mi[P_CHEWY].XyzStart[1] + spz_tinfo->korrektur[spr_nr * 2 + 1] - + y = spieler_mi[P_CHEWY].XyzStart[1] + _G(spz_tinfo)->korrektur[spr_nr * 2 + 1] - _G(spieler).scrolly; calc_zoom(spieler_mi[P_CHEWY].XyzStart[1], (int16)room->_roomInfo->ZoomFak, (int16)room->_roomInfo->ZoomFak, &spieler_vector[P_CHEWY]); - _G(out)->scale_set(spz_tinfo->image[spr_nr], x, y, + _G(out)->scale_set(_G(spz_tinfo)->image[spr_nr], x, y, spieler_vector[P_CHEWY].Xzoom, spieler_vector[P_CHEWY].Yzoom, _G(scr_width)); @@ -192,12 +192,12 @@ void sprite_engine() { case ZOBJ_NICHELLE: p_nr = _G(z_obj_sort)[min_zeiger].ObjArt - 6; if (!_G(spieler).PersonHide[p_nr]) { - if (!spz_ani[p_nr]) { - ts_info = PersonTaf[p_nr]; - spr_nr = PersonSpr[p_nr][spieler_vector[p_nr].PhNr]; + if (!_G(spz_ani)[p_nr]) { + ts_info = _G(PersonTaf)[p_nr]; + spr_nr = _G(PersonSpr)[p_nr][spieler_vector[p_nr].PhNr]; } else { - ts_info = spz_tinfo; - spr_nr = spz_spr_nr[spieler_vector[p_nr].PhNr]; + ts_info = _G(spz_tinfo); + spr_nr = _G(spz_spr_nr)[spieler_vector[p_nr].PhNr]; } x = spieler_mi[p_nr].XyzStart[0] + @@ -917,21 +917,21 @@ void mov_objekt(ObjMov *om, MovInfo *mi) { } else { switch (mi->Id) { case CHEWY_OBJ: - if (!spz_ani[P_CHEWY]) + if (!_G(spz_ani)[P_CHEWY]) calc_person_end_ani(om, P_CHEWY); else calc_person_spz_ani(om); break; case HOWARD_OBJ: - if (!spz_ani[P_HOWARD]) + if (!_G(spz_ani)[P_HOWARD]) calc_person_end_ani(om, P_HOWARD); else calc_person_spz_ani(om); break; case NICHELLE_OBJ: - if (!spz_ani[P_NICHELLE]) + if (!_G(spz_ani)[P_NICHELLE]) calc_person_end_ani(om, P_NICHELLE); else calc_person_spz_ani(om); @@ -1060,7 +1060,7 @@ void zoom_mov_anpass(ObjMov *om, MovInfo *mi) { void start_spz_wait(int16 ani_id, int16 count, bool reverse, int16 p_nr) { if (start_spz(ani_id, count, reverse, p_nr)) { - while (spz_count && !SHOULD_QUIT) + while (_G(spz_count) && !SHOULD_QUIT) set_up_screen(DO_SETUP); } } @@ -1073,8 +1073,8 @@ bool start_spz(int16 ani_id, int16 count, bool reverse, int16 p_nr) { bool ret = false; if (!flags.SpzAni) { flags.SpzAni = true; - spz_ani[p_nr] = true; - spz_p_nr = p_nr; + _G(spz_ani)[p_nr] = true; + _G(spz_p_nr) = p_nr; spr_start = SPZ_ANI_PH[ani_id][0]; spr_anz = SPZ_ANI_PH[ani_id][1]; if (person_end_phase[p_nr] == P_RIGHT) { @@ -1082,28 +1082,28 @@ bool start_spz(int16 ani_id, int16 count, bool reverse, int16 p_nr) { spr_start += CH_SPZ_OFFSET; } - if (ani_id != spz_akt_id) { - if (spz_tinfo) - free((char *)spz_tinfo); - spz_akt_id = ani_id; - spz_tinfo = _G(mem)->taf_seq_adr(spr_start, spr_anz); + if (ani_id != _G(spz_akt_id)) { + if (_G(spz_tinfo)) + free((char *)_G(spz_tinfo)); + _G(spz_akt_id) = ani_id; + _G(spz_tinfo) = _G(mem)->taf_seq_adr(spr_start, spr_anz); } for (i = 0; i < spr_anz; i++) { if (!reverse) - spz_spr_nr[i] = i; + _G(spz_spr_nr)[i] = i; else - spz_spr_nr[i] = spr_anz - i - 1; + _G(spz_spr_nr)[i] = spr_anz - i - 1; } - spz_start = spr_start; - spz_delay[p_nr] = SpzDelay; + _G(spz_start) = spr_start; + _G(spz_delay)[p_nr] = _G(SpzDelay); spieler_vector[p_nr].Count = 0; spieler_vector[p_nr].PhNr = 0; spieler_vector[p_nr].PhAnz = spr_anz; - spieler_vector[p_nr].Delay = _G(spieler).DelaySpeed + spz_delay[p_nr]; + spieler_vector[p_nr].Delay = _G(spieler).DelaySpeed + _G(spz_delay)[p_nr]; spieler_vector[p_nr].DelayCount = 0; - spz_count = count; + _G(spz_count) = count; flags.MausLinks = true; ret = true; } @@ -1114,12 +1114,12 @@ void calc_person_spz_ani(ObjMov *om) { if (om->PhNr < om->PhAnz - 1) ++om->PhNr; else { - --spz_count; - if (spz_count > 0) { + --_G(spz_count); + if (_G(spz_count) > 0) { om->PhNr = 0; - om->Delay = _G(spieler).DelaySpeed + spz_delay[spz_p_nr]; + om->Delay = _G(spieler).DelaySpeed + _G(spz_delay)[_G(spz_p_nr)]; } else { - if (spz_count != 255) + if (_G(spz_count) != 255) stop_spz(); } } @@ -1129,28 +1129,28 @@ void stop_spz() { if (flags.SpzAni) { flags.SpzAni = false; flags.MausLinks = false; - spz_ani[spz_p_nr] = false; - spieler_vector[spz_p_nr].Count = 0; - spieler_vector[spz_p_nr].PhNr = 0; - set_person_spr(person_end_phase[spz_p_nr], spz_p_nr); - spz_delay[spz_p_nr] = 0; + _G(spz_ani)[_G(spz_p_nr)] = false; + spieler_vector[_G(spz_p_nr)].Count = 0; + spieler_vector[_G(spz_p_nr)].PhNr = 0; + set_person_spr(person_end_phase[_G(spz_p_nr)], _G(spz_p_nr)); + _G(spz_delay)[_G(spz_p_nr)] = 0; } } void set_spz_delay(int16 delay) { - SpzDelay = delay; + _G(SpzDelay) = delay; } void load_person_ani(int16 ani_id, int16 p_nr) { int16 ani_start; short ani_anz; - if (PersonAni[p_nr] != ani_id) { + if (_G(PersonAni)[p_nr] != ani_id) { ani_start = SPZ_ANI_PH[ani_id][0]; ani_anz = SPZ_ANI_PH[ani_id][1]; - PersonAni[p_nr] = ani_id; - if (PersonTaf[p_nr]) - free((char *)PersonTaf[p_nr]); - PersonTaf[p_nr] = _G(mem)->taf_seq_adr(ani_start, ani_anz); + _G(PersonAni)[p_nr] = ani_id; + if (_G(PersonTaf)[p_nr]) + free((char *)_G(PersonTaf)[p_nr]); + _G(PersonTaf)[p_nr] = _G(mem)->taf_seq_adr(ani_start, ani_anz); spieler_vector[p_nr].PhNr = 0; spieler_vector[p_nr].PhAnz = ani_anz; } @@ -1173,17 +1173,17 @@ void calc_person_ani() { case P_HOWARD: case P_NICHELLE: - if (!spz_ani[p_nr]) { + if (!_G(spz_ani)[p_nr]) { for (i = 0; i < 8; i++) - PersonSpr[p_nr][i] = i; + _G(PersonSpr)[p_nr][i] = i; if (!spieler_vector[p_nr].Count && _G(auto_p_nr) != p_nr) { ani_nr = (int16)p_ani[p_nr - 1][4] + (person_end_phase[p_nr] * 4); spieler_vector[p_nr].PhAnz = 5; - PersonSpr[p_nr][3] = 1; - PersonSpr[p_nr][4] = 0; + _G(PersonSpr)[p_nr][3] = 1; + _G(PersonSpr)[p_nr][4] = 0; } else { switch (spieler_vector[p_nr].Phase) { case CH_LEFT_NO: