[Scummvm-git-logs] scummvm branch-2-6 -> 04a1f7dc47325174bd3786ebdae77ecf49e9b20b
bluegr
noreply at scummvm.org
Thu Jun 30 14:28:24 UTC 2022
This automated email contains information about 16 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
25b29bc963 CHEWY: Fix Unused Variable GCC Compiler Warning
15959aa5d4 CHEWY: Fix Signed vs. Unsigned GCC Compiler Warning
03439c7f3b CHEWY: Show the current room in the room console command
d9faf9bb66 CHEWY: Mark cursor 22 as blaster
c95b231bab CHEWY: Refactor the cursor handling code
e9e8ee9ee1 CHEWY: Further refactoring of the cursor code
edac2cb52b CHEWY: Add a console command to set the cursor
1c5d4e31d5 CHEWY: Some more renames for cursor defines
bfb954cc3d CHEWY: Cleanup invent_2_slot()
f846178f1d CHEWY: Fix setting blaster cursor - bug #13640
dffdf81eb0 CHEWY: Hide cursor when showing the Hermit's diary - bug #13639
b2c204b108 CHEWY: Fix typo (setSetailPos -> setDetailPos)
d7a0156318 CHEWY: Fix Howard and Chewy's position on the train - bug #13637
be9d94a9eb CHEWY: Cleanup inventory and show button arrows if needed - bug #13610
389026d47f CHEWY: Whitespace fixes
04a1f7dc47 GUI: Add missing domain when checking for subtitle config - bug #13629
Commit: 25b29bc96321281835731d1394441c03a00e0d1c
https://github.com/scummvm/scummvm/commit/25b29bc96321281835731d1394441c03a00e0d1c
Author: D G Turner (digitall at scummvm.org)
Date: 2022-06-30T17:27:53+03:00
Commit Message:
CHEWY: Fix Unused Variable GCC Compiler Warning
Changed paths:
engines/chewy/resource.cpp
diff --git a/engines/chewy/resource.cpp b/engines/chewy/resource.cpp
index aea96b44309..087be70e7d1 100644
--- a/engines/chewy/resource.cpp
+++ b/engines/chewy/resource.cpp
@@ -44,7 +44,7 @@ Resource::Resource(Common::String filename) {
const uint32 header = _stream.readUint32BE();
const bool isText = (header == headerTxtDec || header == headerTxtEnc);
const bool isSprite = (header == headerSprite);
- const bool isSpeech = filename.contains("speech.tvp");
+ //const bool isSpeech = filename.contains("speech.tvp");
const bool isBarrier = (header == headerBarrier);
if (header != headerGeneric && !isSprite && !isText && !isBarrier)
Commit: 15959aa5d425ccf77dcec342d81adc667db509f3
https://github.com/scummvm/scummvm/commit/15959aa5d425ccf77dcec342d81adc667db509f3
Author: D G Turner (digitall at scummvm.org)
Date: 2022-06-30T17:27:53+03:00
Commit Message:
CHEWY: Fix Signed vs. Unsigned GCC Compiler Warning
Changed paths:
engines/chewy/dialogs/cinema.cpp
diff --git a/engines/chewy/dialogs/cinema.cpp b/engines/chewy/dialogs/cinema.cpp
index 324c392a3ef..8425ea3fb9e 100644
--- a/engines/chewy/dialogs/cinema.cpp
+++ b/engines/chewy/dialogs/cinema.cpp
@@ -68,7 +68,7 @@ void Cinema::execute() {
// Render cut-scene list
for (int i = 0; i < CINEMA_LINES; ++i) {
- if ((topIndex + i) >= cutscenes.size())
+ if ((topIndex + i) >= (int)cutscenes.size())
continue;
cutsceneName = _G(atds)->getTextEntry(98,
Commit: 03439c7f3b455bd5b3ef11088f5954cd1f998ba2
https://github.com/scummvm/scummvm/commit/03439c7f3b455bd5b3ef11088f5954cd1f998ba2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:54+03:00
Commit Message:
CHEWY: Show the current room in the room console command
Changed paths:
engines/chewy/console.cpp
engines/chewy/console.h
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index 6230edb9b4e..a36cfeb0dfb 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -45,7 +45,7 @@ static int strToInt(const char *s) {
}
Console::Console() : GUI::Debugger() {
- registerCmd("room", WRAP_METHOD(Console, Cmd_GotoRoom));
+ registerCmd("room", WRAP_METHOD(Console, Cmd_Room));
registerCmd("item", WRAP_METHOD(Console, Cmd_Item));
registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound));
registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech));
@@ -58,9 +58,10 @@ Console::Console() : GUI::Debugger() {
Console::~Console() {
}
-bool Console::Cmd_GotoRoom(int argc, const char **argv) {
+bool Console::Cmd_Room(int argc, const char **argv) {
if (argc == 1) {
debugPrintf("%s <roomNum>\n", argv[0]);
+ debugPrintf("Current room is %d\n", _G(gameState)._personRoomNr[P_CHEWY]);
return true;
} else {
int roomNum = strToInt(argv[1]);
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index 736eabf09bd..09f88efbd23 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -28,7 +28,7 @@ namespace Chewy {
class Console : public GUI::Debugger {
protected:
- bool Cmd_GotoRoom(int argc, const char **argv);
+ bool Cmd_Room(int argc, const char **argv);
bool Cmd_Item(int argc, const char **argv);
bool Cmd_PlaySound(int argc, const char **argv);
bool Cmd_PlaySpeech(int argc, const char **argv);
Commit: d9faf9bb66fd9285ec0328bf706457407c2206d8
https://github.com/scummvm/scummvm/commit/d9faf9bb66fd9285ec0328bf706457407c2206d8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:54+03:00
Commit Message:
CHEWY: Mark cursor 22 as blaster
Changed paths:
engines/chewy/defines.h
engines/chewy/rooms/room91.cpp
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 5b3d44262b8..41facdfd2da 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -82,7 +82,7 @@ enum SetupScreenMode {
#define CUR_HOWARD 19
#define CUR_ZEIGE 20
#define CUR_NICHELLE 21
-#define CUR_22 22
+#define CUR_BLASTER 22
#define EXIT_LEFT_SPR 26
#define EXIT_RIGHT_SPR 27
#define EXIT_ABOVE_SPR 28
diff --git a/engines/chewy/rooms/room91.cpp b/engines/chewy/rooms/room91.cpp
index 73b8d17d8ff..a1b2075f2b2 100644
--- a/engines/chewy/rooms/room91.cpp
+++ b/engines/chewy/rooms/room91.cpp
@@ -104,7 +104,7 @@ void Room91::setup_func() {
_G(menu_item) = CUR_USE;
cur_2_inventory();
- cursorChoice(CUR_22);
+ cursorChoice(CUR_BLASTER);
if (_G(mouseLeftClick) == 0 || _click)
return;
Commit: c95b231babe01609ce024c83d9a337529427bd8e
https://github.com/scummvm/scummvm/commit/c95b231babe01609ce024c83d9a337529427bd8e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:54+03:00
Commit Message:
CHEWY: Refactor the cursor handling code
Changed paths:
engines/chewy/chewy.cpp
engines/chewy/cursor.cpp
engines/chewy/cursor.h
engines/chewy/dialogs/cinema.cpp
engines/chewy/dialogs/files.cpp
engines/chewy/dialogs/inventory.cpp
engines/chewy/dialogs/main_menu.cpp
engines/chewy/dialogs/options.cpp
engines/chewy/globals.h
engines/chewy/inits.cpp
engines/chewy/main.cpp
engines/chewy/mcga_graphics.cpp
engines/chewy/mcga_graphics.h
engines/chewy/menus.cpp
engines/chewy/ngstypes.h
engines/chewy/rooms/room00.cpp
engines/chewy/rooms/room04.cpp
engines/chewy/rooms/room08.cpp
engines/chewy/rooms/room11.cpp
engines/chewy/rooms/room12.cpp
engines/chewy/rooms/room13.cpp
engines/chewy/rooms/room14.cpp
engines/chewy/rooms/room16.cpp
engines/chewy/rooms/room17.cpp
engines/chewy/rooms/room18.cpp
engines/chewy/rooms/room21.cpp
engines/chewy/rooms/room22.cpp
engines/chewy/rooms/room23.cpp
engines/chewy/rooms/room24.cpp
engines/chewy/rooms/room25.cpp
engines/chewy/rooms/room28.cpp
engines/chewy/rooms/room29.cpp
engines/chewy/rooms/room31.cpp
engines/chewy/rooms/room32.cpp
engines/chewy/rooms/room33.cpp
engines/chewy/rooms/room34.cpp
engines/chewy/rooms/room35.cpp
engines/chewy/rooms/room37.cpp
engines/chewy/rooms/room39.cpp
engines/chewy/rooms/room40.cpp
engines/chewy/rooms/room41.cpp
engines/chewy/rooms/room42.cpp
engines/chewy/rooms/room45.cpp
engines/chewy/rooms/room46.cpp
engines/chewy/rooms/room47.cpp
engines/chewy/rooms/room49.cpp
engines/chewy/rooms/room54.cpp
engines/chewy/rooms/room55.cpp
engines/chewy/rooms/room56.cpp
engines/chewy/rooms/room57.cpp
engines/chewy/rooms/room63.cpp
engines/chewy/rooms/room64.cpp
engines/chewy/rooms/room67.cpp
engines/chewy/rooms/room69.cpp
engines/chewy/rooms/room71.cpp
engines/chewy/rooms/room73.cpp
engines/chewy/rooms/room74.cpp
engines/chewy/rooms/room82.cpp
engines/chewy/rooms/room84.cpp
engines/chewy/rooms/room85.cpp
engines/chewy/rooms/room87.cpp
engines/chewy/rooms/room88.cpp
engines/chewy/rooms/room89.cpp
engines/chewy/rooms/room90.cpp
engines/chewy/rooms/room95.cpp
engines/chewy/rooms/room97.cpp
engines/chewy/t_event.cpp
engines/chewy/types.cpp
engines/chewy/types.h
engines/chewy/video/video_player.cpp
diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp
index 3d117e53dfa..b5830d40db7 100644
--- a/engines/chewy/chewy.cpp
+++ b/engines/chewy/chewy.cpp
@@ -23,8 +23,8 @@
#include "common/fs.h"
#include "common/system.h"
#include "engines/util.h"
-#include "graphics/palette.h"
#include "chewy/chewy.h"
+#include "chewy/cursor.h"
#include "chewy/console.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -108,7 +108,7 @@ Common::Error ChewyEngine::loadGameStream(Common::SeekableReadStream *stream) {
_G(flags).LoadGame = true;
- if (_G(gameState).inv_cur && _G(gameState).AkInvent != -1) {
+ if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1) {
_G(menu_item) = CUR_USE;
}
diff --git a/engines/chewy/cursor.cpp b/engines/chewy/cursor.cpp
index b5bb8170c9a..56087d2afc2 100644
--- a/engines/chewy/cursor.cpp
+++ b/engines/chewy/cursor.cpp
@@ -26,17 +26,42 @@
namespace Chewy {
-Cursor::Cursor(CurBlk *curblkp) {
- _curblk = curblkp;
+Cursor::Cursor() {
+ const auto res = new SpriteResource(CURSOR_TAF);
+ const auto invRes = new SpriteResource(INVENTORY_TAF);
+ _cursorCount = res->getChunkCount();
+ _invCursorCount = invRes->getChunkCount();
+ _curSprites = new CursorSprite[_cursorCount + _invCursorCount];
- _curAniCountdown = 0;
- _aniCount = 0;
+ for (uint32 i = 0; i < _cursorCount + _invCursorCount; i++) {
+ const TAFChunk *sprite = (i < _cursorCount) ? res->getSprite(i) : invRes->getSprite(i - _cursorCount);
+ _curSprites[i].width = sprite->width;
+ _curSprites[i].height = sprite->height;
+ _curSprites[i].data = new byte[sprite->width * sprite->height];
+ memcpy(_curSprites[i].data, sprite->data, sprite->width * sprite->height);
+ delete sprite;
+ }
+
+ delete invRes;
+ delete res;
+
+ _currentCursor.data = _customCursor.data = nullptr;
+ _currentCursor.width = _customCursor.width = 0;
+ _currentCursor.height = _customCursor.height = 0;
+
+ clearCustomCursor();
}
Cursor::~Cursor() {
+ for (uint32 i = 0; i < _cursorCount + _invCursorCount; i++) {
+ delete[] _curSprites[i].data;
+ _curSprites[i].data = nullptr;
+ }
+
+ delete[] _curSprites;
}
-void Cursor::plot_cur() {
+void Cursor::updateCursor() {
if (CursorMan.isVisible()) {
--_curAniCountdown;
if (_curAniCountdown <= 0) {
@@ -46,18 +71,27 @@ void Cursor::plot_cur() {
_aniCount = _animStart;
}
- const uint16 w = READ_LE_INT16(_curblk->sprite[_aniCount]);
- const uint16 h = READ_LE_INT16(_curblk->sprite[_aniCount] + 2);
- CursorMan.replaceCursor(_curblk->sprite[_aniCount] + 4, w, h, 0, 0, 0);
+ 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;
+ }
}
}
-void Cursor::show_cur() {
+void Cursor::showCursor() {
CursorMan.showMouse(true);
- plot_cur();
+ updateCursor();
}
-void Cursor::hide_cur() {
+void Cursor::hideCursor() {
CursorMan.showMouse(false);
}
@@ -69,6 +103,34 @@ void Cursor::setAnimation(uint8 start, uint8 end, int16 delay) {
_curAniCountdown = 0;
}
+void Cursor::setCustomRoomCursor(byte *roomSprite) {
+ const uint16 width = READ_LE_INT16(roomSprite);
+ const uint16 height = READ_LE_INT16(roomSprite + 2);
+ setCustomCursor(roomSprite + 4, width, height);
+}
+
+void Cursor::setCustomCursor(byte *data, uint16 width, uint16 height) {
+ _currentCursor.data = _customCursor.data = data;
+ _currentCursor.width = _customCursor.width = width;
+ _currentCursor.height = _customCursor.height = height;
+
+ CursorMan.replaceCursor(_customCursor.data, _customCursor.width, _customCursor.height, 0, 0, 0);
+}
+
+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;
+ }
+}
+
void Cursor::move(int16 x, int16 y) {
g_events->warpMouse(Common::Point(x, y));
}
diff --git a/engines/chewy/cursor.h b/engines/chewy/cursor.h
index 698df518bdd..6fd96deb127 100644
--- a/engines/chewy/cursor.h
+++ b/engines/chewy/cursor.h
@@ -22,27 +22,49 @@
#ifndef CHEWY_CURSOR_H
#define CHEWY_CURSOR_H
-#include "chewy/mcga_graphics.h"
-#include "chewy/ngstypes.h"
#include "chewy/mouse.h"
namespace Chewy {
+struct CursorSprite {
+ uint16 width;
+ uint16 height;
+ byte *data;
+};
+
class Cursor {
public:
Cursor();
- Cursor(CurBlk *curblk);
~Cursor();
- void plot_cur();
- void show_cur();
- void hide_cur();
+ void updateCursor();
+ void showCursor();
+ void hideCursor();
void setAnimation(uint8 start, uint8 end, int16 delay);
+ void setCustomCursor(byte *data, uint16 width, uint16 height);
+ void setCustomRoomCursor(byte *roomSprite);
+ void clearCustomCursor();
void move(int16 x, int16 y);
uint8 getAnimStart() const { return _animStart; }
- CurBlk *_curblk = nullptr;
- int _scrWidth = 0;
+ byte *getCursorSprite() const { return _currentCursor.data; }
+ uint16 getCursorWidth() const { return _currentCursor.width; }
+ uint16 getCursorHeight() const { return _currentCursor.height; }
+ byte *getCursorSprite(uint num) const { return _curSprites[num].data; }
+ 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; }
+
+private:
+ CursorSprite *_curSprites = nullptr;
+ CursorSprite _customCursor;
+ CursorSprite _currentCursor;
+ uint32 _cursorCount = 0;
+ uint32 _invCursorCount = 0;
+ uint32 _cursorOffset = 0;
+
int16 _curAniCountdown = 0;
int16 _aniCount = 0;
diff --git a/engines/chewy/dialogs/cinema.cpp b/engines/chewy/dialogs/cinema.cpp
index 8425ea3fb9e..fe6ccef0c11 100644
--- a/engines/chewy/dialogs/cinema.cpp
+++ b/engines/chewy/dialogs/cinema.cpp
@@ -174,7 +174,7 @@ void Cinema::execute() {
txt_anz = 0;
if (!txt_anz) {
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
if (flag) {
flag = false;
diff --git a/engines/chewy/dialogs/files.cpp b/engines/chewy/dialogs/files.cpp
index 72da8865cc8..4d25138c377 100644
--- a/engines/chewy/dialogs/files.cpp
+++ b/engines/chewy/dialogs/files.cpp
@@ -261,7 +261,7 @@ enter:
const int16 slotNum = text_off + active_slot;
for (uint j = 0; j < saveList.size(); ++j) {
if (saveList[j].getSaveSlot() == slotNum) {
- _G(cur)->hide_cur();
+ _G(cur)->hideCursor();
g_engine->loadGameState(slotNum);
key = Common::KEYCODE_ESCAPE;
break;
@@ -288,7 +288,7 @@ enter:
break;
}
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
EVENTS_UPDATE;
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index a754776bd48..77da706672c 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -89,8 +89,14 @@ void Inventory::plot_menu() {
y = 3;
else
y = 0;
- _G(out)->spriteSet(_G(curtaf)->image[_G(ani_count)[i]],
- WIN_INF_X + 8 + i * 32, WIN_INF_Y + 12 - y, _G(scr_width));
+ _G(out)->spriteSet(
+ _G(cur)->getCursorSprite(_G(ani_count)[i]),
+ WIN_INF_X + 8 + i * 32,
+ WIN_INF_Y + 12 - y,
+ _G(scr_width),
+ _G(cur)->getCursorWidth(_G(ani_count)[i]),
+ _G(cur)->getCursorHeight(_G(ani_count)[i])
+ );
}
for (int16 i = 0; i < 2; i++) {
@@ -278,14 +284,14 @@ void Inventory::menu() {
case Common::KEYCODE_ESCAPE:
if (!menuFirstFl) {
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
while (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE) {
SHOULD_QUIT_RETURN;
setupScreen(NO_SETUP);
inv_rand_x = -1;
inv_rand_y = -1;
plot_menu();
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
}
} else {
@@ -297,7 +303,7 @@ void Inventory::menu() {
break;
case Common::KEYCODE_RIGHT:
- if (g_events->_mousePos.x < 320 - _G(gameState)._curWidth)
+ if (g_events->_mousePos.x < 320 - _G(cur)->getCursorWidth())
g_events->_mousePos.x += 3;
break;
@@ -312,7 +318,7 @@ void Inventory::menu() {
break;
case Common::KEYCODE_DOWN:
- if (g_events->_mousePos.y < 197 - _G(gameState)._curHeight)
+ if (g_events->_mousePos.y < 197 - _G(cur)->getCursorHeight())
g_events->_mousePos.y += 3;
break;
@@ -342,7 +348,7 @@ void Inventory::menu() {
plot_menu();
}
if (menu_flag1 == false)
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->setPointer(nullptr);
if (menu_flag1 == MENU_DISPLAY) {
_G(fx)->blende1(_G(workptr), nullptr, 0, 300);
@@ -362,7 +368,7 @@ void Inventory::menu() {
while (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE && !SHOULD_QUIT) {
setupScreen(NO_SETUP);
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
}
@@ -530,7 +536,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
}
}
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
SHOULD_QUIT_RETURN0;
}
@@ -538,7 +544,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
while (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE) {
setupScreen(NO_SETUP);
plot_menu();
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
SHOULD_QUIT_RETURN0;
}
@@ -566,7 +572,7 @@ void Inventory::look_screen(int16 txt_mode, int16 txt_nr) {
case CUR_HOWARD:
case CUR_NICHELLE:
m_mode = TXT_MARK_USE;
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
ok = false;
break;
diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp
index 3c3b7b6da45..0162bbc7875 100644
--- a/engines/chewy/dialogs/main_menu.cpp
+++ b/engines/chewy/dialogs/main_menu.cpp
@@ -53,7 +53,7 @@ void MainMenu::execute() {
_G(cur)->move(152, 92);
g_events->_mousePos.x = 152;
g_events->_mousePos.y = 92;
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_display) = 0;
_G(gameState).soundLoopMode = 1;
@@ -159,7 +159,7 @@ void MainMenu::animate() {
spriteEngine();
kb_mov(1);
calcMouseText(g_events->_mousePos.x, g_events->_mousePos.y, 1);
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(mouseLeftClick) = false;
_G(out)->setPointer(nullptr);
_G(out)->copyToScreen();
@@ -207,7 +207,7 @@ bool MainMenu::loadGame() {
_G(savegameFlag) = true;
int result = Dialogs::Files::execute(false);
- cursorChoice((_G(gameState).inv_cur && _G(gameState).AkInvent != -1 &&
+ cursorChoice((_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 &&
_G(menu_item) == CUR_USE) ? 8 : 0);
_G(cur_display) = true;
restorePersonAni();
@@ -232,7 +232,7 @@ void MainMenu::playGame() {
_G(flags).mainMouseFlag = false;
_G(flags).MainInput = true;
_G(flags).ShowAtsInvTxt = true;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
_G(moveState)[P_CHEWY].Count = 0;
_G(uhr)->resetTimer(0, 0);
diff --git a/engines/chewy/dialogs/options.cpp b/engines/chewy/dialogs/options.cpp
index d95075807b7..5f73b116e52 100644
--- a/engines/chewy/dialogs/options.cpp
+++ b/engines/chewy/dialogs/options.cpp
@@ -218,7 +218,7 @@ void Options::execute(TafInfo *ti) {
break;
}
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
_G(out)->copyToScreen();
EVENTS_UPDATE;
SHOULD_QUIT_RETURN;
diff --git a/engines/chewy/globals.h b/engines/chewy/globals.h
index b59250aec34..676f4debe01 100644
--- a/engines/chewy/globals.h
+++ b/engines/chewy/globals.h
@@ -177,7 +177,6 @@ public:
RoomDetailInfo *_Rdi = nullptr;
StaticDetailInfo *_Sdi = nullptr;
AniDetailInfo *_Adi = nullptr;
- TafInfo *_curtaf = nullptr;
TafInfo *_menutaf = nullptr;
TafSeqInfo *_howard_taf = nullptr;
TafInfo *_chewy = nullptr;
@@ -204,7 +203,6 @@ public:
bool _ani_stand_flag[MAX_PERSON] = { false };
MouseInfo _minfo;
- CurBlk _curblk;
RaumBlk _room_blk;
Flags _flags = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index ef669726d50..f98a0e36671 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -50,13 +50,7 @@ void standard_init() {
_G(out)->cls();
_G(scr_width) = 0;
- // WORKAROUND: Moved from init_load because the original
- // uses _G(curtaf)->_image below before _G(curtaf) was initialized
- _G(curtaf) = _G(mem)->taf_adr(CURSOR_TAF);
-
- _G(curblk).sprite = _G(curtaf)->image;
-
- _G(cur) = new Cursor(&_G(curblk));
+ _G(cur) = new Cursor();
_G(cur)->setAnimation(0, 0, 0);
alloc_buffers();
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 3c573297395..7a88e114a01 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -84,20 +84,21 @@ void free_buffers() {
free(_G(menutaf));
free(_G(chewy));
- free(_G(curtaf));
free(_G(Ci).tempArea);
free(_G(pal));
free(_G(workpage));
}
void cursorChoice(int16 nr) {
- int16 ok = true;
int16 delay = -1;
if (nr != CUR_USER) {
- _G(curblk).sprite = _G(curtaf)->image;
delay = (1 + _G(gameState).DelaySpeed) * 5;
+ _G(cur)->clearCustomCursor();
}
+
+ _G(cur)->setInventoryCursors(false);
+
switch (nr) {
case CUR_WALK:
_G(cur)->setAnimation(0, 3, delay);
@@ -131,8 +132,7 @@ void cursorChoice(int16 nr) {
break;
case CUR_AK_INVENT:
_G(cur)->setAnimation(_G(gameState).AkInvent, _G(gameState).AkInvent, delay);
- _G(curblk).sprite = &_G(inv_spr)[0];
- _G(gameState).inv_cur = true;
+ _G(cur)->setInventoryCursors(true);
break;
case CUR_SAVE:
_G(cur)->setAnimation(25, 25, delay);
@@ -164,28 +164,22 @@ void cursorChoice(int16 nr) {
case CUR_USER:
break;
default:
- ok = false;
break;
}
-
- if (ok) {
- _G(gameState)._curWidth = READ_LE_INT16(_G(curblk).sprite[_G(cur)->getAnimStart()]);
- _G(gameState)._curHeight = READ_LE_INT16(_G(curblk).sprite[_G(cur)->getAnimStart()] + 2);
- }
}
void hideCur() {
if (!_G(cur_hide_flag)) {
_G(cur_hide_flag) = true;
_G(flags).ShowAtsInvTxt = false;
- _G(cur)->hide_cur();
+ _G(cur)->hideCursor();
_G(flags).CursorStatus = false;
}
}
void showCur() {
_G(flags).ShowAtsInvTxt = true;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
_G(flags).CursorStatus = true;
}
@@ -208,36 +202,36 @@ bool mainLoop(int16 mode) {
if (_G(flags).MainInput) {
switch (g_events->_kbInfo._scanCode) {
case Common::KEYCODE_F1:
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_WALK;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
cursorChoice(_G(menu_item));
if (_G(menu_display) == MENU_DISPLAY)
_G(menu_display) = MENU_HIDE;
break;
case Common::KEYCODE_F2:
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_USE;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
cursorChoice(_G(menu_item));
if (_G(menu_display) == MENU_DISPLAY)
_G(menu_display) = MENU_HIDE;
break;
case Common::KEYCODE_F3:
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_LOOK;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
cursorChoice(_G(menu_item));
if (_G(menu_display) == MENU_DISPLAY)
_G(menu_display) = MENU_HIDE;
break;
case Common::KEYCODE_F4:
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_TALK;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
cursorChoice(_G(menu_item));
if (_G(menu_display) == MENU_DISPLAY)
_G(menu_display) = MENU_HIDE;
@@ -250,7 +244,7 @@ bool mainLoop(int16 mode) {
_G(maus_old_y) = g_events->_mousePos.y;
_G(menu_item) = CUR_USE;
menuEntry();
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
Dialogs::Inventory::menu();
menuExit();
_G(menu_display) = 0;
@@ -258,7 +252,7 @@ bool mainLoop(int16 mode) {
if (_G(gameState).AkInvent == -1) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
@@ -279,20 +273,20 @@ bool mainLoop(int16 mode) {
retValue = true;
_G(fx_blend) = BLEND4;
}
- if (_G(gameState).inv_cur && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
+ if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
cursorChoice(_G(menu_item));
_G(cur_display) = true;
_G(flags).SaveMenu = false;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
_G(out)->setPointer(_G(workptr));
break;
case Common::KEYCODE_ESCAPE:
if (_G(menu_display) == 0) {
menuEntry();
- _G(cur)->hide_cur();
+ _G(cur)->hideCursor();
_G(tmp_menu_item) = _G(menu_item);
_G(maus_old_x) = g_events->_mousePos.x;
_G(maus_old_y) = g_events->_mousePos.y;
@@ -301,10 +295,10 @@ bool mainLoop(int16 mode) {
_G(cur)->move((MOUSE_MENU_MAX_X / 5) * (_G(menu_item)), 100);
} else {
menuExit();
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
_G(menu_item) = _G(tmp_menu_item);
_G(menu_display) = MENU_HIDE;
- if (_G(gameState).inv_cur && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
+ if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
cursorChoice(_G(menu_item));
@@ -317,7 +311,7 @@ bool mainLoop(int16 mode) {
_G(menu_item) = CUR_USE;
menuEntry();
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
Dialogs::Inventory::menu();
menuExit();
_G(menu_display) = 0;
@@ -325,7 +319,7 @@ bool mainLoop(int16 mode) {
if (_G(gameState).AkInvent == -1) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
@@ -353,27 +347,27 @@ bool mainLoop(int16 mode) {
_G(menu_item) = _G(tmp_menu_item);
_G(menu_display) = MENU_HIDE;
- if (_G(gameState).inv_cur && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
+ if (_G(cur)->usingInventoryCursors() && _G(gameState).AkInvent != -1 && _G(menu_item) == CUR_USE) {
cursorChoice(CUR_AK_INVENT);
} else
cursorChoice(_G(tmp_menu_item));
_G(cur_display) = true;
_G(flags).SaveMenu = false;
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
}
break;
default:
if (_G(menu_display) != 0) {
menuExit();
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
_G(menu_display) = 0;
_G(cur_display) = true;
_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(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
cursorChoice(_G(menu_item));
}
break;
@@ -555,12 +549,18 @@ void setupScreen(SetupScreenMode mode) {
calc_mouse_person(g_events->_mousePos.x, g_events->_mousePos.y);
}
}
- if (_G(cur_display) == true && mode == DO_SETUP) {
- _G(cur)->plot_cur();
-
- if ((_G(gameState).inv_cur) && (_G(flags).CursorStatus == true))
- _G(out)->spriteSet(_G(curtaf)->image[_G(pfeil_ani) + 32], g_events->_mousePos.x, g_events->_mousePos.y,
- _G(scr_width));
+ if (_G(cur_display) && mode == DO_SETUP) {
+ _G(cur)->updateCursor();
+
+ if (_G(cur)->usingInventoryCursors() && _G(flags).CursorStatus)
+ _G(out)->spriteSet(
+ _G(cur)->getCursorSprite(),
+ g_events->_mousePos.x,
+ g_events->_mousePos.y,
+ _G(scr_width),
+ _G(cur)->getCursorWidth(),
+ _G(cur)->getCursorHeight()
+ );
if (_G(pfeil_delay) == 0) {
_G(pfeil_delay) = _G(gameState).DelaySpeed;
if (_G(pfeil_ani) < 4)
@@ -657,7 +657,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(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
evaluateObj(nr, txt_mode);
} else {
if (txt_mode == INVENTORY_NORMAL) {
@@ -678,7 +678,7 @@ void mous_obj_action(int16 nr, int16 mode, int16 txt_mode, int16 txt_nr) {
_G(gameState)._personHide[P_CHEWY] = false;
}
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
_G(moveState)[P_CHEWY]._delayCount = 0;
@@ -700,7 +700,7 @@ void kb_mov(int16 mode) {
while (!ende) {
switch (_G(in)->getSwitchCode()) {
case Common::KEYCODE_RIGHT:
- if (g_events->_mousePos.x < 320 - _G(gameState)._curWidth)
+ if (g_events->_mousePos.x < 320 - _G(cur)->getCursorWidth())
_G(cur)->move(g_events->_mousePos.x + 2, g_events->_mousePos.y);
break;
@@ -715,7 +715,7 @@ void kb_mov(int16 mode) {
break;
case Common::KEYCODE_DOWN:
- if (g_events->_mousePos.y < 210 - _G(gameState)._curHeight)
+ if (g_events->_mousePos.y < 210 - _G(cur)->getCursorHeight())
_G(cur)->move(g_events->_mousePos.x, g_events->_mousePos.y + 2);
break;
@@ -781,12 +781,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(gameState).inv_cur && !_G(inv_disp_ok) && _G(gameState).AkInvent != -1) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(inv_disp_ok) && _G(gameState).AkInvent != -1) {
cursorChoice(CUR_USE);
}
_G(inv_disp_ok) = true;
} else {
- if (!_G(gameState).inv_cur && _G(inv_disp_ok)) {
+ if (!_G(cur)->usingInventoryCursors() && _G(inv_disp_ok)) {
cursorChoice(_G(menu_item));
}
_G(inv_disp_ok) = false;
@@ -804,10 +804,10 @@ void mouseAction() {
g_events->_kbInfo._scanCode = Common::KEYCODE_RETURN;
else if (_G(gameState).AkInvent != -1) {
if (_G(inv_disp_ok)) {
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
@@ -884,7 +884,7 @@ void evaluateObj(int16 testNr, int16 mode) {
showCur();
sib_event_inv(testNr);
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
_G(menu_item) = _G(menu_item_vorwahl);
cursorChoice(_G(menu_item));
}
@@ -931,7 +931,7 @@ void evaluateObj(int16 testNr, int16 mode) {
_G(obj)->calc_all_static_detail();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
if (sib_ret || action_flag) {
_G(menu_item) = _G(menu_item_vorwahl);
@@ -972,7 +972,7 @@ void evaluateObj(int16 testNr, int16 mode) {
showCur();
sib_event_no_inv(testNr);
_G(obj)->calc_all_static_detail();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
_G(menu_item) = _G(menu_item_vorwahl);
cursorChoice(_G(menu_item));
}
@@ -1299,7 +1299,7 @@ int16 calcMouseText(int16 x, int16 y, int16 mode) {
case CUR_USER:
case CUR_USE:
txtMode = TXT_MARK_USE;
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
ok = false;
break;
@@ -1445,9 +1445,9 @@ void calc_mouse_person(int16 x, int16 y) {
char *str_ = ch_txt[p_nr];
calcTxtXy(&x, &y, str_, 1);
printShadowed(x, y, 255, 300, 0, _G(scr_width), str_);
- if (_G(mouseLeftClick) == 1) {
+ if (_G(mouseLeftClick)) {
int16 def_nr = -1;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
int16 txt_nr = calc_person_txt(p_nr);
switch (_G(menu_item)) {
case CUR_LOOK:
@@ -1583,7 +1583,7 @@ void get_user_key(int16 mode) {
if (_G(gameState).AkInvent == -1) {
_G(menu_item) = _G(tmp_menu_item);
cursorChoice(_G(menu_item));
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
} else {
_G(menu_item) = CUR_USE;
cursorChoice(CUR_AK_INVENT);
@@ -1617,7 +1617,7 @@ void set_ani_screen() {
void delInventory(int16 nr) {
_G(obj)->delInventory(nr, &_G(room_blk));
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_WALK;
_G(gameState).AkInvent = -1;
cursorChoice(_G(menu_item));
@@ -1628,7 +1628,7 @@ void delInventory(int16 nr) {
bool isCurInventory(int16 nr) {
int16 ret = false;
- if (_G(gameState).AkInvent == nr && _G(gameState).inv_cur)
+ if (_G(gameState).AkInvent == nr && _G(cur)->usingInventoryCursors())
ret = true;
return ret;
diff --git a/engines/chewy/mcga_graphics.cpp b/engines/chewy/mcga_graphics.cpp
index b9d3dfde1f6..867c1e123e5 100644
--- a/engines/chewy/mcga_graphics.cpp
+++ b/engines/chewy/mcga_graphics.cpp
@@ -243,15 +243,23 @@ static bool mspr_set_mcga_clip(int x, int y, int pitch, int &width, int &height,
return true;
}
-void McgaGraphics::spriteSet(byte *sptr, int16 x, int16 y, int16 scrWidth) {
+void McgaGraphics::spriteSet(byte *sptr, int16 x, int16 y, int16 scrWidth, uint16 spriteWidth, uint16 spriteHeight) {
if (!sptr)
return;
byte *destP;
- int width = *((const int16 *)sptr);
- sptr += 2;
- int height = *((const int16 *)sptr);
- sptr += 2;
+ int width, height;
+
+ if (spriteWidth == 0 && spriteHeight == 0) {
+ width = *((const int16 *)sptr);
+ sptr += 2;
+ height = *((const int16 *)sptr);
+ sptr += 2;
+ } else {
+ width = spriteWidth;
+ height = spriteHeight;
+ }
+
const byte *srcP = sptr;
_G(spriteWidth) = width;
diff --git a/engines/chewy/mcga_graphics.h b/engines/chewy/mcga_graphics.h
index 6ea11788870..6ce6e1a8d6c 100644
--- a/engines/chewy/mcga_graphics.h
+++ b/engines/chewy/mcga_graphics.h
@@ -52,7 +52,7 @@ public:
void spriteSave(byte *spritePtr, int16 x, int16 y, int16 width,
int16 height);
- void spriteSet(byte *sptr, int16 x, int16 y, int16 scrWidth);
+ void spriteSet(byte *sptr, int16 x, int16 y, int16 scrWidth, uint16 spriteWidth = 0, uint16 spriteHeight = 0);
void scale_set(byte *sptr, int16 x, int16 y, int16 xdiff,
int16 ydiff, int16 scrwidth);
void map_spr2screen(byte *sptr, int16 x, int16 y);
diff --git a/engines/chewy/menus.cpp b/engines/chewy/menus.cpp
index 7c32d53c9ac..b91b1541801 100644
--- a/engines/chewy/menus.cpp
+++ b/engines/chewy/menus.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/detail.h"
#include "chewy/events.h"
@@ -27,7 +28,6 @@
#include "chewy/mcga_graphics.h"
#include "chewy/menus.h"
#include "chewy/mouse.h"
-#include "chewy/dialogs/inventory.h"
namespace Chewy {
@@ -336,7 +336,7 @@ void cur_2_inventory() {
_G(menu_item) = CUR_WALK;
cursorChoice(_G(menu_item));
}
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
}
void inventory_2_cur(int16 nr) {
diff --git a/engines/chewy/ngstypes.h b/engines/chewy/ngstypes.h
index d067be2bd57..04138095650 100644
--- a/engines/chewy/ngstypes.h
+++ b/engines/chewy/ngstypes.h
@@ -52,10 +52,6 @@ struct MusicInfo {
char *cur_pattern = nullptr;
};
-struct CurBlk {
- byte **sprite = nullptr;
-};
-
struct CustomInfo {
byte *tempArea = 0;
};
diff --git a/engines/chewy/rooms/room00.cpp b/engines/chewy/rooms/room00.cpp
index 2e5a9e54618..72ca73f150a 100644
--- a/engines/chewy/rooms/room00.cpp
+++ b/engines/chewy/rooms/room00.cpp
@@ -123,7 +123,7 @@ bool Room0::timer(int16 timerNr, int16 aniNr) {
bool Room0::getPillow() {
bool retval = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
hideCur();
_G(flags).AutoAniPlay = true;
autoMove(1, P_CHEWY);
@@ -144,7 +144,7 @@ bool Room0::getPillow() {
bool Room0::pullSlime() {
bool retval = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
hideCur();
_G(flags).AutoAniPlay = true;
@@ -234,7 +234,7 @@ void Room0::eyeStart(EyeMode mode) {
setupScreen(NO_SETUP);
SHOULD_QUIT_RETURN;
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
calcEyeClick(3);
_G(out)->copyToScreen();
@@ -279,7 +279,7 @@ void Room0::eyeWait() {
_G(spr_info)[2]._zLevel = 192;
get_user_key(NO_SETUP);
setupScreen(NO_SETUP);
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
calcEyeClick(2);
_G(out)->copyToScreen();
@@ -487,7 +487,7 @@ void Room0::feederStart(int16 mode) {
SHOULD_QUIT_RETURN;
setupScreen(NO_SETUP);
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
if (!mode)
calcPillowClick(1);
@@ -528,7 +528,7 @@ void Room0::feederExtend() {
_G(spr_info)[1]._zLevel = 191;
get_user_key(NO_SETUP);
setupScreen(NO_SETUP);
- _G(cur)->plot_cur();
+ _G(cur)->updateCursor();
calcPillowClick(1);
_G(out)->copyToScreen();
}
diff --git a/engines/chewy/rooms/room04.cpp b/engines/chewy/rooms/room04.cpp
index 00c576f6152..032d4dddd6a 100644
--- a/engines/chewy/rooms/room04.cpp
+++ b/engines/chewy/rooms/room04.cpp
@@ -56,12 +56,26 @@ int16 Room4::comp_probe() {
switchRoom(4);
_G(cur_display) = true;
bool endLoop = false;
- _G(curblk).sprite = _G(room_blk)._detImage;
+
+ // TODO: The original limited the cursor height to 16 pixels
+ //WRITE_LE_INT16(_G(room_blk)._detImage[HAND_NORMAL] + 2, 16);
+ //WRITE_LE_INT16(_G(room_blk)._detImage[HAND_CLICK] + 2, 16);
+
+ _G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_NORMAL]);
+
+ byte curCursor = HAND_NORMAL;
int16 curX = 1;
int16 sprNr = RED_FRAME;
_G(cur)->move(160, 160);
+ // Clear any pending keys
+ g_events->_kbInfo._keyCode = '\0';
+ g_events->_kbInfo._scanCode = Common::KEYCODE_INVALID;
+ _G(minfo).button = 0;
+ _G(mouseLeftClick) = false;
+
start_aad(46);
+
while (!endLoop) {
// WORKAROUND: The original constrained the mouse area.
// We don't do that in ScummVM so the below prevents
@@ -106,12 +120,19 @@ int16 Room4::comp_probe() {
_G(spr_info)[0]._y = CUR_POS[curX][1];
if (_G(minfo).button == 1 || g_events->_kbInfo._keyCode == Common::KEYCODE_RETURN) {
- _G(cur)->setAnimation(HAND_CLICK, HAND_CLICK, -1);
+ if (curCursor != HAND_CLICK) {
+ _G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_CLICK]);
+ _G(cur)->setAnimation(HAND_CLICK, HAND_CLICK, -1);
+ curCursor = HAND_CLICK;
+ }
} else {
- _G(cur)->setAnimation(HAND_NORMAL, HAND_NORMAL, -1);
+ if (curCursor != HAND_NORMAL) {
+ _G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[HAND_NORMAL]);
+ _G(cur)->setAnimation(HAND_NORMAL, HAND_NORMAL, -1);
+ curCursor = HAND_NORMAL;
+ }
}
cursorChoice(CUR_USER);
- _G(gameState)._curHeight = 16;
if (g_events->_mousePos.y < 124)
g_events->_mousePos.y = 123;
diff --git a/engines/chewy/rooms/room08.cpp b/engines/chewy/rooms/room08.cpp
index 819d8ba26a3..73566296627 100644
--- a/engines/chewy/rooms/room08.cpp
+++ b/engines/chewy/rooms/room08.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -84,7 +85,7 @@ void Room8::hole_kohle() {
void Room8::start_verbrennen() {
hideCur();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
autoMove(3, P_CHEWY);
start_aad(102, 0);
_G(gameState)._personHide[P_CHEWY] = true;
diff --git a/engines/chewy/rooms/room11.cpp b/engines/chewy/rooms/room11.cpp
index 8006039df40..a8f5181bb9e 100644
--- a/engines/chewy/rooms/room11.cpp
+++ b/engines/chewy/rooms/room11.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -157,7 +158,7 @@ int16 Room11::scanner() {
startAadWait(12);
showCur();
loadDialogCloseup(3);
- } else if (!_G(gameState).inv_cur) {
+ } else if (!_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R11TerminalOk) {
actionFl = true;
flic_cut(FCUT_009);
diff --git a/engines/chewy/rooms/room12.cpp b/engines/chewy/rooms/room12.cpp
index d19c487ce59..1a3660db88c 100644
--- a/engines/chewy/rooms/room12.cpp
+++ b/engines/chewy/rooms/room12.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -191,7 +192,7 @@ void Room12::bork_ok() {
int16 Room12::use_terminal() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
if (!_G(gameState).R12ChewyBork) {
@@ -248,7 +249,7 @@ void Room12::use_linke_rohr() {
int16 Room12::chewy_trans() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && _G(gameState).R12TransOn) {
+ if (!_G(cur)->usingInventoryCursors() && _G(gameState).R12TransOn) {
action_flag = true;
_G(flags).AutoAniPlay = true;
autoMove(9, P_CHEWY);
@@ -265,7 +266,7 @@ int16 Room12::chewy_trans() {
int16 Room12::useTransformerTube() {
bool result = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
result = true;
if (_G(gameState).R12ChainLeft) {
diff --git a/engines/chewy/rooms/room13.cpp b/engines/chewy/rooms/room13.cpp
index 5f39ffeb3a5..c9b3b66eaae 100644
--- a/engines/chewy/rooms/room13.cpp
+++ b/engines/chewy/rooms/room13.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -214,7 +215,7 @@ void Room13::jmp_floor() {
int16 Room13::monitor_button() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R13Band) {
action_flag = true;
startAadWait(620);
diff --git a/engines/chewy/rooms/room14.cpp b/engines/chewy/rooms/room14.cpp
index d1fa687895d..356826d28e9 100644
--- a/engines/chewy/rooms/room14.cpp
+++ b/engines/chewy/rooms/room14.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -72,7 +73,7 @@ void Room14::eremit_feuer(int16 t_nr, int16 ani_nr) {
int16 Room14::use_schrott() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(12, 1, ANI_FRONT);
@@ -91,7 +92,7 @@ int16 Room14::use_schrott() {
int16 Room14::use_gleiter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
autoMove(4, P_CHEWY);
@@ -131,7 +132,7 @@ void Room14::talk_eremit() {
int16 Room14::use_schleim() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
autoMove(2, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
startSetAILWait(11, 1, ANI_FRONT);
diff --git a/engines/chewy/rooms/room16.cpp b/engines/chewy/rooms/room16.cpp
index 46791fe2833..20ad3924295 100644
--- a/engines/chewy/rooms/room16.cpp
+++ b/engines/chewy/rooms/room16.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -46,7 +47,7 @@ void Room16::entry() {
int16 Room16::use_gleiter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
autoMove(6, P_CHEWY);
_G(gameState).R23GleiterExit = 16;
diff --git a/engines/chewy/rooms/room17.cpp b/engines/chewy/rooms/room17.cpp
index 4ebb941fb31..6cf32df0050 100644
--- a/engines/chewy/rooms/room17.cpp
+++ b/engines/chewy/rooms/room17.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -202,7 +203,7 @@ void Room17::calc_seil() {
if (_G(gameState).R17Seil) {
if (_G(gameState).R17Location == 2) {
startAadWait(619);
- } else if (!_G(flags).AutoAniPlay && !_G(gameState).inv_cur) {
+ } else if (!_G(flags).AutoAniPlay && !_G(cur)->usingInventoryCursors()) {
close_door();
_G(flags).AutoAniPlay = true;
_G(mov_phasen)[CHEWY_OBJ].AtsText = 0;
@@ -279,12 +280,12 @@ int16 Room17::energie_hebel() {
_G(gameState).R17HebelOk = true;
startAadWait(38);
action_flag = true;
- } else if (!_G(gameState).inv_cur) {
+ } else if (!_G(cur)->usingInventoryCursors()) {
startAadWait(37);
action_flag = true;
}
- } else if (!_G(gameState).inv_cur) {
+ } else if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
_G(obj)->calc_rsi_flip_flop(SIB_HEBEL_R17);
@@ -316,7 +317,7 @@ int16 Room17::get_oel() {
int16 action_flag = false;
hideCur();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
autoMove(4, P_CHEWY);
start_spz_wait(CH_EKEL, 3, false, P_CHEWY);
diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp
index 1ec83164173..2e2a2a162b8 100644
--- a/engines/chewy/rooms/room18.cpp
+++ b/engines/chewy/rooms/room18.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -201,7 +202,7 @@ void Room18::monitor() {
int16 Room18::sonden_moni() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R18Gitter) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();
@@ -328,7 +329,7 @@ int16 Room18::calc_surimy() {
int16 Room18::calc_schalter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R18Gitter) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();
@@ -343,7 +344,7 @@ int16 Room18::calc_schalter() {
short Room18::use_cart_moni() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
hideCur();
@@ -377,7 +378,7 @@ short Room18::use_cart_moni() {
int16 Room18::go_cyberspace() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R18Gitter) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R18Gitter) {
action_flag = true;
hideCur();
diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp
index b6944491de2..f0eea2a86ae 100644
--- a/engines/chewy/rooms/room21.cpp
+++ b/engines/chewy/rooms/room21.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -205,7 +206,7 @@ void Room21::chewy_kolli() {
}
void Room21::salto() {
- if (!_G(gameState).inv_cur && _G(atds)->get_ats_str(134, TXT_MARK_USE, ATS_DATA) == 8
+ if (!_G(cur)->usingInventoryCursors() && _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;
@@ -240,7 +241,7 @@ void Room21::use_gitter_energie() {
int16 Room21::use_fenster() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
action_flag = true;
_G(flags).AutoAniPlay = true;
_G(gameState).R18Gitter = true;
diff --git a/engines/chewy/rooms/room22.cpp b/engines/chewy/rooms/room22.cpp
index eda0676c639..acf66e7c769 100644
--- a/engines/chewy/rooms/room22.cpp
+++ b/engines/chewy/rooms/room22.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -78,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(gameState).inv_cur && !_G(flags).AutoAniPlay) {
+ if (!_G(gameState).R22ChewyPlatt && !_G(cur)->usingInventoryCursors() && !_G(flags).AutoAniPlay) {
action_flag = true;
_G(flags).AutoAniPlay = true;
hideCur();
diff --git a/engines/chewy/rooms/room23.cpp b/engines/chewy/rooms/room23.cpp
index d53e873a368..2c387a25302 100644
--- a/engines/chewy/rooms/room23.cpp
+++ b/engines/chewy/rooms/room23.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -56,7 +57,7 @@ void Room23::cockpit() {
int16 Room23::start_gleiter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
if (!_G(gameState).R23FluxoFlex)
startAadWait(23);
diff --git a/engines/chewy/rooms/room24.cpp b/engines/chewy/rooms/room24.cpp
index a821ac43476..b5f72547bfa 100644
--- a/engines/chewy/rooms/room24.cpp
+++ b/engines/chewy/rooms/room24.cpp
@@ -43,8 +43,12 @@ void Room24::entry() {
setPersonPos(0, 0, P_CHEWY, -1);
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
- _G(curblk).sprite = _G(room_blk)._detImage;
+
+ // TODO: There are 4 cursor frames here, but we only support
+ // a single custom cursor frame
+ _G(cur)->setCustomRoomCursor(_G(room_blk)._detImage[7]);
_G(cur)->setAnimation(7, 10, -1);
+
_G(menu_item) = CUR_USER;
cursorChoice(CUR_USER);
diff --git a/engines/chewy/rooms/room25.cpp b/engines/chewy/rooms/room25.cpp
index 59aab38c367..8df843623c7 100644
--- a/engines/chewy/rooms/room25.cpp
+++ b/engines/chewy/rooms/room25.cpp
@@ -25,6 +25,8 @@
#include "chewy/ani_dat.h"
#include "chewy/rooms/room23.h"
#include "chewy/rooms/room25.h"
+
+#include "chewy/cursor.h"
#include "chewy/sound.h"
namespace Chewy {
@@ -64,7 +66,7 @@ void Room25::entry() {
_G(atds)->set_ats_str(113, 0, ATS_DATA);
remove_inventory(TRANSLATOR_INV);
- _G(gameState).inv_cur = false;
+ _G(cur)->setInventoryCursors(false);
_G(menu_item) = CUR_WALK;
_G(gameState).AkInvent = -1;
cursorChoice(_G(menu_item));
@@ -98,7 +100,7 @@ int16 Room25::gleiter_loesch() {
hideCur();
if (!_G(gameState).R25GleiteLoesch && _G(gameState).R29Schlauch2) {
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
_G(gameState).R25GleiteLoesch = true;
autoMove(2, P_CHEWY);
@@ -132,7 +134,7 @@ int16 Room25::gleiter_loesch() {
int16 Room25::use_gleiter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && _G(gameState).R25GleiteLoesch) {
+ if (!_G(cur)->usingInventoryCursors() && _G(gameState).R25GleiteLoesch) {
action_flag = true;
hideCur();
autoMove(3, P_CHEWY);
diff --git a/engines/chewy/rooms/room28.cpp b/engines/chewy/rooms/room28.cpp
index 8a4cc81d208..6f4487113ac 100644
--- a/engines/chewy/rooms/room28.cpp
+++ b/engines/chewy/rooms/room28.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -317,7 +318,7 @@ void Room28::get_pump() {
int16 Room28::use_breifkasten() {
int16 action_flag = false;
- if (_G(gameState).R28Briefkasten && !_G(gameState).inv_cur) {
+ if (_G(gameState).R28Briefkasten && !_G(cur)->usingInventoryCursors()) {
action_flag = true;
hideCur();
_G(gameState).R28Briefkasten = false;
diff --git a/engines/chewy/rooms/room29.cpp b/engines/chewy/rooms/room29.cpp
index edb7008e1d1..dadc1d7a427 100644
--- a/engines/chewy/rooms/room29.cpp
+++ b/engines/chewy/rooms/room29.cpp
@@ -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 Room29::use_pumpe() {
_G(det)->showStaticSpr(7);
_G(atds)->delControlBit(218, ATS_ACTIVE_BIT);
delInventory(SCHLAUCH_INV);
- } else if (!_G(gameState).inv_cur) {
+ } else if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
startAadWait(62);
}
@@ -93,7 +94,7 @@ int16 Room29::use_pumpe() {
int16 Room29::get_schlauch() {
int16 action_flag = false;
- if (_G(gameState).R29Schlauch1 && !_G(gameState).inv_cur) {
+ if (_G(gameState).R29Schlauch1 && !_G(cur)->usingInventoryCursors()) {
action_flag = true;
hideCur();
@@ -160,7 +161,7 @@ void Room29::schlitz_sitz() {
int16 Room29::zaun_sprung() {
int16 action_flag = false;
- if (_G(gameState).R29AutoSitz && !_G(gameState).inv_cur) {
+ if (_G(gameState).R29AutoSitz && !_G(cur)->usingInventoryCursors()) {
hideCur();
action_flag = true;
diff --git a/engines/chewy/rooms/room31.cpp b/engines/chewy/rooms/room31.cpp
index feaa899a9f1..bca495df012 100644
--- a/engines/chewy/rooms/room31.cpp
+++ b/engines/chewy/rooms/room31.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -94,7 +95,7 @@ void Room31::calc_luke() {
int16 Room31::open_luke() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && _G(gameState).R31KlappeZu) {
+ if (!_G(cur)->usingInventoryCursors() && _G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
@@ -111,7 +112,7 @@ int16 Room31::open_luke() {
int16 Room31::close_luke_proc1() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R31KlappeZu) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R31KlappeZu) {
action_flag = true;
hideCur();
autoMove(2, P_CHEWY);
@@ -144,7 +145,7 @@ int16 Room31::use_topf() {
int16 action_flag = false;
hideCur();
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R31PflanzeWeg) {
if (isCurInventory(K_KERNE_INV)) {
_G(gameState).R31KoernerDa = true;
diff --git a/engines/chewy/rooms/room32.cpp b/engines/chewy/rooms/room32.cpp
index d9325a20145..66943f60996 100644
--- a/engines/chewy/rooms/room32.cpp
+++ b/engines/chewy/rooms/room32.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -96,7 +97,7 @@ void Room32::use_schreibmaschine() {
hideCur();
if (_G(gameState).R32HowardWeg) {
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
switch (_G(gameState).AkInvent) {
case CYB_KRONE_INV:
if (!_G(gameState).R32UseSchreib) {
@@ -151,7 +152,7 @@ void Room32::use_schreibmaschine() {
int16 Room32::get_script() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R32Script && _G(gameState).R32UseSchreib) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R32Script && _G(gameState).R32UseSchreib) {
action_flag = true;
_G(gameState).R32Script = true;
autoMove(4, P_CHEWY);
diff --git a/engines/chewy/rooms/room33.cpp b/engines/chewy/rooms/room33.cpp
index 3a41ee311e6..30cb93b0fbd 100644
--- a/engines/chewy/rooms/room33.cpp
+++ b/engines/chewy/rooms/room33.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -80,7 +81,7 @@ void Room33::look_schublade() {
int16 Room33::use_schublade() {
int16 action_flag = false;
- if (_G(gameState).R33SchubFirst && !_G(gameState).inv_cur && !_G(gameState).R33Messer) {
+ if (_G(gameState).R33SchubFirst && !_G(cur)->usingInventoryCursors() && !_G(gameState).R33Messer) {
hideCur();
action_flag = true;
_G(gameState).R33Messer = true;
@@ -105,7 +106,7 @@ void Room33::use_maschine() {
autoMove(4, P_CHEWY);
bool hocker = false;
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
bool action = true;
switch (_G(gameState).AkInvent) {
@@ -198,7 +199,7 @@ bool Room33::calc_muntermacher() {
int16 Room33::get_munter() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R33MunterGet && _G(gameState).R33MunterOk) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R33MunterGet && _G(gameState).R33MunterOk) {
action_flag = true;
hideCur();
_G(gameState).R33MunterGet = true;
diff --git a/engines/chewy/rooms/room34.cpp b/engines/chewy/rooms/room34.cpp
index 6ecde131b56..6ac32bdd7cc 100644
--- a/engines/chewy/rooms/room34.cpp
+++ b/engines/chewy/rooms/room34.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -36,7 +37,7 @@ void Room34::entry() {
bool Room34::use_kuehlschrank() {
bool result = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
result = true;
if (!_G(flags).LoadGame) {
diff --git a/engines/chewy/rooms/room35.cpp b/engines/chewy/rooms/room35.cpp
index fd08525a74d..5b3a45403b9 100644
--- a/engines/chewy/rooms/room35.cpp
+++ b/engines/chewy/rooms/room35.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -44,7 +45,7 @@ int16 Room35::schublade() {
int16 action_flag = false;
hideCur();
- if (_G(gameState).ChewyAni != CHEWY_ROCKER && !_G(gameState).inv_cur) {
+ if (_G(gameState).ChewyAni != CHEWY_ROCKER && !_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R35Schublade) {
action_flag = true;
autoMove(3, P_CHEWY);
diff --git a/engines/chewy/rooms/room37.cpp b/engines/chewy/rooms/room37.cpp
index f1aaa611987..f09eeeb7abf 100644
--- a/engines/chewy/rooms/room37.cpp
+++ b/engines/chewy/rooms/room37.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -102,7 +103,7 @@ void Room37::setup_func() {
short Room37::use_wippe() {
int16 action_flag = false;
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
action_flag = true;
if (isCurInventory(H_FUTTER_INV)) {
@@ -302,7 +303,7 @@ void Room37::use_hahn() {
inventory_2_cur(EIER_INV);
showCur();
}
- } else if (_G(gameState).inv_cur) {
+ } else if (_G(cur)->usingInventoryCursors()) {
startAadWait(143);
}
}
diff --git a/engines/chewy/rooms/room39.cpp b/engines/chewy/rooms/room39.cpp
index 4d9f5af251b..bfb77a3d4a6 100644
--- a/engines/chewy/rooms/room39.cpp
+++ b/engines/chewy/rooms/room39.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -74,7 +75,7 @@ short Room39::use_howard() {
if (!_G(gameState).R39HowardWach) {
int16 dia_nr;
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
if (isCurInventory(MANUSKRIPT_INV)) {
hideCur();
_G(gameState).R39HowardWach = true;
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index 0f418eaae5e..ca1af65f84e 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -316,7 +317,7 @@ int16 Room40::use_mr_pumpkin() {
if (_G(menu_item) != CUR_HOWARD) {
hideCur();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = use_schalter(205);
} else {
@@ -602,7 +603,7 @@ bool Room40::use_police() {
int16 Room40::use_tele() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && _G(gameState).R40PoliceWeg == false) {
+ if (!_G(cur)->usingInventoryCursors() && _G(gameState).R40PoliceWeg == false) {
action_flag = true;
hideCur();
diff --git a/engines/chewy/rooms/room41.cpp b/engines/chewy/rooms/room41.cpp
index bc742d4687f..b47143e4495 100644
--- a/engines/chewy/rooms/room41.cpp
+++ b/engines/chewy/rooms/room41.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -176,7 +177,7 @@ void Room41::stop_hoggy() {
int16 Room41::use_kasse() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_flag = true;
stop_hoggy();
autoMove(1, P_CHEWY);
@@ -190,7 +191,7 @@ int16 Room41::use_kasse() {
int16 Room41::use_lola() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur && !_G(gameState).R41LolaOk && _G(gameState).R41RepairInfo) {
+ if (!_G(cur)->usingInventoryCursors() && !_G(gameState).R41LolaOk && _G(gameState).R41RepairInfo) {
hideCur();
action_flag = true;
_G(gameState).R41LolaOk = true;
diff --git a/engines/chewy/rooms/room42.cpp b/engines/chewy/rooms/room42.cpp
index 1676a94ac63..b8373de35f8 100644
--- a/engines/chewy/rooms/room42.cpp
+++ b/engines/chewy/rooms/room42.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -97,10 +98,10 @@ int16 Room42::useMailBag() {
return action_flag;
hideCur();
- if (!_G(gameState).R42BeamterWach && !_G(gameState).inv_cur) {
+ if (!_G(gameState).R42BeamterWach && !_G(cur)->usingInventoryCursors()) {
action_flag = true;
getPumpkin(136);
- } else if (_G(gameState).R42HoToBeamter && !_G(gameState).inv_cur && !_G(gameState).R42MarkeOk) {
+ } else if (_G(gameState).R42HoToBeamter && !_G(cur)->usingInventoryCursors() && !_G(gameState).R42MarkeOk) {
action_flag = true;
autoMove(3, P_CHEWY);
_G(gameState)._personHide[P_CHEWY] = true;
diff --git a/engines/chewy/rooms/room45.cpp b/engines/chewy/rooms/room45.cpp
index 659818a4211..187c3d19513 100644
--- a/engines/chewy/rooms/room45.cpp
+++ b/engines/chewy/rooms/room45.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -170,7 +171,7 @@ int16 Room45::use_taxi() {
hideCur();
autoMove(1, P_CHEWY);
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
if (_G(gameState).ChewyAni == CHEWY_PUMPKIN) {
action_ret = true;
talk_taxi(254);
diff --git a/engines/chewy/rooms/room46.cpp b/engines/chewy/rooms/room46.cpp
index 29354c19c6b..5a4ea2000c5 100644
--- a/engines/chewy/rooms/room46.cpp
+++ b/engines/chewy/rooms/room46.cpp
@@ -186,7 +186,7 @@ void Room46::kloppe() {
int16 Room46::use_schloss() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
if (!_G(gameState).R46GetLeder) {
diff --git a/engines/chewy/rooms/room47.cpp b/engines/chewy/rooms/room47.cpp
index d8504ce5c55..99a2765d684 100644
--- a/engines/chewy/rooms/room47.cpp
+++ b/engines/chewy/rooms/room47.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -46,7 +47,7 @@ int16 Room47::use_button(int16 txt_nr) {
int16 k_nr = 0;
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
switch (txt_nr) {
diff --git a/engines/chewy/rooms/room49.cpp b/engines/chewy/rooms/room49.cpp
index c76d95860a1..ff2db09fb46 100644
--- a/engines/chewy/rooms/room49.cpp
+++ b/engines/chewy/rooms/room49.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -241,7 +242,7 @@ void Room49::look_hotel() {
int16 Room49::use_taxi() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
hideCur();
startAniBlock(2, ABLOCK34);
diff --git a/engines/chewy/rooms/room54.cpp b/engines/chewy/rooms/room54.cpp
index 9dbcca09904..322b1683b04 100644
--- a/engines/chewy/rooms/room54.cpp
+++ b/engines/chewy/rooms/room54.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -126,7 +127,7 @@ void Room54::setup_func() {
int16 Room54::use_schalter() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
hideCur();
action_ret = true;
@@ -228,7 +229,7 @@ int16 Room54::use_zelle() {
int16 action_ret = false;
hideCur();
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
if (isCurInventory(JMKOST_INV)) {
action_ret = true;
@@ -271,7 +272,7 @@ int16 Room54::use_zelle() {
int16 Room54::use_azug() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
hideCur();
@@ -361,7 +362,7 @@ void Room54::aufzug_ab() {
short Room54::use_taxi() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
hideCur();
autoMove(7, P_CHEWY);
diff --git a/engines/chewy/rooms/room55.cpp b/engines/chewy/rooms/room55.cpp
index 657961e51b6..c8ae030dc82 100644
--- a/engines/chewy/rooms/room55.cpp
+++ b/engines/chewy/rooms/room55.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -131,7 +132,7 @@ int16 Room55::use_stapel1() {
int16 action_ret = false;
hideCur();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
if (!_G(gameState).R55ScriptWeg) {
action_ret = true;
_G(gameState).R55ScriptWeg = true;
@@ -180,7 +181,7 @@ int16 Room55::use_stapel2() {
int16 Room55::use_telefon() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
if (_G(gameState).R55EscScriptOk) {
if (!_G(gameState).R55RaumOk) {
@@ -341,7 +342,7 @@ void Room55::verleger_mov(int16 mode) {
}
void Room55::strasse(int16 mode) {
- if (!_G(gameState).inv_cur || mode) {
+ if (!_G(cur)->usingInventoryCursors() || mode) {
_G(gameState)._personHide[P_CHEWY] = true;
_G(room)->set_timer_status(4, TIMER_STOP);
_G(det)->del_static_ani(4);
diff --git a/engines/chewy/rooms/room56.cpp b/engines/chewy/rooms/room56.cpp
index 82b76e06c07..fc5286399a2 100644
--- a/engines/chewy/rooms/room56.cpp
+++ b/engines/chewy/rooms/room56.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -208,7 +209,7 @@ bool Room56::timer(int16 t_nr, int16 ani_nr) {
int16 Room56::use_taxi() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
hideCur();
autoMove(1, P_CHEWY);
@@ -286,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(gameState).inv_cur && _G(atds)->getControlBit(362, ATS_ACTIVE_BIT) == 0) {
+ if (_G(menu_item) == CUR_WALK && !_G(cur)->usingInventoryCursors() && _G(atds)->getControlBit(362, ATS_ACTIVE_BIT) == 0) {
action_ret = true;
hideCur();
if (_G(gameState).R56Kneipe) {
@@ -346,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(gameState).inv_cur)){
+ } else if (_G(menu_item) == 0 || _G(menu_item) == 2 || (_G(menu_item) == 1 && !_G(cur)->usingInventoryCursors())){
hideCur();
action_ret = 1;
_G(mouseLeftClick) = false;
diff --git a/engines/chewy/rooms/room57.cpp b/engines/chewy/rooms/room57.cpp
index 02451090474..c9a11593d08 100644
--- a/engines/chewy/rooms/room57.cpp
+++ b/engines/chewy/rooms/room57.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -79,7 +80,7 @@ void Room57::setup_func() {
int16 Room57::use_taxi() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
hideCur();
autoMove(3, P_CHEWY);
diff --git a/engines/chewy/rooms/room63.cpp b/engines/chewy/rooms/room63.cpp
index 89a7df04b29..528918a9006 100644
--- a/engines/chewy/rooms/room63.cpp
+++ b/engines/chewy/rooms/room63.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -217,7 +218,7 @@ int16 Room63::use_fx_man() {
int16 Room63::use_schalter() {
int16 action_ret = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
action_ret = true;
if (_G(gameState).R63FxMannWeg) {
if (_G(gameState).R62LauraVerwandlung) {
diff --git a/engines/chewy/rooms/room64.cpp b/engines/chewy/rooms/room64.cpp
index 63bdf0c440e..7af5b83d5fa 100644
--- a/engines/chewy/rooms/room64.cpp
+++ b/engines/chewy/rooms/room64.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -145,7 +146,7 @@ void Room64::talk_man(int16 aad_nr) {
int16 Room64::use_tasche() {
int16 action_ret = false;
hideCur();
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
if (_G(gameState).R64ManWeg) {
if (!_G(atds)->getControlBit(375, ATS_ACTIVE_BIT)) {
autoMove(3, P_CHEWY);
diff --git a/engines/chewy/rooms/room67.cpp b/engines/chewy/rooms/room67.cpp
index 800f71da52a..d87497fc08e 100644
--- a/engines/chewy/rooms/room67.cpp
+++ b/engines/chewy/rooms/room67.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -105,7 +106,7 @@ void Room67::look_brief() {
int16 Room67::use_kommode() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
hideCur();
if (!_G(gameState).R67KommodeAuf) {
action_flag = true;
@@ -138,7 +139,7 @@ void Room67::kostuem_aad(int16 aad_nr) {
int16 Room67::talk_papagei() {
int16 action_flag = false;
- if (!_G(gameState).R67PapageiWeg && !_G(gameState).inv_cur) {
+ if (!_G(gameState).R67PapageiWeg && !_G(cur)->usingInventoryCursors()) {
action_flag = true;
hideCur();
_G(room)->set_timer_status(1, TIMER_STOP);
diff --git a/engines/chewy/rooms/room69.cpp b/engines/chewy/rooms/room69.cpp
index 2646473ddc7..4700bf45c4d 100644
--- a/engines/chewy/rooms/room69.cpp
+++ b/engines/chewy/rooms/room69.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -84,7 +85,7 @@ void Room69::look_schild() {
int16 Room69::use_bruecke() {
int16 action_flag = false;
- if (!_G(gameState).inv_cur) {
+ if (!_G(cur)->usingInventoryCursors()) {
hideCur();
action_flag = true;
diff --git a/engines/chewy/rooms/room71.cpp b/engines/chewy/rooms/room71.cpp
index 6a4cec6b281..c5705628233 100644
--- a/engines/chewy/rooms/room71.cpp
+++ b/engines/chewy/rooms/room71.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -152,7 +153,7 @@ void Room71::setup_func() {
}
int Room71::proc1() {
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
_G(flags).NoScroll = false;
return 0;
}
@@ -258,7 +259,7 @@ void Room71::proc5(int16 val) {
}
int Room71::proc6() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room73.cpp b/engines/chewy/rooms/room73.cpp
index ee072c64f52..7159c60e616 100644
--- a/engines/chewy/rooms/room73.cpp
+++ b/engines/chewy/rooms/room73.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -80,7 +81,7 @@ void Room73::xit(int16 eib_nr) {
}
int Room73::proc1() {
- if (_G(gameState).inv_cur && !_G(gameState).flags28_20)
+ if (_G(cur)->usingInventoryCursors() && !_G(gameState).flags28_20)
return 0;
hideCur();
@@ -97,7 +98,7 @@ int Room73::proc1() {
}
int Room73::proc2() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room74.cpp b/engines/chewy/rooms/room74.cpp
index 291e880e333..e17e0eea672 100644
--- a/engines/chewy/rooms/room74.cpp
+++ b/engines/chewy/rooms/room74.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -103,7 +104,7 @@ int Room74::proc1() {
_G(gameState).flags29_1 = true;
_G(atds)->set_ats_str(435, 1, ATS_DATA);
- } else if (!_G(gameState).inv_cur && _G(gameState).R74CutRubberPlant) {
+ } else if (!_G(cur)->usingInventoryCursors() && _G(gameState).R74CutRubberPlant) {
_G(atds)->setControlBit(435, ATS_ACTIVE_BIT);
autoMove(5, P_CHEWY);
start_spz_wait(13, 1, false, P_CHEWY);
diff --git a/engines/chewy/rooms/room82.cpp b/engines/chewy/rooms/room82.cpp
index 26ecd8a8701..af1a756e4e4 100644
--- a/engines/chewy/rooms/room82.cpp
+++ b/engines/chewy/rooms/room82.cpp
@@ -25,6 +25,8 @@
#include "chewy/room.h"
#include "chewy/rooms/room82.h"
+
+#include "chewy/cursor.h"
#include "chewy/rooms/room66.h"
#include "chewy/sound.h"
@@ -241,7 +243,7 @@ void Room82::proc8() {
}
int Room82::proc9() {
- if (_G(gameState).inv_cur || !_G(gameState).flags30_40)
+ if (_G(cur)->usingInventoryCursors() || !_G(gameState).flags30_40)
return 0;
autoMove(7, P_CHEWY);
diff --git a/engines/chewy/rooms/room84.cpp b/engines/chewy/rooms/room84.cpp
index c96d76af14c..b9c2bd05524 100644
--- a/engines/chewy/rooms/room84.cpp
+++ b/engines/chewy/rooms/room84.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -185,7 +186,7 @@ void Room84::talk2() {
}
int Room84::proc4() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room85.cpp b/engines/chewy/rooms/room85.cpp
index 90b0a738119..b6743120974 100644
--- a/engines/chewy/rooms/room85.cpp
+++ b/engines/chewy/rooms/room85.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -150,7 +151,7 @@ void Room85::setup_func() {
}
int Room85::proc2() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
autoMove(2, P_CHEWY);
diff --git a/engines/chewy/rooms/room87.cpp b/engines/chewy/rooms/room87.cpp
index 0d02775efd5..8b9e4be50a8 100644
--- a/engines/chewy/rooms/room87.cpp
+++ b/engines/chewy/rooms/room87.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -144,7 +145,7 @@ int Room87::proc2(int16 txt_nr) {
}
int Room87::proc4() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room88.cpp b/engines/chewy/rooms/room88.cpp
index 110ecd8759f..dcc1c3aab8f 100644
--- a/engines/chewy/rooms/room88.cpp
+++ b/engines/chewy/rooms/room88.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/detail.h"
#include "chewy/events.h"
@@ -56,7 +57,7 @@ void Room88::xit() {
}
int Room88::proc1() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -70,7 +71,7 @@ int Room88::proc1() {
}
int Room88::proc2() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -89,7 +90,7 @@ int Room88::proc2() {
}
int Room88::proc3() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room89.cpp b/engines/chewy/rooms/room89.cpp
index e3c7edb284d..4fc2e24c5a0 100644
--- a/engines/chewy/rooms/room89.cpp
+++ b/engines/chewy/rooms/room89.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -168,7 +169,7 @@ void Room89::talk1() {
}
int Room89::proc2() {
- if (_G(gameState).inv_cur || _G(gameState).flags33_2)
+ if (_G(cur)->usingInventoryCursors() || _G(gameState).flags33_2)
return 0;
hideCur();
@@ -192,7 +193,7 @@ int Room89::proc2() {
}
int Room89::proc4() {
- if (_G(gameState).inv_cur || _G(gameState).flags32_80)
+ if (_G(cur)->usingInventoryCursors() || _G(gameState).flags32_80)
return 0;
hideCur();
@@ -218,7 +219,7 @@ int Room89::proc4() {
}
int Room89::proc5() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
if (!_G(gameState).flags32_80 || !_G(gameState).flags33_1 || !_G(gameState).flags33_2)
diff --git a/engines/chewy/rooms/room90.cpp b/engines/chewy/rooms/room90.cpp
index e7a5c182149..945e5902037 100644
--- a/engines/chewy/rooms/room90.cpp
+++ b/engines/chewy/rooms/room90.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -234,7 +235,7 @@ void Room90::proc2() {
}
int Room90::getHubcaps() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room95.cpp b/engines/chewy/rooms/room95.cpp
index 759031bba74..f941d3f3490 100644
--- a/engines/chewy/rooms/room95.cpp
+++ b/engines/chewy/rooms/room95.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -101,7 +102,7 @@ int Room95::proc2() {
return 1;
}
- if (_G(gameState).inv_cur) {
+ if (_G(cur)->usingInventoryCursors()) {
showCur();
return 0;
}
diff --git a/engines/chewy/rooms/room97.cpp b/engines/chewy/rooms/room97.cpp
index 45718b727e3..cc50dd935b1 100644
--- a/engines/chewy/rooms/room97.cpp
+++ b/engines/chewy/rooms/room97.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/events.h"
#include "chewy/globals.h"
@@ -413,7 +414,7 @@ int Room97::proc5() {
}
int Room97::proc6() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -447,7 +448,7 @@ int Room97::proc6() {
}
int Room97::proc7() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -528,7 +529,7 @@ int Room97::proc8() {
}
int Room97::proc9() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -556,7 +557,7 @@ int Room97::proc9() {
}
int Room97::proc10() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -576,7 +577,7 @@ int Room97::proc10() {
}
int Room97::proc11() {
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
return 0;
hideCur();
@@ -686,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(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
_G(mouseLeftClick) = true;
}
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index 68011b7cf28..773c69a8d73 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -20,6 +20,7 @@
*/
#include "chewy/chewy.h"
+#include "chewy/cursor.h"
#include "chewy/defines.h"
#include "chewy/dialogs/inventory.h"
#include "chewy/events.h"
@@ -134,7 +135,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
case 71:
if (isCurInventory(ZANGE_INV))
Room8::hole_kohle();
- else if (!_G(gameState).inv_cur)
+ else if (!_G(cur)->usingInventoryCursors())
Room8::start_verbrennen();
break;
@@ -150,7 +151,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
case 77:
- if (!_G(gameState).R10SurimyOk && !_G(gameState).inv_cur) {
+ if (!_G(gameState).R10SurimyOk && !_G(cur)->usingInventoryCursors()) {
hideCur();
autoMove(3, P_CHEWY);
flic_cut(FCUT_004);
@@ -167,7 +168,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 80:
- if (_G(gameState).inv_cur)
+ if (_G(cur)->usingInventoryCursors())
autoMove(3, P_CHEWY);
break;
diff --git a/engines/chewy/types.cpp b/engines/chewy/types.cpp
index 7ad2072907f..50540c260bd 100644
--- a/engines/chewy/types.cpp
+++ b/engines/chewy/types.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "chewy/globals.h"
+#include "chewy/cursor.h"
#include "chewy/types.h"
#include "chewy/detail.h"
#include "common/algorithm.h"
@@ -52,6 +54,8 @@ bool GameState::synchronize(Common::Serializer &s) {
error("Invalid flags structure size");
byte dummy = 0;
+ int16 dummy16 = 0;
+ byte inventoryCursors = _G(cur)->usingInventoryCursors();
// Sync the structure's bitflags
s.syncBytes((byte *)_flags, SPIELER_FLAGS_SIZE);
@@ -70,9 +74,9 @@ bool GameState::synchronize(Common::Serializer &s) {
syncArray(s, InventSlot, MAX_MOV_OBJ);
s.syncAsSint16LE(AkInvent);
- s.syncAsByte(inv_cur);
- s.syncAsSint16LE(_curWidth);
- s.syncAsSint16LE(_curHeight);
+ s.syncAsByte(inventoryCursors);
+ s.syncAsSint16LE(dummy16); // curWidth
+ s.syncAsSint16LE(dummy16); // curHeight
for (int i = 0; i < MAX_MOV_OBJ; ++i)
room_m_obj[i].synchronize(s);
@@ -157,6 +161,8 @@ bool GameState::synchronize(Common::Serializer &s) {
s.syncAsByte(FramesPerSecond);
s.syncAsByte(dummy); // subtitles switch
+ _G(cur)->setInventoryCursors(inventoryCursors);
+
return true;
}
diff --git a/engines/chewy/types.h b/engines/chewy/types.h
index 9cf28399a90..4827dcb8c7d 100644
--- a/engines/chewy/types.h
+++ b/engines/chewy/types.h
@@ -405,9 +405,6 @@ struct GameState : public GameFlags {
int16 InventSlot[MAX_MOV_OBJ] = { 0 };
int16 AkInvent = 0;
- bool inv_cur = 0;
- int16 _curWidth = 0;
- int16 _curHeight = 0;
RoomMovObject room_m_obj[MAX_MOV_OBJ];
RoomStaticInventory room_s_obj[MAX_FEST_OBJ];
diff --git a/engines/chewy/video/video_player.cpp b/engines/chewy/video/video_player.cpp
index 3043ac09c6f..57b947e2a87 100644
--- a/engines/chewy/video/video_player.cpp
+++ b/engines/chewy/video/video_player.cpp
@@ -57,7 +57,7 @@ bool VideoPlayer::playVideo(uint num, bool stopMusic) {
bool keepPlaying = true;
g_system->getPaletteManager()->grabPalette(curPalette, 0, 256);
- _G(cur)->hide_cur();
+ _G(cur)->hideCursor();
// Clear events
Common::Event event;
@@ -101,7 +101,7 @@ bool VideoPlayer::playVideo(uint num, bool stopMusic) {
cfoDecoder->close();
g_system->getPaletteManager()->setPalette(curPalette, 0, 256);
- _G(cur)->show_cur();
+ _G(cur)->showCursor();
g_engine->_sound->popVolume();
delete videoResource;
Commit: e9e8ee9ee153d25f8840a35c19baf4348a4b69d4
https://github.com/scummvm/scummvm/commit/e9e8ee9ee153d25f8840a35c19baf4348a4b69d4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:55+03:00
Commit Message:
CHEWY: Further refactoring of the cursor code
Changed paths:
engines/chewy/chewy.cpp
engines/chewy/cursor.cpp
engines/chewy/cursor.h
engines/chewy/defines.h
engines/chewy/dialogs/inventory.cpp
engines/chewy/dialogs/main_menu.cpp
engines/chewy/inits.cpp
engines/chewy/main.cpp
engines/chewy/menus.cpp
engines/chewy/r_event.cpp
engines/chewy/room.cpp
engines/chewy/rooms/room00.cpp
engines/chewy/rooms/room01.cpp
engines/chewy/rooms/room02.cpp
engines/chewy/rooms/room03.cpp
engines/chewy/rooms/room07.cpp
engines/chewy/rooms/room08.cpp
engines/chewy/rooms/room10.cpp
engines/chewy/rooms/room11.cpp
engines/chewy/rooms/room12.cpp
engines/chewy/rooms/room13.cpp
engines/chewy/rooms/room14.cpp
engines/chewy/rooms/room16.cpp
engines/chewy/rooms/room17.cpp
engines/chewy/rooms/room18.cpp
engines/chewy/rooms/room21.cpp
engines/chewy/rooms/room22.cpp
engines/chewy/rooms/room23.cpp
engines/chewy/rooms/room25.cpp
engines/chewy/rooms/room28.cpp
engines/chewy/rooms/room29.cpp
engines/chewy/rooms/room31.cpp
engines/chewy/rooms/room32.cpp
engines/chewy/rooms/room33.cpp
engines/chewy/rooms/room34.cpp
engines/chewy/rooms/room35.cpp
engines/chewy/rooms/room37.cpp
engines/chewy/rooms/room39.cpp
engines/chewy/rooms/room40.cpp
engines/chewy/rooms/room41.cpp
engines/chewy/rooms/room42.cpp
engines/chewy/rooms/room45.cpp
engines/chewy/rooms/room46.cpp
engines/chewy/rooms/room47.cpp
engines/chewy/rooms/room49.cpp
engines/chewy/rooms/room50.cpp
engines/chewy/rooms/room52.cpp
engines/chewy/rooms/room53.cpp
engines/chewy/rooms/room54.cpp
engines/chewy/rooms/room55.cpp
engines/chewy/rooms/room56.cpp
engines/chewy/rooms/room57.cpp
engines/chewy/rooms/room63.cpp
engines/chewy/rooms/room64.cpp
engines/chewy/rooms/room66.cpp
engines/chewy/rooms/room67.cpp
engines/chewy/rooms/room68.cpp
engines/chewy/rooms/room69.cpp
engines/chewy/rooms/room71.cpp
engines/chewy/rooms/room73.cpp
engines/chewy/rooms/room74.cpp
engines/chewy/rooms/room76.cpp
engines/chewy/rooms/room77.cpp
engines/chewy/rooms/room81.cpp
engines/chewy/rooms/room82.cpp
engines/chewy/rooms/room84.cpp
engines/chewy/rooms/room85.cpp
engines/chewy/rooms/room86.cpp
engines/chewy/rooms/room87.cpp
engines/chewy/rooms/room88.cpp
engines/chewy/rooms/room89.cpp
engines/chewy/rooms/room90.cpp
engines/chewy/rooms/room94.cpp
engines/chewy/rooms/room95.cpp
engines/chewy/rooms/room97.cpp
engines/chewy/t_event.cpp
engines/chewy/types.cpp
engines/chewy/types.h
diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp
index b5830d40db7..1181eaa2242 100644
--- a/engines/chewy/chewy.cpp
+++ b/engines/chewy/chewy.cpp
@@ -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++) {
diff --git a/engines/chewy/cursor.cpp b/engines/chewy/cursor.cpp
index 56087d2afc2..29a8df7bc67 100644
--- a/engines/chewy/cursor.cpp
+++ b/engines/chewy/cursor.cpp
@@ -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 (_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;
- }
+ if (!CursorMan.isVisible())
+ return;
+
+ --_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();
}
}
diff --git a/engines/chewy/cursor.h b/engines/chewy/cursor.h
index 6fd96deb127..15faf2e38c3 100644
--- a/engines/chewy/cursor.h
+++ b/engines/chewy/cursor.h
@@ -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;
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 41facdfd2da..76b3a17301c 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -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
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 77da706672c..cac341dca03 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -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;
diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp
index 0162bbc7875..d399e449a87 100644
--- a/engines/chewy/dialogs/main_menu.cpp
+++ b/engines/chewy/dialogs/main_menu.cpp
@@ -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;
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index f98a0e36671..5527cd06b93 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -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;
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 7a88e114a01..24c400ddf61 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -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) {
diff --git a/engines/chewy/menus.cpp b/engines/chewy/menus.cpp
index b91b1541801..a1b0edb2e7d 100644
--- a/engines/chewy/menus.cpp
+++ b/engines/chewy/menus.cpp
@@ -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));
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index 2058cac70a2..5238c8e4dd7 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -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);
diff --git a/engines/chewy/room.cpp b/engines/chewy/room.cpp
index 1d2b970922a..e5dea3dfd23 100644
--- a/engines/chewy/room.cpp
+++ b/engines/chewy/room.cpp
@@ -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);
}
}
diff --git a/engines/chewy/rooms/room00.cpp b/engines/chewy/rooms/room00.cpp
index 72ca73f150a..6168796624b 100644
--- a/engines/chewy/rooms/room00.cpp
+++ b/engines/chewy/rooms/room00.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room01.cpp b/engines/chewy/rooms/room01.cpp
index 0b21a3ac48b..cf2f1621649 100644
--- a/engines/chewy/rooms/room01.cpp
+++ b/engines/chewy/rooms/room01.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room02.cpp b/engines/chewy/rooms/room02.cpp
index b88e275b1f9..753cc13b59a 100644
--- a/engines/chewy/rooms/room02.cpp
+++ b/engines/chewy/rooms/room02.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room03.cpp b/engines/chewy/rooms/room03.cpp
index 35c19e9ad83..d35667d1fec 100644
--- a/engines/chewy/rooms/room03.cpp
+++ b/engines/chewy/rooms/room03.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room07.cpp b/engines/chewy/rooms/room07.cpp
index a14106c1ad6..a51a4c768b7 100644
--- a/engines/chewy/rooms/room07.cpp
+++ b/engines/chewy/rooms/room07.cpp
@@ -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));
diff --git a/engines/chewy/rooms/room08.cpp b/engines/chewy/rooms/room08.cpp
index 73566296627..e5455c690fd 100644
--- a/engines/chewy/rooms/room08.cpp
+++ b/engines/chewy/rooms/room08.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room10.cpp b/engines/chewy/rooms/room10.cpp
index 27842de0977..34fc92c4a00 100644
--- a/engines/chewy/rooms/room10.cpp
+++ b/engines/chewy/rooms/room10.cpp
@@ -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();
}
diff --git a/engines/chewy/rooms/room11.cpp b/engines/chewy/rooms/room11.cpp
index a8f5181bb9e..960b4e8d1ed 100644
--- a/engines/chewy/rooms/room11.cpp
+++ b/engines/chewy/rooms/room11.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room12.cpp b/engines/chewy/rooms/room12.cpp
index 1a3660db88c..c540bf65ccb 100644
--- a/engines/chewy/rooms/room12.cpp
+++ b/engines/chewy/rooms/room12.cpp
@@ -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) {
diff --git a/engines/chewy/rooms/room13.cpp b/engines/chewy/rooms/room13.cpp
index c9b3b66eaae..b63b2cd948c 100644
--- a/engines/chewy/rooms/room13.cpp
+++ b/engines/chewy/rooms/room13.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room14.cpp b/engines/chewy/rooms/room14.cpp
index 356826d28e9..57418e6d4de 100644
--- a/engines/chewy/rooms/room14.cpp
+++ b/engines/chewy/rooms/room14.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room16.cpp b/engines/chewy/rooms/room16.cpp
index 20ad3924295..e08c9e0b615 100644
--- a/engines/chewy/rooms/room16.cpp
+++ b/engines/chewy/rooms/room16.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room17.cpp b/engines/chewy/rooms/room17.cpp
index 6cf32df0050..9cd46ac53e7 100644
--- a/engines/chewy/rooms/room17.cpp
+++ b/engines/chewy/rooms/room17.cpp
@@ -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);
}
diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp
index 2e2a2a162b8..7f48f28b57f 100644
--- a/engines/chewy/rooms/room18.cpp
+++ b/engines/chewy/rooms/room18.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp
index f0eea2a86ae..2d1719a8d6a 100644
--- a/engines/chewy/rooms/room21.cpp
+++ b/engines/chewy/rooms/room21.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room22.cpp b/engines/chewy/rooms/room22.cpp
index acf66e7c769..f3c3b7569f2 100644
--- a/engines/chewy/rooms/room22.cpp
+++ b/engines/chewy/rooms/room22.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room23.cpp b/engines/chewy/rooms/room23.cpp
index 2c387a25302..efba4da953b 100644
--- a/engines/chewy/rooms/room23.cpp
+++ b/engines/chewy/rooms/room23.cpp
@@ -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) {
diff --git a/engines/chewy/rooms/room25.cpp b/engines/chewy/rooms/room25.cpp
index 8df843623c7..00edbc2c09b 100644
--- a/engines/chewy/rooms/room25.cpp
+++ b/engines/chewy/rooms/room25.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room28.cpp b/engines/chewy/rooms/room28.cpp
index 6f4487113ac..2438b319dc7 100644
--- a/engines/chewy/rooms/room28.cpp
+++ b/engines/chewy/rooms/room28.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room29.cpp b/engines/chewy/rooms/room29.cpp
index dadc1d7a427..a81a640f282 100644
--- a/engines/chewy/rooms/room29.cpp
+++ b/engines/chewy/rooms/room29.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room31.cpp b/engines/chewy/rooms/room31.cpp
index bca495df012..faa5fed4de0 100644
--- a/engines/chewy/rooms/room31.cpp
+++ b/engines/chewy/rooms/room31.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room32.cpp b/engines/chewy/rooms/room32.cpp
index 66943f60996..4bc518560f9 100644
--- a/engines/chewy/rooms/room32.cpp
+++ b/engines/chewy/rooms/room32.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room33.cpp b/engines/chewy/rooms/room33.cpp
index 30cb93b0fbd..52b61e8a281 100644
--- a/engines/chewy/rooms/room33.cpp
+++ b/engines/chewy/rooms/room33.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room34.cpp b/engines/chewy/rooms/room34.cpp
index 6ac32bdd7cc..542ea69639a 100644
--- a/engines/chewy/rooms/room34.cpp
+++ b/engines/chewy/rooms/room34.cpp
@@ -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) {
diff --git a/engines/chewy/rooms/room35.cpp b/engines/chewy/rooms/room35.cpp
index 5b3a45403b9..5b0f760a4b5 100644
--- a/engines/chewy/rooms/room35.cpp
+++ b/engines/chewy/rooms/room35.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room37.cpp b/engines/chewy/rooms/room37.cpp
index f09eeeb7abf..743e26b9b58 100644
--- a/engines/chewy/rooms/room37.cpp
+++ b/engines/chewy/rooms/room37.cpp
@@ -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);
}
}
diff --git a/engines/chewy/rooms/room39.cpp b/engines/chewy/rooms/room39.cpp
index bfb77a3d4a6..7702d965ace 100644
--- a/engines/chewy/rooms/room39.cpp
+++ b/engines/chewy/rooms/room39.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index ca1af65f84e..dd53c0599eb 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -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);
}
diff --git a/engines/chewy/rooms/room41.cpp b/engines/chewy/rooms/room41.cpp
index b47143e4495..ae2bfbc21a4 100644
--- a/engines/chewy/rooms/room41.cpp
+++ b/engines/chewy/rooms/room41.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room42.cpp b/engines/chewy/rooms/room42.cpp
index b8373de35f8..27e4d290c3f 100644
--- a/engines/chewy/rooms/room42.cpp
+++ b/engines/chewy/rooms/room42.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room45.cpp b/engines/chewy/rooms/room45.cpp
index 187c3d19513..e767b259616 100644
--- a/engines/chewy/rooms/room45.cpp
+++ b/engines/chewy/rooms/room45.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room46.cpp b/engines/chewy/rooms/room46.cpp
index 5a4ea2000c5..9ce420efa14 100644
--- a/engines/chewy/rooms/room46.cpp
+++ b/engines/chewy/rooms/room46.cpp
@@ -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) {
diff --git a/engines/chewy/rooms/room47.cpp b/engines/chewy/rooms/room47.cpp
index 99a2765d684..f0e16282f76 100644
--- a/engines/chewy/rooms/room47.cpp
+++ b/engines/chewy/rooms/room47.cpp
@@ -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) {
diff --git a/engines/chewy/rooms/room49.cpp b/engines/chewy/rooms/room49.cpp
index ff2db09fb46..0e1487bf415 100644
--- a/engines/chewy/rooms/room49.cpp
+++ b/engines/chewy/rooms/room49.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room50.cpp b/engines/chewy/rooms/room50.cpp
index 55cadae0c07..693df0cc94c 100644
--- a/engines/chewy/rooms/room50.cpp
+++ b/engines/chewy/rooms/room50.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room52.cpp b/engines/chewy/rooms/room52.cpp
index 4df8e0e33ee..31a9425fec0 100644
--- a/engines/chewy/rooms/room52.cpp
+++ b/engines/chewy/rooms/room52.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room53.cpp b/engines/chewy/rooms/room53.cpp
index 903a533c87c..ddd39764474 100644
--- a/engines/chewy/rooms/room53.cpp
+++ b/engines/chewy/rooms/room53.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room54.cpp b/engines/chewy/rooms/room54.cpp
index 322b1683b04..7caf214c5cf 100644
--- a/engines/chewy/rooms/room54.cpp
+++ b/engines/chewy/rooms/room54.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room55.cpp b/engines/chewy/rooms/room55.cpp
index c8ae030dc82..f74489a6672 100644
--- a/engines/chewy/rooms/room55.cpp
+++ b/engines/chewy/rooms/room55.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room56.cpp b/engines/chewy/rooms/room56.cpp
index fc5286399a2..835f008b200 100644
--- a/engines/chewy/rooms/room56.cpp
+++ b/engines/chewy/rooms/room56.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room57.cpp b/engines/chewy/rooms/room57.cpp
index c9a11593d08..bd6d9a60cb8 100644
--- a/engines/chewy/rooms/room57.cpp
+++ b/engines/chewy/rooms/room57.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room63.cpp b/engines/chewy/rooms/room63.cpp
index 528918a9006..e5619945f18 100644
--- a/engines/chewy/rooms/room63.cpp
+++ b/engines/chewy/rooms/room63.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room64.cpp b/engines/chewy/rooms/room64.cpp
index 7af5b83d5fa..30b97e3ddbe 100644
--- a/engines/chewy/rooms/room64.cpp
+++ b/engines/chewy/rooms/room64.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room66.cpp b/engines/chewy/rooms/room66.cpp
index 5490ad49ece..554df23fe34 100644
--- a/engines/chewy/rooms/room66.cpp
+++ b/engines/chewy/rooms/room66.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room67.cpp b/engines/chewy/rooms/room67.cpp
index d87497fc08e..53b3da07377 100644
--- a/engines/chewy/rooms/room67.cpp
+++ b/engines/chewy/rooms/room67.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room68.cpp b/engines/chewy/rooms/room68.cpp
index c14af72c5b5..f8599050639 100644
--- a/engines/chewy/rooms/room68.cpp
+++ b/engines/chewy/rooms/room68.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room69.cpp b/engines/chewy/rooms/room69.cpp
index 4700bf45c4d..474f0aa5244 100644
--- a/engines/chewy/rooms/room69.cpp
+++ b/engines/chewy/rooms/room69.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room71.cpp b/engines/chewy/rooms/room71.cpp
index c5705628233..caa3e3100fd 100644
--- a/engines/chewy/rooms/room71.cpp
+++ b/engines/chewy/rooms/room71.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room73.cpp b/engines/chewy/rooms/room73.cpp
index 7159c60e616..ec03b1ad249 100644
--- a/engines/chewy/rooms/room73.cpp
+++ b/engines/chewy/rooms/room73.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room74.cpp b/engines/chewy/rooms/room74.cpp
index e17e0eea672..b474dbd0186 100644
--- a/engines/chewy/rooms/room74.cpp
+++ b/engines/chewy/rooms/room74.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room76.cpp b/engines/chewy/rooms/room76.cpp
index f1c4b0db10f..d483ca1f5f8 100644
--- a/engines/chewy/rooms/room76.cpp
+++ b/engines/chewy/rooms/room76.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room77.cpp b/engines/chewy/rooms/room77.cpp
index f4a675eb250..ff1c0969920 100644
--- a/engines/chewy/rooms/room77.cpp
+++ b/engines/chewy/rooms/room77.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room81.cpp b/engines/chewy/rooms/room81.cpp
index 88adbde46fd..ff16bac9dde 100644
--- a/engines/chewy/rooms/room81.cpp
+++ b/engines/chewy/rooms/room81.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room82.cpp b/engines/chewy/rooms/room82.cpp
index af1a756e4e4..01a588b1901 100644
--- a/engines/chewy/rooms/room82.cpp
+++ b/engines/chewy/rooms/room82.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room84.cpp b/engines/chewy/rooms/room84.cpp
index b9c2bd05524..a0036e50be3 100644
--- a/engines/chewy/rooms/room84.cpp
+++ b/engines/chewy/rooms/room84.cpp
@@ -186,7 +186,7 @@ void Room84::talk2() {
}
int Room84::proc4() {
- if (_G(cur)->usingInventoryCursors())
+ if (_G(cur)->usingInventoryCursor())
return 0;
hideCur();
diff --git a/engines/chewy/rooms/room85.cpp b/engines/chewy/rooms/room85.cpp
index b6743120974..c375c3f80a3 100644
--- a/engines/chewy/rooms/room85.cpp
+++ b/engines/chewy/rooms/room85.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room86.cpp b/engines/chewy/rooms/room86.cpp
index 315ed68baa6..9e186e0f1f8 100644
--- a/engines/chewy/rooms/room86.cpp
+++ b/engines/chewy/rooms/room86.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room87.cpp b/engines/chewy/rooms/room87.cpp
index 8b9e4be50a8..93a76d73557 100644
--- a/engines/chewy/rooms/room87.cpp
+++ b/engines/chewy/rooms/room87.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room88.cpp b/engines/chewy/rooms/room88.cpp
index dcc1c3aab8f..ce6c610bb27 100644
--- a/engines/chewy/rooms/room88.cpp
+++ b/engines/chewy/rooms/room88.cpp
@@ -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();
diff --git a/engines/chewy/rooms/room89.cpp b/engines/chewy/rooms/room89.cpp
index 4fc2e24c5a0..3a2a81a4203 100644
--- a/engines/chewy/rooms/room89.cpp
+++ b/engines/chewy/rooms/room89.cpp
@@ -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)
diff --git a/engines/chewy/rooms/room90.cpp b/engines/chewy/rooms/room90.cpp
index 945e5902037..9b0f9fba095 100644
--- a/engines/chewy/rooms/room90.cpp
+++ b/engines/chewy/rooms/room90.cpp
@@ -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);
diff --git a/engines/chewy/rooms/room94.cpp b/engines/chewy/rooms/room94.cpp
index 0bf775e8c75..514140cd26c 100644
--- a/engines/chewy/rooms/room94.cpp
+++ b/engines/chewy/rooms/room94.cpp
@@ -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;
diff --git a/engines/chewy/rooms/room95.cpp b/engines/chewy/rooms/room95.cpp
index f941d3f3490..5c45252a924 100644
--- a/engines/chewy/rooms/room95.cpp
+++ b/engines/chewy/rooms/room95.cpp
@@ -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;
}
diff --git a/engines/chewy/rooms/room97.cpp b/engines/chewy/rooms/room97.cpp
index cc50dd935b1..9b6ee59f3fe 100644
--- a/engines/chewy/rooms/room97.cpp
+++ b/engines/chewy/rooms/room97.cpp
@@ -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);
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index 773c69a8d73..252e63611db 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -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);
diff --git a/engines/chewy/types.cpp b/engines/chewy/types.cpp
index 50540c260bd..ed1953218c7 100644
--- a/engines/chewy/types.cpp
+++ b/engines/chewy/types.cpp
@@ -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;
}
diff --git a/engines/chewy/types.h b/engines/chewy/types.h
index 4827dcb8c7d..2ba3e769f76 100644
--- a/engines/chewy/types.h
+++ b/engines/chewy/types.h
@@ -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];
Commit: edac2cb52b7475a5b399a3a21f8fc6e0633b0c38
https://github.com/scummvm/scummvm/commit/edac2cb52b7475a5b399a3a21f8fc6e0633b0c38
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:55+03:00
Commit Message:
CHEWY: Add a console command to set the cursor
Changed paths:
engines/chewy/console.cpp
engines/chewy/console.h
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index a36cfeb0dfb..4c289c98529 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -47,6 +47,7 @@ static int strToInt(const char *s) {
Console::Console() : GUI::Debugger() {
registerCmd("room", WRAP_METHOD(Console, Cmd_Room));
registerCmd("item", WRAP_METHOD(Console, Cmd_Item));
+ registerCmd("cursor", WRAP_METHOD(Console, Cmd_Cursor));
registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound));
registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech));
registerCmd("play_music", WRAP_METHOD(Console, Cmd_PlayMusic));
@@ -87,6 +88,17 @@ bool Console::Cmd_Item(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_Cursor(int argc, const char **argv) {
+ if (argc == 1) {
+ debugPrintf("%s <cursorNum>\n", argv[0]);
+ } else {
+ int cursorNum = strToInt(argv[1]);
+ cursorChoice(cursorNum);
+ }
+
+ return false;
+}
+
bool Console::Cmd_PlaySound(int argc, const char **argv) {
if (argc < 2) {
debugPrintf("Usage: play_sound <number>\n");
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index 09f88efbd23..010d3c63dfe 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -30,6 +30,7 @@ class Console : public GUI::Debugger {
protected:
bool Cmd_Room(int argc, const char **argv);
bool Cmd_Item(int argc, const char **argv);
+ bool Cmd_Cursor(int argc, const char **argv);
bool Cmd_PlaySound(int argc, const char **argv);
bool Cmd_PlaySpeech(int argc, const char **argv);
bool Cmd_PlayMusic(int argc, const char **argv);
Commit: 1c5d4e31d541a51d82d1ab3dfc176a5a068fcf50
https://github.com/scummvm/scummvm/commit/1c5d4e31d541a51d82d1ab3dfc176a5a068fcf50
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:55+03:00
Commit Message:
CHEWY: Some more renames for cursor defines
Changed paths:
engines/chewy/defines.h
engines/chewy/dialogs/main_menu.cpp
engines/chewy/main.cpp
engines/chewy/rooms/room48.cpp
engines/chewy/rooms/room80.cpp
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 76b3a17301c..20a3355ff66 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -79,7 +79,7 @@ enum SetupScreenMode {
#define CUR_DISK 18
#define CUR_HOWARD 19
-#define CUR_ZEIGE 20
+#define CUR_POINT 20
#define CUR_NICHELLE 21
#define CUR_BLASTER 22
#define EXIT_LEFT_SPR 26
diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp
index d399e449a87..4236e75022c 100644
--- a/engines/chewy/dialogs/main_menu.cpp
+++ b/engines/chewy/dialogs/main_menu.cpp
@@ -62,7 +62,7 @@ void MainMenu::execute() {
g_engine->_sound->stopAllSounds();
_G(SetUpScreenFunc) = screenFunc;
- cursorChoice(CUR_ZEIGE);
+ cursorChoice(CUR_POINT);
_selection = -1;
_G(gameState).scrollx = _G(gameState).scrolly = 0;
_G(gameState)._personRoomNr[P_CHEWY] = 98;
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 24c400ddf61..7f76d211a1f 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -154,7 +154,7 @@ void cursorChoice(int16 nr) {
case CUR_NICHELLE:
_G(cur)->setAnimation(37, 37, delay);
break;
- case CUR_ZEIGE:
+ case CUR_POINT:
_G(cur)->setAnimation(9, 9, delay);
break;
case CUR_USER:
diff --git a/engines/chewy/rooms/room48.cpp b/engines/chewy/rooms/room48.cpp
index 8fed2c52660..e4ca69eb146 100644
--- a/engines/chewy/rooms/room48.cpp
+++ b/engines/chewy/rooms/room48.cpp
@@ -93,7 +93,7 @@ void Room48::setup_func() {
if (_G(menu_display) == 0) {
_G(menu_item) = CUR_USE;
cur_2_inventory();
- cursorChoice(CUR_ZEIGE);
+ cursorChoice(CUR_POINT);
const int16 idx = _G(det)->maus_vector(g_events->_mousePos.x, g_events->_mousePos.y);
if (idx != -1) {
diff --git a/engines/chewy/rooms/room80.cpp b/engines/chewy/rooms/room80.cpp
index 050051db060..9293253f511 100644
--- a/engines/chewy/rooms/room80.cpp
+++ b/engines/chewy/rooms/room80.cpp
@@ -78,7 +78,7 @@ void Room80::setup_func() {
_G(menu_item) = CUR_USE;
cur_2_inventory();
- cursorChoice(CUR_ZEIGE);
+ cursorChoice(CUR_POINT);
int vec = _G(det)->maus_vector(_G(gameState).scrollx + g_events->_mousePos.x, g_events->_mousePos.y);
if (vec == -1)
return;
Commit: bfb954cc3d6f7048711a2758c5fd95d297dbd843
https://github.com/scummvm/scummvm/commit/bfb954cc3d6f7048711a2758c5fd95d297dbd843
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:56+03:00
Commit Message:
CHEWY: Cleanup invent_2_slot()
Changed paths:
engines/chewy/menus.cpp
diff --git a/engines/chewy/menus.cpp b/engines/chewy/menus.cpp
index a1b0edb2e7d..ceeb56a1ddd 100644
--- a/engines/chewy/menus.cpp
+++ b/engines/chewy/menus.cpp
@@ -355,11 +355,10 @@ void new_invent_2_cur(int16 inv_nr) {
}
void invent_2_slot(int16 nr) {
- int16 ok = 0;
- for (int16 i = 0; i < MAX_MOV_OBJ && !ok; i++) {
+ for (int16 i = 0; i < MAX_MOV_OBJ; i++) {
if (_G(gameState).InventSlot[i] == -1) {
_G(gameState).InventSlot[i] = nr;
- ok = true;
+ break;
}
}
_G(obj)->addInventory(nr, &_G(room_blk));
Commit: f846178f1d699c4cb6c70616ddb3b49f630ed7ed
https://github.com/scummvm/scummvm/commit/f846178f1d699c4cb6c70616ddb3b49f630ed7ed
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:56+03:00
Commit Message:
CHEWY: Fix setting blaster cursor - bug #13640
Changed paths:
engines/chewy/main.cpp
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 7f76d211a1f..208928a0310 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -157,6 +157,9 @@ void cursorChoice(int16 nr) {
case CUR_POINT:
_G(cur)->setAnimation(9, 9, delay);
break;
+ case CUR_BLASTER:
+ _G(cur)->setAnimation(40, 40, delay);
+ break;
case CUR_USER:
break;
default:
Commit: dffdf81eb083bf120798e2354528370e1584f858
https://github.com/scummvm/scummvm/commit/dffdf81eb083bf120798e2354528370e1584f858
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:56+03:00
Commit Message:
CHEWY: Hide cursor when showing the Hermit's diary - bug #13639
Changed paths:
engines/chewy/dialogs/inventory.cpp
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index cac341dca03..a344c04d1c5 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -641,12 +641,14 @@ bool Inventory::calc_use_invent(int16 invNr) {
return retVal;
}
+// Shows the Hermit's diary
void Inventory::showDiary() {
int16 scrollx = _G(gameState).scrollx,
scrolly = _G(gameState).scrolly;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
+ _G(cur)->hideCursor();
_G(room)->load_tgp(DIARY_START, &_G(room_blk), GBOOK_TGP, false, GBOOK);
_G(out)->setPointer(_G(workptr));
_G(out)->map_spr2screen(_G(ablage)[_G(room_blk).AkAblage], _G(gameState).scrollx, _G(gameState).scrolly);
@@ -659,10 +661,6 @@ void Inventory::showDiary() {
g_events->update();
SHOULD_QUIT_RETURN;
}
- while (_G(in)->getSwitchCode() != Common::KEYCODE_INVALID) {
- g_events->update();
- SHOULD_QUIT_RETURN;
- }
_G(room)->load_tgp(_G(gameState)._personRoomNr[P_CHEWY], &_G(room_blk), EPISODE1_TGP, true, EPISODE1);
_G(gameState).scrollx = scrollx;
@@ -672,6 +670,7 @@ void Inventory::showDiary() {
_G(out)->setPointer(nullptr);
_G(room)->set_ak_pal(&_G(room_blk));
_G(fx)->blende1(_G(workptr), _G(pal), 0, 0);
+ _G(cur)->showCursor();
}
} // namespace Dialogs
Commit: b2c204b10894c14e835da7871b086eeaa1fe2d12
https://github.com/scummvm/scummvm/commit/b2c204b10894c14e835da7871b086eeaa1fe2d12
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:57+03:00
Commit Message:
CHEWY: Fix typo (setSetailPos -> setDetailPos)
Changed paths:
engines/chewy/detail.cpp
engines/chewy/detail.h
engines/chewy/rooms/room12.cpp
engines/chewy/rooms/room13.cpp
engines/chewy/rooms/room18.cpp
engines/chewy/rooms/room21.cpp
engines/chewy/rooms/room28.cpp
engines/chewy/rooms/room40.cpp
engines/chewy/rooms/room45.cpp
engines/chewy/rooms/room51.cpp
engines/chewy/rooms/room78.cpp
engines/chewy/rooms/room90.cpp
engines/chewy/rooms/room97.cpp
diff --git a/engines/chewy/detail.cpp b/engines/chewy/detail.cpp
index 57c9410562c..bb3fa31d71b 100644
--- a/engines/chewy/detail.cpp
+++ b/engines/chewy/detail.cpp
@@ -322,7 +322,7 @@ void Detail::setStaticPos(int16 detNr, int16 x, int16 y, bool hideFl, bool corre
_rdi.Sinfo[detNr].Hide = hideFl;
}
-void Detail::setSetailPos(int16 detNr, int16 x, int16 y) {
+void Detail::setDetailPos(int16 detNr, int16 x, int16 y) {
_rdi.Ainfo[detNr].x = x;
_rdi.Ainfo[detNr].y = y;
}
diff --git a/engines/chewy/detail.h b/engines/chewy/detail.h
index 12ce0c288a6..6e28792246d 100644
--- a/engines/chewy/detail.h
+++ b/engines/chewy/detail.h
@@ -172,7 +172,7 @@ public:
void load_rdi_taf(const char *fname, int16 load_flag);
void setStaticPos(int16 detNr, int16 x, int16 y, bool hideFl, bool correctionFlag);
- void setSetailPos(int16 detNr, int16 x, int16 y);
+ void setDetailPos(int16 detNr, int16 x, int16 y);
void hideStaticSpr(int16 detNr);
void showStaticSpr(int16 detNr);
void freezeAni();
diff --git a/engines/chewy/rooms/room12.cpp b/engines/chewy/rooms/room12.cpp
index c540bf65ccb..a534bd71bf1 100644
--- a/engines/chewy/rooms/room12.cpp
+++ b/engines/chewy/rooms/room12.cpp
@@ -170,7 +170,7 @@ void Room12::bork_ok() {
wait_auto_obj(R12_BORK_OBJ);
_G(gameState).R12BorkInRohr = true;
- _G(det)->setSetailPos(3, 170, 145);
+ _G(det)->setDetailPos(3, 170, 145);
_G(det)->startDetail(3, 255, ANI_FRONT);
startAadWait(57);
_G(det)->stop_detail(3);
diff --git a/engines/chewy/rooms/room13.cpp b/engines/chewy/rooms/room13.cpp
index b63b2cd948c..f474231cb27 100644
--- a/engines/chewy/rooms/room13.cpp
+++ b/engines/chewy/rooms/room13.cpp
@@ -103,7 +103,7 @@ void Room13::talk_bork() {
_G(gameState).R13BorkOk = true;
_G(gameState).R12ChewyBork = false;
_G(det)->showStaticSpr(13);
- _G(det)->setSetailPos(10, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
+ _G(det)->setDetailPos(10, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
_G(det)->setStaticPos(12, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1], false, true);
_G(gameState)._personHide[P_CHEWY] = true;
startAadWait(33);
diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp
index 7f48f28b57f..394a5f0b08a 100644
--- a/engines/chewy/rooms/room18.cpp
+++ b/engines/chewy/rooms/room18.cpp
@@ -263,8 +263,8 @@ int16 Room18::calc_surimy() {
_G(gameState)._personHide[P_CHEWY] = false;
wait_auto_obj(SURIMY_OBJ);
- _G(det)->setSetailPos(21, 392, 170);
- _G(det)->setSetailPos(22, 447, 154);
+ _G(det)->setDetailPos(21, 392, 170);
+ _G(det)->setDetailPos(22, 447, 154);
startDetailFrame(21, 1, ANI_FRONT, 14);
_G(det)->startDetail(22, 1, ANI_FRONT);
waitDetail(21);
@@ -289,8 +289,8 @@ int16 Room18::calc_surimy() {
auto_scroll(70, 0);
wait_auto_obj(SURIMY_OBJ);
- _G(det)->setSetailPos(21, 143, 170);
- _G(det)->setSetailPos(22, 198, 154);
+ _G(det)->setDetailPos(21, 143, 170);
+ _G(det)->setDetailPos(22, 198, 154);
startDetailFrame(21, 1, ANI_FRONT, 14);
_G(det)->startDetail(22, 1, ANI_FRONT);
waitDetail(21);
diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp
index 2d1719a8d6a..b017872d91a 100644
--- a/engines/chewy/rooms/room21.cpp
+++ b/engines/chewy/rooms/room21.cpp
@@ -195,7 +195,7 @@ void Room21::chewy_kolli() {
_G(flags).AutoAniPlay = true;
_G(gameState)._personHide[P_CHEWY] = true;
int16 ani_nr = (_G(moveState)[P_CHEWY].Xyvo[0] < 0) ? 10 : 11;
- _G(det)->setSetailPos(ani_nr, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
+ _G(det)->setDetailPos(ani_nr, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
startSetAILWait(ani_nr, 1, ANI_FRONT);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).AutoAniPlay = false;
@@ -213,7 +213,7 @@ void Room21::salto() {
_G(gameState)._personHide[P_CHEWY] = true;
for (int16 i = 0; i < 3; i++) {
- _G(det)->setSetailPos(12 + i, _G(moveState)[P_CHEWY].Xypos[0],
+ _G(det)->setDetailPos(12 + i, _G(moveState)[P_CHEWY].Xypos[0],
_G(moveState)[P_CHEWY].Xypos[1]);
}
diff --git a/engines/chewy/rooms/room28.cpp b/engines/chewy/rooms/room28.cpp
index 2438b319dc7..5163688532d 100644
--- a/engines/chewy/rooms/room28.cpp
+++ b/engines/chewy/rooms/room28.cpp
@@ -250,7 +250,7 @@ void Room28::set_pump() {
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp = (_G(person_end_phase)[P_CHEWY] == P_RIGHT) ? 1 : 0;
delInventory(K_MASKE_INV);
- _G(det)->setSetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
+ _G(det)->setDetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
if (_G(gameState).R28PumpTxt1 < 3) {
start_aad(137);
@@ -297,7 +297,7 @@ void Room28::get_pump() {
_G(gameState).R28ChewyPump = false;
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp = (_G(person_end_phase)[P_CHEWY] == P_RIGHT) ? 1 : 0;
- _G(det)->setSetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
+ _G(det)->setDetailPos(tmp, _G(moveState)[P_CHEWY].Xypos[0], _G(moveState)[P_CHEWY].Xypos[1]);
startSetAILWait(tmp, 1, ANI_BACK);
invent_2_slot(K_MASKE_INV);
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index dd53c0599eb..5b7d57dcafc 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -182,7 +182,7 @@ void Room40::move_train(int16 mode) {
int16 delay = 0;
while (ax < 560) {
- _G(det)->setSetailPos(7, lx, 46);
+ _G(det)->setDetailPos(7, lx, 46);
_G(det)->setStaticPos(11, ax, 62, false, false);
if (mode && _G(gameState).ChewyAni == CHEWY_PUMPKIN)
diff --git a/engines/chewy/rooms/room45.cpp b/engines/chewy/rooms/room45.cpp
index e767b259616..5bd01c989a4 100644
--- a/engines/chewy/rooms/room45.cpp
+++ b/engines/chewy/rooms/room45.cpp
@@ -120,7 +120,7 @@ void Room45::setup_func() {
_G(det)->stop_detail(3 + i);
}
}
- _G(det)->setSetailPos(3 + i, x, y);
+ _G(det)->setDetailPos(3 + i, x, y);
} else {
++_G(r45_pinfo)[i][2];
@@ -133,7 +133,7 @@ void Room45::setup_func() {
} else {
x = 0;
}
- _G(det)->setSetailPos(3 + i, x, y);
+ _G(det)->setDetailPos(3 + i, x, y);
_G(det)->startDetail(3 + i, 255, ANI_FRONT);
}
}
diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp
index 6139c5ed399..8bd50e5fe61 100644
--- a/engines/chewy/rooms/room51.cpp
+++ b/engines/chewy/rooms/room51.cpp
@@ -145,7 +145,7 @@ void Room51::setup_func() {
if ((_G(minfo).button == 1 || _G(in)->getSwitchCode() == 28) && !_flag) {
_flag = true;
- _G(det)->setSetailPos(8, _tmpx - 20, _tmpy + 41);
+ _G(det)->setDetailPos(8, _tmpx - 20, _tmpy + 41);
startSetAILWait(8, 1, ANI_FRONT);
_flag = false;
++_index;
diff --git a/engines/chewy/rooms/room78.cpp b/engines/chewy/rooms/room78.cpp
index af355de8cfe..06b8cd88976 100644
--- a/engines/chewy/rooms/room78.cpp
+++ b/engines/chewy/rooms/room78.cpp
@@ -49,7 +49,7 @@ void Room78::entry() {
int destX = 592;
while (destX > 0) {
- _G(det)->setSetailPos(3, destX, 77);
+ _G(det)->setDetailPos(3, destX, 77);
if (delay)
--delay;
else {
@@ -71,8 +71,8 @@ void Room78::entry() {
bool flag2 = false;
while (exitLoopFlag == 0) {
- _G(det)->setSetailPos(0, det0DestX, 93);
- _G(det)->setSetailPos(4, det4DestX, 57);
+ _G(det)->setDetailPos(0, det0DestX, 93);
+ _G(det)->setDetailPos(4, det4DestX, 57);
if (delay)
--delay;
diff --git a/engines/chewy/rooms/room90.cpp b/engines/chewy/rooms/room90.cpp
index 9b0f9fba095..fc2b62f9b2e 100644
--- a/engines/chewy/rooms/room90.cpp
+++ b/engines/chewy/rooms/room90.cpp
@@ -66,7 +66,7 @@ void Room90::entry(int16 eib_nr) {
_G(HowardMov) = 1;
if (_G(gameState).flags34_40 && !_G(gameState).flags33_40) {
- _G(det)->setSetailPos(12, 329, 15);
+ _G(det)->setDetailPos(12, 329, 15);
_G(det)->startDetail(12, 255, false);
g_engine->_sound->playSound(12, 0);
g_engine->_sound->playSound(12);
@@ -138,7 +138,7 @@ void Room90::setup_func() {
_G(det)->stop_detail(i + 4);
}
}
- _G(det)->setSetailPos(i + 4, destX, destY);
+ _G(det)->setDetailPos(i + 4, destX, destY);
} else {
++_G(gameState).r90_Array187030[i][2];
if (_G(gameState).r90_Array187030[i][2] < _G(gameState).r90_Array187030[i][3])
@@ -151,7 +151,7 @@ void Room90::setup_func() {
else
destX = 500;
- _G(det)->setSetailPos(i + 4, destX, _G(Adi)[i + 4].y);
+ _G(det)->setDetailPos(i + 4, destX, _G(Adi)[i + 4].y);
if (!_G(gameState).flags34_40)
_G(det)->startDetail(i + 4, 255, false);
@@ -257,7 +257,7 @@ int Room90::getHubcaps() {
_G(gameState).flags35_1 = true;
autoMove(4, P_CHEWY);
auto_scroll(176, 0);
- _G(det)->setSetailPos(12, 495, 15);
+ _G(det)->setDetailPos(12, 495, 15);
_G(det)->startDetail(12, 255, false);
g_engine->_sound->playSound(12, 0);
g_engine->_sound->playSound(12);
@@ -266,7 +266,7 @@ int Room90::getHubcaps() {
while (destX > 329) {
destX -= 2;
- _G(det)->setSetailPos(12, destX, 15);
+ _G(det)->setDetailPos(12, destX, 15);
setupScreen(DO_SETUP);
SHOULD_QUIT_RETURN0;
}
diff --git a/engines/chewy/rooms/room97.cpp b/engines/chewy/rooms/room97.cpp
index 9b6ee59f3fe..399c628978e 100644
--- a/engines/chewy/rooms/room97.cpp
+++ b/engines/chewy/rooms/room97.cpp
@@ -82,7 +82,7 @@ void Room97::entry() {
}
if (_G(gameState).flags36_20) {
- _G(det)->setSetailPos(27, 272, 110);
+ _G(det)->setDetailPos(27, 272, 110);
for (int i = 0; i < 2; ++i) {
_G(det)->stop_detail(23 + i);
_G(det)->startDetail(27 + i, 255, ANI_FRONT);
@@ -194,7 +194,7 @@ void Room97::setup_func() {
_G(det)->setStaticPos(16, 699, _word18DB38, false, false);
if (_G(gameState).flags36_10) {
- _G(det)->setSetailPos(12, _word18DB34, _word18DB36);
+ _G(det)->setDetailPos(12, _word18DB34, _word18DB36);
} else {
_G(det)->setStaticPos(14, _word18DB34, _word18DB36, false, false);
}
@@ -513,7 +513,7 @@ int Room97::proc8() {
_G(det)->stop_detail(27);
_G(gameState).flags36_20 = true;
_G(det)->startDetail(28, 255, false);
- _G(det)->setSetailPos(27, 272, 110);
+ _G(det)->setDetailPos(27, 272, 110);
_G(det)->startDetail(27, 255, false);
_G(atds)->setControlBit(533, ATS_ACTIVE_BIT);
_G(atds)->setControlBit(534, ATS_ACTIVE_BIT);
Commit: d7a0156318b43352fa0303efcc234606630d9b9f
https://github.com/scummvm/scummvm/commit/d7a0156318b43352fa0303efcc234606630d9b9f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:57+03:00
Commit Message:
CHEWY: Fix Howard and Chewy's position on the train - bug #13637
Changed paths:
engines/chewy/rooms/room40.cpp
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index 5b7d57dcafc..23cc642726b 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -183,10 +183,15 @@ void Room40::move_train(int16 mode) {
while (ax < 560) {
_G(det)->setDetailPos(7, lx, 46);
+ // Train sprite
_G(det)->setStaticPos(11, ax, 62, false, false);
+ // Chewy and Howard sprite
+ // The original offsets were ax and 62, which for some reason
+ // aren't shown correctly here (perhaps bad correction coords).
+ // Thus, adjust the coordinates here.
if (mode && _G(gameState).ChewyAni == CHEWY_PUMPKIN)
- _G(det)->setStaticPos(12, ax, 62, false, true);
+ _G(det)->setStaticPos(12, ax + 27, 161, false, true);
if (!delay) {
lx += SPEED;
Commit: be9d94a9ebb8a9a82b31f79115cb962ca1f5fcee
https://github.com/scummvm/scummvm/commit/be9d94a9ebb8a9a82b31f79115cb962ca1f5fcee
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:57+03:00
Commit Message:
CHEWY: Cleanup inventory and show button arrows if needed - bug #13610
Changed paths:
engines/chewy/defines.h
engines/chewy/dialogs/inventory.cpp
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 20a3355ff66..9ec3aa92972 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -99,7 +99,7 @@ enum SetupScreenMode {
#define WIN_INF_Y 15
#define WIN_LOOK_X 30
#define WIN_LOOK_Y 150
-#define PFEIL_UP 26
+#define ARROW_UP 26
#define INVENTORY_HOTSPOTS_COUNT 8
#define HOT_LOOK_NR 2
#define MES_RAHMEN 1
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index a344c04d1c5..60267100c0f 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -33,9 +33,6 @@
namespace Chewy {
namespace Dialogs {
-static const int16 ANI_INVENT_END[3] = { 7, 16, 24 };
-
-
int16 Inventory::inv_rand_x;
int16 Inventory::inv_rand_y;
int Inventory::keyVal;
@@ -45,36 +42,69 @@ void Inventory::plot_menu() {
_G(out)->setPointer(_G(workptr));
buildMenu(WIN_INVENTORY);
+ // Draw inventory slots grid
for (int16 j = 0; j < 3; j++) {
- for (int16 i = 0; i < 5; i++)
- _G(out)->boxFill(WIN_INF_X + 14 + i * 54, WIN_INF_Y + 6 + 30 + j * 32,
- WIN_INF_X + 14 + i * 54 + 40, WIN_INF_Y + 6 + 30 + j * 32 + 24, 12);
+ for (int16 i = 0; i < 5; i++) {
+ _G(out)->boxFill(
+ WIN_INF_X + 14 + i * 54,
+ WIN_INF_Y + 6 + 30 + j * 32,
+ WIN_INF_X + 14 + i * 54 + 40,
+ WIN_INF_Y + 6 + 30 + j * 32 + 24,
+ 12
+ );
+ }
}
int16 y;
- int16 k = _G(in)->findHotspot(_G(inventoryHotspots));
- if (k != -1) {
- if (k < 5)
- _G(out)->boxFill(_G(inventoryHotspots)[k].left, _G(inventoryHotspots)[k].top,
- _G(inventoryHotspots)[k].right + 1, _G(inventoryHotspots)[k].bottom + 5, 41);
- else {
- int16 x = (g_events->_mousePos.x - (WIN_INF_X)) / 54;
+ int16 hotspotId = _G(in)->findHotspot(_G(inventoryHotspots));
+
+ // Highlight hotspots
+ if (hotspotId != -1) {
+ if (hotspotId < 5) {
+ _G(out)->boxFill(
+ _G(inventoryHotspots)[hotspotId].left,
+ _G(inventoryHotspots)[hotspotId].top,
+ _G(inventoryHotspots)[hotspotId].right + 1,
+ _G(inventoryHotspots)[hotspotId].bottom + 5,
+ 41
+ );
+ } else {
+ const 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(gameState).InventY * 5;
- if (k < (_G(gameState).InventY + 3) * 5)
- _G(out)->boxFill(WIN_INF_X + 14 + x * 54, WIN_INF_Y + 6 + 30 + y * 32,
- WIN_INF_X + 14 + x * 54 + 40, WIN_INF_Y + 6 + 30 + y * 32 + 24, 41);
+ hotspotId = x + (y * 5);
+ hotspotId += _G(gameState).InventY * 5;
+ if (hotspotId < (_G(gameState).InventY + 3) * 5) {
+ _G(out)->boxFill(
+ WIN_INF_X + 14 + x * 54,
+ WIN_INF_Y + 6 + 30 + y * 32,
+ WIN_INF_X + 14 + x * 54 + 40,
+ WIN_INF_Y + 6 + 30 + y * 32 + 24,
+ 41
+ );
+ }
}
}
if (inv_rand_x != -1) {
- _G(out)->boxFill(WIN_INF_X + 14 + inv_rand_x * 54, WIN_INF_Y + 6 + 30 + inv_rand_y * 32,
- WIN_INF_X + 14 + inv_rand_x * 54 + 40, WIN_INF_Y + 6 + 30 + inv_rand_y * 32 + 24, 41);
- _G(out)->box(WIN_INF_X + 14 + inv_rand_x * 54 - 1, WIN_INF_Y + 6 + 30 + inv_rand_y * 32 - 1,
- WIN_INF_X + 14 + inv_rand_x * 54 + 40 + 1, WIN_INF_Y + 6 + 30 + inv_rand_y * 32 + 24 + 1, 14);
+ _G(out)->boxFill(
+ WIN_INF_X + 14 + inv_rand_x * 54,
+ WIN_INF_Y + 6 + 30 + inv_rand_y * 32,
+ WIN_INF_X + 14 + inv_rand_x * 54 + 40,
+ WIN_INF_Y + 6 + 30 + inv_rand_y * 32 + 24,
+ 41
+ );
+ _G(out)->box(
+ WIN_INF_X + 14 + inv_rand_x * 54 - 1,
+ WIN_INF_Y + 6 + 30 + inv_rand_y * 32 - 1,
+ WIN_INF_X + 14 + inv_rand_x * 54 + 40 + 1,
+ WIN_INF_Y + 6 + 30 + inv_rand_y * 32 + 24 + 1,
+ 14
+ );
}
+ const int16 ANI_INVENT_END[3] = {7, 16, 24};
+
+ // Draw inventory action icons (look and use, to the left of the dialog)
for (int16 i = 0; i < 2; i++) {
_G(ani_invent_delay)[i][0] -= 1;
if (_G(ani_invent_delay)[i][0] <= 0) {
@@ -85,10 +115,9 @@ void Inventory::plot_menu() {
_G(ani_invent_delay)[i][0] = 30000;
}
}
- if (i == 2)
- y = 3;
- else
- y = 0;
+
+ y = (i == 2) ? 3 : 0;
+
_G(out)->spriteSet(
_G(cur)->getCursorSprite(_G(ani_count)[i]),
WIN_INF_X + 8 + i * 32,
@@ -99,26 +128,52 @@ void Inventory::plot_menu() {
);
}
+ // Draw inventory arrows (up and down, to the right of the dialog)
for (int16 i = 0; i < 2; i++) {
- _G(out)->spriteSet(_G(menutaf)->image[PFEIL_UP + i],
- WIN_INF_X + 200 + i * 40, WIN_INF_Y + 12, _G(scr_width));
+ _G(out)->spriteSet(
+ _G(menutaf)->image[ARROW_UP + i],
+ WIN_INF_X + 200 + i * 40,
+ WIN_INF_Y + 12,
+ _G(scr_width)
+ );
}
y = WIN_INF_Y + 6 + 30;
+
+ // Draw inventory items
for (int16 j = 0; j < 3; j++) {
for (int16 i = 0; i < 5; i++) {
- if (_G(gameState).InventSlot[(_G(gameState).InventY + j) * 5 + i] != -1) {
- int16 *xy = (int16 *)_G(inv_spr)[_G(gameState).InventSlot[(_G(gameState).InventY + j) * 5 + i]];
- int16 x1 = 40 - xy[0];
- x1 /= 2;
- int16 y1 = 24 - xy[1];
- y1 /= 2;
- _G(out)->spriteSet(_G(inv_spr)[_G(gameState).InventSlot[(_G(gameState).InventY + j) * 5 + i]],
+ const int slot = (_G(gameState).InventY + j) * 5 + i;
+ const int16 invSlot = _G(gameState).InventSlot[slot];
+ if (invSlot != -1) {
+ const int16 *xy = (const int16 *)_G(inv_spr)[invSlot];
+ const int16 x1 = (40 - xy[0]) / 2;
+ const int16 y1 = (24 - xy[1]) / 2;
+
+ _G(out)->spriteSet(
+ _G(inv_spr)[invSlot],
x1 + WIN_INF_X + 14 + i * 54,
- y1 + y + 32 * j, _G(scr_width));
+ y1 + y + 32 * j,
+ _G(scr_width)
+ );
}
}
}
+
+ // Show up arrow, if needed
+ if (_G(gameState).InventY) {
+ const char c[2] = { 24, 0 };
+ _G(out)->printxy(225, 32, 19, 300, _G(scr_width), c);
+ }
+
+ // Show down arrow, if needed
+ for (int i = 5 * (_G(gameState).InventY + 3); i < 140; ++i) {
+ if (_G(gameState).InventSlot[i] != -1) {
+ const char c[2] = {25, 0};
+ _G(out)->printxy(265, 29, 19, 300, _G(scr_width), c);
+ break;
+ }
+ }
}
void Inventory::menu() {
Commit: 389026d47f9fbd7a4c4c2b15c08768b1b7cac051
https://github.com/scummvm/scummvm/commit/389026d47f9fbd7a4c4c2b15c08768b1b7cac051
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:58+03:00
Commit Message:
CHEWY: Whitespace fixes
Changed paths:
engines/chewy/dialogs/inventory.cpp
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 60267100c0f..7f4f09acf24 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -169,7 +169,7 @@ void Inventory::plot_menu() {
// Show down arrow, if needed
for (int i = 5 * (_G(gameState).InventY + 3); i < 140; ++i) {
if (_G(gameState).InventSlot[i] != -1) {
- const char c[2] = {25, 0};
+ const char c[2] = { 25, 0 };
_G(out)->printxy(265, 29, 19, 300, _G(scr_width), c);
break;
}
Commit: 04a1f7dc47325174bd3786ebdae77ecf49e9b20b
https://github.com/scummvm/scummvm/commit/04a1f7dc47325174bd3786ebdae77ecf49e9b20b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-30T17:27:58+03:00
Commit Message:
GUI: Add missing domain when checking for subtitle config - bug #13629
This disallowed selecting "both" for speech and subtitles, as the
subtitles setting was never saved. A regression from d6dbf721b62e773f.
Changed paths:
gui/options.cpp
diff --git a/gui/options.cpp b/gui/options.cpp
index 803c44f4776..2a9a7372268 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -965,7 +965,7 @@ void OptionsDialog::apply() {
break;
}
- if (subtitles != ConfMan.getBool("subtitles")) {
+ if (subtitles != ConfMan.getBool("subtitles", _domain)) {
ConfMan.setBool("subtitles", subtitles, _domain);
_subToggleDesc->setFontColor(ThemeEngine::FontColor::kFontColorNormal);
}
More information about the Scummvm-git-logs
mailing list