diff --git a/engines/chewy/dialogs/cinema.cpp b/engines/chewy/dialogs/cinema.cpp index b14605ad678..09ae2ca03b4 100644 --- a/engines/chewy/dialogs/cinema.cpp +++ b/engines/chewy/dialogs/cinema.cpp @@ -203,7 +203,7 @@ void Cinema::execute() { _G(room)->open_handle(EPISODE1, 0); _G(room)->set_ak_pal(&_G(room_blk)); hideCur(); - _G(uhr)->reset_timer(0, 5); + _G(uhr)->resetTimer(0, 5); } int16 Cinema::cut_serv(int16 frame) { diff --git a/engines/chewy/dialogs/credits.cpp b/engines/chewy/dialogs/credits.cpp index 9ce69b4c322..3080cb6cccf 100644 --- a/engines/chewy/dialogs/credits.cpp +++ b/engines/chewy/dialogs/credits.cpp @@ -266,7 +266,7 @@ void Credits::execute() { _G(room)->set_ak_pal(&_G(room_blk)); hideCur(); - _G(uhr)->reset_timer(0, 5); + _G(uhr)->resetTimer(0, 5); } } // namespace Dialogs diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp index f9f86619268..21820138703 100644 --- a/engines/chewy/dialogs/inventory.cpp +++ b/engines/chewy/dialogs/inventory.cpp @@ -526,7 +526,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) { int16 k = 0; for (int16 i = txt_start; i < txt_anz && i < txt_start + txt_zeilen; i++) { _G(out)->printxy(WIN_LOOK_X, WIN_LOOK_Y + yoff + k * 10, 14, 300, - _G(scr_width), _G(txt)->str_pos(txt_adr, i)); + _G(scr_width), _G(txt)->strPos(txt_adr, i)); ++k; } diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp index 5710aac2b07..433fb234bc9 100644 --- a/engines/chewy/dialogs/main_menu.cpp +++ b/engines/chewy/dialogs/main_menu.cpp @@ -141,8 +141,8 @@ void MainMenu::screenFunc() { } void MainMenu::animate() { - if (_G(ani_timer)->TimeFlag) { - _G(uhr)->reset_timer(0, 0); + if (_G(ani_timer)->_timeFlag) { + _G(uhr)->resetTimer(0, 0); _G(spieler).DelaySpeed = _G(FrameSpeed) / _G(spieler).FramesPerSecond; _G(spieler_vector)->Delay = _G(spieler).DelaySpeed + _G(spz_delay)[0]; _G(FrameSpeed) = 0; @@ -266,7 +266,7 @@ void MainMenu::playGame() { _G(flags).ShowAtsInvTxt = true; _G(cur)->show_cur(); _G(spieler_vector)[P_CHEWY].Count = 0; - _G(uhr)->reset_timer(0, 0); + _G(uhr)->resetTimer(0, 0); _G(sndPlayer)->setLoopMode(_G(spieler).soundLoopMode); while (!SHOULD_QUIT && !mainLoop(1)) { diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp index 42e464a784c..a21972959b7 100644 --- a/engines/chewy/inits.cpp +++ b/engines/chewy/inits.cpp @@ -100,7 +100,7 @@ void standard_init() { _G(pal)[767] = 63; _G(out)->einblenden(_G(pal), 0); _G(out)->cls(); - _G(uhr)->set_new_timer(0, 5, SEC_10_MODE); + _G(uhr)->setNewTimer(0, 5, SEC_10_MODE); _G(curblk).cur_back = _G(cur_back); sound_init(); diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp index 3b3c450622e..eb9f392232e 100644 --- a/engines/chewy/main.cpp +++ b/engines/chewy/main.cpp @@ -242,13 +242,13 @@ void showCur() { void menuEntry() { _G(det)->freezeAni(); - _G(uhr)->set_all_status(TIMER_FREEZE); + _G(uhr)->setAllStatus(TIMER_FREEZE); } void menuExit() { _G(det)->unfreeze_ani(); - _G(uhr)->set_all_status(TIMER_UNFREEZE); - _G(uhr)->reset_timer(0, 0); + _G(uhr)->setAllStatus(TIMER_UNFREEZE); + _G(uhr)->resetTimer(0, 0); _G(FrameSpeed) = 0; } @@ -497,10 +497,10 @@ void set_up_screen(SetupScreenMode mode) { if (isMainLoop) mode = DO_SETUP; - _G(uhr)->calc_timer(); + _G(uhr)->calcTimer(); - if (_G(ani_timer)[0].TimeFlag) { - _G(uhr)->reset_timer(0, 0); + if (_G(ani_timer)[0]._timeFlag) { + _G(uhr)->resetTimer(0, 0); _G(spieler).DelaySpeed = _G(FrameSpeed) / _G(spieler).FramesPerSecond; _G(spieler_vector)[P_CHEWY].Delay = _G(spieler).DelaySpeed + _G(spz_delay)[P_CHEWY]; _G(FrameSpeed) = 0; @@ -704,7 +704,7 @@ void mous_obj_action(int16 nr, int16 mode, int16 txt_mode, int16 txt_nr) { int16 y = _G(minfo).y; calc_txt_xy(&x, &y, str_adr, anz); for (int16 i = 0; i < anz; i++) - printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->str_pos(str_adr, i)); + printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos(str_adr, i)); } } } @@ -1441,7 +1441,7 @@ int16 calcMouseText(int16 x, int16 y, int16 mode) { _G(fontMgr)->setFont(_G(font8)); calc_txt_xy(&x, &y, str_, anz); for (int16 i = 0; i < anz; i++) - printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->str_pos((char *)str_, i)); + printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos((char *)str_, i)); } } } else { @@ -1618,7 +1618,7 @@ int16 calc_mouse_mov_obj(int16 *auto_nr) { void calc_ani_timer() { for (int16 i = _G(room)->_roomTimer.TimerStart; i < _G(room)->_roomTimer.TimerStart + _G(room)->_roomTimer.TimerAnz; i++) { - if (_G(ani_timer)[i].TimeFlag) + if (_G(ani_timer)[i]._timeFlag) timer_action(i); } } @@ -1869,12 +1869,12 @@ void auto_scroll(int16 scrx, int16 scry) { } void disable_timer() { - _G(uhr)->disable_timer(); + _G(uhr)->disableTimer(); _G(FrameSpeedTmp) = _G(FrameSpeed); } void enable_timer() { - _G(uhr)->enable_timer(); + _G(uhr)->enableTimer(); _G(FrameSpeed) = _G(FrameSpeedTmp); } diff --git a/engines/chewy/menus.cpp b/engines/chewy/menus.cpp index 130ba6c3973..674b3add13f 100644 --- a/engines/chewy/menus.cpp +++ b/engines/chewy/menus.cpp @@ -96,7 +96,7 @@ void maus_mov_menu() { void calc_txt_xy(int16 *x, int16 *y, char *txt_adr, int16 txt_anz) { int16 len = 0; for (int16 i = 0; i < txt_anz; i++) { - int16 tmp_len = strlen(_G(txt)->str_pos((char *)txt_adr, i)); + int16 tmp_len = strlen(_G(txt)->strPos((char *)txt_adr, i)); if (tmp_len > len) len = tmp_len; } @@ -209,7 +209,7 @@ void auto_menu(int16 *x, int16 *y, int16 zeilen_anz, int16 hoehe, char *text, in int16 x_pix = 0; for (int16 i = 0; i < zeilen_anz; i++) { - tmp = strlen(_G(txt)->str_pos(text, i)); + tmp = strlen(_G(txt)->strPos(text, i)); if (x_pix < tmp) x_pix = tmp; } diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp index 4c1dc20dbdb..232954bde58 100644 --- a/engines/chewy/r_event.cpp +++ b/engines/chewy/r_event.cpp @@ -126,7 +126,7 @@ void timer_action(int16 t_nr) { if (default_flag && _G(flags).AutoAniPlay == false) { _G(det)->start_detail(_G(room)->_roomTimer.ObjNr[ani_nr], 1, ANI_FRONT); - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); } _G(kbinfo).scan_code = Common::KEYCODE_INVALID; @@ -325,7 +325,7 @@ void enter_room(int16 eib_nr) { _G(spieler).ZoomXy[P_CHEWY][0] = (int16)_G(room)->_roomInfo->_zoomFactor; _G(spieler).ZoomXy[P_CHEWY][1] = (int16)_G(room)->_roomInfo->_zoomFactor; - _G(uhr)->reset_timer(0, 0); + _G(uhr)->resetTimer(0, 0); _G(flags).AutoAniPlay = false; _G(SetUpScreenFunc) = nullptr; _G(HowardMov) = 0; @@ -782,7 +782,7 @@ void print_rows(int16 id) { _G(out)->setPointer(nullptr); for (int i = 0; i < txt_anz; ++i) { - char *s = _G(txt)->str_pos(txtStr, i); + char *s = _G(txt)->strPos(txtStr, i); int16 len = (strlen(s) * _G(fontMgr)->getFont()->getDataWidth()) / 2; _G(out)->printxy(160 - len, 50 + i * 10, 14, 300, 0, s); @@ -1144,7 +1144,7 @@ void flic_cut(int16 nr) { if (_G(spieler).SpeechSwitch) _G(det)->enable_room_sound(); - _G(uhr)->reset_timer(0, 0); + _G(uhr)->resetTimer(0, 0); } if (!_G(flags).NoPalAfterFlc) diff --git a/engines/chewy/room.cpp b/engines/chewy/room.cpp index 62d681038df..5b53ca051ff 100644 --- a/engines/chewy/room.cpp +++ b/engines/chewy/room.cpp @@ -224,7 +224,7 @@ void Room::add_timer_new_room() { void Room::del_timer_old_room() { for (int i = 0; i < _roomTimer.TimerAnz; i++) { - _G(uhr)->set_status(_roomTimer.TimerNr[i], TIMER_STOP); + _G(uhr)->setStatus(_roomTimer.TimerNr[i], TIMER_STOP); } @@ -234,7 +234,7 @@ void Room::del_timer_old_room() { int16 Room::set_timer(int16 ani_nr, int16 timer_end) { int16 timer_nr_ = _roomTimer.TimerStart + _roomTimer.TimerAnz; - int16 ret = _G(uhr)->set_new_timer(timer_nr_, timer_end, SEC_MODE); + int16 ret = _G(uhr)->setNewTimer(timer_nr_, timer_end, SEC_MODE); if (ret != -1) { _roomTimer.ObjNr[_roomTimer.TimerAnz] = ani_nr; _roomTimer.TimerNr[_roomTimer.TimerAnz] = timer_nr_; @@ -247,7 +247,7 @@ int16 Room::set_timer(int16 ani_nr, int16 timer_end) { void Room::set_timer_status(int16 ani_nr, int16 status) { for (int i = 0; i < _roomTimer.TimerAnz; i++) { if (_roomTimer.ObjNr[i] == ani_nr) { - _G(uhr)->set_status(_roomTimer.TimerNr[i], status); + _G(uhr)->setStatus(_roomTimer.TimerNr[i], status); } } } diff --git a/engines/chewy/rooms/room00.cpp b/engines/chewy/rooms/room00.cpp index 8d147c1e1a7..38ed4e2418b 100644 --- a/engines/chewy/rooms/room00.cpp +++ b/engines/chewy/rooms/room00.cpp @@ -59,7 +59,7 @@ void Room0::entry() { hideCur(); _G(timer_nr)[0] = _G(room)->set_timer(255, 3); - while (!_G(ani_timer)[_G(timer_nr)[0]].TimeFlag && !SHOULD_QUIT) { + while (!_G(ani_timer)[_G(timer_nr)[0]]._timeFlag && !SHOULD_QUIT) { set_up_screen(DO_SETUP); } @@ -74,7 +74,7 @@ bool Room0::timer(int16 t_nr, int16 ani_nr) { bool retval = false; if (ani_nr == 1) { if (_G(timer_action_ctr) > 0) { - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); --_G(timer_action_ctr); } else if (!is_chewy_busy()) { if (!_G(spieler).R0FueterLab) @@ -113,7 +113,7 @@ bool Room0::timer(int16 t_nr, int16 ani_nr) { if (!_G(spieler).R0PillowThrow) feederAni(); - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); _G(flags).AutoAniPlay = false; } } else if (t_nr == 3) @@ -311,7 +311,7 @@ void Room0::calcEyeClick(int16 ani_nr) { int16 y = _G(minfo).y; calc_txt_xy(&x, &y, str_, anz); for (int16 i = 0; i < anz; i++) - printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->str_pos((char *)str_, i)); + printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos((char *)str_, i)); } } else if (_G(minfo).button == 1 || _G(kbinfo).key_code == Common::KEYCODE_RETURN) { if (is_cur_inventar(SLIME_INV)) { @@ -549,7 +549,7 @@ void Room0::calcPillowClick(int16 ani_nr) { int16 y = _G(minfo).y; calc_txt_xy(&x, &y, str_, anz); for (int16 i = 0; i < anz; i++) - printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->str_pos((char *)str_, i)); + printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos((char *)str_, i)); } } else if (_G(minfo).button == 1 || _G(kbinfo).key_code == Common::KEYCODE_RETURN) { if (is_cur_inventar(PILLOW_INV) && _G(spieler).R0SlimeUsed) { diff --git a/engines/chewy/rooms/room11.cpp b/engines/chewy/rooms/room11.cpp index e0f06e04544..440ad8dfec2 100644 --- a/engines/chewy/rooms/room11.cpp +++ b/engines/chewy/rooms/room11.cpp @@ -97,7 +97,7 @@ void Room11::bork_zwinkert() { _G(flags).AutoAniPlay = true; _G(det)->hideStaticSpr(8); start_ani_block(2, ABLOCK18); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(det)->showStaticSpr(8); _G(flags).AutoAniPlay = false; } diff --git a/engines/chewy/rooms/room12.cpp b/engines/chewy/rooms/room12.cpp index 97195ec4bf1..206579245dd 100644 --- a/engines/chewy/rooms/room12.cpp +++ b/engines/chewy/rooms/room12.cpp @@ -132,7 +132,7 @@ void Room12::init_bork() { if (_G(spieler).R12BorkCount < 3) { ++_G(spieler).R12BorkCount; - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); wait_show_screen(10); start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY); start_aad_wait(14, -1); @@ -145,7 +145,7 @@ void Room12::init_bork() { } } - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); } } @@ -224,7 +224,7 @@ int16 Room12::use_terminal() { } else { _G(spieler).R12TransOn = true; - _G(uhr)->reset_timer(_G(timer_nr)[1], 0); + _G(uhr)->resetTimer(_G(timer_nr)[1], 0); } } else { start_aad(114, 0); @@ -237,7 +237,7 @@ int16 Room12::use_terminal() { void Room12::use_linke_rohr() { _G(spieler).R12TalismanOk = false; _G(spieler).R12KetteLinks = true; - _G(uhr)->disable_timer(); + _G(uhr)->disableTimer(); _G(obj)->calc_rsi_flip_flop(SIB_L_ROEHRE_R12); _G(obj)->calc_rsi_flip_flop(SIB_ROEHRE_R12); _G(obj)->calc_all_static_detail(); @@ -270,7 +270,7 @@ int16 Room12::useTransformerTube() { if (_G(spieler).R12KetteLinks) { _G(spieler).R12KetteLinks = false; - _G(uhr)->enable_timer(); + _G(uhr)->enableTimer(); _G(atds)->set_ats_str(117, 1, AAD_DATEI); } else { autoMove(7, P_CHEWY); diff --git a/engines/chewy/rooms/room14.cpp b/engines/chewy/rooms/room14.cpp index 67c6d61aac0..9c34d907f31 100644 --- a/engines/chewy/rooms/room14.cpp +++ b/engines/chewy/rooms/room14.cpp @@ -62,7 +62,7 @@ void Room14::eremit_feuer(int16 t_nr, int16 ani_nr) { _G(flags).AutoAniPlay = true; _G(det)->hideStaticSpr(9); start_detail_wait(_G(room)->_roomTimer.ObjNr[ani_nr], 1, ANI_FRONT); - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); _G(det)->showStaticSpr(9); _G(det)->start_detail(7, 1, ANI_FRONT); _G(flags).AutoAniPlay = false; diff --git a/engines/chewy/rooms/room17.cpp b/engines/chewy/rooms/room17.cpp index 789f9071e89..bf73825686d 100644 --- a/engines/chewy/rooms/room17.cpp +++ b/engines/chewy/rooms/room17.cpp @@ -111,7 +111,7 @@ bool Room17::timer(int16 t_nr, int16 ani_nr) { if (_G(room)->_roomTimer.ObjNr[ani_nr] == 2 || _G(room)->_roomTimer.ObjNr[ani_nr] == 3) { if (_G(spieler).R17EnergieOut) - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); else return true; } diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp index 70e6eb851eb..5239be70b1b 100644 --- a/engines/chewy/rooms/room18.cpp +++ b/engines/chewy/rooms/room18.cpp @@ -131,7 +131,7 @@ bool Room18::timer(int16 t_nr, int16 ani_nr) { _G(det)->hideStaticSpr(16); start_detail_wait(10, 1, ANI_FRONT); _G(det)->showStaticSpr(16); - _G(uhr)->reset_timer(_G(timer_nr)[0], 10); + _G(uhr)->resetTimer(_G(timer_nr)[0], 10); } else if (t_nr == _G(timer_nr)[1]) { hideCur(); _G(det)->hideStaticSpr(17); @@ -152,7 +152,7 @@ bool Room18::timer(int16 t_nr, int16 ani_nr) { } showCur(); - _G(uhr)->reset_timer(_G(timer_nr)[1], 15); + _G(uhr)->resetTimer(_G(timer_nr)[1], 15); } _G(flags).AutoAniPlay = false; diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp index 87d524ab863..83943c2ab36 100644 --- a/engines/chewy/rooms/room21.cpp +++ b/engines/chewy/rooms/room21.cpp @@ -142,7 +142,7 @@ void Room21::init_spinne() { void Room21::restart_spinne2() { _G(mov_phasen)[SPINNE2_OBJ].Repeat = 1; init_auto_obj(SPINNE2_OBJ, &SPINNE_PHASEN[0][0], _G(mov_phasen)[SPINNE2_OBJ].Lines, (const MovLine *)SPINNE_MPKT1); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(e_streifen) = false; } diff --git a/engines/chewy/rooms/room22.cpp b/engines/chewy/rooms/room22.cpp index 23591b6b6be..10e3e450ee8 100644 --- a/engines/chewy/rooms/room22.cpp +++ b/engines/chewy/rooms/room22.cpp @@ -131,7 +131,7 @@ void Room22::bork(int16 t_nr) { showCur(); } - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); _G(flags).AutoAniPlay = false; } } diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp index ee82f8a01f0..7d9dddca13c 100644 --- a/engines/chewy/rooms/room40.cpp +++ b/engines/chewy/rooms/room40.cpp @@ -114,12 +114,12 @@ void Room40::xit(int16 eib_nr) { _G(spieler).room_e_obj[72].Exit = 45; _G(obj)->hide_sib(SIB_MUENZE_R40); - _G(uhr)->disable_timer(); + _G(uhr)->disableTimer(); _G(out)->ausblenden(0); hide_person(); set_up_screen(DO_SETUP); _G(out)->einblenden(_G(pal), 0); - _G(uhr)->enable_timer(); + _G(uhr)->enableTimer(); _G(maus_links_click) = false; start_aad_wait(238, -1); @@ -243,7 +243,7 @@ void Room40::setup_func() { _G(spieler).R40PoliceStart = false; _G(spieler).R40PoliceAniStatus = POLICE_LEFT; _G(room)->set_timer_status(255, TIMER_STOP); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(det)->hideStaticSpr(15); _G(det)->start_detail(POLICE_LEFT, 1, ANI_FRONT); _G(atds)->set_steuer_bit(275, ATS_AKTIV_BIT, ATS_DATEI); @@ -270,7 +270,7 @@ void Room40::setup_func() { _G(det)->showStaticSpr(15); _G(spieler).R40PoliceAniStatus = 255; _G(room)->set_timer_status(255, TIMER_START); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(atds)->del_steuer_bit(275, ATS_AKTIV_BIT, ATS_DATEI); } break; @@ -404,7 +404,7 @@ int16 Room40::use_schalter(int16 aad_nr) { start_detail_wait(13, 1, ANI_FRONT); _G(det)->showStaticSpr(15); _G(room)->set_timer_status(255, TIMER_START); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); showCur(); } @@ -419,7 +419,7 @@ void Room40::talk_police() { autoMove(7, P_CHEWY); start_aad_wait(203, -1); _G(room)->set_timer_status(255, TIMER_START); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); showCur(); } } @@ -650,7 +650,7 @@ int16 Room40::use_tele() { _G(spieler).R40PoliceAb = false; _G(room)->set_timer_status(255, TIMER_START); - _G(uhr)->reset_timer(_G(timer_nr)[0], timer_wert); + _G(uhr)->resetTimer(_G(timer_nr)[0], timer_wert); } if (dia_nr1 != 223) diff --git a/engines/chewy/rooms/room48.cpp b/engines/chewy/rooms/room48.cpp index 8ad4060d654..e7e9924748e 100644 --- a/engines/chewy/rooms/room48.cpp +++ b/engines/chewy/rooms/room48.cpp @@ -79,7 +79,7 @@ void Room48::frage() { _G(det)->showStaticSpr(6); start_detail_wait(1, 1, ANI_BACK); _G(det)->hideStaticSpr(6); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); showCur(); _G(flags).AutoAniPlay = false; } diff --git a/engines/chewy/rooms/room49.cpp b/engines/chewy/rooms/room49.cpp index 2527577c1ec..586c5252e1c 100644 --- a/engines/chewy/rooms/room49.cpp +++ b/engines/chewy/rooms/room49.cpp @@ -109,14 +109,14 @@ void Room49::calc_boy_ani() { _G(det)->set_static_ani(_G(spieler).R49BoyAni ? 1 : 0, -1); _G(det)->start_detail(_G(spieler).R49BoyAni ? 1 : 0, 1, ANI_FRONT); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); } void Room49::calc_boy() { if (!_G(spieler).R49WegFrei) { hideCur(); _G(room)->set_timer_status(255, TIMER_STOP); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); stop_person(P_CHEWY); stop_person(P_HOWARD); _G(person_end_phase)[P_CHEWY] = P_LEFT; @@ -186,7 +186,7 @@ void Room49::use_boy_cigar() { register_cutscene(17); _G(room)->set_timer_status(255, TIMER_STOP); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(det)->del_static_ani(_G(spieler).R49BoyAni ? 1 : 0); _G(det)->stop_detail(_G(spieler).R49BoyAni ? 1 : 0); @@ -214,7 +214,7 @@ void Room49::talk_boy() { void Room49::talk_boy(int16 aad_nr) { if (!_G(spieler).R49BoyWeg) { _G(room)->set_timer_status(255, TIMER_STOP); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(det)->stop_detail(_G(spieler).R49BoyAni ? 1 : 0); _G(det)->set_static_ani(_G(spieler).R49BoyAni ? 1 : 0, -1); diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp index 6a0857bc9a3..1f91a3010be 100644 --- a/engines/chewy/rooms/room51.cpp +++ b/engines/chewy/rooms/room51.cpp @@ -359,7 +359,7 @@ void Room51::timer_action(int16 t_nr, int16 obj_nr) { } else if (!_G(det)->get_ani_status(obj_nr)) { _G(det)->start_detail(obj_nr, 1, ANI_GO); _G(det)->start_detail(obj_nr + 2, 1, ANI_FRONT); - _G(uhr)->reset_timer(t_nr, 0); + _G(uhr)->resetTimer(t_nr, 0); _enemyFlag[obj_nr - 9] = false; } } diff --git a/engines/chewy/rooms/room56.cpp b/engines/chewy/rooms/room56.cpp index 24f01ae6983..9852dfabf84 100644 --- a/engines/chewy/rooms/room56.cpp +++ b/engines/chewy/rooms/room56.cpp @@ -394,7 +394,7 @@ void Room56::setup_func() { if (_G(det)->get_ani_status(10) == false) { _G(r56koch_flug) = 0; - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); } break; diff --git a/engines/chewy/rooms/room68.cpp b/engines/chewy/rooms/room68.cpp index eea8c49b7cc..632ee16f45a 100644 --- a/engines/chewy/rooms/room68.cpp +++ b/engines/chewy/rooms/room68.cpp @@ -123,7 +123,7 @@ void Room68::setup_func() { _G(r68HohesC) = -1; _G(det)->stop_detail(18); _G(det)->showStaticSpr(3); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); } break; @@ -262,7 +262,7 @@ void Room68::calc_diva() { if (!_G(spieler).R68DivaWeg) { if (!_G(spieler).R68Papagei) { if (_G(r68HohesC) == -1) { - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(r68HohesC) = 0; _G(det)->hideStaticSpr(3); _G(det)->start_detail(_G(r68HohesC), 1, ANI_BACK); @@ -275,7 +275,7 @@ void Room68::calc_diva() { start_aad_wait(386, -1); start_spz_wait(CH_LGET_O, 1, false, P_CHEWY); new_invent_2_cur(BAR_GUT_INV); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); showCur(); } } @@ -307,7 +307,7 @@ int16 Room68::use_diva() { del_inventar(_G(spieler).AkInvent); action_flag = 1; autoMove(4, P_CHEWY); - _G(uhr)->reset_timer(_G(timer_nr)[0], 0); + _G(uhr)->resetTimer(_G(timer_nr)[0], 0); _G(det)->hideStaticSpr(3); start_detail_wait(4, 1, ANI_FRONT); _G(spieler).R68Gutschein = false; diff --git a/engines/chewy/text.cpp b/engines/chewy/text.cpp index df088d6fd6b..1c352acfed4 100644 --- a/engines/chewy/text.cpp +++ b/engines/chewy/text.cpp @@ -51,11 +51,11 @@ TextEntryList *Text::getDialog(uint dialogNum, uint entryNum) { TextEntry curDialog; ptr++; // current entry ptr += 2; - curDialog.speechId = READ_LE_UINT16(ptr) - VOICE_OFFSET; + curDialog._speechId = READ_LE_UINT16(ptr) - VOICE_OFFSET; ptr += 2; do { - curDialog.text += *ptr++; + curDialog._text += *ptr++; if (*ptr == 0 && *(ptr + 1) != kEndText) { // TODO: Split lines @@ -96,12 +96,12 @@ TextEntry *Text::getText(uint dialogNum, uint entryNum) { for (uint i = 0; i <= entryNum; i++) { ptr += 13; - d->speechId = READ_LE_UINT16(ptr) - VOICE_OFFSET; + d->_speechId = READ_LE_UINT16(ptr) - VOICE_OFFSET; ptr += 2; do { if (i == entryNum) - d->text += *ptr++; + d->_text += *ptr++; else ptr++; @@ -141,20 +141,16 @@ TextEntry *Text::getText(uint dialogNum, uint entryNum) { void Text::crypt(char *txt, uint32 size) { - uint8 *sp; - uint32 i; - sp = (uint8 *)txt; - for (i = 0; i < size; i++) { + uint8 *sp = (uint8 *)txt; + for (uint32 i = 0; i < size; i++) { *sp = -(*sp); ++sp; } } -char *Text::str_pos(char *txt_adr, int16 pos) { - char *ptr; - int16 i; - ptr = txt_adr; - for (i = 0; i < pos;) { +char *Text::strPos(char *txtAdr, int16 pos) { + char *ptr = txtAdr; + for (int16 i = 0; i < pos;) { if (*ptr == 0) ++i; ++ptr; diff --git a/engines/chewy/text.h b/engines/chewy/text.h index dba7d4f4cdd..f650fb9715f 100644 --- a/engines/chewy/text.h +++ b/engines/chewy/text.h @@ -59,8 +59,8 @@ enum TextEntryMarkers { #define VOICE_OFFSET 20 struct TextEntry { - int16 speechId; - Common::String text; + int16 _speechId; + Common::String _text; }; typedef Common::List TextEntryList; @@ -85,7 +85,7 @@ public: TextEntry *getText(uint dialogNum, uint entryNum); void crypt(char *txt, uint32 size); - char *str_pos(char *txt_adr, int16 pos); + char *strPos(char *txtAdr, int16 pos); }; } // namespace Chewy diff --git a/engines/chewy/timer.cpp b/engines/chewy/timer.cpp index fd2c6285acf..8808d7d2612 100644 --- a/engines/chewy/timer.cpp +++ b/engines/chewy/timer.cpp @@ -33,7 +33,7 @@ Timer::Timer(int16 max_t, TimerBlk *t) { _timerMax = max_t; _G(timer_int) = false; _G(timer_suspend) = false; - set_all_status(TIMER_STOP); + setAllStatus(TIMER_STOP); } Timer::~Timer() { @@ -48,97 +48,90 @@ float timer_freq[6] = { 65520.0f }; -void Timer::calc_timer() { - int16 i; - int16 count; - int ak_time; - float freq; - ak_time = _G(timer_count); - for (i = 0; i < _timerMax; i++) { - if (_timerBlk[i].TimeStatus != TIMER_STOP) { - freq = timer_freq[_timerBlk[i].TimeMode]; +void Timer::calcTimer() { + int ak_time = _G(timer_count); + for (int16 i = 0; i < _timerMax; i++) { + if (_timerBlk[i]._timeStatus != TIMER_STOP) { + float freq = timer_freq[_timerBlk[i]._timeMode]; - _timerBlk[i].TimeLast = ((float)ak_time - (float)_timerBlk[i].TimeLast); + _timerBlk[i]._timeLast = ((float)ak_time - (float)_timerBlk[i]._timeLast); - count = (int16)((float)_timerBlk[i].TimeLast / (float)freq); - if (_timerBlk[i].TimeStatus == TIMER_START) - _timerBlk[i].TimeCount += count; + int16 count = (int16)((float)_timerBlk[i]._timeLast / (float)freq); + if (_timerBlk[i]._timeStatus == TIMER_START) + _timerBlk[i]._timeCount += count; - _timerBlk[i].TimeLast = (float)ak_time - (float)(_timerBlk[i].TimeLast - + _timerBlk[i]._timeLast = (float)ak_time - (float)(_timerBlk[i]._timeLast - (float)((float)count * (float)freq)); - if (_timerBlk[i].TimeCount >= _timerBlk[i].TimeEnd) { - ++_timerBlk[i].TimeFlag; - _timerBlk[i].TimeCount = 0; + if (_timerBlk[i]._timeCount >= _timerBlk[i]._timeEnd) { + ++_timerBlk[i]._timeFlag; + _timerBlk[i]._timeCount = 0; } } } } -int16 Timer::set_new_timer(int16 timer_nr, int16 timer_end_wert, int16 timer_mode) { +int16 Timer::setNewTimer(int16 timerNr, int16 timerEndValue, int16 timerMode) { int16 ret; - if (timer_nr < _timerMax) { - ret = true; - _timerBlk[timer_nr].TimeCount = 0; - _timerBlk[timer_nr].TimeEnd = timer_end_wert; - _timerBlk[timer_nr].TimeFlag = 0; - _timerBlk[timer_nr].TimeLast = _G(timer_count); - _timerBlk[timer_nr].TimeMode = timer_mode; - _timerBlk[timer_nr].TimeStatus = true; + if (timerNr < _timerMax) { + ret = 1; + _timerBlk[timerNr]._timeCount = 0; + _timerBlk[timerNr]._timeEnd = timerEndValue; + _timerBlk[timerNr]._timeFlag = 0; + _timerBlk[timerNr]._timeLast = _G(timer_count); + _timerBlk[timerNr]._timeMode = timerMode; + _timerBlk[timerNr]._timeStatus = true; } else ret = -1; return ret; } -void Timer::reset_timer(int16 timer_nr, int16 timer_wert) { - if (timer_nr < _timerMax) { - _timerBlk[timer_nr].TimeCount = 0; - _timerBlk[timer_nr].TimeFlag = 0; - _timerBlk[timer_nr].TimeLast = _G(timer_count); - if (timer_wert) - _timerBlk[timer_nr].TimeEnd = timer_wert; +void Timer::resetTimer(int16 timerNr, int16 timerValue) { + if (timerNr < _timerMax) { + _timerBlk[timerNr]._timeCount = 0; + _timerBlk[timerNr]._timeFlag = 0; + _timerBlk[timerNr]._timeLast = _G(timer_count); + if (timerValue) + _timerBlk[timerNr]._timeEnd = timerValue; } } -void Timer::reset_all_timer() { - int16 i; - for (i = 0; i < _timerMax; i++) { - _timerBlk[i].TimeCount = 0; - _timerBlk[i].TimeFlag = 0; - _timerBlk[i].TimeLast = _G(timer_count); +void Timer::resetAllTimer() { + for (int16 i = 0; i < _timerMax; i++) { + _timerBlk[i]._timeCount = 0; + _timerBlk[i]._timeFlag = 0; + _timerBlk[i]._timeLast = _G(timer_count); } } -void Timer::set_status(int16 timer_nr, int16 status) { - if (timer_nr < _timerMax) { - _timerBlk[timer_nr].TimeStatus = status; +void Timer::setStatus(int16 timerNr, int16 status) { + if (timerNr < _timerMax) { + _timerBlk[timerNr]._timeStatus = status; } } -void Timer::set_all_status(int16 status) { - int16 i; +void Timer::setAllStatus(int16 status) { if (status == TIMER_FREEZE) { - for (i = 0; i < _timerMax; i++) { - if (_timerBlk[i].TimeStatus != TIMER_STOP) - _timerBlk[i].TimeStatus = TIMER_FREEZE; + for (int16 i = 0; i < _timerMax; i++) { + if (_timerBlk[i]._timeStatus != TIMER_STOP) + _timerBlk[i]._timeStatus = TIMER_FREEZE; } - } - else if (status == TIMER_UNFREEZE) { - for (i = 0; i < _timerMax; i++) { - if (_timerBlk[i].TimeStatus != TIMER_STOP) - _timerBlk[i].TimeStatus = TIMER_START; + } else if (status == TIMER_UNFREEZE) { + for (int16 i = 0; i < _timerMax; i++) { + if (_timerBlk[i]._timeStatus != TIMER_STOP) + _timerBlk[i]._timeStatus = TIMER_START; } } else { - for (i = 0; i < _timerMax; i++) - _timerBlk[i].TimeStatus = status; + for (int16 i = 0; i < _timerMax; i++) + _timerBlk[i]._timeStatus = status; } } -void Timer::disable_timer() { +void Timer::disableTimer() { _G(timer_suspend) = true; } -void Timer::enable_timer() { +void Timer::enableTimer() { _G(timer_suspend) = false; } diff --git a/engines/chewy/timer.h b/engines/chewy/timer.h index 7864907d453..314e7494a09 100644 --- a/engines/chewy/timer.h +++ b/engines/chewy/timer.h @@ -38,31 +38,30 @@ namespace Chewy { #define TIMER_UNFREEZE 3 struct TimerBlk { - int16 TimeCount; + int16 _timeCount; - int16 TimeEnd; - float TimeLast; - int16 TimeFlag; + int16 _timeEnd; + float _timeLast; + int16 _timeFlag; - int16 TimeMode; + int16 _timeMode; - int16 TimeStatus; + int16 _timeStatus; }; class Timer { public: - Timer(int16 max_timer, TimerBlk *t); + Timer(int16 maxTimer, TimerBlk *t); ~Timer(); - void calc_timer(); - int16 set_new_timer(int16 timer_nr, int16 timer_end_wert, - int16 timer_mode); - void reset_timer(int16 timer_nr, int16 timer_wert); - void reset_all_timer(); - void set_status(int16 timer_nr, int16 status); - void set_all_status(int16 status); - void disable_timer(); - void enable_timer(); + void calcTimer(); + int16 setNewTimer(int16 timerNr, int16 timerEndValue, int16 timerMode); + void resetTimer(int16 timerNr, int16 timerValue); + void resetAllTimer(); + void setStatus(int16 timerNr, int16 status); + void setAllStatus(int16 status); + void disableTimer(); + void enableTimer(); private: TimerBlk *_timerBlk;