CHEWY: Start replacing minfo for cursor position

This commit is contained in:
Filippos Karapetis 2022-03-06 14:15:43 +02:00
parent 2ed0dea723
commit a80e543a3c
15 changed files with 57 additions and 57 deletions

View File

@ -86,7 +86,7 @@ void Cinema::execute() {
if (_G(minfo)._button == 1 && !flag) {
flag = true;
switch (_G(in)->mouseVector(_G(minfo).x, _G(minfo).y, CINEMA_TBL, 3)) {
switch (_G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, CINEMA_TBL, 3)) {
case 0:
_G(kbinfo).scan_code = Common::KEYCODE_UP;
if (!endLoop)
@ -103,7 +103,7 @@ void Cinema::execute() {
case 2:
{
int selIndex = (_G(minfo).y - 68) / 10 + topIndex;
int selIndex = (g_events->_mousePos.y - 68) / 10 + topIndex;
if (selIndex < (int)cutscenes.size())
selected = selIndex;
_G(kbinfo).scan_code = Common::KEYCODE_RETURN;

View File

@ -162,7 +162,7 @@ int16 Files::execute(bool isInGame) {
}
if (!flag && _G(minfo)._button == 1) {
int16 rect = _G(in)->mouseVector(_G(minfo).x, _G(minfo).y, FILE_ICONS, 8);
int16 rect = _G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, FILE_ICONS, 8);
flag = true;
key = 0;
@ -174,7 +174,7 @@ int16 Files::execute(bool isInGame) {
key = Common::KEYCODE_DOWN;
break;
case 2: {
int16 line = (_G(minfo).y - 68) / 10;
int16 line = (g_events->_mousePos.y - 68) / 10;
if (line == active_slot)
key = Common::KEYCODE_RETURN;
else

View File

@ -60,14 +60,14 @@ void Inventory::plot_menu() {
}
int16 y;
int16 k = _G(in)->mouseVector(_G(minfo).x, _G(minfo).y, &INVENTORY_HOTSPOTS[0][0], INVENTORY_HOTSPOTS_COUNT);
int16 k = _G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, &INVENTORY_HOTSPOTS[0][0], INVENTORY_HOTSPOTS_COUNT);
if (k != -1) {
if (k < 5)
_G(out)->boxFill(INVENTORY_HOTSPOTS[k][0], INVENTORY_HOTSPOTS[k][1],
INVENTORY_HOTSPOTS[k][2] + 1, INVENTORY_HOTSPOTS[k][3] + 5, 41);
else {
int16 x = (_G(minfo).x - (WIN_INF_X)) / 54;
y = (_G(minfo).y - (WIN_INF_Y + 4 + 30)) / 30;
int16 x = (g_events->_mousePos.x - (WIN_INF_X)) / 54;
y = (g_events->_mousePos.y - (WIN_INF_Y + 4 + 30)) / 30;
k = x + (y * 5);
k += _G(spieler).InventY * 5;
if (k < (_G(spieler).InventY + 3) * 5)
@ -133,8 +133,8 @@ void Inventory::menu() {
_G(flags).StopAutoObj = true;
_G(menu_display) = 0;
_G(cur)->move(152, 92);
_G(minfo).x = 152;
_G(minfo).y = 92;
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
_G(invent_cur_mode) = CUR_USE;
if (_G(spieler).AkInvent != -1) {
@ -167,7 +167,7 @@ void Inventory::menu() {
mouseFl = true;
_G(kbinfo)._keyCode = '\0';
int16 k = _G(in)->mouseVector(_G(minfo).x, _G(minfo).y, &INVENTORY_HOTSPOTS[0][0], INVENTORY_HOTSPOTS_COUNT);
int16 k = _G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, &INVENTORY_HOTSPOTS[0][0], INVENTORY_HOTSPOTS_COUNT);
if (keyVal == Common::KEYCODE_F1)
k = 0;
else if (keyVal == Common::KEYCODE_F2)
@ -211,8 +211,8 @@ void Inventory::menu() {
break;
case 5:
inv_rand_x = (_G(minfo).x - (WIN_INF_X)) / 54;
inv_rand_y = (_G(minfo).y - (WIN_INF_Y + 4 + 30)) / 30;
inv_rand_x = (g_events->_mousePos.x - (WIN_INF_X)) / 54;
inv_rand_y = (g_events->_mousePos.y - (WIN_INF_Y + 4 + 30)) / 30;
k = inv_rand_x + (inv_rand_y * 5);
k += _G(spieler).InventY * 5;
if (_G(invent_cur_mode) == CUR_USE) {
@ -303,23 +303,23 @@ void Inventory::menu() {
break;
case Common::KEYCODE_RIGHT:
if (_G(minfo).x < 320 - _G(spieler)._curWidth)
_G(minfo).x += 3;
if (g_events->_mousePos.x < 320 - _G(spieler)._curWidth)
g_events->_mousePos.x += 3;
break;
case Common::KEYCODE_LEFT:
if (_G(minfo).x > 2)
_G(minfo).x -= 3;
if (g_events->_mousePos.x > 2)
g_events->_mousePos.x -= 3;
break;
case Common::KEYCODE_UP:
if (_G(minfo).y > 2)
_G(minfo).y -= 3;
if (g_events->_mousePos.y > 2)
g_events->_mousePos.y -= 3;
break;
case Common::KEYCODE_DOWN:
if (_G(minfo).y < 197 - _G(spieler)._curHeight)
_G(minfo).y += 3;
if (g_events->_mousePos.y < 197 - _G(spieler)._curHeight)
g_events->_mousePos.y += 3;
break;
case Common::KEYCODE_PAGEUP:
@ -342,7 +342,7 @@ void Inventory::menu() {
if (_G(show_invent_menu) != 2) {
setupScreen(NO_SETUP);
_G(cur)->move(_G(minfo).x, _G(minfo).y);
_G(cur)->move(g_events->_mousePos.x, g_events->_mousePos.y);
_G(cur)->show_cur();
if (menu_flag1 != MENU_HIDE) {
inv_rand_x = -1;
@ -365,8 +365,8 @@ void Inventory::menu() {
}
_G(cur)->move(_G(maus_old_x), _G(maus_old_y));
_G(minfo).x = _G(maus_old_x);
_G(minfo).y = _G(maus_old_y);
g_events->_mousePos.x = _G(maus_old_x);
g_events->_mousePos.y = _G(maus_old_y);
_G(minfo)._button = 0;
while (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE && !SHOULD_QUIT) {
@ -422,7 +422,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
}
while (!endLoop) {
int16 rect = _G(in)->mouseVector(_G(minfo).x, _G(minfo).y, (const int16 *)INVENTORY_HOTSPOTS, INVENTORY_HOTSPOTS_COUNT);
int16 rect = _G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, (const int16 *)INVENTORY_HOTSPOTS, INVENTORY_HOTSPOTS_COUNT);
if (_G(minfo)._button) {
if (_G(minfo)._button == 2) {

View File

@ -53,8 +53,8 @@ void MainMenu::execute() {
show_intro();
_G(cur)->move(152, 92);
_G(minfo).x = 152;
_G(minfo).y = 92;
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
_G(spieler).inv_cur = false;
_G(menu_display) = 0;
_G(spieler).soundLoopMode = 1;
@ -107,8 +107,8 @@ void MainMenu::execute() {
case MM_CINEMA:
cursorChoice(CUR_SAVE);
_G(cur)->move(152, 92);
_G(minfo).x = 152;
_G(minfo).y = 92;
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
Dialogs::Cinema::execute();
break;
@ -133,7 +133,7 @@ void MainMenu::execute() {
}
void MainMenu::screenFunc() {
int vec = _G(det)->maus_vector(_G(minfo).x + _G(spieler).scrollx, _G(minfo).y + _G(spieler).scrolly);
int vec = _G(det)->maus_vector(g_events->_mousePos.x + _G(spieler).scrollx, g_events->_mousePos.y + _G(spieler).scrolly);
if (_G(in)->getSwitchCode() == 28 || _G(minfo)._button == 1) {
_selection = vec;
@ -161,7 +161,7 @@ void MainMenu::animate() {
spriteEngine();
kb_mov(1);
calcMouseText(_G(minfo).x, _G(minfo).y, 1);
calcMouseText(g_events->_mousePos.x, g_events->_mousePos.y, 1);
_G(cur)->plot_cur();
_G(mouseLeftClick) = false;
_G(menu_flag) = 0;
@ -218,8 +218,8 @@ bool MainMenu::loadGame() {
_G(fontMgr)->setFont(_G(font6));
cursorChoice(CUR_SAVE);
_G(cur)->move(152, 92);
_G(minfo).x = 152;
_G(minfo).y = 92;
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
_G(savegameFlag) = true;
int result = Dialogs::Files::execute(false);

View File

@ -149,7 +149,7 @@ void Options::execute(TafInfo *ti) {
if ((_G(minfo)._button == 1) || (key == Common::KEYCODE_RETURN)) {
WAIT_TASTE_LOS
int16 rect = _G(in)->mouseVector(_G(minfo).x, _G(minfo).y, OPTION_ICONS, 9);
int16 rect = _G(in)->mouseVector(g_events->_mousePos.x, g_events->_mousePos.y, OPTION_ICONS, 9);
switch (rect) {
case 0:
if (_G(spieler).FramesPerSecond > 6)
@ -194,11 +194,11 @@ void Options::execute(TafInfo *ti) {
key = Common::KEYCODE_ESCAPE;
break;
case 7:
_G(spieler).SoundVol = (136 - _G(minfo).y) << 1;
_G(spieler).SoundVol = (136 - g_events->_mousePos.y) << 1;
g_engine->_sound->setSoundVolume(_G(spieler).SoundVol * Audio::Mixer::kMaxChannelVolume / 120);
break;
case 8:
_G(spieler).MusicVol = (136 - _G(minfo).y) << 1;
_G(spieler).MusicVol = (136 - g_events->_mousePos.y) << 1;
g_engine->_sound->setMusicVolume(_G(spieler).MusicVol * Audio::Mixer::kMaxChannelVolume / 120);
break;
@ -210,19 +210,19 @@ void Options::execute(TafInfo *ti) {
switch (key) {
case Common::KEYCODE_UP:
_G(cur)->move(_G(minfo).x, --_G(minfo).y);
_G(cur)->move(g_events->_mousePos.x, --g_events->_mousePos.y);
break;
case Common::KEYCODE_DOWN:
_G(cur)->move(_G(minfo).x, ++_G(minfo).y);
_G(cur)->move(g_events->_mousePos.x, ++g_events->_mousePos.y);
break;
case Common::KEYCODE_LEFT:
_G(cur)->move(--_G(minfo).x, _G(minfo).y);
_G(cur)->move(--g_events->_mousePos.x, g_events->_mousePos.y);
break;
case Common::KEYCODE_RIGHT:
_G(cur)->move(++_G(minfo).x, _G(minfo).y);
_G(cur)->move(++g_events->_mousePos.x, g_events->_mousePos.y);
break;
default:

View File

@ -307,8 +307,8 @@ void Room0::calcEyeClick(int16 aniNr) {
char *str_ = _G(atds)->ats_get_txt(172, TXT_MARK_NAME, &anz, ATS_DATA);
if (str_ != 0) {
_G(fontMgr)->setFont(_G(font8));
int16 x = _G(minfo).x;
int16 y = _G(minfo).y;
int16 x = g_events->_mousePos.x;
int16 y = g_events->_mousePos.y;
calcTxtXy(&x, &y, str_, anz);
for (int16 i = 0; i < anz; i++)
printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos((char *)str_, i));
@ -545,8 +545,8 @@ void Room0::calcPillowClick(int16 aniNr) {
char *str_ = _G(atds)->ats_get_txt(173, TXT_MARK_NAME, &anz, ATS_DATA);
if (str_ != nullptr) {
_G(fontMgr)->setFont(_G(font8));
int16 x = _G(minfo).x;
int16 y = _G(minfo).y;
int16 x = g_events->_mousePos.x;
int16 y = g_events->_mousePos.y;
calcTxtXy(&x, &y, str_, anz);
for (int16 i = 0; i < anz; i++)
printShadowed(x, y + i * 10, 255, 300, 0, _G(scr_width), _G(txt)->strPos((char *)str_, i));

View File

@ -61,7 +61,7 @@ int16 Room4::comp_probe() {
while (!endLoop) {
mouseAction();
if (_G(mouseLeftClick)) {
switch (_G(in)->mouseVector(_G(minfo).x + 17, _G(minfo).y + 7, &CONSOLE[0][0], 3)) {
switch (_G(in)->mouseVector(g_events->_mousePos.x + 17, g_events->_mousePos.y + 7, &CONSOLE[0][0], 3)) {
case 0:
if (curX > 0)
--curX;
@ -104,8 +104,8 @@ int16 Room4::comp_probe() {
cursorChoice(CUR_USER);
_G(spieler)._curHeight = 16;
if (_G(minfo).y < 124)
_G(minfo).y = 123;
if (g_events->_mousePos.y < 124)
g_events->_mousePos.y = 123;
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN0;

View File

@ -95,8 +95,8 @@ void Room8::start_verbrennen() {
SHOULD_QUIT_RETURN;
if (_G(minfo)._button == 1 || _G(kbinfo)._keyCode == Common::KEYCODE_RETURN) {
if (_G(minfo).x > 146 && _G(minfo).x < 208 &&
_G(minfo).y > 107 && _G(minfo).y < 155)
if (g_events->_mousePos.x > 146 && g_events->_mousePos.x < 208 &&
g_events->_mousePos.y > 107 && g_events->_mousePos.y < 155)
break;
}
}

View File

@ -89,8 +89,8 @@ void Room37::gedAction(int index) {
void Room37::setup_func() {
if (_G(mouseLeftClick) && !_G(spieler).R37Kloppe &&
_G(menu_item) == CUR_WALK) {
if ((_G(minfo).x + _G(spieler).scrollx > 380 && _G(minfo).y > 120) ||
(_G(minfo).x + _G(spieler).scrollx > 482)) {
if ((g_events->_mousePos.x + _G(spieler).scrollx > 380 && g_events->_mousePos.y > 120) ||
(g_events->_mousePos.x + _G(spieler).scrollx > 482)) {
// Don't allow moving into chicken coop area
// until the rooster has left
autoMove(7, P_CHEWY);

View File

@ -94,7 +94,7 @@ void Room48::setup_func() {
_G(menu_item) = CUR_USE;
cur_2_inventory();
cursorChoice(CUR_ZEIGE);
const int16 idx = _G(det)->maus_vector(_G(minfo).x, _G(minfo).y);
const int16 idx = _G(det)->maus_vector(g_events->_mousePos.x, g_events->_mousePos.y);
if (idx != -1) {
if (_G(spieler).R48Auswahl[idx]) {

View File

@ -134,8 +134,8 @@ bool Room51::timer(int16 t_nr, int16 ani_nr) {
void Room51::setup_func() {
if (_G(spieler).flags32_10) {
_tmpx = _G(minfo).x;
_tmpy = _G(minfo).y;
_tmpx = g_events->_mousePos.x;
_tmpy = g_events->_mousePos.y;
if (_tmpx > 215)
_tmpx = 215;
if (_tmpy < 81)

View File

@ -433,7 +433,7 @@ void Room56::setup_func() {
return;
if (!_G(atds)->get_steuer_bit(362, ATS_AKTIV_BIT, ATS_DATA) && _G(menu_item) == CUR_WALK) {
if (_G(minfo).x + _G(spieler).scrollx >= 157 && _G(minfo).x + _G(spieler).scrollx <= 204 && _G(minfo).y >= 28 && _G(minfo).y <= 89)
if (g_events->_mousePos.x + _G(spieler).scrollx >= 157 && g_events->_mousePos.x + _G(spieler).scrollx <= 204 && g_events->_mousePos.y >= 28 && g_events->_mousePos.y <= 89)
cursorChoice(CUR_EXIT_TOP);
else
cursorChoice(CUR_WALK);

View File

@ -79,7 +79,7 @@ void Room80::setup_func() {
_G(menu_item) = CUR_USE;
cur_2_inventory();
cursorChoice(CUR_ZEIGE);
int vec = _G(det)->maus_vector(_G(spieler).scrollx + _G(minfo).x, _G(minfo).y);
int vec = _G(det)->maus_vector(_G(spieler).scrollx + g_events->_mousePos.x, g_events->_mousePos.y);
if (vec == -1)
return;

View File

@ -112,7 +112,7 @@ void Room91::setup_func() {
const int oldClick = _click;
_G(mouseLeftClick) = oldClick;
_click = 1;
const int aniNr = 1 + (_G(minfo).y <= 100 ? 1 : 0);
const int aniNr = 1 + (g_events->_mousePos.y <= 100 ? 1 : 0);
hideCur();
_G(det)->stop_detail(0);
startSetailWait(aniNr, 1, ANI_FRONT);

View File

@ -199,7 +199,7 @@ void Room97::setup_func() {
}
if (_G(spieler).flags37_1 && _G(menu_item) == CUR_WALK) {
if (_G(spieler).scrollx + _G(minfo).x >= 487 && _G(spieler).scrollx + _G(minfo).x <= 522 && _G(minfo).y >= 23 && _G(minfo).y <= 59)
if (_G(spieler).scrollx + g_events->_mousePos.x >= 487 && _G(spieler).scrollx + g_events->_mousePos.x <= 522 && g_events->_mousePos.y >= 23 && g_events->_mousePos.y <= 59)
cursorChoice(CUR_EXIT_TOP);
else
cursorChoice(CUR_WALK);