CHEWY: more renaming

This commit is contained in:
Strangerke 2022-02-27 23:22:24 +01:00 committed by Paul Gilbert
parent e919953073
commit ef70d3ef56
27 changed files with 139 additions and 151 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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;
}

View File

@ -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)) {

View File

@ -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();

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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);
}
}
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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)

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<TextEntry> 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

View File

@ -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;
}

View File

@ -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;