[Scummvm-git-logs] scummvm master -> 35e238ec64b7f6e3d7589ec93b93df3404d3cae0
bluegr
noreply at scummvm.org
Sun Jul 10 17:07:45 UTC 2022
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
79af8bad9d CHEWY: Remove the overriden music buffer added for bug #13672
5342a5a403 CHEWY: Fix compilation
1840da803e CHEWY: Renaming
8908733fc4 CHEWY: Fix invalid older save data in rooms 18 and 25 - bug #13671
8d96ad04d7 CHEWY: Renaming
19616084ea CHEWY: Fix regression in saved games with held items
7ce29e8460 CHEWY: Initialization fixes for room 37
35e238ec64 CHEWY: Fix game state synchronization - bug #13671
Commit: 79af8bad9de38127a15d163138f0ac167f650019
https://github.com/scummvm/scummvm/commit/79af8bad9de38127a15d163138f0ac167f650019
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:19+03:00
Commit Message:
CHEWY: Remove the overriden music buffer added for bug #13672
The MOD player loads the entirety of a song in memory, so we don't need
to add another music buffer
Changed paths:
engines/chewy/r_event.cpp
engines/chewy/sound.cpp
engines/chewy/sound.h
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index e8f8adc3204..920f01fccc5 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -723,7 +723,6 @@ void flic_cut(int16 nr) {
}
g_engine->_sound->stopMusic();
- g_engine->_sound->disposeMusicBuffer();
_G(out)->fadeOut();
_G(out)->cls();
break;
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index d5541772710..77dade8ee26 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -130,13 +130,7 @@ void Sound::playMusic(int16 num, bool loop) {
delete[] data;
}
-void Sound::playMusic(uint8 *data, uint32 size, uint8 volume, bool handleBuffer) {
- if (handleBuffer) {
- _overridenMusicBuffer = new uint8[size];
- memcpy(_overridenMusicBuffer, data, size);
- data = _overridenMusicBuffer;
- }
-
+void Sound::playMusic(uint8 *data, uint32 size, uint8 volume) {
TMFStream *stream = new TMFStream(new Common::MemoryReadStream(data, size), 0);
_curMusic = -1;
@@ -156,11 +150,6 @@ void Sound::stopMusic() {
_mixer->stopHandle(_musicHandle);
}
-void Sound::disposeMusicBuffer() {
- delete[] _overridenMusicBuffer;
- _overridenMusicBuffer = nullptr;
-}
-
bool Sound::isMusicActive() const {
return _mixer->isSoundHandleActive(_musicHandle);
}
diff --git a/engines/chewy/sound.h b/engines/chewy/sound.h
index cecb0e7b2ca..17cfcc0ab93 100644
--- a/engines/chewy/sound.h
+++ b/engines/chewy/sound.h
@@ -60,11 +60,10 @@ public:
void setSoundChannelBalance(uint channel, int8 balance);
void playMusic(int16 num, bool loop = false);
- void playMusic(uint8 *data, uint32 size, uint8 volume = 63, bool handleBuffer = false);
+ void playMusic(uint8 *data, uint32 size, uint8 volume = 63);
void pauseMusic();
void resumeMusic();
void stopMusic();
- void disposeMusicBuffer();
bool isMusicActive() const;
void setUserMusicVolume(uint volume);
int getUserMusicVolume() const;
@@ -121,7 +120,6 @@ private:
SoundResource *_speechRes;
SoundResource *_soundRes;
- uint8 *_overridenMusicBuffer = nullptr;
};
} // End of namespace Chewy
Commit: 5342a5a40323269c9335002b8e42d3ddc8890d68
https://github.com/scummvm/scummvm/commit/5342a5a40323269c9335002b8e42d3ddc8890d68
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:19+03:00
Commit Message:
CHEWY: Fix compilation
Changed paths:
engines/chewy/sound.cpp
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index 77dade8ee26..45ccf2d05ae 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -44,7 +44,6 @@ Sound::Sound(Audio::Mixer *mixer) {
Sound::~Sound() {
delete _soundRes;
delete _speechRes;
- delete _overridenMusicBuffer;
}
void Sound::playSound(int num, uint channel, uint16 loops, uint16 volume, uint16 balance) {
Commit: 1840da803eaced0ce282f4bfd38518cf77b0beed
https://github.com/scummvm/scummvm/commit/1840da803eaced0ce282f4bfd38518cf77b0beed
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:20+03:00
Commit Message:
CHEWY: Renaming
Changed paths:
engines/chewy/defines.h
engines/chewy/r_event.cpp
engines/chewy/rooms/room14.cpp
engines/chewy/rooms/room16.cpp
engines/chewy/rooms/room17.cpp
engines/chewy/rooms/room18.cpp
engines/chewy/rooms/room18.h
engines/chewy/rooms/room21.cpp
engines/chewy/rooms/room23.cpp
engines/chewy/rooms/room24.cpp
engines/chewy/rooms/room25.cpp
engines/chewy/rooms/room25.h
engines/chewy/rooms/room26.cpp
engines/chewy/rooms/room29.cpp
engines/chewy/rooms/room29.h
engines/chewy/rooms/room31.cpp
engines/chewy/rooms/room33.cpp
engines/chewy/t_event.cpp
engines/chewy/types.cpp
engines/chewy/types.h
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index e22ab6c68be..8620988c84d 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -339,8 +339,8 @@ enum SetupScreenMode {
#define RECORDER_INV 49
#define ZAPPER_INV 50
#define MUNTER_INV 51
-#define MILCH_LEER_INV 52
-#define MILCH_WAS_INV 53
+#define EMPTY_MILK_BOTTLE_INV 52
+#define WATER_FILLED_BOTTLE_INV 53
#define PAPIER_INV 54
#define LETTER_INV 55
#define TICKET_INV 56
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index 920f01fccc5..cddc57a3f10 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -217,7 +217,7 @@ void enter_room(int16 eib_nr) {
case 17:
Room17::entry();
if (g_engine->_sound->soundEnabled()) {
- if (!_G(gameState).R17EnergieOut)
+ if (!_G(gameState).R17EnergyOut)
_G(det)->playSound(15, 0);
}
break;
@@ -340,7 +340,7 @@ void exit_room(int16 eib_nr) {
_G(gameState).R17Location = 3;
_G(gameState).ScrollxStep = 1;
_G(flags).NoScroll = false;
- _G(gameState).R18Gitter = false;
+ _G(gameState).R18Grid = false;
_G(gameState).room_e_obj[50].Attribut = 255;
_G(gameState).room_e_obj[41].Attribut = EXIT_BOTTOM;
break;
@@ -363,13 +363,13 @@ void exit_room(int16 eib_nr) {
case 23:
_G(gameState)._personHide[P_CHEWY] = false;
- switch (_G(gameState).R23GleiterExit) {
+ switch (_G(gameState).R23GliderExit) {
case 16:
setPersonPos(126, 110, P_CHEWY, P_RIGHT);
break;
case 25:
- _G(gameState).R25GleiterExit = true;
+ _G(gameState).R25GliderExit = true;
break;
default:
diff --git a/engines/chewy/rooms/room14.cpp b/engines/chewy/rooms/room14.cpp
index a5766c336fb..f716888877e 100644
--- a/engines/chewy/rooms/room14.cpp
+++ b/engines/chewy/rooms/room14.cpp
@@ -31,7 +31,7 @@ namespace Chewy {
namespace Rooms {
void Room14::entry() {
- _G(gameState).R23GleiterExit = 14;
+ _G(gameState).R23GliderExit = 14;
_G(zoom_horizont) = 310;
_G(gameState).ScrollxStep = 2;
@@ -104,7 +104,7 @@ int16 Room14::use_gleiter() {
_G(det)->showStaticSpr(6);
_G(atds)->set_ats_str(107, TXT_MARK_LOOK, 1, ATS_DATA);
} else {
- _G(gameState).R23GleiterExit = 14;
+ _G(gameState).R23GliderExit = 14;
Room23::cockpit();
}
}
diff --git a/engines/chewy/rooms/room16.cpp b/engines/chewy/rooms/room16.cpp
index e08c9e0b615..fe5261bc085 100644
--- a/engines/chewy/rooms/room16.cpp
+++ b/engines/chewy/rooms/room16.cpp
@@ -50,7 +50,7 @@ int16 Room16::use_gleiter() {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
autoMove(6, P_CHEWY);
- _G(gameState).R23GleiterExit = 16;
+ _G(gameState).R23GliderExit = 16;
Room23::cockpit();
}
diff --git a/engines/chewy/rooms/room17.cpp b/engines/chewy/rooms/room17.cpp
index f194e61c16e..31d914f05f6 100644
--- a/engines/chewy/rooms/room17.cpp
+++ b/engines/chewy/rooms/room17.cpp
@@ -52,7 +52,7 @@ static const MovLine CHEWY_MPKT1[2] = {
};
void Room17::entry() {
- if (!_G(gameState).R17EnergieOut) {
+ if (!_G(gameState).R17EnergyOut) {
_G(det)->startDetail(1, 255, ANI_FRONT);
for (int i = 0; i < 3; ++i)
_G(det)->startDetail(6 + i, 255, ANI_FRONT);
@@ -111,7 +111,7 @@ void Room17::xit() {
bool Room17::timer(int16 t_nr, int16 ani_nr) {
if (_G(room)->_roomTimer._objNr[ani_nr] == 2 ||
_G(room)->_roomTimer._objNr[ani_nr] == 3) {
- if (_G(gameState).R17EnergieOut)
+ if (_G(gameState).R17EnergyOut)
_G(uhr)->resetTimer(t_nr, 0);
else
return true;
@@ -289,20 +289,20 @@ int16 Room17::energie_hebel() {
action_flag = true;
_G(obj)->calc_rsi_flip_flop(SIB_HEBEL_R17);
- _G(gameState).R17EnergieOut ^= 1;
+ _G(gameState).R17EnergyOut ^= 1;
- if (!_G(gameState).R17EnergieOut) {
+ if (!_G(gameState).R17EnergyOut) {
_G(det)->startDetail(1, 255, ANI_FRONT);
for (int i = 0; i < 3; ++i)
_G(det)->startDetail(i + 6, 255, ANI_FRONT);
}
- _G(atds)->set_ats_str(142, _G(gameState).R17EnergieOut ? 1 : 0, ATS_DATA);
- _G(atds)->set_ats_str(140, _G(gameState).R17EnergieOut ? 1 : 0, ATS_DATA);
+ _G(atds)->set_ats_str(142, _G(gameState).R17EnergyOut ? 1 : 0, ATS_DATA);
+ _G(atds)->set_ats_str(140, _G(gameState).R17EnergyOut ? 1 : 0, ATS_DATA);
_G(det)->playSound(12, 0);
- if (_G(gameState).R17EnergieOut) {
+ if (_G(gameState).R17EnergyOut) {
_G(det)->stopSound(0);
} else {
_G(det)->playSound(15, 0);
diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp
index 3146499e9ab..1e7c78b7eb1 100644
--- a/engines/chewy/rooms/room18.cpp
+++ b/engines/chewy/rooms/room18.cpp
@@ -29,10 +29,10 @@
namespace Chewy {
namespace Rooms {
-static const int16 BORK_SPR[5] = { 15, 16, 17, 24, 25 };
-static const int16 BORK_SPR1[4] = { 20, 21, 18, 19 };
+static const int16 BORK_AWAKE_SPR[5] = { 15, 16, 17, 24, 25 };
+static const int16 BORK_FAINTED_SPR[4] = { 20, 21, 18, 19 };
-static const int16 SURIMY_PHASEN[4][2] = {
+static const int16 SURIMY_PHASES[4][2] = {
{ 245, 252 },
{ 0, 0 },
{ 0, 0 },
@@ -88,44 +88,46 @@ static const AniBlock ABLOCK24[2] = {
void Room18::entry() {
- _G(gameState).R18MoniSwitch = false;
+ _G(gameState).R18MonitorSwitch = false;
_G(atds)->set_ats_str(151, TXT_MARK_LOOK, 0, ATS_DATA);
_G(gameState).ScrollxStep = 2;
if (_G(gameState).R18CartTerminal)
_G(det)->showStaticSpr(23);
- if (!_G(gameState).R18SurimyWurf) {
- init_borks();
+ if (!_G(gameState).R18SurimyThrown) {
+ initBorks();
} else {
for (int16 i = 0; i < 5; i++)
- _G(det)->hideStaticSpr(BORK_SPR[i]);
+ _G(det)->hideStaticSpr(BORK_AWAKE_SPR[i]);
- for (int16 i = 0; i < (4 - (_G(gameState).R18Krone ? 1 : 0)); i++)
- _G(det)->showStaticSpr(BORK_SPR1[i]);
+ for (int16 i = 0; i < (4 - (_G(gameState).R18Crown ? 1 : 0)); i++)
+ _G(det)->showStaticSpr(BORK_FAINTED_SPR[i]);
}
- if (_G(gameState).R16F5Exit)
+ if (_G(gameState).R16F5Exit) {
+ // Hide cyber crown
_G(det)->hideStaticSpr(19);
-
- if (_G(gameState).R17EnergieOut) {
+ }
+
+ if (_G(gameState).R17EnergyOut) {
_G(det)->stopDetail(0);
_G(atds)->set_ats_str(150, TXT_MARK_LOOK, 1, ATS_DATA);
} else {
_G(atds)->set_ats_str(150, TXT_MARK_LOOK, 0, ATS_DATA);
}
- if (!_G(gameState).R18FirstEntry && !_G(gameState).R18Gitter) {
+ if (!_G(gameState).R18FirstEntry && !_G(gameState).R18Grid) {
startAadWait(39);
_G(gameState).R18FirstEntry = true;
}
- if (_G(gameState).R18Gitter)
+ if (_G(gameState).R18Grid)
_G(gameState).scrolly = 0;
}
bool Room18::timer(int16 t_nr, int16 ani_nr) {
- if (!_G(gameState).R18SurimyWurf && !_G(flags).AutoAniPlay) {
+ if (!_G(gameState).R18SurimyThrown && !_G(flags).AutoAniPlay) {
_G(flags).AutoAniPlay = true;
if (t_nr == _G(timer_nr)[0]) {
@@ -163,19 +165,19 @@ bool Room18::timer(int16 t_nr, int16 ani_nr) {
}
void Room18::gedAction(int index) {
- if (!index && !_G(gameState).R18SurimyWurf) {
+ if (!index && !_G(gameState).R18SurimyThrown) {
stopPerson(P_CHEWY);
autoMove(1, P_CHEWY);
start_aad(40, 0);
}
}
-void Room18::init_borks() {
+void Room18::initBorks() {
for (int16 i = 0; i < 5; i++)
- _G(det)->showStaticSpr(BORK_SPR[i]);
+ _G(det)->showStaticSpr(BORK_AWAKE_SPR[i]);
for (int16 i = 0; i < 4; i++)
- _G(det)->hideStaticSpr(BORK_SPR1[i]);
+ _G(det)->hideStaticSpr(BORK_FAINTED_SPR[i]);
_G(timer_nr)[0] = _G(room)->set_timer(255, 10);
_G(timer_nr)[1] = _G(room)->set_timer(255, 15);
@@ -185,12 +187,12 @@ void Room18::init_borks() {
}
void Room18::monitor() {
- _G(gameState).R18MoniSwitch ^= 1;
+ _G(gameState).R18MonitorSwitch ^= 1;
int16 nr = 0;
- if (_G(gameState).R18MoniSwitch) {
+ if (_G(gameState).R18MonitorSwitch) {
startAniBlock(2, ABLOCK21);
- nr = (_G(gameState).R17EnergieOut) ? 2 : 1;
+ nr = (_G(gameState).R17EnergyOut) ? 2 : 1;
} else {
_G(det)->stopDetail(23);
_G(atds)->set_ats_str(41, TXT_MARK_LOOK, 1, ATS_DATA);
@@ -200,11 +202,7 @@ void Room18::monitor() {
}
int16 Room18::sonden_moni() {
- int16 action_flag = false;
-
- if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
- action_flag = true;
-
+ if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(8, P_CHEWY);
startSetAILWait(3, 1, ANI_FRONT);
@@ -220,19 +218,18 @@ int16 Room18::sonden_moni() {
_G(det)->hideStaticSpr(i + 10);
showCur();
+
+ return true;
+ } else {
+ return false;
}
- return action_flag;
}
-int16 Room18::calc_surimy() {
- int16 action_flag = false;
-
+int16 Room18::calcSurimy() {
if (isCurInventory(SURIMY_INV)) {
- action_flag = true;
-
hideCur();
delInventory(_G(cur)->getInventoryCursor());
- _G(gameState).R18SurimyWurf = true;
+ _G(gameState).R18SurimyThrown = true;
_G(det)->load_taf_seq(245, 50, nullptr);
_G(det)->load_taf_seq(116, 55, nullptr);
_G(auto_obj) = 1;
@@ -247,7 +244,7 @@ int16 Room18::calc_surimy() {
if (_G(moveState)[P_CHEWY].Xypos[1] < 150) {
startDetailFrame(18, 1, ANI_FRONT, 8);
- init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT3);
+ init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT3);
waitDetail(18);
} else {
autoMove(1, P_CHEWY);
@@ -256,7 +253,7 @@ int16 Room18::calc_surimy() {
startDetailFrame(17, 1, ANI_FRONT, 12);
_G(mouseLeftClick) = false;
- init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT);
+ init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT);
waitDetail(17);
}
@@ -285,7 +282,7 @@ int16 Room18::calc_surimy() {
_G(flags).NoScroll = true;
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
- init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT1);
+ init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT1);
auto_scroll(70, 0);
wait_auto_obj(SURIMY_OBJ);
@@ -303,7 +300,7 @@ int16 Room18::calc_surimy() {
_G(det)->hideStaticSpr(26);
_G(mov_phasen)[SURIMY_OBJ].Repeat = 1;
- init_auto_obj(SURIMY_OBJ, &SURIMY_PHASEN[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT2);
+ init_auto_obj(SURIMY_OBJ, &SURIMY_PHASES[0][0], _G(mov_phasen)[SURIMY_OBJ].Lines, (const MovLine *)SURIMY_MPKT2);
auto_scroll(0, 0);
wait_auto_obj(SURIMY_OBJ);
_G(gameState).ScrollxStep = 6;
@@ -321,32 +318,27 @@ int16 Room18::calc_surimy() {
_G(atds)->delControlBit(179, ATS_ACTIVE_BIT);
showCur();
_G(det)->del_taf_tbl(245, 50, nullptr);
- }
- return action_flag;
+ return true;
+ } else {
+ return false;
+ }
}
-int16 Room18::calc_schalter() {
- int16 action_flag = false;
-
- if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
- action_flag = true;
-
+int16 Room18::calcMonitorControls() {
+ if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(6, P_CHEWY);
monitor();
showCur();
+ return true;
+ } else {
+ return false;
}
-
- return action_flag;
}
short Room18::use_cart_moni() {
- int16 action_flag = false;
-
if (!_G(cur)->usingInventoryCursor()) {
- action_flag = true;
-
hideCur();
autoMove(9, P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
@@ -370,26 +362,24 @@ short Room18::use_cart_moni() {
}
showCur();
+ return true;
+ } else {
+ return false;
}
-
- return action_flag;
}
int16 Room18::go_cyberspace() {
- int16 action_flag = false;
-
- if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Gitter) {
- action_flag = true;
-
+ if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R18Grid) {
hideCur();
autoMove(7, P_CHEWY);
cur_2_inventory();
showCur();
switchRoom(24);
+ return true;
+ } else {
+ return false;
}
-
- return action_flag;
}
} // namespace Rooms
diff --git a/engines/chewy/rooms/room18.h b/engines/chewy/rooms/room18.h
index 27287cd766d..de37f34d197 100644
--- a/engines/chewy/rooms/room18.h
+++ b/engines/chewy/rooms/room18.h
@@ -27,7 +27,7 @@ namespace Rooms {
class Room18 {
private:
- static void init_borks();
+ static void initBorks();
static void monitor();
public:
@@ -35,8 +35,8 @@ public:
static bool timer(int16 t_nr, int16 ani_nr);
static void gedAction(int index);
- static int16 calc_surimy();
- static int16 calc_schalter();
+ static int16 calcSurimy();
+ static int16 calcMonitorControls();
static short use_cart_moni();
static int16 go_cyberspace();
static int16 sonden_moni();
diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp
index 95154bb28d2..97a1c0d8236 100644
--- a/engines/chewy/rooms/room21.cpp
+++ b/engines/chewy/rooms/room21.cpp
@@ -243,7 +243,7 @@ int16 Room21::use_fenster() {
if (!_G(cur)->usingInventoryCursor() && !_G(flags).AutoAniPlay && _G(gameState).R21Laser1Weg) {
action_flag = true;
_G(flags).AutoAniPlay = true;
- _G(gameState).R18Gitter = true;
+ _G(gameState).R18Grid = true;
autoMove(13, P_CHEWY);
setPersonPos(541, 66, P_CHEWY, P_LEFT);
switchRoom(18);
diff --git a/engines/chewy/rooms/room23.cpp b/engines/chewy/rooms/room23.cpp
index 886798a6132..38c06f85fb6 100644
--- a/engines/chewy/rooms/room23.cpp
+++ b/engines/chewy/rooms/room23.cpp
@@ -48,7 +48,7 @@ void Room23::cockpit() {
_G(mouseLeftClick) = false;
switchRoom(23);
- if (!_G(gameState).R23Cartridge || !_G(gameState).R25GleiteLoesch)
+ if (!_G(gameState).R23Cartridge || !_G(gameState).R25GliderFlamesExtinguished)
_G(det)->hideStaticSpr(3);
else
_G(det)->showStaticSpr(3);
@@ -64,14 +64,14 @@ int16 Room23::start_gleiter() {
else {
bool start_ok = true;
- if (_G(gameState).R23GleiterExit == 16) {
+ if (_G(gameState).R23GliderExit == 16) {
if (!_G(gameState).R16F5Exit) {
start_ok = false;
startAadWait(35);
} else if (!_G(gameState).R23Cartridge || !_G(gameState).R18CartSave) {
start_ok = false;
startAadWait(41);
- } else if (!_G(gameState).R17EnergieOut) {
+ } else if (!_G(gameState).R17EnergyOut) {
start_ok = false;
startAadWait(300);
}
@@ -85,17 +85,17 @@ int16 Room23::start_gleiter() {
for (int16 i = 0; i < 4; i++)
_G(det)->stopDetail(i);
- if (_G(gameState).R23GleiterExit == 14) {
+ if (_G(gameState).R23GliderExit == 14) {
_G(out)->setPointer(nullptr);
_G(out)->cls();
_G(flags).NoPalAfterFlc = true;
flic_cut(FCUT_011);
register_cutscene(7);
_G(out)->cls();
- _G(gameState).R23GleiterExit = 16;
+ _G(gameState).R23GliderExit = 16;
setPersonPos(126, 110, P_CHEWY, P_RIGHT);
- switchRoom(_G(gameState).R23GleiterExit);
+ switchRoom(_G(gameState).R23GliderExit);
start_spz_wait(CH_WONDER1, 2, false, P_CHEWY);
start_spz(CH_TALK2, 255, ANI_FRONT, P_CHEWY);
@@ -104,11 +104,11 @@ int16 Room23::start_gleiter() {
stopPerson(P_CHEWY);
_G(mouseLeftClick) = false;
- } else if (_G(gameState).R23GleiterExit == 16) {
+ } else if (_G(gameState).R23GliderExit == 16) {
_G(out)->setPointer(nullptr);
_G(out)->cls();
flic_cut(FCUT_SPACECHASE_18);
- _G(gameState).R23GleiterExit = 25;
+ _G(gameState).R23GliderExit = 25;
register_cutscene(9);
cur_2_inventory();
@@ -117,7 +117,7 @@ int16 Room23::start_gleiter() {
remove_inventory(4);
remove_inventory(15);
remove_inventory(16);
- switchRoom(_G(gameState).R23GleiterExit);
+ switchRoom(_G(gameState).R23GliderExit);
}
showCur();
diff --git a/engines/chewy/rooms/room24.cpp b/engines/chewy/rooms/room24.cpp
index 3115bb8364f..ae7e3d212d5 100644
--- a/engines/chewy/rooms/room24.cpp
+++ b/engines/chewy/rooms/room24.cpp
@@ -61,7 +61,7 @@ void Room24::entry() {
calc_animation(255);
for (int16 i = 0; i < 3; i++) {
- if (KRISTALL_SPR[i][_G(gameState).R24Hebel[i]] == 20)
+ if (KRISTALL_SPR[i][_G(gameState).R24Lever[i]] == 20)
_G(det)->startDetail(5 + i * 4, 255, ANI_BACK);
}
}
@@ -77,33 +77,32 @@ void Room24::xit() {
}
void Room24::use_hebel(int16 txt_nr) {
- if (!_G(gameState).R24Hebel[txt_nr - 161] ||
- _G(gameState).R24Hebel[txt_nr - 161] == 2) {
- _G(gameState).R24Hebel[txt_nr - 161] = 1;
+ if (!_G(gameState).R24Lever[txt_nr - 161] ||
+ _G(gameState).R24Lever[txt_nr - 161] == 2) {
+ _G(gameState).R24Lever[txt_nr - 161] = 1;
_G(gameState).R24HebelDir[txt_nr - 161] ^= 1;
} else {
if (_G(gameState).R24HebelDir[txt_nr - 161])
- _G(gameState).R24Hebel[txt_nr - 161] = 0;
+ _G(gameState).R24Lever[txt_nr - 161] = 0;
else
- _G(gameState).R24Hebel[txt_nr - 161] = 2;
+ _G(gameState).R24Lever[txt_nr - 161] = 2;
}
calc_hebel_spr();
calc_animation(txt_nr - 161);
- if (_G(gameState).R24Hebel[0] == 1 && _G(gameState).R24Hebel[1] == 0 && _G(gameState).R24Hebel[2] == 2) {
+ if (_G(gameState).R24Lever[0] == 1 && _G(gameState).R24Lever[1] == 0 && _G(gameState).R24Lever[2] == 2) {
_G(gameState).R16F5Exit = true;
_G(det)->playSound(1, 0);
_G(det)->stopSound(1);
_G(det)->startDetail(1, 1, ANI_FRONT);
_G(det)->showStaticSpr(10);
_G(atds)->set_ats_str(164, TXT_MARK_NAME, 1, ATS_DATA);
-
} else if (_G(gameState).R16F5Exit) {
+ _G(gameState).R16F5Exit = false;
_G(det)->hideStaticSpr(10);
_G(det)->playSound(1, 1);
_G(det)->stopSound(0);
_G(det)->startDetail(1, 1, ANI_BACK);
- _G(gameState).R16F5Exit = false;
_G(atds)->set_ats_str(164, TXT_MARK_NAME, 0, ATS_DATA);
}
}
@@ -111,11 +110,11 @@ void Room24::use_hebel(int16 txt_nr) {
void Room24::calc_hebel_spr() {
if (!_G(gameState).R24FirstEntry) {
_G(gameState).R24FirstEntry = true;
- _G(gameState).R24Hebel[0] = 2;
+ _G(gameState).R24Lever[0] = 2;
_G(gameState).R24HebelDir[0] = 0;
- _G(gameState).R24Hebel[1] = 1;
+ _G(gameState).R24Lever[1] = 1;
_G(gameState).R24HebelDir[1] = 0;
- _G(gameState).R24Hebel[2] = 0;
+ _G(gameState).R24Lever[2] = 0;
_G(gameState).R24HebelDir[2] = 1;
}
@@ -123,8 +122,8 @@ void Room24::calc_hebel_spr() {
for (int16 j = 0; j < 3; j++)
_G(det)->hideStaticSpr(1 + j + i * 3);
- _G(det)->showStaticSpr(1 + _G(gameState).R24Hebel[i] + i * 3);
- _G(atds)->set_ats_str(166 + i, TXT_MARK_NAME, _G(gameState).R24Hebel[i], ATS_DATA);
+ _G(det)->showStaticSpr(1 + _G(gameState).R24Lever[i] + i * 3);
+ _G(atds)->set_ats_str(166 + i, TXT_MARK_NAME, _G(gameState).R24Lever[i], ATS_DATA);
}
}
@@ -132,7 +131,7 @@ void Room24::calc_animation(int16 kristall_nr) {
if (kristall_nr != 255) {
hideCur();
- if (KRISTALL_SPR[kristall_nr][_G(gameState).R24Hebel[kristall_nr]] == 20) {
+ if (KRISTALL_SPR[kristall_nr][_G(gameState).R24Lever[kristall_nr]] == 20) {
int16 ani_nr = _G(gameState).R24KristallLast[kristall_nr] == 13 ? 7 : 8;
_G(det)->playSound(ani_nr + kristall_nr * 4, 0);
_G(det)->stopSound(0);
@@ -142,7 +141,7 @@ void Room24::calc_animation(int16 kristall_nr) {
_G(det)->startDetail(5 + kristall_nr * 4, 255, ANI_BACK);
} else if (_G(gameState).R24KristallLast[kristall_nr] == 20) {
- int16 ani_nr = KRISTALL_SPR[kristall_nr][_G(gameState).R24Hebel[kristall_nr]] == 13 ? 7 : 8;
+ int16 ani_nr = KRISTALL_SPR[kristall_nr][_G(gameState).R24Lever[kristall_nr]] == 13 ? 7 : 8;
_G(det)->stopSound(0);
_G(det)->playSound(5 + ani_nr + kristall_nr * 4, 0);
_G(det)->stopDetail(5 + kristall_nr * 4);
@@ -157,8 +156,8 @@ void Room24::calc_animation(int16 kristall_nr) {
_G(det)->hideStaticSpr(13 + i);
for (int16 i = 0; i < 3; i++) {
- _G(det)->showStaticSpr(KRISTALL_SPR[i][_G(gameState).R24Hebel[i]] + i * 2);
- _G(gameState).R24KristallLast[i] = KRISTALL_SPR[i][_G(gameState).R24Hebel[i]];
+ _G(det)->showStaticSpr(KRISTALL_SPR[i][_G(gameState).R24Lever[i]] + i * 2);
+ _G(gameState).R24KristallLast[i] = KRISTALL_SPR[i][_G(gameState).R24Lever[i]];
}
}
diff --git a/engines/chewy/rooms/room25.cpp b/engines/chewy/rooms/room25.cpp
index 5cdc41cce27..878ff603e4a 100644
--- a/engines/chewy/rooms/room25.cpp
+++ b/engines/chewy/rooms/room25.cpp
@@ -46,14 +46,14 @@ static const MovLine SURIMY_MPKT[2] = {
void Room25::entry() {
- if (!_G(gameState).R25GleiteLoesch) {
+ if (!_G(gameState).R25GliderFlamesExtinguished) {
_G(det)->playSound(0, 0);
for (int i = 0; i < 9; ++i)
_G(det)->startDetail(i, 255, ANI_FRONT);
}
- if (!_G(gameState).R29Schlauch2) {
+ if (!_G(gameState).R29WaterHose) {
_G(det)->hideStaticSpr(0);
_G(det)->hideStaticSpr(1);
}
@@ -82,27 +82,26 @@ void Room25::entry() {
start_spz(CH_TALK11, 255, ANI_FRONT, P_CHEWY);
startAadWait(64);
showCur();
-
- } else if (_G(gameState).R25GleiterExit && !_G(flags).LoadGame) {
+ } else if (_G(gameState).R25GliderExit && !_G(flags).LoadGame) {
setPersonPos(127, 122, P_CHEWY, P_LEFT);
if (!_G(gameState).R25SurimyGo) {
_G(gameState).R25SurimyGo = 1;
- xit_gleiter();
+ xit_glider();
}
}
- _G(gameState).R25GleiterExit = false;
+ _G(gameState).R25GliderExit = false;
}
-int16 Room25::gleiter_loesch() {
+int16 Room25::extinguishGliderFlames() {
int16 action_flag = false;
hideCur();
- if (!_G(gameState).R25GleiteLoesch && _G(gameState).R29Schlauch2) {
+ if (!_G(gameState).R25GliderFlamesExtinguished && _G(gameState).R29WaterHose) {
if (!_G(cur)->usingInventoryCursor()) {
action_flag = true;
- _G(gameState).R25GleiteLoesch = true;
+ _G(gameState).R25GliderFlamesExtinguished = true;
autoMove(2, P_CHEWY);
flic_cut(FCUT_030);
_G(obj)->calc_rsi_flip_flop(SIB_SCHLAUCH_R25);
@@ -114,15 +113,15 @@ int16 Room25::gleiter_loesch() {
_G(det)->stopDetail(i);
}
- } else if (_G(gameState).R25GleiteLoesch) {
- if (isCurInventory(MILCH_LEER_INV)) {
+ } else if (_G(gameState).R25GliderFlamesExtinguished) {
+ if (isCurInventory(EMPTY_MILK_BOTTLE_INV)) {
action_flag = true;
autoMove(2, P_CHEWY);
start_spz_wait((_G(gameState).ChewyAni == CHEWY_ROCKER) ? 28 : 14, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
- _G(obj)->addInventory(MILCH_WAS_INV, &_G(room_blk));
- inventory_2_cur(MILCH_WAS_INV);
+ _G(obj)->addInventory(WATER_FILLED_BOTTLE_INV, &_G(room_blk));
+ inventory_2_cur(WATER_FILLED_BOTTLE_INV);
startAadWait(253);
}
}
@@ -131,22 +130,22 @@ int16 Room25::gleiter_loesch() {
return action_flag;
}
-int16 Room25::use_gleiter() {
+int16 Room25::useGlider() {
int16 action_flag = false;
- if (!_G(cur)->usingInventoryCursor() && _G(gameState).R25GleiteLoesch) {
+ if (!_G(cur)->usingInventoryCursor() && _G(gameState).R25GliderFlamesExtinguished) {
action_flag = true;
hideCur();
autoMove(3, P_CHEWY);
showCur();
- _G(gameState).R23GleiterExit = 25;
+ _G(gameState).R23GliderExit = 25;
Room23::cockpit();
}
return action_flag;
}
-void Room25::xit_gleiter() {
+void Room25::xit_glider() {
if (!_G(gameState).R25SurimyLauf) {
hideCur();
_G(gameState).R25SurimyLauf = true;
diff --git a/engines/chewy/rooms/room25.h b/engines/chewy/rooms/room25.h
index 0b7c6a9b8b7..0229571b148 100644
--- a/engines/chewy/rooms/room25.h
+++ b/engines/chewy/rooms/room25.h
@@ -27,12 +27,12 @@ namespace Rooms {
class Room25 {
private:
- static void xit_gleiter();
+ static void xit_glider();
public:
static void entry();
- static int16 gleiter_loesch();
- static int16 use_gleiter();
+ static int16 extinguishGliderFlames();
+ static int16 useGlider();
};
} // namespace Rooms
diff --git a/engines/chewy/rooms/room26.cpp b/engines/chewy/rooms/room26.cpp
index a4eb47ea382..76a35cb766b 100644
--- a/engines/chewy/rooms/room26.cpp
+++ b/engines/chewy/rooms/room26.cpp
@@ -29,7 +29,7 @@ namespace Chewy {
namespace Rooms {
void Room26::entry() {
- if (_G(gameState).R25GleiteLoesch)
+ if (_G(gameState).R25GliderFlamesExtinguished)
_G(det)->stopSound(0);
else
_G(det)->playSound(0, 0);
diff --git a/engines/chewy/rooms/room29.cpp b/engines/chewy/rooms/room29.cpp
index d4e90bd2d68..643eb40f688 100644
--- a/engines/chewy/rooms/room29.cpp
+++ b/engines/chewy/rooms/room29.cpp
@@ -46,7 +46,7 @@ static const AniBlock ABLOCK27[5] = {
void Room29::entry() {
if (_G(gameState).R29Schlauch1) {
_G(det)->showStaticSpr(7);
- } else if (_G(gameState).R29Schlauch2) {
+ } else if (_G(gameState).R29WaterHose) {
_G(det)->showStaticSpr(8);
_G(det)->showStaticSpr(10);
}
@@ -92,7 +92,7 @@ int16 Room29::use_pumpe() {
return action_flag;
}
-int16 Room29::get_schlauch() {
+int16 Room29::getWaterHose() {
int16 action_flag = false;
if (_G(gameState).R29Schlauch1 && !_G(cur)->usingInventoryCursor()) {
action_flag = true;
@@ -107,7 +107,7 @@ int16 Room29::get_schlauch() {
return action_flag;
}
-bool Room29::use_schlauch() {
+bool Room29::useWaterHose() {
bool result = false;
if (isCurInventory(PUMPE_INV)) {
@@ -125,7 +125,7 @@ bool Room29::use_schlauch() {
_G(atds)->set_ats_str(218, 1, ATS_DATA);
_G(gameState).R29Schlauch1 = false;
- _G(gameState).R29Schlauch2 = true;
+ _G(gameState).R29WaterHose = true;
delInventory(PUMPE_INV);
setPersonPos(308, 105, P_CHEWY, P_RIGHT);
_G(gameState)._personHide[P_CHEWY] = false;
diff --git a/engines/chewy/rooms/room29.h b/engines/chewy/rooms/room29.h
index aeb941b7c82..643fd5ff65e 100644
--- a/engines/chewy/rooms/room29.h
+++ b/engines/chewy/rooms/room29.h
@@ -30,8 +30,8 @@ public:
static void entry();
static void xit();
static int16 use_pumpe();
- static int16 get_schlauch();
- static bool use_schlauch();
+ static int16 getWaterHose();
+ static bool useWaterHose();
static void schlitz_sitz();
static int16 zaun_sprung();
};
diff --git a/engines/chewy/rooms/room31.cpp b/engines/chewy/rooms/room31.cpp
index 3f158681cb2..e77cf089378 100644
--- a/engines/chewy/rooms/room31.cpp
+++ b/engines/chewy/rooms/room31.cpp
@@ -156,7 +156,7 @@ int16 Room31::use_topf() {
dia_nr = 150;
_G(atds)->set_ats_str(242, 2, ATS_DATA);
- } else if (isCurInventory(MILCH_WAS_INV)) {
+ } else if (isCurInventory(WATER_FILLED_BOTTLE_INV)) {
if (_G(gameState).R31KoernerDa) {
_G(gameState).R31Wasser = true;
autoMove(1, P_CHEWY);
@@ -164,8 +164,8 @@ int16 Room31::use_topf() {
startAniBlock(3, ABLOCK30);
_G(gameState)._personHide[P_CHEWY] = false;
delInventory(_G(cur)->getInventoryCursor());
- _G(obj)->addInventory(MILCH_LEER_INV, &_G(room_blk));
- inventory_2_cur(MILCH_LEER_INV);
+ _G(obj)->addInventory(EMPTY_MILK_BOTTLE_INV, &_G(room_blk));
+ inventory_2_cur(EMPTY_MILK_BOTTLE_INV);
ani_nr = CH_TALK6;
dia_nr = 151;
_G(atds)->set_ats_str(242, 3, ATS_DATA);
diff --git a/engines/chewy/rooms/room33.cpp b/engines/chewy/rooms/room33.cpp
index dc887039c9c..6a673201aab 100644
--- a/engines/chewy/rooms/room33.cpp
+++ b/engines/chewy/rooms/room33.cpp
@@ -112,7 +112,7 @@ void Room33::use_maschine() {
switch (_G(cur)->getInventoryCursor()) {
case MILCH_INV:
_G(gameState).R33Munter[3] = true;
- invent_2_slot(MILCH_LEER_INV);
+ invent_2_slot(EMPTY_MILK_BOTTLE_INV);
break;
case K_FLEISCH_INV:
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index 61462565d29..2615b964feb 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -215,7 +215,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 114:
- switchRoom(_G(gameState).R23GleiterExit);
+ switchRoom(_G(gameState).R23GliderExit);
break;
case 117:
@@ -260,7 +260,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
case 149:
case 153:
- retValue = Room18::calc_surimy();
+ retValue = Room18::calcSurimy();
break;
case 154:
@@ -272,7 +272,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 159:
- retValue = Room18::calc_schalter();
+ retValue = Room18::calcMonitorControls();
break;
case 161:
@@ -303,7 +303,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 187:
- retValue = Room25::use_gleiter();
+ retValue = Room25::useGlider();
break;
case 203:
@@ -323,7 +323,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 215:
- retValue = Room29::use_schlauch();
+ retValue = Room29::useWaterHose();
break;
case 216:
@@ -331,11 +331,11 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 218:
- retValue = Room29::get_schlauch();
+ retValue = Room29::getWaterHose();
break;
case 219:
- retValue = Room25::gleiter_loesch();
+ retValue = Room25::extinguishGliderFlames();
break;
case 220:
@@ -785,7 +785,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 114:
- switchRoom(_G(gameState).R23GleiterExit);
+ switchRoom(_G(gameState).R23GliderExit);
break;
case 227:
diff --git a/engines/chewy/types.cpp b/engines/chewy/types.cpp
index 661e01c7e6f..4c69f81f76e 100644
--- a/engines/chewy/types.cpp
+++ b/engines/chewy/types.cpp
@@ -117,8 +117,8 @@ bool GameState::synchronize(Common::Serializer &s) {
s.syncAsByte(R12BorkCount);
s.syncAsByte(R13MonitorStatus);
s.syncAsByte(R17Location);
- s.syncAsSint16LE(R23GleiterExit);
- syncArray(s, R24Hebel, 3);
+ s.syncAsSint16LE(R23GliderExit);
+ syncArray(s, R24Lever, 3);
syncArray(s, R24HebelDir, 3);
syncArray(s, R24KristallLast, 3);
s.syncAsByte(R25SurimyGo);
diff --git a/engines/chewy/types.h b/engines/chewy/types.h
index 8821700d23a..02a10f9ae9a 100644
--- a/engines/chewy/types.h
+++ b/engines/chewy/types.h
@@ -96,19 +96,19 @@ struct GameFlags {
bool R17Seil : 1;
bool R17HebelOk : 1;
- bool R17EnergieOut : 1;
+ bool R17EnergyOut : 1;
bool R17DoorKommand : 1;
bool R18DoorBruecke : 1;
bool R18CartridgeInSlot : 1;
bool R18CartTerminal : 1;
bool R18CartSave : 1;
- bool R18SurimyWurf : 1;
+ bool R18SurimyThrown : 1;
bool R18SondeMoni : 1;
- bool R18MoniSwitch : 1;
- bool R18Krone : 1;
+ bool R18MonitorSwitch : 1;
+ bool R18Crown : 1;
bool R18FirstEntry : 1;
- bool R18Gitter : 1;
+ bool R18Grid : 1;
bool R21Salto : 1;
bool R21GitterEnergie : 1;
@@ -128,10 +128,10 @@ struct GameFlags {
bool R23Cartridge : 1;
bool R24FirstEntry : 1;
bool R25FirstEntry : 1;
- bool R25GleiteLoesch : 1;
+ bool R25GliderFlamesExtinguished : 1;
bool R25SurimyLauf : 1;
- bool R25GleiterExit : 1;
+ bool R25GliderExit : 1;
bool R27SurimyOk : 1;
bool R28SurimyCar : 1;
bool R28ChewyPump : 1;
@@ -144,7 +144,7 @@ struct GameFlags {
bool R28PostCar : 1;
bool R29Pumpe : 1;
bool R29Schlauch1 : 1;
- bool R29Schlauch2 : 1;
+ bool R29WaterHose : 1;
bool R29AutoSitz : 1;
bool R31PflanzeWeg : 1;
@@ -435,9 +435,9 @@ struct GameState : public GameFlags {
uint8 R17Location = 0;
- int16 R23GleiterExit = 0;
+ int16 R23GliderExit = 0;
- uint8 R24Hebel[3] = { 0 };
+ uint8 R24Lever[3] = { 0 };
uint8 R24HebelDir[3] = { 0 };
uint8 R24KristallLast[3] = { 0 };
uint8 R25SurimyGo = 0;
Commit: 8908733fc4742821bd4f831b586b47feaf72e87f
https://github.com/scummvm/scummvm/commit/8908733fc4742821bd4f831b586b47feaf72e87f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:20+03:00
Commit Message:
CHEWY: Fix invalid older save data in rooms 18 and 25 - bug #13671
This fixes invalid states in the throne room (room 18) and cellar
(room 25)
Changed paths:
engines/chewy/rooms/room18.cpp
engines/chewy/rooms/room25.cpp
diff --git a/engines/chewy/rooms/room18.cpp b/engines/chewy/rooms/room18.cpp
index 1e7c78b7eb1..c85cc5d94a3 100644
--- a/engines/chewy/rooms/room18.cpp
+++ b/engines/chewy/rooms/room18.cpp
@@ -108,6 +108,15 @@ void Room18::entry() {
if (_G(gameState).R16F5Exit) {
// Hide cyber crown
_G(det)->hideStaticSpr(19);
+ _G(atds)->setControlBit(158, ATS_ACTIVE_BIT);
+ } else {
+ // Show cyber crown
+ _G(det)->showStaticSpr(19);
+ _G(atds)->set_ats_str(153, 1, ATS_DATA);
+ _G(atds)->set_ats_str(149, TXT_MARK_LOOK, 1, ATS_DATA);
+
+ for (int16 i = 0; i < 3; i++)
+ _G(atds)->delControlBit(158 + i, ATS_ACTIVE_BIT);
}
if (_G(gameState).R17EnergyOut) {
diff --git a/engines/chewy/rooms/room25.cpp b/engines/chewy/rooms/room25.cpp
index 878ff603e4a..d0f1e680708 100644
--- a/engines/chewy/rooms/room25.cpp
+++ b/engines/chewy/rooms/room25.cpp
@@ -56,6 +56,11 @@ void Room25::entry() {
if (!_G(gameState).R29WaterHose) {
_G(det)->hideStaticSpr(0);
_G(det)->hideStaticSpr(1);
+ _G(atds)->setControlBit(219, ATS_ACTIVE_BIT);
+ } else {
+ _G(det)->showStaticSpr(0);
+ _G(det)->showStaticSpr(1);
+ _G(atds)->delControlBit(219, ATS_ACTIVE_BIT);
}
if (!_G(gameState).R25FirstEntry) {
Commit: 8d96ad04d7dd3a4c692f4c2f4bfd420cb449f564
https://github.com/scummvm/scummvm/commit/8d96ad04d7dd3a4c692f4c2f4bfd420cb449f564
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:20+03:00
Commit Message:
CHEWY: Renaming
Changed paths:
engines/chewy/barriers.cpp
engines/chewy/defines.h
engines/chewy/rooms/room33.cpp
engines/chewy/rooms/room37.cpp
engines/chewy/rooms/room37.h
engines/chewy/t_event.cpp
engines/chewy/types.h
engines/chewy/video/video_player.cpp
diff --git a/engines/chewy/barriers.cpp b/engines/chewy/barriers.cpp
index b0de07ac758..064eaba8b26 100644
--- a/engines/chewy/barriers.cpp
+++ b/engines/chewy/barriers.cpp
@@ -127,7 +127,7 @@ int16 Barriers::getBarrierId(int16 g_idx, const byte *buffer) {
return 3;
case 37:
- if (!_G(gameState).R37Kloppe)
+ if (!_G(gameState).R37RoosterFoughtWithDog)
return 0;
break;
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 8620988c84d..7d6e11ab31b 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -324,14 +324,14 @@ enum SetupScreenMode {
#define KNIFE_INV 34
#define PUMPE_INV 35
#define CENT_INV 36
-#define ANGEL2_INV 37
-#define GEBISS_INV 38
+#define FISHING_ROD_INV 37
+#define DENTURES_INV 38
#define H_FUTTER_INV 39
#define PUMPKIN_INV 40
#define K_MASKE_INV 41
#define K_FLEISCH_INV 42
#define K_KERNE_INV 43
-#define EIER_INV 44
+#define EGGS_INV 44
#define KAFFEE_INV 45
#define PUTENKEULE_INV 46
#define BONE_INV 47
diff --git a/engines/chewy/rooms/room33.cpp b/engines/chewy/rooms/room33.cpp
index 6a673201aab..49a52cb9469 100644
--- a/engines/chewy/rooms/room33.cpp
+++ b/engines/chewy/rooms/room33.cpp
@@ -119,7 +119,7 @@ void Room33::use_maschine() {
_G(gameState).R33Munter[1] = true;
break;
- case EIER_INV:
+ case EGGS_INV:
_G(gameState).R33Munter[2] = true;
break;
diff --git a/engines/chewy/rooms/room37.cpp b/engines/chewy/rooms/room37.cpp
index 80e33607c24..76a26b2113e 100644
--- a/engines/chewy/rooms/room37.cpp
+++ b/engines/chewy/rooms/room37.cpp
@@ -51,23 +51,23 @@ void Room37::entry() {
setPersonPos(219, 66, P_CHEWY, P_RIGHT);
}
- if (!_G(gameState).R37Kloppe) {
+ if (!_G(gameState).R37RoosterFoughtWithDog) {
_G(timer_nr)[1] = _G(room)->set_timer(7, 5);
_G(det)->set_static_ani(7, -1);
- if (!_G(gameState).R37HundScham) {
+ if (!_G(gameState).R37DogAshamed) {
_G(timer_nr)[0] = _G(room)->set_timer(3, 4);
_G(det)->set_static_ani(3, -1);
_G(det)->playSound(3, 0);
}
}
- if (_G(gameState).R37Gebiss) {
+ if (_G(gameState).R37TakenDenturesFromGlass) {
_G(det)->hideStaticSpr(9);
- if (_G(gameState).R37Kloppe) {
+ if (_G(gameState).R37RoosterFoughtWithDog) {
_G(det)->hideStaticSpr(8);
- } else if (_G(gameState).R37HundScham) {
+ } else if (_G(gameState).R37DogAshamed) {
_G(det)->showStaticSpr(0);
}
}
@@ -78,7 +78,7 @@ void Room37::gedAction(int index) {
dog_bell();
} else if (index == 1) {
- if (_G(gameState).R37Kloppe && !_G(gameState).R37Mes) {
+ if (_G(gameState).R37RoosterFoughtWithDog && !_G(gameState).R37Mes) {
stopPerson(P_CHEWY);
_G(gameState).R37Mes = true;
start_spz(CH_TALK6, 255, ANI_FRONT, P_CHEWY);
@@ -88,7 +88,7 @@ void Room37::gedAction(int index) {
}
void Room37::setup_func() {
- if (_G(mouseLeftClick) && !_G(gameState).R37Kloppe &&
+ if (_G(mouseLeftClick) && !_G(gameState).R37RoosterFoughtWithDog &&
_G(menu_item) == CUR_WALK) {
if ((g_events->_mousePos.x + _G(gameState).scrollx > 380 && g_events->_mousePos.y > 120) ||
(g_events->_mousePos.x + _G(gameState).scrollx > 482)) {
@@ -100,12 +100,8 @@ void Room37::setup_func() {
}
}
-short Room37::use_wippe() {
- int16 action_flag = false;
-
+short Room37::useSeesaw() {
if (_G(cur)->usingInventoryCursor()) {
- action_flag = true;
-
if (isCurInventory(H_FUTTER_INV)) {
hideCur();
autoMove(0, P_CHEWY);
@@ -126,17 +122,16 @@ short Room37::use_wippe() {
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(160);
}
- }
- return action_flag;
+ return true;
+ } else {
+ return false;
+ }
}
-int16 Room37::use_glas() {
- int16 action_flag = false;
-
- if (!_G(gameState).R37Gebiss) {
- action_flag = true;
- if (isCurInventory(ANGEL2_INV)) {
+int16 Room37::useGlass() {
+ if (!_G(gameState).R37TakenDenturesFromGlass) {
+ if (isCurInventory(FISHING_ROD_INV)) {
_G(flags).NoScroll = true;
hideCur();
autoMove(5, P_CHEWY);
@@ -147,13 +142,13 @@ int16 Room37::use_glas() {
delInventory(_G(cur)->getInventoryCursor());
flic_cut(FCUT_048);
flic_cut(FCUT_049);
- invent_2_slot(GEBISS_INV);
+ invent_2_slot(DENTURES_INV);
_G(det)->hideStaticSpr(9);
_G(atds)->set_ats_str(250, 1, ATS_DATA);
_G(atds)->set_ats_str(256, 1, ATS_DATA);
_G(atds)->delControlBit(251, ATS_ACTIVE_BIT);
_G(obj)->show_sib(SIB_HFUTTER2_R37);
- _G(gameState).R37Gebiss = true;
+ _G(gameState).R37TakenDenturesFromGlass = true;
start_spz(CH_TALK3, 255, ANI_FRONT, P_CHEWY);
startAadWait(146);
showCur();
@@ -162,9 +157,11 @@ int16 Room37::use_glas() {
} else {
autoMove(4, P_CHEWY);
}
- }
- return action_flag;
+ return true;
+ } else {
+ return false;
+ }
}
void Room37::dog_bell() {
@@ -176,7 +173,7 @@ void Room37::dog_bell() {
_G(flags).AutoAniPlay = true;
_G(det)->stopSound(0); // nr 3, sslot 0
- if (!_G(gameState).R37Gebiss) {
+ if (!_G(gameState).R37TakenDenturesFromGlass) {
stopPerson(P_CHEWY);
_G(flags).ChAutoMov = false;
setPersonSpr(P_LEFT, P_CHEWY);
@@ -204,7 +201,7 @@ void Room37::dog_bell() {
dia_nr = 149;
ani_nr = CH_TALK12;
- } else if (!_G(gameState).R37HundScham) {
+ } else if (!_G(gameState).R37DogAshamed) {
stopPerson(P_CHEWY);
setPersonSpr(P_LEFT, P_CHEWY);
_G(flags).NoScroll = true;
@@ -219,7 +216,7 @@ void Room37::dog_bell() {
register_cutscene(10);
_G(det)->showStaticSpr(0);
- _G(gameState).R37HundScham = true;
+ _G(gameState).R37DogAshamed = true;
dia_nr = 148;
ani_nr = CH_TALK6;
}
@@ -236,36 +233,35 @@ void Room37::dog_bell() {
showCur();
}
-void Room37::talk_hahn() {
+void Room37::talkWithRooster() {
hideCur();
autoMove(7, P_CHEWY);
showCur();
- if (!_G(gameState).R37TransHahn) {
+ if (!_G(gameState).R37UsedTranslatorOnRooster) {
hideCur();
startAadWait(145);
showCur();
} else {
- hahn_dia();
+ roosterDialog();
}
}
-void Room37::use_hahn() {
+void Room37::useRooster() {
if (isCurInventory(TRANSLATOR_INV)) {
hideCur();
autoMove(7, P_CHEWY);
- _G(gameState).R37TransHahn = true;
+ _G(gameState).R37UsedTranslatorOnRooster = true;
start_spz_wait(CH_TRANS, 1, false, P_CHEWY);
flic_cut(FCUT_052);
cur_2_inventory();
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
showCur();
- hahn_dia();
-
- } else if (_G(gameState).R37TransHahn) {
- if (isCurInventory(GEBISS_INV)) {
- _G(gameState).R37Kloppe = true;
+ roosterDialog();
+ } else if (_G(gameState).R37UsedTranslatorOnRooster) {
+ if (isCurInventory(DENTURES_INV)) {
+ _G(gameState).R37RoosterFoughtWithDog = true;
hideCur();
autoMove(6, P_CHEWY);
g_engine->_sound->playRoomMusic(256);
@@ -274,7 +270,7 @@ void Room37::use_hahn() {
_G(det)->del_static_ani(7);
_G(det)->startDetail(9, 1, ANI_FRONT);
start_spz_wait(CH_LGET_O, 1, false, P_CHEWY);
- delInventory(GEBISS_INV);
+ delInventory(DENTURES_INV);
_G(flags).NoScroll = true;
auto_scroll(177, 0);
@@ -298,8 +294,8 @@ void Room37::use_hahn() {
_G(det)->hideStaticSpr(8);
start_spz(CH_TALK5, 255, ANI_FRONT, P_CHEWY);
startAadWait(141);
- _G(obj)->addInventory(EIER_INV, &_G(room_blk));
- inventory_2_cur(EIER_INV);
+ _G(obj)->addInventory(EGGS_INV, &_G(room_blk));
+ inventory_2_cur(EGGS_INV);
showCur();
}
} else if (_G(cur)->usingInventoryCursor()) {
@@ -307,7 +303,7 @@ void Room37::use_hahn() {
}
}
-void Room37::hahn_dia() {
+void Room37::roosterDialog() {
_G(gameState)._personHide[P_CHEWY] = true;
int16 tmp_scrollx = _G(gameState).scrollx;
int16 tmp_scrolly = _G(gameState).scrolly;
diff --git a/engines/chewy/rooms/room37.h b/engines/chewy/rooms/room37.h
index 74c3676fd53..de775f4b7bb 100644
--- a/engines/chewy/rooms/room37.h
+++ b/engines/chewy/rooms/room37.h
@@ -30,17 +30,17 @@ namespace Rooms {
class Room37 {
private:
static void setup_func();
- static void hahn_dia();
+ static void roosterDialog();
static void dog_bell();
public:
static void entry();
static void gedAction(int index);
- static short use_wippe();
- static int16 use_glas();
- static void talk_hahn();
- static void use_hahn();
+ static short useSeesaw();
+ static int16 useGlass();
+ static void talkWithRooster();
+ static void useRooster();
};
} // namespace Rooms
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index 2615b964feb..aea2122dd7e 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -383,15 +383,15 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 249:
- retValue = Room37::use_wippe();
+ retValue = Room37::useSeesaw();
break;
case 251:
- Room37::use_hahn();
+ Room37::useRooster();
break;
case 256:
- retValue = Room37::use_glas();
+ retValue = Room37::useGlass();
break;
case 263:
@@ -854,7 +854,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 mode) {
break;
case 251:
- Room37::talk_hahn();
+ Room37::talkWithRooster();
break;
case 265:
@@ -2194,8 +2194,8 @@ void useItemWithInvItem(int16 itemId) {
_G(menu_item) = CUR_USE;
cursorChoice(_G(menu_item));
ret = del_invent_slot(itemId);
- _G(gameState).InventSlot[ret] = ANGEL2_INV;
- _G(obj)->changeInventory(itemId, ANGEL2_INV, &_G(room_blk));
+ _G(gameState).InventSlot[ret] = FISHING_ROD_INV;
+ _G(obj)->changeInventory(itemId, FISHING_ROD_INV, &_G(room_blk));
break;
case PUMPKIN_INV:
diff --git a/engines/chewy/types.h b/engines/chewy/types.h
index 02a10f9ae9a..51d0691c321 100644
--- a/engines/chewy/types.h
+++ b/engines/chewy/types.h
@@ -166,10 +166,10 @@ struct GameFlags {
bool R35Schublade : 1;
bool R35CatEat : 1;
- bool R37TransHahn : 1;
- bool R37Gebiss : 1;
- bool R37HundScham : 1;
- bool R37Kloppe : 1;
+ bool R37UsedTranslatorOnRooster : 1;
+ bool R37TakenDenturesFromGlass : 1;
+ bool R37DogAshamed : 1;
+ bool R37RoosterFoughtWithDog : 1;
bool R37Mes : 1;
bool R39TranslatorUsed : 1;
bool R39TvOn : 1;
diff --git a/engines/chewy/video/video_player.cpp b/engines/chewy/video/video_player.cpp
index 00c7b0c6729..37365b41a70 100644
--- a/engines/chewy/video/video_player.cpp
+++ b/engines/chewy/video/video_player.cpp
@@ -186,8 +186,8 @@ bool VideoPlayer::handleCustom(uint num, uint frame, CfoDecoder *cfoDecoder) {
break;
case FCUT_047:
// Room37::cut_serv1
- if (!_G(gameState).R37Kloppe) {
- if (!_G(gameState).R37Gebiss) {
+ if (!_G(gameState).R37RoosterFoughtWithDog) {
+ if (!_G(gameState).R37TakenDenturesFromGlass) {
_G(det)->plot_static_details(scrollx, scrolly, 9, 9);
_G(det)->plot_static_details(scrollx, scrolly, 11, 11);
_G(det)->showStaticSpr(11);
Commit: 19616084eae3d38edf38552ca74dac8c0610d3de
https://github.com/scummvm/scummvm/commit/19616084eae3d38edf38552ca74dac8c0610d3de
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:20+03:00
Commit Message:
CHEWY: Fix regression in saved games with held items
Changed paths:
engines/chewy/main.cpp
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 4c492aa0092..e8f1f3951da 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -342,11 +342,13 @@ bool mainLoop(int16 mode) {
}
_G(out)->setPointer(_G(workptr));
- _G(menu_item) = _G(tmp_menu_item);
_G(menu_display) = MENU_HIDE;
- if (!(_G(cur)->usingInventoryCursor() && _G(menu_item) == CUR_USE))
- cursorChoice(_G(tmp_menu_item));
+ if (!_G(cur)->usingInventoryCursor()) {
+ _G(menu_item) = CUR_WALK;
+ cursorChoice(_G(menu_item));
+ } else
+ _G(menu_item) = CUR_USE;
_G(flags).SaveMenu = false;
_G(cur)->showCursor();
Commit: 7ce29e846083777ac2806f2f17203b7993f024c6
https://github.com/scummvm/scummvm/commit/7ce29e846083777ac2806f2f17203b7993f024c6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:21+03:00
Commit Message:
CHEWY: Initialization fixes for room 37
Changed paths:
engines/chewy/rooms/room37.cpp
diff --git a/engines/chewy/rooms/room37.cpp b/engines/chewy/rooms/room37.cpp
index 76a26b2113e..2dabe598710 100644
--- a/engines/chewy/rooms/room37.cpp
+++ b/engines/chewy/rooms/room37.cpp
@@ -1,4 +1,4 @@
- /* ScummVM - Graphic Adventure Engine
+/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -69,6 +69,9 @@ void Room37::entry() {
_G(det)->hideStaticSpr(8);
} else if (_G(gameState).R37DogAshamed) {
_G(det)->showStaticSpr(0);
+ _G(atds)->set_ats_str(250, 1, ATS_DATA);
+ _G(atds)->set_ats_str(256, 1, ATS_DATA);
+ _G(atds)->delControlBit(251, ATS_ACTIVE_BIT);
}
}
}
Commit: 35e238ec64b7f6e3d7589ec93b93df3404d3cae0
https://github.com/scummvm/scummvm/commit/35e238ec64b7f6e3d7589ec93b93df3404d3cae0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-10T20:07:21+03:00
Commit Message:
CHEWY: Fix game state synchronization - bug #13671
There were two instances of the Text class, which led to
desynchronization of the saved game data
Changed paths:
engines/chewy/atds.cpp
diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index 7b70308986a..8bd79c78f2d 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -84,7 +84,7 @@ Atdsys::Atdsys() {
_invBlockNr = -1;
_dialogResource = new DialogResource(ADS_TXT_STEUER);
- _text = new Text();
+ _text = _G(txt);
_dialogCloseupNextBlock._blkNr = 0;
_dialogCloseupNextBlock._endNr = 0;
More information about the Scummvm-git-logs
mailing list