CHEWY: Further refactoring of the cursor code

This commit is contained in:
Filippos Karapetis 2022-06-29 16:23:33 +03:00
parent c95b231bab
commit e9e8ee9ee1
78 changed files with 321 additions and 334 deletions

View file

@ -108,20 +108,20 @@ Common::Error ChewyEngine::loadGameStream(Common::SeekableReadStream *stream) {
_G(flags).LoadGame = true;
if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1) {
if (_G(cur)->usingInventoryCursor()) {
_G(menu_item) = CUR_USE;
}
if (_G(gameState).AkInvent != -1)
_G(gameState).room_m_obj[_G(gameState).AkInvent].RoomNr = -1;
if (_G(cur)->usingInventoryCursor())
_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].RoomNr = -1;
_G(room)->loadRoom(&_G(room_blk), _G(gameState)._personRoomNr[P_CHEWY], &_G(gameState));
load_chewy_taf(_G(gameState).ChewyAni);
_G(fx_blend) = BLEND1;
_G(room)->calc_invent(&_G(room_blk), &_G(gameState));
if (_G(gameState).AkInvent != -1)
_G(gameState).room_m_obj[_G(gameState).AkInvent].RoomNr = 255;
if (_G(cur)->usingInventoryCursor())
_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].RoomNr = 255;
_G(obj)->sort();
for (int i = 0; i < MAX_PERSON; i++) {

View file

@ -62,27 +62,29 @@ Cursor::~Cursor() {
}
void Cursor::updateCursor() {
if (CursorMan.isVisible()) {
--_curAniCountdown;
if (_curAniCountdown <= 0) {
_curAniCountdown = _animDelay;
++_aniCount;
if (_aniCount > _animEnd)
_aniCount = _animStart;
}
if (!CursorMan.isVisible())
return;
if (_customCursor.data != nullptr) {
CursorMan.replaceCursor(_customCursor.data, _customCursor.width, _customCursor.height, 0, 0, 0);
_currentCursor.data = _customCursor.data;
_currentCursor.width = _customCursor.width;
_currentCursor.height = _customCursor.height;
} else {
const CursorSprite s = _curSprites[_aniCount + _cursorOffset];
CursorMan.replaceCursor(s.data, s.width, s.height, 0, 0, 0);
_currentCursor.data = s.data;
_currentCursor.width = s.width;
_currentCursor.height = s.height;
}
--_curAniCountdown;
if (_curAniCountdown <= 0) {
_curAniCountdown = _animDelay;
++_aniCount;
if (_aniCount > _animEnd)
_aniCount = _animStart;
}
if (_customCursor.data != nullptr) {
CursorMan.replaceCursor(_customCursor.data, _customCursor.width, _customCursor.height, 0, 0, 0);
_currentCursor.data = _customCursor.data;
_currentCursor.width = _customCursor.width;
_currentCursor.height = _customCursor.height;
} else {
const uint32 cursorOffset = _invCursor >= 0 ? _cursorCount : 0;
const CursorSprite s = _curSprites[_aniCount + cursorOffset];
CursorMan.replaceCursor(s.data, s.width, s.height, 0, 0, 0);
_currentCursor.data = s.data;
_currentCursor.width = s.width;
_currentCursor.height = s.height;
}
}
@ -119,15 +121,11 @@ void Cursor::setCustomCursor(byte *data, uint16 width, uint16 height) {
void Cursor::clearCustomCursor() {
if (_customCursor.data) {
const CursorSprite s = _curSprites[_aniCount + _cursorOffset];
CursorMan.replaceCursor(s.data, s.width, s.height, 0, 0, 0);
_currentCursor.data = s.data;
_currentCursor.width = s.width;
_currentCursor.height = s.height;
_customCursor.data = nullptr;
_customCursor.width = 0;
_customCursor.height = 0;
updateCursor();
}
}

View file

@ -22,6 +22,7 @@
#ifndef CHEWY_CURSOR_H
#define CHEWY_CURSOR_H
#include "chewy/globals.h"
#include "chewy/mouse.h"
namespace Chewy {
@ -54,8 +55,13 @@ public:
uint16 getCursorWidth(uint num) const { return _curSprites[num].width; }
uint16 getCursorHeight(uint num) const { return _curSprites[num].height; }
void setInventoryCursors(bool inventory) { _cursorOffset = !inventory ? 0 : _cursorCount; }
bool usingInventoryCursors() const { return _cursorOffset > 0; }
void setInventoryCursor(int num) {
_invCursor = num;
if (num >= 0)
setAnimation(num, num, (1 + _G(gameState).DelaySpeed) * 5);
}
int getInventoryCursor() const { return _invCursor; }
bool usingInventoryCursor() const { return _invCursor >= 0; }
private:
CursorSprite *_curSprites = nullptr;
@ -63,7 +69,7 @@ private:
CursorSprite _currentCursor;
uint32 _cursorCount = 0;
uint32 _invCursorCount = 0;
uint32 _cursorOffset = 0;
int _invCursor = 0;
int16 _curAniCountdown = 0;
int16 _aniCount = 0;

View file

@ -68,7 +68,6 @@ enum SetupScreenMode {
#define CUR_INVENT 5
#define CUR_NO_WALK 6
#define CUR_NOPE 7
#define CUR_AK_INVENT 8
#define CUR_NO_USE 10
#define CUR_NO_LOOK 11
#define CUR_NO_TALK 12

View file

@ -135,10 +135,8 @@ void Inventory::menu() {
g_events->_mousePos.y = 92;
_G(invent_cur_mode) = CUR_USE;
if (_G(gameState).AkInvent != -1) {
cursorChoice(CUR_AK_INVENT);
} else {
if (!_G(cur)->usingInventoryCursor()) {
_G(invent_cur_mode) = CUR_USE;
cursorChoice(CUR_USE);
}
@ -179,18 +177,16 @@ void Inventory::menu() {
case 0:
_G(invent_cur_mode) = CUR_USE;
_G(menu_item) = CUR_USE;
if (_G(gameState).AkInvent == -1) {
if (!_G(cur)->usingInventoryCursor()) {
cursorChoice(CUR_USE);
} else {
cursorChoice(CUR_AK_INVENT);
}
break;
case 1:
if (_G(gameState).AkInvent != -1) {
if (_G(cur)->usingInventoryCursor()) {
inv_rand_x = -1;
inv_rand_y = -1;
ret_look = look(_G(gameState).AkInvent, INV_ATS_MODE, -1);
ret_look = look(_G(cur)->getInventoryCursor(), INV_ATS_MODE, -1);
taste_flag = Common::KEYCODE_ESCAPE;
} else {
@ -214,26 +210,25 @@ void Inventory::menu() {
k = inv_rand_x + (inv_rand_y * 5);
k += _G(gameState).InventY * 5;
if (_G(invent_cur_mode) == CUR_USE) {
if (_G(gameState).AkInvent == -1) {
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).InventSlot[k] != -1 && calc_use_invent(_G(gameState).InventSlot[k]) == false) {
_G(menu_item) = CUR_USE;
_G(gameState).AkInvent = _G(gameState).InventSlot[k];
cursorChoice(CUR_AK_INVENT);
_G(cur)->setInventoryCursor(_G(gameState).InventSlot[k]);
del_invent_slot(_G(gameState).InventSlot[k]);
}
} else if (_G(gameState).InventSlot[k] != -1)
evaluateObj(_G(gameState).InventSlot[k], INVENTORY_NORMAL);
else {
_G(gameState).InventSlot[k] = _G(gameState).AkInvent;
_G(gameState).InventSlot[k] = _G(cur)->getInventoryCursor();
_G(obj)->sort();
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = _G(invent_cur_mode);
cursorChoice(_G(invent_cur_mode));
}
} else if (_G(invent_cur_mode) == CUR_LOOK && _G(gameState).InventSlot[k] != -1 && calc_use_invent(_G(gameState).InventSlot[k]) == false) {
_G(gameState).AkInvent = _G(gameState).InventSlot[k];
_G(cur)->setInventoryCursor(_G(gameState).InventSlot[k]);
ret_look = look(_G(gameState).InventSlot[k], INV_ATS_MODE, -1);
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(invent_cur_mode));
taste_flag = Common::KEYCODE_ESCAPE;
}
@ -254,10 +249,8 @@ void Inventory::menu() {
if (ret_look == 0) {
_G(invent_cur_mode) = CUR_USE;
_G(menu_item) = CUR_USE;
if (_G(gameState).AkInvent == -1)
if (!_G(cur)->usingInventoryCursor())
cursorChoice(CUR_USE);
else
cursorChoice(CUR_AK_INVENT);
} else if (ret_look == 5) {
taste_flag = false;
mouseFl = false;
@ -572,7 +565,7 @@ void Inventory::look_screen(int16 txt_mode, int16 txt_nr) {
case CUR_HOWARD:
case CUR_NICHELLE:
m_mode = TXT_MARK_USE;
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
ok = false;
break;

View file

@ -53,7 +53,7 @@ void MainMenu::execute() {
_G(cur)->move(152, 92);
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_display) = 0;
_G(gameState).soundLoopMode = 1;
@ -205,10 +205,9 @@ bool MainMenu::loadGame() {
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
_G(savegameFlag) = true;
int result = Dialogs::Files::execute(false);
int result = Files::execute(false);
cursorChoice((_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 &&
_G(menu_item) == CUR_USE) ? 8 : 0);
cursorChoice((_G(cur)->usingInventoryCursor() && _G(menu_item) == CUR_USE) ? 8 : 0);
_G(cur_display) = true;
restorePersonAni();
_G(flags).SaveMenu = false;

View file

@ -87,7 +87,7 @@ void var_init() {
new_game();
_G(gameState).MainMenuY = MENU_Y;
_G(gameState).DispFlag = true;
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
_G(gameState).ScrollxStep = 1;
_G(gameState).ScrollyStep = 1;

View file

@ -97,7 +97,7 @@ void cursorChoice(int16 nr) {
_G(cur)->clearCustomCursor();
}
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
switch (nr) {
case CUR_WALK:
@ -130,10 +130,6 @@ void cursorChoice(int16 nr) {
case CUR_INVENT:
_G(cur)->setAnimation(21, 24, delay);
break;
case CUR_AK_INVENT:
_G(cur)->setAnimation(_G(gameState).AkInvent, _G(gameState).AkInvent, delay);
_G(cur)->setInventoryCursors(true);
break;
case CUR_SAVE:
_G(cur)->setAnimation(25, 25, delay);
break;
@ -202,7 +198,7 @@ bool mainLoop(int16 mode) {
if (_G(flags).MainInput) {
switch (g_events->_kbInfo._scanCode) {
case Common::KEYCODE_F1:
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
_G(cur)->showCursor();
cursorChoice(_G(menu_item));
@ -211,7 +207,7 @@ bool mainLoop(int16 mode) {
break;
case Common::KEYCODE_F2:
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_USE;
_G(cur)->showCursor();
cursorChoice(_G(menu_item));
@ -220,7 +216,7 @@ bool mainLoop(int16 mode) {
break;
case Common::KEYCODE_F3:
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_LOOK;
_G(cur)->showCursor();
cursorChoice(_G(menu_item));
@ -229,7 +225,7 @@ bool mainLoop(int16 mode) {
break;
case Common::KEYCODE_F4:
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_TALK;
_G(cur)->showCursor();
cursorChoice(_G(menu_item));
@ -249,15 +245,14 @@ bool mainLoop(int16 mode) {
menuExit();
_G(menu_display) = 0;
_G(cur_display) = true;
if (_G(gameState).AkInvent == -1) {
if (!_G(cur)->usingInventoryCursor()) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(gameState).AkInvent);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(cur)->getInventoryCursor());
}
g_events->_kbInfo._keyCode = '\0';
@ -273,9 +268,7 @@ bool mainLoop(int16 mode) {
retValue = true;
_G(fx_blend) = BLEND4;
}
if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
if (!(_G(cur)->usingInventoryCursor() && _G(menu_item) == CUR_USE))
cursorChoice(_G(menu_item));
_G(cur_display) = true;
_G(flags).SaveMenu = false;
@ -298,9 +291,7 @@ bool mainLoop(int16 mode) {
_G(cur)->showCursor();
_G(menu_item) = _G(tmp_menu_item);
_G(menu_display) = MENU_HIDE;
if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
if (!(_G(cur)->usingInventoryCursor() && _G(menu_item) == CUR_USE))
cursorChoice(_G(menu_item));
}
break;
@ -316,14 +307,13 @@ bool mainLoop(int16 mode) {
menuExit();
_G(menu_display) = 0;
_G(cur_display) = true;
if (_G(gameState).AkInvent == -1) {
if (!_G(cur)->usingInventoryCursor()) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(gameState).AkInvent);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(cur)->getInventoryCursor());
}
break;
@ -347,9 +337,7 @@ bool mainLoop(int16 mode) {
_G(menu_item) = _G(tmp_menu_item);
_G(menu_display) = MENU_HIDE;
if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
if (!(_G(cur)->usingInventoryCursor() && _G(menu_item) == CUR_USE))
cursorChoice(_G(tmp_menu_item));
_G(cur_display) = true;
@ -367,7 +355,7 @@ bool mainLoop(int16 mode) {
_G(cur)->move(_G(maus_old_x), _G(maus_old_y));
g_events->_mousePos.x = _G(maus_old_x);
g_events->_mousePos.y = _G(maus_old_y);
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(menu_item));
}
break;
@ -475,10 +463,10 @@ void setupScreen(SetupScreenMode mode) {
if (!_G(flags).SaveMenu)
calc_ani_timer();
if (_G(gameState).AkInvent != -1 && _G(gameState).DispFlag) {
if (_G(cur)->usingInventoryCursor() && _G(gameState).DispFlag) {
buildMenu(invent_display[_G(gameState).InvDisp][0],
invent_display[_G(gameState).InvDisp][1], 3, 3, 60, 0);
_G(out)->spriteSet(_G(inv_spr)[_G(gameState).AkInvent],
_G(out)->spriteSet(_G(inv_spr)[_G(cur)->getInventoryCursor()],
invent_display[_G(gameState).InvDisp][0] + 1 + _G(gameState).DispZx,
invent_display[_G(gameState).InvDisp][1] + 1 + _G(gameState).DispZy
, _G(scr_width));
@ -552,7 +540,7 @@ void setupScreen(SetupScreenMode mode) {
if (_G(cur_display) && mode == DO_SETUP) {
_G(cur)->updateCursor();
if (_G(cur)->usingInventoryCursors() && _G(flags).CursorStatus)
if (_G(cur)->usingInventoryCursor() && _G(flags).CursorStatus)
_G(out)->spriteSet(
_G(cur)->getCursorSprite(),
g_events->_mousePos.x,
@ -657,7 +645,7 @@ void mous_obj_action(int16 nr, int16 mode, int16 txt_mode, int16 txt_nr) {
if (_G(menu_item) != CUR_USE)
Dialogs::Inventory::look_screen(txt_mode, txt_nr);
else {
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
evaluateObj(nr, txt_mode);
} else {
if (txt_mode == INVENTORY_NORMAL) {
@ -666,8 +654,8 @@ void mous_obj_action(int16 nr, int16 mode, int16 txt_mode, int16 txt_nr) {
autoMove(_G(gameState).room_m_obj[nr].AutoMov, P_CHEWY);
Dialogs::Inventory::look_screen(txt_mode, txt_nr);
if (_G(gameState).AkInvent != -1)
_G(gameState).room_m_obj[_G(gameState).AkInvent].RoomNr = -1;
if (_G(cur)->usingInventoryCursor())
_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].RoomNr = -1;
if (_G(gameState).room_m_obj[nr].AniFlag == 255) {
invent_2_slot(nr);
} else {
@ -678,13 +666,13 @@ void mous_obj_action(int16 nr, int16 mode, int16 txt_mode, int16 txt_nr) {
_G(gameState)._personHide[P_CHEWY] = false;
}
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
_G(moveState)[P_CHEWY]._delayCount = 0;
if (_G(gameState).AkInvent != -1)
_G(gameState).room_m_obj[_G(gameState).AkInvent].RoomNr = 255;
if (_G(cur)->usingInventoryCursor())
_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].RoomNr = 255;
}
} else if (txt_mode == INVENTORY_STATIC) {
@ -781,12 +769,12 @@ void mouseAction() {
x < invent_display[_G(gameState).InvDisp][0] + 48 &&
y > invent_display[_G(gameState).InvDisp][1] &&
y < invent_display[_G(gameState).InvDisp][1] + 48) {
if (!_G(cur)->usingInventoryCursors() && !_G(inv_disp_ok) && _G(gameState).AkInvent != -1) {
if (!_G(cur)->usingInventoryCursor() && !_G(inv_disp_ok) && _G(cur)->usingInventoryCursor()) {
cursorChoice(CUR_USE);
}
_G(inv_disp_ok) = true;
} else {
if (!_G(cur)->usingInventoryCursors() && _G(inv_disp_ok)) {
if (!_G(cur)->usingInventoryCursor() && _G(inv_disp_ok)) {
cursorChoice(_G(menu_item));
}
_G(inv_disp_ok) = false;
@ -802,15 +790,14 @@ void mouseAction() {
if (!_G(flags).mainMouseFlag) {
if (_G(menu_display) == MENU_DISPLAY)
g_events->_kbInfo._scanCode = Common::KEYCODE_RETURN;
else if (_G(gameState).AkInvent != -1) {
else if (_G(cur)->usingInventoryCursor()) {
if (_G(inv_disp_ok)) {
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
g_events->_kbInfo._scanCode = Common::KEYCODE_INVALID;
}
} else if (!_G(flags).MouseLeft)
@ -828,17 +815,17 @@ void mouseAction() {
void evaluateObj(int16 testNr, int16 mode) {
int16 ani_nr;
int16 txt_nr;
int16 tmp = _G(gameState).AkInvent;
int16 tmp;
int16 ret = NO_ACTION;
int16 action_flag = false;
switch (mode) {
case INVENTORY_NORMAL:
ret = _G(obj)->action_iib_iib(_G(gameState).AkInvent, testNr);
ret = _G(obj)->action_iib_iib(_G(cur)->getInventoryCursor(), testNr);
if (ret != NO_ACTION) {
hideCur();
if (_G(flags).InventMenu == false) {
if (_G(gameState).room_m_obj[_G(gameState).AkInvent].AutoMov != 255) {
if (_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].AutoMov != 255) {
_G(mouseLeftClick) = false;
autoMove(_G(gameState).room_m_obj[testNr].AutoMov, P_CHEWY);
}
@ -855,11 +842,11 @@ void evaluateObj(int16 testNr, int16 mode) {
break;
case INVENTORY_STATIC:
ret = _G(obj)->action_iib_sib(_G(gameState).AkInvent, testNr);
ret = _G(obj)->action_iib_sib(_G(cur)->getInventoryCursor(), testNr);
if (ret != NO_ACTION) {
_G(mouseLeftClick) = false;
hideCur();
if (_G(gameState).room_m_obj[_G(gameState).AkInvent].AutoMov != 255) {
if (_G(gameState).room_m_obj[_G(cur)->getInventoryCursor()].AutoMov != 255) {
autoMove(_G(gameState).room_s_obj[testNr].AutoMov, P_CHEWY);
}
txt_nr = _G(obj)->sib_txt_nr(testNr);
@ -884,7 +871,7 @@ void evaluateObj(int16 testNr, int16 mode) {
showCur();
sib_event_inv(testNr);
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
_G(menu_item) = _G(menu_item_vorwahl);
cursorChoice(_G(menu_item));
}
@ -931,7 +918,7 @@ void evaluateObj(int16 testNr, int16 mode) {
_G(obj)->calc_all_static_detail();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
if (sib_ret || action_flag) {
_G(menu_item) = _G(menu_item_vorwahl);
@ -972,7 +959,7 @@ void evaluateObj(int16 testNr, int16 mode) {
showCur();
sib_event_no_inv(testNr);
_G(obj)->calc_all_static_detail();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
_G(menu_item) = _G(menu_item_vorwahl);
cursorChoice(_G(menu_item));
}
@ -1299,7 +1286,7 @@ int16 calcMouseText(int16 x, int16 y, int16 mode) {
case CUR_USER:
case CUR_USE:
txtMode = TXT_MARK_USE;
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
ok = false;
break;
@ -1447,7 +1434,7 @@ void calc_mouse_person(int16 x, int16 y) {
printShadowed(x, y, 255, 300, 0, _G(scr_width), str_);
if (_G(mouseLeftClick)) {
int16 def_nr = -1;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
int16 txt_nr = calc_person_txt(p_nr);
switch (_G(menu_item)) {
case CUR_LOOK:
@ -1580,15 +1567,14 @@ void get_user_key(int16 mode) {
Dialogs::Inventory::menu();
_G(menu_display) = 0;
_G(cur_display) = true;
if (_G(gameState).AkInvent == -1) {
if (!_G(cur)->usingInventoryCursor()) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(gameState).AkInvent);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(cur)->getInventoryCursor());
}
g_events->_kbInfo._keyCode = '\0';
@ -1617,21 +1603,16 @@ void set_ani_screen() {
void delInventory(int16 nr) {
_G(obj)->delInventory(nr, &_G(room_blk));
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(menu_item));
del_invent_slot(nr);
_G(mouseLeftClick) = false;
}
bool isCurInventory(int16 nr) {
int16 ret = false;
if (_G(gameState).AkInvent == nr && _G(cur)->usingInventoryCursors())
ret = true;
return ret;
return _G(cur)->getInventoryCursor() == nr;
}
void check_mouse_ausgang(int16 x, int16 y) {

View file

@ -330,22 +330,21 @@ void stopDialogCloseupDialog() {
}
void cur_2_inventory() {
if (_G(gameState).AkInvent != -1) {
invent_2_slot(_G(gameState).AkInvent);
_G(gameState).AkInvent = -1;
if (_G(cur)->usingInventoryCursor()) {
invent_2_slot(_G(cur)->getInventoryCursor());
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
}
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
}
void inventory_2_cur(int16 nr) {
if (_G(gameState).AkInvent == -1 && _G(obj)->checkInventory(nr)) {
if (!_G(cur)->usingInventoryCursor() && _G(obj)->checkInventory(nr)) {
del_invent_slot(nr);
_G(menu_item) = CUR_USE;
_G(gameState).AkInvent = nr;
cursorChoice(CUR_AK_INVENT);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(gameState).AkInvent);
_G(cur)->setInventoryCursor(nr);
getDisplayCoord(&_G(gameState).DispZx, &_G(gameState).DispZy, _G(cur)->getInventoryCursor());
}
}
@ -380,7 +379,7 @@ int16 del_invent_slot(int16 nr) {
}
void remove_inventory(int16 nr) {
if (nr == _G(gameState).AkInvent) {
if (nr == _G(cur)->getInventoryCursor()) {
delInventory(nr);
} else {
_G(obj)->delInventory(nr, &_G(room_blk));

View file

@ -20,13 +20,12 @@
*/
#include "common/system.h"
#include "chewy/dialogs/main_menu.h"
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/ani_dat.h"
#include "chewy/rooms/rooms.h"
#include "chewy/main.h"
#include "chewy/resource.h"
#include "chewy/sound.h"
#include "chewy/video/video_player.h"
@ -55,7 +54,7 @@ void play_scene_ani(int16 nr, int16 mode) {
break;
case ROOM_18_20:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
break;
default:
@ -1181,7 +1180,7 @@ void sib_event_inv(int16 sib_nr) {
break;
case SIB_BOLA_BUTTON_R6:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R6BolaSchild = true;
_G(det)->showStaticSpr(2);
_G(obj)->calc_rsi_flip_flop(SIB_BOLA_BUTTON_R6);
@ -1234,13 +1233,13 @@ void sib_event_inv(int16 sib_nr) {
case SIB_FLUXO_R23:
_G(gameState).R23FluxoFlex = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(112, 1, ATS_DATA);
_G(menu_item_vorwahl) = CUR_USE;
break;
case SIB_TRANSLATOR_23:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(113, 0, ATS_DATA);
_G(menu_item_vorwahl) = CUR_USE;
break;
@ -1251,7 +1250,7 @@ void sib_event_inv(int16 sib_nr) {
case SIB_ROEHRE_R12:
_G(gameState).R12TalismanOk = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(118, TXT_MARK_LOOK, 1, ATS_DATA);
start_spz(CH_TALK6, 255, false, P_CHEWY);
startAadWait(115);
@ -1270,7 +1269,7 @@ void sib_event_inv(int16 sib_nr) {
_G(cur_hide_flag) = false;
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(gameState).R18CartFach = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->showStaticSpr(7);
_G(atds)->set_ats_str(157, TXT_MARK_LOOK, 1, ATS_DATA);

View file

@ -24,6 +24,8 @@
#include "chewy/memory.h"
#include "chewy/resource.h"
#include "chewy/room.h"
#include "cursor.h"
#include "chewy/sound.h"
namespace Chewy {
@ -285,9 +287,10 @@ void Room::calc_invent(RaumBlk *Rb, GameState *player) {
free(tmp_inv_spr[i]);
}
if (player->AkInvent != -1) {
if (Rb->InvSprAdr[player->AkInvent] == nullptr) {
spriteRes->getSpriteData(player->AkInvent, &Rb->InvSprAdr[player->AkInvent], true);
if (_G(cur)->usingInventoryCursor()) {
const int cursor = _G(cur)->getInventoryCursor();
if (Rb->InvSprAdr[cursor] == nullptr) {
spriteRes->getSpriteData(cursor, &Rb->InvSprAdr[cursor], true);
}
}

View file

@ -123,7 +123,7 @@ bool Room0::timer(int16 timerNr, int16 aniNr) {
bool Room0::getPillow() {
bool retval = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
_G(flags).AutoAniPlay = true;
autoMove(1, P_CHEWY);
@ -144,7 +144,7 @@ bool Room0::getPillow() {
bool Room0::pullSlime() {
bool retval = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
_G(flags).AutoAniPlay = true;
@ -313,7 +313,7 @@ void Room0::calcEyeClick(int16 aniNr) {
}
} else if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (isCurInventory(SLIME_INV)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R0SlimeUsed = true;
} else if (isCurInventory(PILLOW_INV)) {
startAtsWait(172, TXT_MARK_WALK, 14, ATS_DATA);
@ -551,7 +551,7 @@ void Room0::calcPillowClick(int16 aniNr) {
}
} else if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
if (isCurInventory(PILLOW_INV) && _G(gameState).R0SlimeUsed) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R0PillowThrow = true;
} else if (isCurInventory(SLIME_INV)) {
startAtsWait(173, TXT_MARK_WALK, 14, ATS_DATA);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -40,9 +41,9 @@ void Room1::gedAction(int index) {
if (index == 0 && !_G(gameState).R2ElectrocutedBork) {
bool flag = false;
if (_G(gameState).AkInvent == KABEL_INV) {
if (_G(cur)->getInventoryCursor() == KABEL_INV) {
flag = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
} else if (_G(obj)->checkInventory(KABEL_INV)) {
flag = true;
_G(obj)->del_obj_use(KABEL_INV);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -62,7 +63,7 @@ void Room2::electrifyWalkway1() {
_G(det)->startDetail(GRID_FLASHING, 12, ANI_FRONT);
_G(gameState).R2ElectrocutedBork = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->delControlBit(11, ATS_COUNT_BIT);
_G(atds)->delControlBit(11, ATS_ACTION_BIT);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -356,7 +357,7 @@ void Room3::probeTransfer() {
else
start_aad(44);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R2FussSchleim = true;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][0] = 142;
_G(mov_phasen)[SONDE_OBJ1].Phase[0][1] = 149;

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -50,7 +51,7 @@ void Room7::hook(int16 sibNr) {
int16 diaNr;
delInventory(8);
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));

View file

@ -85,7 +85,7 @@ void Room8::hole_kohle() {
void Room8::start_verbrennen() {
hideCur();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
autoMove(3, P_CHEWY);
start_aad(102, 0);
_G(gameState)._personHide[P_CHEWY] = true;

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -59,7 +60,7 @@ void Room10::get_surimy() {
_G(atds)->set_ats_str(77, TXT_MARK_LOOK, 1, ATS_DATA);
invent_2_slot(18);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
showCur();
}

View file

@ -158,7 +158,7 @@ int16 Room11::scanner() {
startAadWait(12);
showCur();
loadDialogCloseup(3);
} else if (!_G(cur)->usingInventoryCursors()) {
} else if (!_G(cur)->usingInventoryCursor()) {
if (!_G(gameState).R11TerminalOk) {
actionFl = true;
flic_cut(FCUT_009);
@ -182,9 +182,7 @@ void Room11::get_card() {
_G(gameState).R11CardOk = false;
_G(obj)->addInventory(_G(gameState).R11IdCardNr, &_G(room_blk));
_G(gameState).AkInvent = _G(gameState).R11IdCardNr;
cursorChoice(CUR_AK_INVENT);
cursorChoice(CUR_AK_INVENT);
_G(cur)->setInventoryCursor(_G(gameState).R11IdCardNr);
_G(det)->stop_detail(0);
_G(atds)->set_ats_str(83, TXT_MARK_LOOK, 0, ATS_DATA);
_G(atds)->set_ats_str(84, TXT_MARK_LOOK, 0, ATS_DATA);
@ -193,7 +191,7 @@ void Room11::get_card() {
void Room11::put_card() {
if (isCurInventory(RED_CARD_INV) || isCurInventory(YEL_CARD_INV)) {
_G(gameState).R11IdCardNr = _G(gameState).AkInvent;
_G(gameState).R11IdCardNr = _G(cur)->getInventoryCursor();
delInventory(_G(gameState).R11IdCardNr);
_G(det)->startDetail(0, 255, ANI_FRONT);
_G(atds)->set_ats_str(83, TXT_MARK_LOOK, 1, ATS_DATA);

View file

@ -192,7 +192,7 @@ void Room12::bork_ok() {
int16 Room12::use_terminal() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
if (!_G(gameState).R12ChewyBork) {
@ -249,7 +249,7 @@ void Room12::use_linke_rohr() {
int16 Room12::chewy_trans() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && _G(gameState).R12TransOn) {
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R12TransOn) {
action_flag = true;
_G(flags).AutoAniPlay = true;
autoMove(9, P_CHEWY);
@ -266,7 +266,7 @@ int16 Room12::chewy_trans() {
int16 Room12::useTransformerTube() {
bool result = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
result = true;
if (_G(gameState).R12ChainLeft) {

View file

@ -215,7 +215,7 @@ void Room13::jmp_floor() {
int16 Room13::monitor_button() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).R13Band) {
action_flag = true;
startAadWait(620);

View file

@ -73,7 +73,7 @@ void Room14::eremit_feuer(int16 t_nr, int16 ani_nr) {
int16 Room14::use_schrott() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(12, 1, ANI_FRONT);
@ -92,7 +92,7 @@ int16 Room14::use_schrott() {
int16 Room14::use_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(4, P_CHEWY);
@ -132,7 +132,7 @@ void Room14::talk_eremit() {
int16 Room14::use_schleim() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
autoMove(2, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(11, 1, ANI_FRONT);
@ -151,7 +151,7 @@ int16 Room14::use_schleim() {
void Room14::feuer() {
int16 waffe = false;
int16 tmp = _G(gameState).AkInvent;
int16 tmp = _G(cur)->getInventoryCursor();
_G(gameState).R14Feuer = true;
_G(cur_hide_flag) = false;
_G(flags).AutoAniPlay = true;

View file

@ -47,7 +47,7 @@ void Room16::entry() {
int16 Room16::use_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(6, P_CHEWY);
_G(gameState).R23GleiterExit = 16;

View file

@ -142,7 +142,7 @@ int16 Room17::use_seil() {
action_flag = true;
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(flags).AutoAniPlay = true;
autoMove(5, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
@ -203,7 +203,7 @@ void Room17::calc_seil() {
if (_G(gameState).R17Seil) {
if (_G(gameState).R17Location == 2) {
startAadWait(619);
} else if (!_G(flags).AutoAniPlay && !_G(cur)->usingInventoryCursors()) {
} else if (!_G(flags).AutoAniPlay && !_G(cur)->usingInventoryCursor()) {
close_door();
_G(flags).AutoAniPlay = true;
_G(mov_phasen)[CHEWY_OBJ].AtsText = 0;
@ -276,16 +276,16 @@ int16 Room17::energie_hebel() {
if (!_G(gameState).R17HebelOk) {
if (isCurInventory(BECHER_VOLL_INV)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R17HebelOk = true;
startAadWait(38);
action_flag = true;
} else if (!_G(cur)->usingInventoryCursors()) {
} else if (!_G(cur)->usingInventoryCursor()) {
startAadWait(37);
action_flag = true;
}
} else if (!_G(cur)->usingInventoryCursors()) {
} else if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
_G(obj)->calc_rsi_flip_flop(SIB_HEBEL_R17);
@ -317,7 +317,7 @@ int16 Room17::get_oel() {
int16 action_flag = false;
hideCur();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(4, P_CHEWY);
start_spz_wait(CH_EKEL, 3, false, P_CHEWY);
@ -329,7 +329,7 @@ int16 Room17::get_oel() {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(13, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(BECHER_VOLL_INV, &_G(room_blk));
inventory_2_cur(BECHER_VOLL_INV);
}

View file

@ -202,7 +202,7 @@ void Room18::monitor() {
int16 Room18::sonden_moni() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();
@ -231,7 +231,7 @@ int16 Room18::calc_surimy() {
action_flag = true;
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R18SurimyWurf = true;
_G(det)->load_taf_seq(245, 50, nullptr);
_G(det)->load_taf_seq(116, 55, nullptr);
@ -329,7 +329,7 @@ int16 Room18::calc_surimy() {
int16 Room18::calc_schalter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();
@ -344,7 +344,7 @@ int16 Room18::calc_schalter() {
short Room18::use_cart_moni() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
@ -378,7 +378,7 @@ short Room18::use_cart_moni() {
int16 Room18::go_cyberspace() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();

View file

@ -206,7 +206,7 @@ void Room21::chewy_kolli() {
}
void Room21::salto() {
if (!_G(cur)->usingInventoryCursors() && _G(atds)->get_ats_str(134, TXT_MARK_USE, ATS_DATA) == 8
if (!_G(cur)->usingInventoryCursor() && _G(atds)->get_ats_str(134, TXT_MARK_USE, ATS_DATA) == 8
&& !_G(gameState).R21Salto && !_G(flags).AutoAniPlay) {
_G(gameState).R21Salto = true;
_G(flags).AutoAniPlay = true;
@ -241,7 +241,7 @@ void Room21::use_gitter_energie() {
int16 Room21::use_fenster() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
if (!_G(cur)->usingInventoryCursor() && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
action_flag = true;
_G(flags).AutoAniPlay = true;
_G(gameState).R18Gitter = true;

View file

@ -79,7 +79,7 @@ bool Room22::timer(int16 t_nr, int16 ani_nr) {
int16 Room22::chewy_amboss() {
int16 action_flag = false;
if (!_G(gameState).R22ChewyPlatt && !_G(cur)->usingInventoryCursors() && !_G(flags).AutoAniPlay) {
if (!_G(gameState).R22ChewyPlatt && !_G(cur)->usingInventoryCursor() && !_G(flags).AutoAniPlay) {
action_flag = true;
_G(flags).AutoAniPlay = true;
hideCur();
@ -191,7 +191,7 @@ int16 Room22::malen() {
_G(gameState).R22Paint = true;
_G(obj)->calc_rsi_flip_flop(SIB_PAINT_R22);
_G(obj)->hide_sib(SIB_PAINT_R22);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->calc_all_static_detail();
_G(flags).AutoAniPlay = false;

View file

@ -57,7 +57,7 @@ void Room23::cockpit() {
int16 Room23::start_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
if (!_G(gameState).R23FluxoFlex)
startAadWait(23);
@ -129,7 +129,7 @@ int16 Room23::start_gleiter() {
}
void Room23::use_cartridge() {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R23Cartridge = true;
if (_G(gameState).R18CartSave) {

View file

@ -66,9 +66,9 @@ void Room25::entry() {
_G(atds)->set_ats_str(113, 0, ATS_DATA);
remove_inventory(TRANSLATOR_INV);
_G(cur)->setInventoryCursors(false);
_G(cur)->setInventoryCursor(-1);
_G(menu_item) = CUR_WALK;
_G(gameState).AkInvent = -1;
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(menu_item));
}
@ -100,7 +100,7 @@ int16 Room25::gleiter_loesch() {
hideCur();
if (!_G(gameState).R25GleiteLoesch && _G(gameState).R29Schlauch2) {
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
_G(gameState).R25GleiteLoesch = true;
autoMove(2, P_CHEWY);
@ -120,7 +120,7 @@ int16 Room25::gleiter_loesch() {
autoMove(2, P_CHEWY);
start_spz_wait((_G(gameState).ChewyAni == CHEWY_ROCKER) ? 28 : 14, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(MILCH_WAS_INV, &_G(room_blk));
inventory_2_cur(MILCH_WAS_INV);
startAadWait(253);
@ -134,7 +134,7 @@ int16 Room25::gleiter_loesch() {
int16 Room25::use_gleiter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && _G(gameState).R25GleiteLoesch) {
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R25GleiteLoesch) {
action_flag = true;
hideCur();
autoMove(3, P_CHEWY);

View file

@ -318,7 +318,7 @@ void Room28::get_pump() {
int16 Room28::use_breifkasten() {
int16 action_flag = false;
if (_G(gameState).R28Briefkasten && !_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R28Briefkasten && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
_G(gameState).R28Briefkasten = false;

View file

@ -81,7 +81,7 @@ int16 Room29::use_pumpe() {
_G(det)->showStaticSpr(7);
_G(atds)->delControlBit(218, ATS_ACTIVE_BIT);
delInventory(SCHLAUCH_INV);
} else if (!_G(cur)->usingInventoryCursors()) {
} else if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
startAadWait(62);
}
@ -94,7 +94,7 @@ int16 Room29::use_pumpe() {
int16 Room29::get_schlauch() {
int16 action_flag = false;
if (_G(gameState).R29Schlauch1 && !_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R29Schlauch1 && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
@ -161,7 +161,7 @@ void Room29::schlitz_sitz() {
int16 Room29::zaun_sprung() {
int16 action_flag = false;
if (_G(gameState).R29AutoSitz && !_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R29AutoSitz && !_G(cur)->usingInventoryCursor()) {
hideCur();
action_flag = true;

View file

@ -95,7 +95,7 @@ void Room31::calc_luke() {
int16 Room31::open_luke() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && _G(gameState).R31KlappeZu) {
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
@ -112,7 +112,7 @@ int16 Room31::open_luke() {
int16 Room31::close_luke_proc1() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R31KlappeZu) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
@ -145,13 +145,13 @@ int16 Room31::use_topf() {
int16 action_flag = false;
hideCur();
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
if (_G(gameState).R31PflanzeWeg) {
if (isCurInventory(K_KERNE_INV)) {
_G(gameState).R31KoernerDa = true;
autoMove(1, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
ani_nr = CH_TALK3;
dia_nr = 150;
_G(atds)->set_ats_str(242, 2, ATS_DATA);
@ -163,7 +163,7 @@ int16 Room31::use_topf() {
_G(gameState)._personHide[P_CHEWY] = true;
startAniBlock(3, ABLOCK30);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(obj)->addInventory(MILCH_LEER_INV, &_G(room_blk));
inventory_2_cur(MILCH_LEER_INV);
ani_nr = CH_TALK6;

View file

@ -97,8 +97,8 @@ void Room32::use_schreibmaschine() {
hideCur();
if (_G(gameState).R32HowardWeg) {
if (_G(cur)->usingInventoryCursors()) {
switch (_G(gameState).AkInvent) {
if (_G(cur)->usingInventoryCursor()) {
switch (_G(cur)->getInventoryCursor()) {
case CYB_KRONE_INV:
if (!_G(gameState).R32UseSchreib) {
if (!_G(gameState).R32PapierOk) {
@ -123,7 +123,7 @@ void Room32::use_schreibmaschine() {
autoMove(2, P_CHEWY);
_G(gameState).R32PapierOk = true;
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(231, TXT_MARK_LOOK, 1, ATS_DATA);
ani_nr = CH_TALK3;
dia_nr = 86;
@ -152,7 +152,7 @@ void Room32::use_schreibmaschine() {
int16 Room32::get_script() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R32Script && _G(gameState).R32UseSchreib) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R32Script && _G(gameState).R32UseSchreib) {
action_flag = true;
_G(gameState).R32Script = true;
autoMove(4, P_CHEWY);

View file

@ -81,7 +81,7 @@ void Room33::look_schublade() {
int16 Room33::use_schublade() {
int16 action_flag = false;
if (_G(gameState).R33SchubFirst && !_G(cur)->usingInventoryCursors() && !_G(gameState).R33Messer) {
if (_G(gameState).R33SchubFirst && !_G(cur)->usingInventoryCursor() && !_G(gameState).R33Messer) {
hideCur();
action_flag = true;
_G(gameState).R33Messer = true;
@ -106,10 +106,10 @@ void Room33::use_maschine() {
autoMove(4, P_CHEWY);
bool hocker = false;
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
bool action = true;
switch (_G(gameState).AkInvent) {
switch (_G(cur)->getInventoryCursor()) {
case MILCH_INV:
_G(gameState).R33Munter[3] = true;
invent_2_slot(MILCH_LEER_INV);
@ -140,7 +140,7 @@ void Room33::use_maschine() {
setPersonPos(128, 65, P_CHEWY, P_LEFT);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
hocker = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
ani_nr = CH_TALK12;
if (calc_muntermacher()) {
@ -199,7 +199,7 @@ bool Room33::calc_muntermacher() {
int16 Room33::get_munter() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R33MunterGet && _G(gameState).R33MunterOk) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R33MunterGet && _G(gameState).R33MunterOk) {
action_flag = true;
hideCur();
_G(gameState).R33MunterGet = true;

View file

@ -37,7 +37,7 @@ void Room34::entry() {
bool Room34::use_kuehlschrank() {
bool result = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
result = true;
if (!_G(flags).LoadGame) {

View file

@ -45,7 +45,7 @@ int16 Room35::schublade() {
int16 action_flag = false;
hideCur();
if (_G(gameState).ChewyAni != CHEWY_ROCKER && !_G(cur)->usingInventoryCursors()) {
if (_G(gameState).ChewyAni != CHEWY_ROCKER && !_G(cur)->usingInventoryCursor()) {
if (!_G(gameState).R35Schublade) {
action_flag = true;
autoMove(3, P_CHEWY);
@ -91,7 +91,7 @@ int16 Room35::use_cat() {
autoMove(4, P_CHEWY);
_G(gameState).R35CatEat = true;
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->stop_detail(0);
_G(det)->del_static_ani(0);
startSetAILWait(1, 1, ANI_FRONT);

View file

@ -103,7 +103,7 @@ void Room37::setup_func() {
short Room37::use_wippe() {
int16 action_flag = false;
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
action_flag = true;
if (isCurInventory(H_FUTTER_INV)) {
@ -113,7 +113,7 @@ short Room37::use_wippe() {
auto_scroll(129, 0);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(159);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
flic_cut(FCUT_047);
_G(flags).NoScroll = false;
showCur();
@ -144,7 +144,7 @@ int16 Room37::use_glas() {
auto_scroll(146, 0);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
startAadWait(147);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
flic_cut(FCUT_048);
flic_cut(FCUT_049);
invent_2_slot(GEBISS_INV);
@ -303,7 +303,7 @@ void Room37::use_hahn() {
inventory_2_cur(EIER_INV);
showCur();
}
} else if (_G(cur)->usingInventoryCursors()) {
} else if (_G(cur)->usingInventoryCursor()) {
startAadWait(143);
}
}

View file

@ -75,7 +75,7 @@ short Room39::use_howard() {
if (!_G(gameState).R39HowardWach) {
int16 dia_nr;
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
if (isCurInventory(MANUSKRIPT_INV)) {
hideCur();
_G(gameState).R39HowardWach = true;
@ -88,7 +88,7 @@ short Room39::use_howard() {
startSetAILWait(7, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->stop_detail(1);
startAniBlock(2, ABLOCK33);
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);

View file

@ -317,15 +317,14 @@ int16 Room40::use_mr_pumpkin() {
if (_G(menu_item) != CUR_HOWARD) {
hideCur();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = use_schalter(205);
} else {
switch (_G(gameState).AkInvent) {
switch (_G(cur)->getInventoryCursor()) {
case CENT_INV:
action_ret = true;
autoMove(5, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
startSetAILWait(15, 1, ANI_FRONT);
start_spz(CH_PUMP_TALK, 255, ANI_FRONT, P_CHEWY);
startAadWait(200);
@ -341,7 +340,7 @@ int16 Room40::use_mr_pumpkin() {
hideCur();
autoMove(8, P_CHEWY);
start_spz_wait(CH_PUMP_GET1, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(out)->fadeOut();
Room43::catch_pg();
remove_inventory(LIKOER_INV);
@ -603,7 +602,7 @@ bool Room40::use_police() {
int16 Room40::use_tele() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && _G(gameState).R40PoliceWeg == false) {
if (!_G(cur)->usingInventoryCursor() && _G(gameState).R40PoliceWeg == false) {
action_flag = true;
hideCur();
@ -635,7 +634,7 @@ int16 Room40::use_tele() {
if (dia_nr1 == 223) {
if (isCurInventory(DUENGER_INV)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
} else {
remove_inventory(DUENGER_INV);
}

View file

@ -177,7 +177,7 @@ void Room41::stop_hoggy() {
int16 Room41::use_kasse() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
stop_hoggy();
autoMove(1, P_CHEWY);
@ -191,7 +191,7 @@ int16 Room41::use_kasse() {
int16 Room41::use_lola() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R41LolaOk && _G(gameState).R41RepairInfo) {
if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R41LolaOk && _G(gameState).R41RepairInfo) {
hideCur();
action_flag = true;
_G(gameState).R41LolaOk = true;
@ -224,7 +224,7 @@ int16 Room41::use_brief() {
} else if (isCurInventory(BRIEF2_INV)) {
action_flag = true;
autoMove(6, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
stop_hoggy();
startAadWait(186);
start_hoggy();

View file

@ -98,10 +98,10 @@ int16 Room42::useMailBag() {
return action_flag;
hideCur();
if (!_G(gameState).R42BeamterWach && !_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R42BeamterWach && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
getPumpkin(136);
} else if (_G(gameState).R42HoToBeamter && !_G(cur)->usingInventoryCursors() && !_G(gameState).R42MarkeOk) {
} else if (_G(gameState).R42HoToBeamter && !_G(cur)->usingInventoryCursor() && !_G(gameState).R42MarkeOk) {
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
@ -123,7 +123,7 @@ int16 Room42::useMailBag() {
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(10, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
startAadWait(183);
_G(obj)->calc_rsi_flip_flop(SIB_BKASTEN_R28);
_G(atds)->set_ats_str(206, 1, ATS_DATA);

View file

@ -171,7 +171,7 @@ int16 Room45::use_taxi() {
hideCur();
autoMove(1, P_CHEWY);
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).ChewyAni == CHEWY_PUMPKIN) {
action_ret = true;
talk_taxi(254);

View file

@ -186,7 +186,7 @@ void Room46::kloppe() {
int16 Room46::use_schloss() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
if (!_G(gameState).R46GetLeder) {

View file

@ -47,7 +47,7 @@ int16 Room47::use_button(int16 txt_nr) {
int16 k_nr = 0;
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
switch (txt_nr) {

View file

@ -155,7 +155,7 @@ int16 Room49::use_boy() {
action_ret = true;
hideCur();
autoMove(3, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
talk_boy(265);
_G(gameState).R49WegFrei = true;
_G(gameState).room_e_obj[80].Attribut = EXIT_TOP;
@ -171,7 +171,7 @@ int16 Room49::use_boy() {
void Room49::use_boy_cigar() {
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
talk_boy(263);
_G(SetUpScreenFunc) = nullptr;
autoMove(5, P_CHEWY);
@ -242,7 +242,7 @@ void Room49::look_hotel() {
int16 Room49::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
startAniBlock(2, ABLOCK34);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -169,7 +170,7 @@ int16 Room50::use_gutschein() {
_G(room)->set_timer_status(1, TIMER_STOP);
_wasser = false;
stop_page();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
startAniBlock(2, ABLOCK36);
aad_page(274, 8);
} else {
@ -199,7 +200,7 @@ int16 Room50::use_gum() {
goAutoXy(112, 57, P_HOWARD, ANI_WAIT);
setPersonSpr(P_LEFT, P_HOWARD);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
hide_person();
startSetAILWait(2, 1, ANI_FRONT);
_G(det)->showStaticSpr(4);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -77,7 +78,7 @@ int16 Room52::use_hot_dog() {
autoMove(3, P_CHEWY);
start_spz_wait(CH_ROCK_GET1, 1, false, P_CHEWY);
_G(det)->showStaticSpr(0);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
autoMove(4, P_CHEWY);
_G(gameState).R52HotDogOk = true;
plot_armee(20);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -80,7 +81,7 @@ int16 Room53::use_man() {
action_ret = true;
hideCur();
_G(gameState).R53Kostuem = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
autoMove(2, P_CHEWY);
startAadWait(271);
_G(room)->set_timer_status(1, TIMER_STOP);

View file

@ -127,7 +127,7 @@ void Room54::setup_func() {
int16 Room54::use_schalter() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
action_ret = true;
@ -189,7 +189,7 @@ void Room54::talk_verkauf() {
if (!_G(gameState).R54HotDogOk) {
if (_G(gameState).R45MagOk) {
if (_G(gameState).AkInvent == DOLLAR175_INV)
if (_G(cur)->getInventoryCursor() == DOLLAR175_INV)
delInventory(DOLLAR175_INV);
else
remove_inventory(DOLLAR175_INV);
@ -229,7 +229,7 @@ int16 Room54::use_zelle() {
int16 action_ret = false;
hideCur();
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
if (isCurInventory(JMKOST_INV)) {
action_ret = true;
@ -243,7 +243,7 @@ int16 Room54::use_zelle() {
goAutoXy(239, 101, P_HOWARD, ANI_WAIT);
flic_cut(FCUT_069);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
invent_2_slot(LEDER_INV);
load_chewy_taf(CHEWY_JMANS);
_G(zoom_horizont) = 90;
@ -272,7 +272,7 @@ int16 Room54::use_zelle() {
int16 Room54::use_azug() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
@ -362,7 +362,7 @@ void Room54::aufzug_ab() {
short Room54::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
autoMove(7, P_CHEWY);

View file

@ -132,7 +132,7 @@ int16 Room55::use_stapel1() {
int16 action_ret = false;
hideCur();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
if (!_G(gameState).R55ScriptWeg) {
action_ret = true;
_G(gameState).R55ScriptWeg = true;
@ -154,7 +154,7 @@ int16 Room55::use_stapel1() {
autoMove(4, P_CHEWY);
_G(gameState).R55EscScriptOk = true;
_G(det)->showStaticSpr(0);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(354, 2, ATS_DATA);
} else {
startAadWait(326);
@ -181,7 +181,7 @@ int16 Room55::use_stapel2() {
int16 Room55::use_telefon() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
if (_G(gameState).R55EscScriptOk) {
if (!_G(gameState).R55RaumOk) {
@ -342,7 +342,7 @@ void Room55::verleger_mov(int16 mode) {
}
void Room55::strasse(int16 mode) {
if (!_G(cur)->usingInventoryCursors() || mode) {
if (!_G(cur)->usingInventoryCursor() || mode) {
_G(gameState)._personHide[P_CHEWY] = true;
_G(room)->set_timer_status(4, TIMER_STOP);
_G(det)->del_static_ani(4);
@ -379,7 +379,7 @@ int16 Room55::use_kammeraus() {
_G(gameState).R55ExitDia = 322;
_G(gameState).R55SekWeg = true;
_G(atds)->setControlBit(352, ATS_ACTIVE_BIT);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->setControlBit(345, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(346, ATS_ACTIVE_BIT);
strasse(1);

View file

@ -209,7 +209,7 @@ bool Room56::timer(int16 t_nr, int16 ani_nr) {
int16 Room56::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
autoMove(1, P_CHEWY);
@ -269,7 +269,7 @@ int16 Room56::use_man() {
_G(room)->set_timer_status(0, TIMER_START);
_G(det)->set_static_ani(0, -1);
} else {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R56AbfahrtOk = true;
startSetAILWait(6, 1, ANI_FRONT);
@ -287,7 +287,7 @@ int16 Room56::use_man() {
int16 Room56::use_kneipe() {
int16 action_ret = false;
if (!_G(gameState).flags32_10) {
if (_G(menu_item) == CUR_WALK && !_G(cur)->usingInventoryCursors() && _G(atds)->getControlBit(362, ATS_ACTIVE_BIT) == 0) {
if (_G(menu_item) == CUR_WALK && !_G(cur)->usingInventoryCursor() && _G(atds)->getControlBit(362, ATS_ACTIVE_BIT) == 0) {
action_ret = true;
hideCur();
if (_G(gameState).R56Kneipe) {
@ -347,7 +347,7 @@ int16 Room56::use_kneipe() {
startAadWait(518);
}
showCur();
} else if (_G(menu_item) == 0 || _G(menu_item) == 2 || (_G(menu_item) == 1 && !_G(cur)->usingInventoryCursors())){
} else if (_G(menu_item) == 0 || _G(menu_item) == 2 || (_G(menu_item) == 1 && !_G(cur)->usingInventoryCursor())){
hideCur();
action_ret = 1;
_G(mouseLeftClick) = false;

View file

@ -80,7 +80,7 @@ void Room57::setup_func() {
int16 Room57::use_taxi() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
hideCur();
autoMove(3, P_CHEWY);
@ -135,7 +135,7 @@ int16 Room57::use_pfoertner() {
if (_G(gameState).R56AbfahrtOk) {
startAadWait(341);
goAutoXy(176, 130, P_HOWARD, ANI_WAIT);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).R57StudioAuf = true;
_G(gameState).room_e_obj[91].Attribut = EXIT_TOP;
_G(det)->hideStaticSpr(4);

View file

@ -200,7 +200,7 @@ int16 Room63::use_fx_man() {
action_ret = true;
hideCur();
autoMove(1, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
remove_inventory(34);
startAadWait(359);
_G(det)->del_static_ani(5);
@ -218,7 +218,7 @@ int16 Room63::use_fx_man() {
int16 Room63::use_schalter() {
int16 action_ret = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
action_ret = true;
if (_G(gameState).R63FxMannWeg) {
if (_G(gameState).R62LauraVerwandlung) {
@ -267,7 +267,7 @@ int16 Room63::use_girl() {
action_ret = true;
hideCur();
autoMove(2, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->stop_detail(12);
startSetAILWait(13, 1, ANI_FRONT);
_G(det)->set_static_ani(14, -1);
@ -300,7 +300,7 @@ int16 Room63::use_aschenbecher() {
if (_G(gameState).R63Uhr) {
if (_G(gameState).R63FxMannWeg) {
autoMove(5, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(flags).NoScroll = true;
auto_scroll(70, 0);
autoMove(1, P_CHEWY);

View file

@ -146,7 +146,7 @@ void Room64::talk_man(int16 aad_nr) {
int16 Room64::use_tasche() {
int16 action_ret = false;
hideCur();
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
if (_G(gameState).R64ManWeg) {
if (!_G(atds)->getControlBit(375, ATS_ACTIVE_BIT)) {
autoMove(3, P_CHEWY);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -184,7 +185,7 @@ int Room66::proc7() {
hideCur();
autoMove(7, P_CHEWY);
if (_G(gameState).flags26_10) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
invent_2_slot(92);
invent_2_slot(93);
invent_2_slot(94);

View file

@ -106,7 +106,7 @@ void Room67::look_brief() {
int16 Room67::use_kommode() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
if (!_G(gameState).R67KommodeAuf) {
action_flag = true;
@ -139,7 +139,7 @@ void Room67::kostuem_aad(int16 aad_nr) {
int16 Room67::talk_papagei() {
int16 action_flag = false;
if (!_G(gameState).R67PapageiWeg && !_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R67PapageiWeg && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
hideCur();
_G(room)->set_timer_status(1, TIMER_STOP);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -187,7 +188,7 @@ int16 Room68::use_indigo() {
hideCur();
autoMove(3, P_CHEWY);
auto_scroll(78, 0);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
talk_indigo(394);
_G(cur_hide_flag) = false;
hideCur();
@ -246,7 +247,7 @@ int16 Room68::use_papagei() {
hideCur();
action_flag = true;
_G(gameState).R68Papagei = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
autoMove(5, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
_G(det)->showStaticSpr(12);
@ -285,7 +286,7 @@ int16 Room68::use_keeper() {
int16 action_flag = false;
if (isCurInventory(BAR_GUT_INV)) {
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
action_flag = true;
autoMove(2, P_CHEWY);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
@ -304,7 +305,7 @@ int16 Room68::use_diva() {
int16 action_flag;
hideCur();
if (isCurInventory(B_MARY_INV)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
action_flag = 1;
autoMove(4, P_CHEWY);
_G(uhr)->resetTimer(_G(timer_nr)[0], 0);
@ -313,7 +314,7 @@ int16 Room68::use_diva() {
_G(gameState).R68Gutschein = false;
_G(det)->showStaticSpr(3);
} else if (isCurInventory(B_MARY2_INV)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
action_flag = 1;
autoMove(4, P_CHEWY);
_G(det)->hideStaticSpr(3);
@ -348,7 +349,7 @@ void Room68::kostuem_aad(int16 aad_nr) {
startAadWait(389);
else {
_G(SetUpScreenFunc) = nullptr;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
goAutoXy(150, -13, P_NICHELLE, ANI_WAIT);
_G(gameState)._personHide[P_NICHELLE] = true;
goAutoXy(161, 59, P_HOWARD, ANI_GO);

View file

@ -85,7 +85,7 @@ void Room69::look_schild() {
int16 Room69::use_bruecke() {
int16 action_flag = false;
if (!_G(cur)->usingInventoryCursors()) {
if (!_G(cur)->usingInventoryCursor()) {
hideCur();
action_flag = true;

View file

@ -153,7 +153,7 @@ void Room71::setup_func() {
}
int Room71::proc1() {
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
_G(flags).NoScroll = false;
return 0;
}
@ -259,7 +259,7 @@ void Room71::proc5(int16 val) {
}
int Room71::proc6() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();

View file

@ -81,7 +81,7 @@ void Room73::xit(int16 eib_nr) {
}
int Room73::proc1() {
if (_G(cur)->usingInventoryCursors() && !_G(gameState).flags28_20)
if (_G(cur)->usingInventoryCursor() && !_G(gameState).flags28_20)
return 0;
hideCur();
@ -98,7 +98,7 @@ int Room73::proc1() {
}
int Room73::proc2() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();

View file

@ -104,7 +104,7 @@ int Room74::proc1() {
_G(gameState).flags29_1 = true;
_G(atds)->set_ats_str(435, 1, ATS_DATA);
} else if (!_G(cur)->usingInventoryCursors() && _G(gameState).R74CutRubberPlant) {
} else if (!_G(cur)->usingInventoryCursor() && _G(gameState).R74CutRubberPlant) {
_G(atds)->setControlBit(435, ATS_ACTIVE_BIT);
autoMove(5, P_CHEWY);
start_spz_wait(13, 1, false, P_CHEWY);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -156,7 +157,7 @@ int Room76::proc6() {
if (isCurInventory(93)) {
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).flags29_8 = true;
retVal = 1;
autoMove(3, P_CHEWY);
@ -187,7 +188,7 @@ int Room76::proc7() {
hideCur();
autoMove(6, P_CHEWY);
start_spz_wait(13, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
invent_2_slot(106);
invent_2_slot(105);
startAadWait(444);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -106,7 +107,7 @@ int Room77::proc2() {
int diaNr, aniId;
if (_G(gameState).flags29_8) {
start_spz_wait(14, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(464, 1, 1);
_G(gameState).flags29_20 = true;
_G(gameState).flags29_40 = true;

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -116,7 +117,7 @@ int Room81::proc2() {
start_spz_wait(13, 1, false, P_CHEWY);
aniId = 5;
diaNr = 462;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).flags30_2 = true;
} else if (isCurInventory(104)) {
aniId = 4;

View file

@ -158,7 +158,7 @@ int Room82::proc3() {
_G(det)->set_static_ani(0, -1);
start_spz_wait(13, 1, false, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
new_invent_2_cur(104);
showCur();
@ -209,7 +209,7 @@ int Room82::proc6() {
Room66::proc8(2, 7, 7, 451);
_G(gameState).flags30_20 = true;
_G(gameState).flags37_20 = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
remove_inventory(105);
remove_inventory(106);
} else {
@ -243,7 +243,7 @@ void Room82::proc8() {
}
int Room82::proc9() {
if (_G(cur)->usingInventoryCursors() || !_G(gameState).flags30_40)
if (_G(cur)->usingInventoryCursor() || !_G(gameState).flags30_40)
return 0;
autoMove(7, P_CHEWY);

View file

@ -186,7 +186,7 @@ void Room84::talk2() {
}
int Room84::proc4() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();

View file

@ -151,7 +151,7 @@ void Room85::setup_func() {
}
int Room85::proc2() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
autoMove(2, P_CHEWY);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/detail.h"
#include "chewy/events.h"
@ -152,7 +153,7 @@ int Room86::proc2() {
_G(det)->startDetail(0, 255, false);
g_engine->_sound->playSound(0, 0);
g_engine->_sound->playSound(0);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
autoMove(3, P_CHEWY);
proc3(true);
_G(atds)->delControlBit(499, ATS_ACTIVE_BIT);

View file

@ -133,7 +133,7 @@ int Room87::proc2(int16 txt_nr) {
startAadWait(diaNr);
} else {
autoMove(movNr, P_CHEWY);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
start_spz_wait(14, 1, false, P_CHEWY);
_G(atds)->set_ats_str(txt_nr, 1, ATS_DATA);
_G(det)->showStaticSpr(movNr);
@ -145,7 +145,7 @@ int Room87::proc2(int16 txt_nr) {
}
int Room87::proc4() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();

View file

@ -57,7 +57,7 @@ void Room88::xit() {
}
int Room88::proc1() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -71,7 +71,7 @@ int Room88::proc1() {
}
int Room88::proc2() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -90,7 +90,7 @@ int Room88::proc2() {
}
int Room88::proc3() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();

View file

@ -169,7 +169,7 @@ void Room89::talk1() {
}
int Room89::proc2() {
if (_G(cur)->usingInventoryCursors() || _G(gameState).flags33_2)
if (_G(cur)->usingInventoryCursor() || _G(gameState).flags33_2)
return 0;
hideCur();
@ -193,7 +193,7 @@ int Room89::proc2() {
}
int Room89::proc4() {
if (_G(cur)->usingInventoryCursors() || _G(gameState).flags32_80)
if (_G(cur)->usingInventoryCursor() || _G(gameState).flags32_80)
return 0;
hideCur();
@ -219,7 +219,7 @@ int Room89::proc4() {
}
int Room89::proc5() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
if (!_G(gameState).flags32_80 || !_G(gameState).flags33_1 || !_G(gameState).flags33_2)

View file

@ -235,7 +235,7 @@ void Room90::proc2() {
}
int Room90::getHubcaps() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -285,7 +285,7 @@ int Room90::shootControlUnit() {
return 0;
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(HowardMov) = 2;
_G(flags).ZoomMov = false;
autoMove(5, P_CHEWY);

View file

@ -19,6 +19,7 @@
*
*/
#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@ -136,7 +137,7 @@ int Room94::giveGhostBottle() {
hideCur();
autoMove(2, P_CHEWY);
auto_scroll(216, 0);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(flags).NoPalAfterFlc = true;

View file

@ -92,7 +92,7 @@ int Room95::proc2() {
hideCur();
autoMove(3, P_CHEWY);
if (isCurInventory(113)) {
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
start_spz_wait(14, 1, false, P_CHEWY);
_G(gameState).flags35_20 = true;
@ -102,7 +102,7 @@ int Room95::proc2() {
return 1;
}
if (_G(cur)->usingInventoryCursors()) {
if (_G(cur)->usingInventoryCursor()) {
showCur();
return 0;
}

View file

@ -400,7 +400,7 @@ int Room97::proc5() {
_G(gameState).scrollx = 720;
setPersonPos(822, 98, P_CHEWY, P_LEFT);
setPersonPos(861, 81, P_HOWARD, P_LEFT);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->showStaticSpr(21);
_G(gameState).flags35_80 = true;
startAadWait(546);
@ -414,7 +414,7 @@ int Room97::proc5() {
}
int Room97::proc6() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -448,7 +448,7 @@ int Room97::proc6() {
}
int Room97::proc7() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -484,7 +484,7 @@ int Room97::proc8() {
else {
start_spz_wait(14, 1, false, P_CHEWY);
_G(det)->startDetail(11, 255, false);
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(gameState).flags36_10 = true;
_G(gameState).flags36_8 = false;
_G(det)->startDetail(12, 255, false);
@ -529,7 +529,7 @@ int Room97::proc8() {
}
int Room97::proc9() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -557,7 +557,7 @@ int Room97::proc9() {
}
int Room97::proc10() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -577,7 +577,7 @@ int Room97::proc10() {
}
int Room97::proc11() {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
@ -664,7 +664,7 @@ int Room97::throwSlime() {
_slimeThrown = true;
hideCur();
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(CUR_USE);
@ -687,7 +687,7 @@ void Room97::sensorAnim() {
while (_G(det)->get_ani_status(16)) {
get_user_key(NO_SETUP);
if (_G(minfo).button == 1 || _G(in)->getSwitchCode() == 28) {
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
_G(mouseLeftClick) = true;
}
@ -705,7 +705,7 @@ void Room97::sensorAnim() {
_G(gameState)._personHide[P_CHEWY] = false;
} else {
_G(gameState).flags37_4 = true;
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(det)->showStaticSpr(27);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(21, 1, ANI_FRONT);

View file

@ -135,7 +135,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
case 71:
if (isCurInventory(ZANGE_INV))
Room8::hole_kohle();
else if (!_G(cur)->usingInventoryCursors())
else if (!_G(cur)->usingInventoryCursor())
Room8::start_verbrennen();
break;
@ -151,7 +151,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
case 77:
if (!_G(gameState).R10SurimyOk && !_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R10SurimyOk && !_G(cur)->usingInventoryCursor()) {
hideCur();
autoMove(3, P_CHEWY);
flic_cut(FCUT_004);
@ -168,7 +168,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 80:
if (_G(cur)->usingInventoryCursors())
if (_G(cur)->usingInventoryCursor())
autoMove(3, P_CHEWY);
break;
@ -2188,7 +2188,7 @@ void calc_inv_use_txt(int16 test_nr) {
case ANGEL_INV:
case KNOCHEN_INV:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
ret = del_invent_slot(test_nr);
@ -2205,21 +2205,21 @@ void calc_inv_use_txt(int16 test_nr) {
break;
case MESSER_INV:
if (_G(gameState).AkInvent == 40) {
delInventory(_G(gameState).AkInvent);
if (_G(cur)->getInventoryCursor() == 40) {
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
invent_2_slot(K_MASKE_INV);
invent_2_slot(K_FLEISCH_INV);
invent_2_slot(K_KERNE_INV);
} else if (_G(gameState).AkInvent == 88) {
} else if (_G(cur)->getInventoryCursor() == 88) {
_G(gameState).flags26_10 = true;
startAadWait(_G(gameState)._personRoomNr[P_CHEWY] + 350);
}
break;
case BRIEF_INV:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
_G(gameState).R42BriefMarke = true;
@ -2229,7 +2229,7 @@ void calc_inv_use_txt(int16 test_nr) {
break;
case FLASCHE_INV:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
// fall through
@ -2242,7 +2242,7 @@ void calc_inv_use_txt(int16 test_nr) {
case B_MARY_INV:
case PIRANHA_INV:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
ret = del_invent_slot(test_nr);
@ -2267,7 +2267,7 @@ void calc_inv_use_txt(int16 test_nr) {
case 102:
case 104:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(menu_item) = CUR_USE;
cursorChoice(CUR_USE);
@ -2277,7 +2277,7 @@ void calc_inv_use_txt(int16 test_nr) {
break;
case 105:
delInventory(_G(gameState).AkInvent);
delInventory(_G(cur)->getInventoryCursor());
_G(atds)->set_ats_str(105, 0, 1, 6);
_G(menu_item) = CUR_USE;
cursorChoice(CUR_USE);
@ -2335,7 +2335,7 @@ bool calc_inv_no_use(int16 test_nr, int16 mode) {
}
if (inv_mode != -1) {
int16 txt_nr = _G(atds)->calc_inv_no_use(_G(gameState).AkInvent, test_nr);
int16 txt_nr = _G(atds)->calc_inv_no_use(_G(cur)->getInventoryCursor(), test_nr);
if (txt_nr != -1) {
if (!_G(flags).InventMenu) {
if (txt_nr >= 15000) {
@ -2354,7 +2354,7 @@ bool calc_inv_no_use(int16 test_nr, int16 mode) {
int16 r_val = g_engine->getRandomNumber(5);
if (_G(flags).InventMenu) {
calc_inv_get_text(_G(gameState).AkInvent, test_nr);
calc_inv_get_text(_G(cur)->getInventoryCursor(), test_nr);
Dialogs::Inventory::look(-1, INV_USE_ATS_MODE, RAND_NO_USE[r_val] + 15000);
} else {
ret = startAtsWait(RAND_NO_USE[r_val], TXT_MARK_USE, 14, INV_USE_DEF);
@ -2454,7 +2454,7 @@ int16 calc_person_click(int16 p_nr) {
switch (p_nr) {
case P_CHEWY:
switch (_G(gameState).AkInvent) {
switch (_G(cur)->getInventoryCursor()) {
case K_MASKE_INV:
Room28::set_pump();
action_ret = true;
@ -2480,7 +2480,7 @@ int16 calc_person_click(int16 p_nr) {
break;
case P_HOWARD:
switch (_G(gameState).AkInvent) {
switch (_G(cur)->getInventoryCursor()) {
case GALA_INV:
if (_G(gameState)._personRoomNr[P_CHEWY] == 67) {
Room67::kostuem_aad(378);
@ -2495,7 +2495,7 @@ int16 calc_person_click(int16 p_nr) {
break;
case P_NICHELLE:
switch (_G(gameState).AkInvent) {
switch (_G(cur)->getInventoryCursor()) {
case GALA_INV:
if (_G(gameState)._personRoomNr[P_CHEWY] == 67) {
Room67::kostuem_aad(377);

View file

@ -55,7 +55,7 @@ bool GameState::synchronize(Common::Serializer &s) {
byte dummy = 0;
int16 dummy16 = 0;
byte inventoryCursors = _G(cur)->usingInventoryCursors();
int inventoryCursor = _G(cur)->getInventoryCursor();
// Sync the structure's bitflags
s.syncBytes((byte *)_flags, SPIELER_FLAGS_SIZE);
@ -73,8 +73,8 @@ bool GameState::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(InventY);
syncArray(s, InventSlot, MAX_MOV_OBJ);
s.syncAsSint16LE(AkInvent);
s.syncAsByte(inventoryCursors);
s.syncAsSint16LE(inventoryCursor);
s.syncAsByte(dummy); // obsolete inventoryCursor flag
s.syncAsSint16LE(dummy16); // curWidth
s.syncAsSint16LE(dummy16); // curHeight
@ -161,7 +161,7 @@ bool GameState::synchronize(Common::Serializer &s) {
s.syncAsByte(FramesPerSecond);
s.syncAsByte(dummy); // subtitles switch
_G(cur)->setInventoryCursors(inventoryCursors);
_G(cur)->setInventoryCursor(inventoryCursor);
return true;
}

View file

@ -404,8 +404,6 @@ struct GameState : public GameFlags {
int16 InventY = 0;
int16 InventSlot[MAX_MOV_OBJ] = { 0 };
int16 AkInvent = 0;
RoomMovObject room_m_obj[MAX_MOV_OBJ];
RoomStaticInventory room_s_obj[MAX_FEST_OBJ];
RoomExit room_e_obj[MAX_EXIT];