[Scummvm-git-logs] scummvm master -> 199b68228ef79a86302f6ad0a511310f1434a11d
neuromancer
noreply at scummvm.org
Tue Nov 24 19:10:12 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
d5a23a3a0c HOLLYWOOD: RUNAWAY: implemented idle animations
f559cdadbe HOLLYWOOD: RUNAWAY: restored some unused interactions
199b68228e HOLLYWOOD: RUNAWAY: added some chapter 6 restored interactions
Commit: d5a23a3a0c352012a34f98fb86835b5f0b44148c
https://github.com/scummvm/scummvm/commit/d5a23a3a0c352012a34f98fb86835b5f0b44148c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-24T20:09:55+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: implemented idle animations
Changed paths:
engines/hollywood/runaway/animation.cpp
engines/hollywood/runaway/animation.h
engines/hollywood/runaway/audio.cpp
engines/hollywood/runaway/audio.h
engines/hollywood/runaway/graphics.cpp
engines/hollywood/runaway/graphics.h
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene2020.cpp
engines/hollywood/runaway/scene5030.cpp
engines/hollywood/runaway/scene5030.h
engines/hollywood/runaway/ui.cpp
engines/hollywood/runaway/ui.h
diff --git a/engines/hollywood/runaway/animation.cpp b/engines/hollywood/runaway/animation.cpp
index a369219b670..60f930226ee 100644
--- a/engines/hollywood/runaway/animation.cpp
+++ b/engines/hollywood/runaway/animation.cpp
@@ -22,6 +22,7 @@
#include "common/file.h"
#include "common/util.h"
#include "hollywood/runaway/animation.h"
+#include "hollywood/runaway/graphics.h"
namespace Hollywood {
namespace {
@@ -159,17 +160,16 @@ void RunawayIdleHead::pause(uint32 elapsed) {
_blinkTick += elapsed;
}
-void RunawayIdleHead::update(uint32 now, bool enabled, uint blinkInterval, Common::RandomSource &random) {
+void RunawayIdleHead::update(uint32 now, bool enabled, Common::RandomSource &random, bool museum) {
if (!enabled || !_active) {
reset(now);
_active = enabled;
return;
}
- // Native 0x42a610 moves between three poses on a 60 ms clock. The
- // center is index 6 in the transition table at 0x464660. Blinks use
- // 0x42ab50's separate timer, retaining the last speech character period.
+ // Retail 0x434c50 turns every 60 ms; 0x412f60 restores the 150 ms
+ // blink clock after speech. The museum demo uses rand() % 400.
static const byte frames[] = {24, 23, 22, 21, 20, 19, 0, 12, 13, 14, 15, 16, 17};
- blinkInterval = MAX<uint>(10, blinkInterval);
+ const uint blinkInterval = 150;
while (now - _turnTick >= 60 || now - _blinkTick >= blinkInterval) {
if (now - _turnTick >= 60 && (int32)((_turnTick + 60) - (_blinkTick + blinkInterval)) <= 0) {
_turnTick += 60;
@@ -177,7 +177,7 @@ void RunawayIdleHead::update(uint32 now, bool enabled, uint blinkInterval, Commo
_step += _target > _step ? 1 : -1;
_frame = frames[_step];
} else if (!_blink) {
- const uint choice = random.getRandomNumber(499);
+ const uint choice = random.getRandomNumber(museum ? 399 : 499);
if (_step == 6) {
if (choice < 4)
_target = choice < 2 ? 0 : 12;
@@ -198,6 +198,112 @@ void RunawayIdleHead::update(uint32 now, bool enabled, uint blinkInterval, Commo
}
}
+void RunawayIdleBody::reset(uint32 now) {
+ _kind = kNone;
+ _frames.clear();
+ _tick = _lastInteraction = now;
+ _step = 0;
+ _returning = false;
+}
+
+void RunawayIdleBody::pause(uint32 elapsed) {
+ _tick += elapsed;
+ _lastInteraction += elapsed;
+}
+
+void RunawayIdleBody::interact(uint32 now) {
+ _lastInteraction = now;
+ if (!active() || _returning)
+ return;
+ if (_kind == kTurn) {
+ reset(now);
+ return;
+ }
+ _returning = true;
+ const byte frame = _frames[_step];
+ // Native 0x436650 lowers the arm before walking. A shrug already past
+ // its halfway point finishes forwards instead.
+ if (_kind == kShrug && frame > 5)
+ return;
+ _frames.clear();
+ for (int i = frame; i >= 0; --i)
+ _frames.push_back(i);
+ _step = 0;
+ _tick = now;
+}
+
+bool RunawayIdleBody::start(Kind kind, uint32 now, byte facing, RunawayActor &actor, Common::RandomSource &random) {
+ if (!actor.loadIdle(facing, kind))
+ return false;
+ _kind = kind;
+ _tick = now;
+ _step = 0;
+ _returning = false;
+ _frames.clear();
+ // Retail 0x435dd0: scratch twice, shrug, or hold the thinking pose.
+ if (kind == kScratch) {
+ for (uint i = 0; i < 16; ++i)
+ _frames.push_back(i);
+ for (uint repeat = 0; repeat < 2; ++repeat) {
+ for (uint i = 16; i < 20; ++i)
+ _frames.push_back(i);
+ for (int i = 18; i >= 15; --i)
+ _frames.push_back(i);
+ }
+ for (int i = 14; i >= 0; --i)
+ _frames.push_back(i);
+ } else if (kind == kShrug) {
+ _lastInteraction = now;
+ for (uint i = 0; i < 13; ++i)
+ _frames.push_back(i);
+ } else {
+ for (uint i = 0; i < 12; ++i)
+ _frames.push_back(i);
+ const uint hold = (1 + random.getRandomNumber(9)) * 10;
+ for (uint i = 0; i < hold; ++i)
+ _frames.push_back(12);
+ for (int i = 11; i >= 0; --i)
+ _frames.push_back(i);
+ }
+ return true;
+}
+
+bool RunawayIdleBody::update(uint32 now, bool enabled, bool headCentered, byte &facing, RunawayActor &actor, Common::RandomSource &random) {
+ if (!enabled) {
+ reset(now);
+ return false;
+ }
+ if (now - _tick >= 60) {
+ _tick = now;
+ if (_kind == kTurn) {
+ facing += facing < 4 ? 1 : -1;
+ actor.setFrame(facing, 0);
+ if (facing == 4 && !start(kShrug, now, facing, actor, random))
+ reset(now);
+ } else if (active()) {
+ if (++_step == _frames.size()) {
+ _kind = kNone;
+ _returning = false;
+ }
+ } else if (headCentered) {
+ // Retail 0x436840 checks each random gesture twice out of 1000.
+ if (now - _lastInteraction >= 30000) {
+ if (facing != 4)
+ _kind = kTurn;
+ else if (!start(kShrug, now, facing, actor, random))
+ _lastInteraction = now;
+ } else {
+ const uint choice = random.getRandomNumber(999);
+ if (choice < 4)
+ start(choice < 2 ? kScratch : kThink, now, facing, actor, random);
+ }
+ }
+ }
+ if (_kind == kTurn)
+ return actor.setFrame(facing, 0);
+ return active() && actor.setIdleFrame(_frames[_step]);
+}
+
void RunawayCarlaAnimation::update(uint32 now, bool talking, Common::RandomSource &random) {
if (talking && (_state == kBreathing || _state == kWaiting)) {
_state = kTurning;
diff --git a/engines/hollywood/runaway/animation.h b/engines/hollywood/runaway/animation.h
index 2ee32f39d60..738bdbdee2a 100644
--- a/engines/hollywood/runaway/animation.h
+++ b/engines/hollywood/runaway/animation.h
@@ -28,6 +28,8 @@
namespace Hollywood {
+class RunawayActor;
+
// The room actor, inventory portrait and other speakers share the original
// text-derived mouth shapes (0..5), with a closed-eye set at 6..11.
class RunawayLipSync {
@@ -48,8 +50,9 @@ class RunawayIdleHead {
public:
void reset(uint32 now);
void pause(uint32 elapsed);
- void update(uint32 now, bool enabled, uint blinkInterval, Common::RandomSource &random);
+ void update(uint32 now, bool enabled, Common::RandomSource &random, bool museum = false);
byte frame() const { return _frame; }
+ bool centered() const { return _step == 6 && _target == 6; }
private:
uint32 _turnTick = 0, _blinkTick = 0;
@@ -57,6 +60,24 @@ private:
bool _blink = false, _active = false;
};
+class RunawayIdleBody {
+public:
+ void reset(uint32 now);
+ void pause(uint32 elapsed);
+ void interact(uint32 now);
+ bool active() const { return _kind != kNone; }
+ bool update(uint32 now, bool enabled, bool headCentered, byte &facing, RunawayActor &actor, Common::RandomSource &random);
+
+private:
+ enum Kind { kNone, kScratch, kShrug, kThink, kTurn };
+ bool start(Kind kind, uint32 now, byte facing, RunawayActor &actor, Common::RandomSource &random);
+ Kind _kind = kNone;
+ Common::Array<byte> _frames;
+ uint32 _tick = 0, _lastInteraction = 0;
+ uint _step = 0;
+ bool _returning = false;
+};
+
class RunawayCarlaAnimation {
public:
void update(uint32 now, bool talking, Common::RandomSource &random);
diff --git a/engines/hollywood/runaway/audio.cpp b/engines/hollywood/runaway/audio.cpp
index 7e66ab9886e..e65793e530e 100644
--- a/engines/hollywood/runaway/audio.cpp
+++ b/engines/hollywood/runaway/audio.cpp
@@ -255,6 +255,17 @@ void RunawayAudio::playPointer() {
Audio::makeRawStream(samples, data.size(), 16000, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN), 3);
}
+void RunawayAudio::playInventoryIdle() {
+ // The old museum demo calls cue 22, but ships no sample for it.
+ if (_museum)
+ return;
+ // Chapter six omits the shared knock; chapter five has the same sample
+ // as chapters one through four and is present on the same retail disc.
+ const Common::String archive = Common::String::format("RESOURCE.S%02u", MIN<byte>(_chapter, 5));
+ play(archive.c_str(), 5, 1000, false, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN,
+ Audio::Mixer::kSFXSoundType, _effects[0], 255, false, 16000);
+}
+
void RunawayAudio::playMenuMusic() {
if (_museum) {
playMusic(11);
diff --git a/engines/hollywood/runaway/audio.h b/engines/hollywood/runaway/audio.h
index 5dbbc6a40ed..38cbb6446cb 100644
--- a/engines/hollywood/runaway/audio.h
+++ b/engines/hollywood/runaway/audio.h
@@ -52,6 +52,7 @@ public:
void playEffectAt(uint16 cue, Common::Point position, byte volume = Audio::Mixer::kMaxChannelVolume, byte channel = 0, bool loop = false);
void playFootstep(byte surface, byte variant, byte volume = Audio::Mixer::kMaxChannelVolume, int x = -1);
void playPointer();
+ void playInventoryIdle();
void playMenuMusic();
void playDemoSlideshowMusic();
void stopMusic();
diff --git a/engines/hollywood/runaway/graphics.cpp b/engines/hollywood/runaway/graphics.cpp
index 4d930e4fc60..5518b6a8278 100644
--- a/engines/hollywood/runaway/graphics.cpp
+++ b/engines/hollywood/runaway/graphics.cpp
@@ -259,6 +259,7 @@ bool RunawayActor::load(Model model) {
if (_loadedModel == model)
return setFrame(3, 0);
_loadedModel = -1;
+ _idleChunk = -1;
Common::File file;
Common::Array<byte> palette;
const bool museum = model == kMuseumInterior || model == kMuseumHall;
@@ -361,6 +362,11 @@ bool RunawayActor::setFrame(uint facing, uint frame, int headFrame) {
}
bool RunawayActor::loadAction(uint chunk, uint frames) {
+ const int facing = _facing;
+ return loadActionBank(chunk, frames, _actionDescriptors, _actionBank) && setFrame(facing, 0);
+}
+
+bool RunawayActor::loadActionBank(uint chunk, uint frames, Common::Array<byte> &descriptors, Common::Array<byte> &bank) {
// RESOURCE.001 has 216 banks, each preceded by 100 frame descriptors.
// The size table counts only the sprite data after those descriptors.
Common::File file;
@@ -374,29 +380,56 @@ bool RunawayActor::loadAction(uint chunk, uint frames) {
if (!offset || !size || (uint64)offset + 3200 + size > (uint64)file.size()) {
return false;
}
- _actionDescriptors.resize(frames * 32);
- _actionBank.resize(size);
+ descriptors.resize(frames * 32);
+ bank.resize(size);
file.seek(offset);
- if (file.read(_actionDescriptors.data(), _actionDescriptors.size()) != _actionDescriptors.size() ||
- !file.seek(offset + 3200) || file.read(_actionBank.data(), size) != size) {
+ if (file.read(descriptors.data(), descriptors.size()) != descriptors.size() ||
+ !file.seek(offset + 3200) || file.read(bank.data(), size) != size) {
return false;
}
- const int facing = _facing;
for (uint frame = 0; frame < frames; ++frame) {
- if (!setActionFrame(frame)) {
+ if (!setBankFrame(frame, descriptors, bank)) {
return false;
}
}
- return setFrame(facing, 0);
+ return true;
}
bool RunawayActor::setActionFrame(uint frame) {
- if (frame >= _actionDescriptors.size() / 32) {
+ return setBankFrame(frame, _actionDescriptors, _actionBank);
+}
+
+bool RunawayActor::loadIdle(byte facing, byte action) {
+ if (_museum || _loadedModel < 0 || facing >= kFacings || action < 1 || action > 3)
+ return false;
+ // Retail 0x40ef90 selects six directions, two variants and three outfits.
+ // East/west stops share the southeast/southwest standing poses.
+ static const byte directions[] = {0, 1, 2, 2, 3, 4, 4, 5};
+ const uint outfit = _loadedModel == kCabin || _loadedModel == kCabinAlternate ? 1 :
+ _loadedModel == kChapters456 || _loadedModel == kChapters456Alternate ? 2 : 0;
+ const bool alternate = _loadedModel == kChapters12Alternate || _loadedModel == kCabinAlternate ||
+ _loadedModel == kChapters456Alternate;
+ const uint chunk = ((outfit * 6 + directions[facing]) * 2 + alternate) * 6 + action - 1;
+ if (_idleChunk == (int)chunk)
+ return true;
+ _idleChunk = -1;
+ if (!loadActionBank(chunk, action == 1 ? 20 : 13, _idleDescriptors, _idleBank))
+ return false;
+ _idleChunk = chunk;
+ return true;
+}
+
+bool RunawayActor::setIdleFrame(uint frame) {
+ return _idleChunk >= 0 && setBankFrame(frame, _idleDescriptors, _idleBank);
+}
+
+bool RunawayActor::setBankFrame(uint frame, const Common::Array<byte> &descriptors, const Common::Array<byte> &bank) {
+ if (frame >= descriptors.size() / 32) {
return false;
}
- const byte *descriptor = _actionDescriptors.data() + frame * 32;
- const uint end = (frame + 1) * 32 < _actionDescriptors.size() ? READ_LE_UINT32(descriptor + 32) : _actionBank.size();
- return decodeBodyFrame(_actionBank, descriptor, end);
+ const byte *descriptor = descriptors.data() + frame * 32;
+ const uint end = (frame + 1) * 32 < descriptors.size() ? READ_LE_UINT32(descriptor + 32) : bank.size();
+ return decodeBodyFrame(bank, descriptor, end);
}
bool RunawayActor::decodeBodyFrame(const Common::Array<byte> &bank, const byte *descriptor, uint end) {
@@ -411,7 +444,7 @@ bool RunawayActor::decodeBodyFrame(const Common::Array<byte> &bank, const byte *
memset(_pixels.data(), 0, _pixels.size());
memset(_opacity.data(), 0, _opacity.size());
memset(_shadow.data(), 0, _shadow.size());
- _facing = _frame = _headFrame = -1;
+ _frame = _headFrame = -1;
return decodeFrame(bank, descriptor, end, false);
}
diff --git a/engines/hollywood/runaway/graphics.h b/engines/hollywood/runaway/graphics.h
index 27b0af0f33a..e63dcc72fd6 100644
--- a/engines/hollywood/runaway/graphics.h
+++ b/engines/hollywood/runaway/graphics.h
@@ -89,6 +89,8 @@ public:
bool setFrame(uint facing, uint frame, int headFrame = -1);
bool loadAction(uint chunk, uint frames);
bool setActionFrame(uint frame);
+ bool loadIdle(byte facing, byte action);
+ bool setIdleFrame(uint frame);
static float perspectiveHeight(Common::Point position);
void draw(Graphics::ManagedSurface &surface, Common::Point position, int cameraX,
int roomTop, const Common::Array<byte> &mask, const Common::Array<byte> &maps,
@@ -104,8 +106,12 @@ private:
bool _museum = false;
bool decodeBodyFrame(const Common::Array<byte> &bank, const byte *descriptor, uint end);
bool decodeFrame(const Common::Array<byte> &bank, const byte *descriptor, uint end, bool head);
+ bool loadActionBank(uint chunk, uint frames, Common::Array<byte> &descriptors, Common::Array<byte> &bank);
+ bool setBankFrame(uint frame, const Common::Array<byte> &descriptors, const Common::Array<byte> &bank);
Common::Array<byte> _descriptors, _headDescriptors;
Common::Array<byte> _actionDescriptors, _actionBank;
+ Common::Array<byte> _idleDescriptors, _idleBank;
+ int _idleChunk = -1;
Common::Array<byte> _banks[kFacings];
Common::Array<byte> _headBanks[kHeadFacings];
Common::Array<byte> _pixels, _opacity, _shadow;
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 66220359a26..1b5f1b60110 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -81,6 +81,7 @@ bool RunawayRoomScene::load(uint16 entryScene) {
void RunawayRoomScene::start(uint32 now) {
_now = _lastUpdate = now;
_idleHead.reset(now);
+ _idleBody.reset(now);
if (townChapter() || hopiChapter() || finaleChapter()) {
_inventory.startChapter(finaleChapter() ? 6 : hopiChapter() ? 5 : 4);
_entering = true;
@@ -247,6 +248,7 @@ bool RunawayRoomScene::restoreState(const RunawaySaveState &state, uint32 now, b
_now = _lastUpdate = now;
_random.setSeed(state.randomSeed);
_idleHead.reset(now);
+ _idleBody.reset(now);
if (entering)
updateCamera();
else
@@ -275,6 +277,8 @@ bool RunawayRoomScene::enterRoom(uint16 number, Common::Point position, byte fac
_position = position;
_walkPath.reset(position);
_facing = facing;
+ _idleHead.reset(_now);
+ _idleBody.reset(_now);
_walkElapsed = 0;
_pendingHotspot = _pendingItem = 0;
_pendingAction = 0;
@@ -431,6 +435,7 @@ void RunawayRoomScene::arrive() {
void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
if (busy())
return;
+ _idleBody.interact(_now);
const byte id = hotspotAt(mouse);
_caption = actionCaption(id, verb, item);
const RunawayHotspot *spot = hotspot(id);
@@ -470,8 +475,8 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
void RunawayRoomScene::showLine() {
const SpeechLine &line = _lines[_lineIndex];
_speech.start(line.text, line.sample, line.global, _now, line.color);
- if (_game == kRunawayFullGame)
- _idleHead.reset(_now);
+ _idleHead.reset(_now);
+ _idleBody.reset(_now);
}
void RunawayRoomScene::say(uint16 cue, byte variation, bool global, byte speaker, byte color) {
@@ -677,10 +682,16 @@ int RunawayRoomScene::sceneViewportYOffset() const {
void RunawayRoomScene::update(uint32 now, int scrollDirection, bool inventoryOpen) {
_now = now;
+ if (inventoryOpen || _inventoryOpen) {
+ _idleHead.pause(now - _lastUpdate);
+ _idleBody.pause(now - _lastUpdate);
+ }
_inventoryOpen = inventoryOpen;
const uint elapsed = MIN<uint>(100, now - _lastUpdate);
_lastUpdate = now;
if (_sequence.active()) {
+ _idleHead.reset(now);
+ _idleBody.reset(now);
_sequence.update(now);
if (!_sequence.active()) {
if (_inventorySequence) {
@@ -772,8 +783,18 @@ void RunawayRoomScene::leaveRoom(uint16 scene) {
}
void RunawayRoomScene::updateActor(uint elapsed, int scrollDirection, bool inventoryOpen) {
- if (inventoryOpen || !shouldUpdateActor()) {
+ if (inventoryOpen)
return;
+ if (!shouldUpdateActor()) {
+ _idleHead.reset(_now);
+ _idleBody.reset(_now);
+ return;
+ }
+ if (_idleBody.active() && _walkPath.active() && !speaking()) {
+ _idleBody.interact(_now);
+ _idleHead.reset(_now);
+ if (_idleBody.update(_now, true, false, _facing, _actor, _random))
+ return;
}
if (_walkPath.active() && !speaking()) {
_walkPath.advance(elapsed * actorWalkSpeed(), _position, _facing);
@@ -792,19 +813,14 @@ void RunawayRoomScene::updateActor(uint elapsed, int scrollDirection, bool inven
}
}
const bool walking = _walkPath.active();
- int headFrame = -1;
- if (_game != kRunawayMuseumDemo) {
- const bool idle = !walking && !busy();
- _idleHead.update(_now, idle, _speech.frameDuration(), _random);
- if (!walking) {
- headFrame = speaking() && !speaker() ? speechFrame() : idle ? _idleHead.frame() : -1;
- }
- } else if (_game == kRunawayMuseumDemo && !walking && speaking() && !speaker()) {
- headFrame = speechFrame();
- }
+ const bool idle = !walking && !busy() && shouldDrawActor();
+ _idleHead.update(_now, idle && !_idleBody.active(), _random, _game == kRunawayMuseumDemo);
+ const bool bodyIdle = _idleBody.update(_now, idle && _game != kRunawayMuseumDemo,
+ _idleHead.centered(), _facing, _actor, _random);
+ const int headFrame = walking ? -1 : speaking() && !speaker() ? speechFrame() : idle ? _idleHead.frame() : -1;
if (_actionUsesActor && _roomAction && !_actionFrames.empty() && !walking && !speaking()) {
_actor.setActionFrame(_actionFrames[_actionStep]);
- } else {
+ } else if (!bodyIdle) {
_actor.setFrame(_facing, walking ? 1 + (_walkElapsed / 60) % 12 : 0, headFrame);
}
if (scrollDirection) {
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index dd4c2c88508..2fce6d2086b 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -310,6 +310,7 @@ protected:
Common::RandomSource _random;
RunawaySpeech _speech;
RunawayIdleHead _idleHead;
+ RunawayIdleBody _idleBody;
ChunkArchive _archive;
SceneTextStore _text;
RunawayActor _actor;
diff --git a/engines/hollywood/runaway/scene2020.cpp b/engines/hollywood/runaway/scene2020.cpp
index 0a36bfdd0aa..e5f349a04d9 100644
--- a/engines/hollywood/runaway/scene2020.cpp
+++ b/engines/hollywood/runaway/scene2020.cpp
@@ -570,6 +570,7 @@ float Scene2020::actorHeight() const {
void Scene2020::start(uint32 now) {
_now = _lastUpdate = now;
_idleHead.reset(now);
+ _idleBody.reset(now);
for (byte item = 1; item <= 4; ++item) {
_inventory.add(item);
}
diff --git a/engines/hollywood/runaway/scene5030.cpp b/engines/hollywood/runaway/scene5030.cpp
index a116ce86767..c85d564d6b5 100644
--- a/engines/hollywood/runaway/scene5030.cpp
+++ b/engines/hollywood/runaway/scene5030.cpp
@@ -158,6 +158,8 @@ bool Scene5030::loadRoomGraphics() {
void Scene5030::start(uint32 now) {
_now = _lastUpdate = now;
+ _idleHead.reset(now);
+ _idleBody.reset(now);
_entering = true;
resume();
if (_entryScene == 5030)
@@ -231,6 +233,7 @@ bool Scene5030::restoreState(const RunawaySaveState &state, uint32 now, bool ent
setPosition(Common::Point(state.x, state.y), state.facing);
setCameraX(entering ? state.x - kScreenWidth / 2 : state.camera);
_idleHead.reset(now);
+ _idleBody.reset(now);
return _actor.setFrame(_facing, 0, 0);
}
@@ -329,6 +332,7 @@ void Scene5030::showSpeechRow() {
const uint16 sample = _globalSpeech ? _speechSample : _voiceSamples[_speechRow - 500];
_speech.start(Common::U32String(_text.largeTextRecord(_speechRow), Common::kDos850), sample, _globalSpeech, _now);
_idleHead.reset(_now);
+ _idleBody.reset(_now);
debugC(1, kDebugScene, "Runaway demo: dialogue row %u, voice %u, ends at row %u",
_speechRow, sample, _speechEnd);
}
@@ -477,6 +481,7 @@ void Scene5030::playWalkFootstep() {
void Scene5030::click(Common::Point mouse, RunawayVerb verb, byte item) {
if (_action != kNone || speaking() || mouse.y < kRoomTop || mouse.y >= kRoomTop + kRoomHeight)
return;
+ _idleBody.interact(_now);
const byte id = hotspotAt(mouse);
debugC(1, kDebugScene, "Runaway demo: verb %u item %u at %d,%d, hotspot %u",
(uint)verb, item, mouse.x + _cameraX, mouse.y - kRoomTop, id);
@@ -1117,9 +1122,16 @@ void Scene5030::update(uint32 now, int scrollDirection, bool inventoryOpen) {
if (inventoryOpen && !inventoryPresentation()) {
_actionStarted += pausedTime;
_idleHead.pause(pausedTime);
+ _idleBody.pause(pausedTime);
return;
}
updateAction();
+ if (_idleBody.active() && _walkPath.active() && !speaking()) {
+ _idleBody.interact(now);
+ _idleHead.reset(now);
+ if (_idleBody.update(now, true, false, _facing, _actor, _random))
+ return;
+ }
if ((_action == kNone || _action == kWalkingAction) && _walkPath.active()) {
const uint previousWalkFrame = _walkElapsed / 60;
if (_walkPath.advance(elapsed * 0.18f, _position, _facing)) {
@@ -1145,9 +1157,11 @@ void Scene5030::update(uint32 now, int scrollDirection, bool inventoryOpen) {
walkForAction(Common::Point(900, 473), 2, kMeltIce);
const bool walking = _walkPath.active();
const bool idle = !walking && !_speechRow && _action == kNone;
- _idleHead.update(now, idle, _speech.frameDuration(), _random);
+ _idleHead.update(now, idle && !_idleBody.active(), _random);
+ const bool bodyIdle = _idleBody.update(now, idle, _idleHead.centered(), _facing, _actor, _random);
const int headFrame = walking ? -1 : _speechRow ? speechFrame() : idle ? _idleHead.frame() : -1;
- _actor.setFrame(_facing, walking ? 1 + (_walkElapsed / 60) % 12 : 0, headFrame);
+ if (!bodyIdle)
+ _actor.setFrame(_facing, walking ? 1 + (_walkElapsed / 60) % 12 : 0, headFrame);
if (scrollDirection)
_cameraX += scrollDirection * MAX<int>(1, elapsed / (_fastScrolling ? 2 : 4));
else if (walking || (_action != kNone && _action != kIntro))
diff --git a/engines/hollywood/runaway/scene5030.h b/engines/hollywood/runaway/scene5030.h
index 6d859702145..4ecb87b4b1f 100644
--- a/engines/hollywood/runaway/scene5030.h
+++ b/engines/hollywood/runaway/scene5030.h
@@ -140,6 +140,7 @@ private:
RunawayActor _actor;
RunawaySpeech _speech;
RunawayIdleHead _idleHead;
+ RunawayIdleBody _idleBody;
RunawayAnimation _intro, _lidActor, _lid, _unplug, _climb, _actionAnimation, _water, _hatch;
RunawayVideo _video;
Common::Point _position = Common::Point(623, 447);
diff --git a/engines/hollywood/runaway/ui.cpp b/engines/hollywood/runaway/ui.cpp
index a99a81ac32e..0b28cba0105 100644
--- a/engines/hollywood/runaway/ui.cpp
+++ b/engines/hollywood/runaway/ui.cpp
@@ -33,6 +33,10 @@ const uint kCursorWidth = 60;
const uint kButtonX = 312;
const byte kMuseumPickupFrames[] = {0, 30, 31, 32, 31, 30, 31, 32, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 3};
const byte kMuseumBlinkFrames[] = {1, 2, 1, 0, 3};
+const byte kMuseumIdleFrames[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 11, 12, 13, 14, 11, 12, 13, 14, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0
+};
void shadeBevelPixel(Graphics::ManagedSurface &screen, int x, int y, int amount) {
uint16 *pixel = (uint16 *)screen.getBasePtr(x, y);
@@ -179,6 +183,7 @@ void RunawayUI::restoreState(const RunawaySaveState &state, uint32 now) {
_audio.stopEffect();
_now = _buttonTick = _verbStarted = _portraitTick = _mouthTick = _lastInteraction = now;
_blinkUntil = _idleStarted = _pickupStarted = 0;
+ _idleStep = 0;
_pickupItem = _hovered = _buttonFrame = _optionsFrame = _mouth = 0;
_blocked = _speaking = _inventoryPresentation = _returnAfterPickup = _pickupSoundPlayed = false;
_inventoryFrame = 0xff;
@@ -202,11 +207,12 @@ void RunawayUI::setInventoryOpen(bool open) {
_enteredInventory = inViewport();
_hovered = 0;
_idleStarted = 0;
+ _idleStep = 0;
_lastInteraction = _now;
+ _blinkUntil = 0;
if (_museum) {
_mouth = 0;
_mouthTick = _now;
- _blinkUntil = 0;
}
setVerb(kVerbWalk);
}
@@ -320,30 +326,52 @@ void RunawayUI::update(uint32 now, Common::Point mouse, byte roomHotspot, bool b
else
_optionsFrame = MAX<int>(0, MIN<int>(5, _optionsFrame) - steps);
}
- if (_inventoryOpen && now - _portraitTick >= 60) {
- _portraitTick = now;
- if (_speaking || _inventoryFrame != 0xff) {
- _blinkUntil = 0;
- _lastInteraction = now;
- _idleStarted = 0;
- } else if (!busy() && (!_museum || (int32)(_blinkUntil - now) <= 0) &&
- _random.getRandomNumber(_museum ? 29 : 49) == 0) {
- _blinkUntil = now + (_museum ? ARRAYSIZE(kMuseumBlinkFrames) * 60 : 180);
+ updatePortrait(now);
+ updateCursor();
+}
+
+void RunawayUI::updatePortrait(uint32 now) {
+ if (!_inventoryOpen || now - _portraitTick < 60)
+ return;
+ _portraitTick = now;
+ if (_speaking || _inventoryFrame != 0xff || _pickupItem) {
+ _blinkUntil = _idleStarted = 0;
+ _lastInteraction = now;
+ return;
+ }
+ if (_idleStarted) {
+ const uint count = _museum ? ARRAYSIZE(kMuseumIdleFrames) : _idlePortrait.frameCount();
+ const uint step = MIN<uint>(count - 1, (now - _idleStarted) / 60);
+ // Retail 0x411a10 sounds at cel 11. Museum 0x427830 repeats cel 13
+ // three times, sounding each knock before reversing back to rest.
+ for (uint i = _idleStep + 1; i <= step; ++i) {
+ if (_museum ? kMuseumIdleFrames[i] == 13 : i == 11)
+ _audio.playInventoryIdle();
}
- if (!busy() && !_speaking && _inventoryFrame == 0xff && !_idleStarted && now - _lastInteraction >= 30000)
- _idleStarted = now;
- if (_idleStarted && now - _idleStarted >= _idlePortrait.frameCount() * 60) {
+ _idleStep = step;
+ if (now - _idleStarted >= count * 60) {
_idleStarted = 0;
_lastInteraction = now;
}
+ return;
+ }
+ if (!_blocked && now - _lastInteraction >= (_museum ? 60000U : 30000U)) {
+ _idleStarted = now;
+ _idleStep = 0;
+ _blinkUntil = 0;
+ } else if (_blinkUntil) {
+ if ((int32)(_blinkUntil - now) <= 0)
+ _blinkUntil = 0;
+ } else if (_random.getRandomNumber(_museum ? 29 : 49) == 0) {
+ _blinkUntil = now + (_museum ? ARRAYSIZE(kMuseumBlinkFrames) * 60 : 180);
}
- updateCursor();
}
RunawayUI::Command RunawayUI::click(bool right) {
Command command;
+ if (_idleStarted)
+ return command;
_lastInteraction = _now;
- _idleStarted = 0;
if (!right && overOptions()) {
command.type = Command::kOpenMenu;
return command;
@@ -516,7 +544,7 @@ void RunawayUI::drawInventory(Graphics::ManagedSurface &screen) {
} else if (_inventoryFrame != 0xff) {
_portrait.draw(screen, _inventoryFrame, 0, kRunawayViewportTop);
} else if (_idleStarted) {
- _idlePortrait.draw(screen, MIN<uint>(_idlePortrait.frameCount() - 1, (_now - _idleStarted) / 60), 0, kRunawayViewportTop);
+ _idlePortrait.draw(screen, _museum ? kMuseumIdleFrames[_idleStep] : _idleStep, 0, kRunawayViewportTop);
} else {
const bool blinking = (int32)(_blinkUntil - _now) > 0;
uint frame = _speaking ? _mouth : blinking ? 6 : 0;
diff --git a/engines/hollywood/runaway/ui.h b/engines/hollywood/runaway/ui.h
index cacd547c4a8..a81686d5de1 100644
--- a/engines/hollywood/runaway/ui.h
+++ b/engines/hollywood/runaway/ui.h
@@ -53,7 +53,7 @@ public:
void toggleInventory();
bool cancel();
bool inventoryOpen() const { return _inventoryOpen; }
- bool busy() const { return _pickupItem != 0; }
+ bool busy() const { return _pickupItem != 0 || _idleStarted != 0; }
RunawayVerb verb() const { return _verb; }
byte hovered() const { return _hovered; }
void captureState(RunawaySaveState &state) const;
@@ -77,6 +77,7 @@ private:
void updateCursor();
Common::U32String inventoryCaption() const;
void drawInventory(Graphics::ManagedSurface &screen);
+ void updatePortrait(uint32 now);
RunawayAudio _audio;
RunawayInventory &_inventory;
@@ -108,6 +109,7 @@ private:
uint32 _mouthTick = 0;
uint32 _blinkUntil = 0, _idleStarted = 0, _lastInteraction = 0, _pickupStarted = 0;
uint _mouth = 0;
+ uint _idleStep = 0;
int _cursorKey = -1;
};
Commit: f559cdadbe233be3a337dbfad0a689688555c29f
https://github.com/scummvm/scummvm/commit/f559cdadbe233be3a337dbfad0a689688555c29f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-24T20:09:55+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: restored some unused interactions
Changed paths:
engines/hollywood/runaway/scene.cpp
engines/hollywood/runaway/scene.h
engines/hollywood/runaway/scene2060.cpp
engines/hollywood/runaway/scene4050.cpp
diff --git a/engines/hollywood/runaway/scene.cpp b/engines/hollywood/runaway/scene.cpp
index 1b5f1b60110..47626d28bca 100644
--- a/engines/hollywood/runaway/scene.cpp
+++ b/engines/hollywood/runaway/scene.cpp
@@ -55,6 +55,25 @@ const RunawayResponse kGlobalResponses[] = {
{0, 31, 25, 0},
};
+// New bindings for the original, unused response handlers.
+const RunawayItemAction kRestoredItemActions[] = {
+ {kHospitalStoreroom, 2, 8, 9, 0}, // Try the car keys in the left file cabinet.
+ {kHospitalStoreroom, 2, 9, 9, 0}, // Try the car keys in the right file cabinet.
+ {kHospitalStoreroom, 15, 3, 27, 0}, // Return the syringe to its box.
+ {kHospitalStoreroom, 17, 7, 27, 0}, // Return the head to the anatomical model.
+ {kHospitalStoreroom, 19, 11, 26, 0}, // Return the medical reference book to its box.
+ {kHospitalBathroom, 11, 1, 26, 0}, // Return the marker to the wastebasket.
+ {kHospitalBathroom, 11, 9, 12, 0}, // Discard the marker in the toilet.
+ {kHospitalBathroom, 15, 1, 25, 0}, // Discard the syringe in the wastebasket.
+ {kHospitalBathroom, 15, 9, 25, 0}, // Discard the syringe in the toilet.
+ {kHospitalBathroom, 19, 1, 12, 0}, // Discard the medical reference book in the wastebasket.
+ {kHospitalBathroom, 19, 9, 12, 0}, // Discard the medical reference book in the toilet.
+ {kMuseumLaboratory, 6, 7, 25, 0}, // Discard the battery in the wastepaper basket.
+ {kMuseumLaboratory, 9, 7, 12, 0}, // Discard the varnish in the wastepaper basket.
+ {kMuseumLaboratory, 9, 12, 26, 0}, // Return the varnish to the briefcase.
+ {6190, 20, 4, 27, 0}, // Return the ancient stapler to the bank shelves.
+};
+
} // End of anonymous namespace
RunawayRoomScene::RunawayRoomScene(RunawayAudio &audio, RunawayInventory &inventory, const RunawayStrings &strings, RunawayGameType game) :
@@ -455,6 +474,9 @@ void RunawayRoomScene::click(Common::Point mouse, RunawayVerb verb, byte item) {
break;
}
}
+ const RunawayItemAction *restored = restoredItemAction(item, id);
+ if (restored)
+ approach = restored->approach;
}
approach = customizeSceneActionApproach(id, index != 0, item, approach);
if (approach > 0) {
@@ -560,7 +582,23 @@ void RunawayRoomScene::skipSpeech() {
}
}
+const RunawayItemAction *RunawayRoomScene::restoredItemAction(byte item, byte id) const {
+ if (_game != kRunawayFullGame || !_restoredContent)
+ return nullptr;
+ for (uint i = 0; i < ARRAYSIZE(kRestoredItemActions); ++i) {
+ const RunawayItemAction &action = kRestoredItemActions[i];
+ if (action.room == _room && action.item == item && action.hotspot == id)
+ return &action;
+ }
+ return nullptr;
+}
+
void RunawayRoomScene::useItem(byte item, byte id) {
+ const RunawayItemAction *restored = restoredItemAction(item, id);
+ if (restored) {
+ executeItemAction(restored->action);
+ return;
+ }
const RunawayRoom *room = findRunawayRoom(_room);
for (uint i = 0; i < room->itemActionCount; ++i) {
const RunawayItemAction &action = room->itemActions[i];
@@ -594,10 +632,25 @@ void RunawayRoomScene::executeItemAction(uint16 action) {
case 2: // A variation of "That won't work."
say(1, _random.getRandomNumber(2), true);
return;
+ case 7: // "No can do."
+ say(6, _random.getRandomBit(), true);
+ return;
+ case 12: // Keep the item (masculine).
+ say(11, _random.getRandomNumber(2), true);
+ return;
case 24: // Think before rejecting the combination.
say(20, 0, true);
say(20, 1 + _random.getRandomNumber(2), true);
return;
+ case 25: { // Keep the item (feminine).
+ const byte variation = _random.getRandomNumber(2);
+ say(11, variation ? variation + 2 : 0, true);
+ return;
+ }
+ case 26: // Refuse to put the item back (masculine).
+ case 27: // Refuse to put the item back (feminine).
+ say(21, (action == 27 ? 2 : 0) + _random.getRandomBit(), true);
+ return;
case 29: // Refuse to burn the object.
say(_random.getRandomNumber(4) ? 23 : 14, 0, true);
return;
diff --git a/engines/hollywood/runaway/scene.h b/engines/hollywood/runaway/scene.h
index 2fce6d2086b..8ff4b23fbb7 100644
--- a/engines/hollywood/runaway/scene.h
+++ b/engines/hollywood/runaway/scene.h
@@ -215,6 +215,7 @@ protected:
void arrive();
void execute(uint16 action);
void executeItemAction(uint16 action);
+ const RunawayItemAction *restoredItemAction(byte item, byte hotspot) const;
void useItem(byte item, byte hotspot);
void say(uint16 cue, byte variation = 0, bool global = false, byte speaker = 0, byte color = 0);
void say(const SceneTextStore &text, const SceneSpeechCue &speech, bool global, byte speaker = 0, byte color = 0);
diff --git a/engines/hollywood/runaway/scene2060.cpp b/engines/hollywood/runaway/scene2060.cpp
index dad46f2f968..6c3e950beff 100644
--- a/engines/hollywood/runaway/scene2060.cpp
+++ b/engines/hollywood/runaway/scene2060.cpp
@@ -132,6 +132,11 @@ void Scene2060::applyCustomHotspotState() {
RunawayRoomScene::ActionResult Scene2060::dispatchCustomSceneAction(uint16 action) {
switch (action) {
+ case 5: // Try to take the serum stand.
+ if (_game != kRunawayFullGame || !_restoredContent)
+ return kUnhandled;
+ executeItemAction(13);
+ return kHandled;
case 302: // Climb back to Gina's room.
beginRoomAnimation(action, 4, 44);
return kHandled;
diff --git a/engines/hollywood/runaway/scene4050.cpp b/engines/hollywood/runaway/scene4050.cpp
index bf7389a7a64..ca91fe55104 100644
--- a/engines/hollywood/runaway/scene4050.cpp
+++ b/engines/hollywood/runaway/scene4050.cpp
@@ -365,6 +365,7 @@ void Scene4050::drawCustomForegroundComposite(Graphics::ManagedSurface &viewport
}
RunawayRoomScene::ActionResult Scene4050::dispatchCustomSceneAction(uint16 action) {
+ const bool restoredResponses = _game == kRunawayFullGame && _restoredContent;
if (museumChapter()) {
switch (action) {
case 302: // Look at the restoration shelves.
@@ -389,15 +390,17 @@ RunawayRoomScene::ActionResult Scene4050::dispatchCustomSceneAction(uint16 actio
}
return kHandled;
case 312: // Look in the wastepaper basket.
- say(19, 1, true);
+ executeItemAction(restoredResponses ? 14 : 23);
return kHandled;
case 313: // Use the wastepaper basket.
say(4, 0, true);
return kHandled;
- case 315: // Use the tank.
- say(7, 0, true);
+ case 315: // Try to take the tank.
+ executeItemAction(restoredResponses ? 18 : 8);
return kHandled;
case 317: // Use the machine.
+ executeItemAction(restoredResponses ? 7 : 15);
+ return kHandled;
case 335: // Use an item with the laser.
say(14, _random.getRandomNumber(2), true);
return kHandled;
Commit: 199b68228ef79a86302f6ad0a511310f1434a11d
https://github.com/scummvm/scummvm/commit/199b68228ef79a86302f6ad0a511310f1434a11d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-24T20:09:55+01:00
Commit Message:
HOLLYWOOD: RUNAWAY: added some chapter 6 restored interactions
Changed paths:
engines/hollywood/runaway/inventory.cpp
engines/hollywood/runaway/saveload.cpp
engines/hollywood/runaway/scene2010.cpp
engines/hollywood/runaway/scene2010.h
engines/hollywood/runaway/scene8090.cpp
engines/hollywood/runaway/scene8240.cpp
engines/hollywood/runaway/ui.cpp
diff --git a/engines/hollywood/runaway/inventory.cpp b/engines/hollywood/runaway/inventory.cpp
index 289ae0469c0..f4841be872b 100644
--- a/engines/hollywood/runaway/inventory.cpp
+++ b/engines/hollywood/runaway/inventory.cpp
@@ -54,7 +54,7 @@ const byte kHospitalItemActions[19][19] = {
const uint kMuseumItemCount = 19;
const uint kTownItemCount = 32;
const uint kHopiItemCount = 16;
-const uint kFinaleItemCount = 21;
+const uint kFinaleItemCount = 22;
const byte kItemCursors[] = {
0, 41, 43, 45, 47, 49, 51, 55, 57, 59, 61, 63, 65, 67, 69,
@@ -190,6 +190,9 @@ Common::U32String RunawayInventory::name(byte item) const {
if (item == 20 && _finale.podsOpened) {
return _strings.text(RunawayStrings::kOpenPods);
}
+ if (item == 22) { // Restored tobacco leaves.
+ return _strings.itemName(4, 27);
+ }
return _strings.itemName(_chapter, item);
}
if (_chapter == 5) {
@@ -273,6 +276,9 @@ uint RunawayInventory::icon(byte item) const {
if (item == 20 && _finale.podsOpened) {
return 23;
}
+ if (item == 22) {
+ return 25;
+ }
return item;
}
if (_chapter == 5) {
@@ -407,6 +413,9 @@ RunawayInventory::Reply RunawayInventory::examine(byte item, const RunawaySaveSt
if (item == 20) {
return Reply(311, _finale.podsOpened);
}
+ if (item == 22) {
+ return Reply(217, state.town.rawTobaccoRefused);
+ }
static const uint16 cues[] = {1, 50, 51, 74, 200, 300, 301, 253, 303, 256, 304, 1, 305, 306, 307, 308, 309, 1, 1, 310, 311, 312};
return Reply(item < ARRAYSIZE(cues) ? cues[item] : 1);
}
diff --git a/engines/hollywood/runaway/saveload.cpp b/engines/hollywood/runaway/saveload.cpp
index 7645d319f62..1416f5ad1ef 100644
--- a/engines/hollywood/runaway/saveload.cpp
+++ b/engines/hollywood/runaway/saveload.cpp
@@ -578,7 +578,7 @@ bool RunawaySaveState::valid() const {
}
for (uint i = 0; i < itemCount; ++i) {
if (!items[i] || items[i] >= sizeof(owned) || owned[items[i]] ||
- items[i] > (chapter() == 6 ? 21 : chapter() == 5 ? 16 : chapter() == 4 ? 32 : chapter() == 3 ? 26 : 19))
+ items[i] > (chapter() == 6 ? 22 : chapter() == 5 ? 16 : chapter() == 4 ? 32 : chapter() == 3 ? 26 : 19))
return false;
owned[items[i]] = true;
}
diff --git a/engines/hollywood/runaway/scene2010.cpp b/engines/hollywood/runaway/scene2010.cpp
index 432eff5f39b..cb7a8b0b134 100644
--- a/engines/hollywood/runaway/scene2010.cpp
+++ b/engines/hollywood/runaway/scene2010.cpp
@@ -275,14 +275,8 @@ void RunawayOpening::enter(Step step, uint32 now) {
_firstFrame = _chapterVariation == 1 ? 161 : 177;
_lastFrame = _chapterVariation == 1 ? 177 : 161;
} else if (_chapter == 5) {
- if (_chapterVariation == 1) {
- _firstFrame = 51;
- _lastFrame = 75;
- } else {
- _headBank = 1;
- _firstFrame = _chapterVariation == 2 ? 7 : 17;
- _lastFrame = _chapterVariation == 2 ? 10 : 20;
- }
+ _firstFrame = 51;
+ _lastFrame = 75;
} else if (_chapterVariation == 1) {
_firstFrame = 177;
_lastFrame = 161;
@@ -291,6 +285,14 @@ void RunawayOpening::enter(Step step, uint32 now) {
_lastFrame = _chapterVariation == 2 ? 50 : 75;
}
break;
+ case kChapterExpression: {
+ const bool stern = (_chapter == 3 && _chapterVariation == 3) || (_chapter == 5 && _chapterVariation == 2);
+ _bodyFrame = 20;
+ _headBank = 1;
+ _firstFrame = stern ? 7 : 17;
+ _lastFrame = stern ? 10 : 20;
+ break;
+ }
case kFinished:
_video.close();
_audio.stopMusic();
@@ -307,11 +309,18 @@ void RunawayOpening::enter(Step step, uint32 now) {
void RunawayOpening::advance() {
if (_step == kChapter) {
const uint variations = narrationVariations();
- if (++_chapterVariation < variations)
- enter(_chapterVariation < 4 ? kChapterGesture : kChapter, _now);
- else
+ if (++_chapterVariation < variations) {
+ if ((_chapter == 3 && _chapterVariation == 4) || (_chapter == 5 && _chapterVariation >= 2))
+ enter(kChapterExpression, _now);
+ else
+ enter(kChapterGesture, _now);
+ } else {
enter(kFinished, _now);
+ }
} else if (_step == kChapterGesture) {
+ // Native 0x575d14 changes expression after Brian sits back in chapter three.
+ enter(_chapter == 3 && _chapterVariation == 3 ? kChapterExpression : kChapter, _now);
+ } else if (_step == kChapterExpression) {
enter(kChapter, _now);
} else {
enter((Step)(_step + 1), _now);
@@ -392,7 +401,8 @@ void RunawayOpening::update(uint32 now) {
advance();
break;
}
- case kChapterGesture: {
+ case kChapterGesture:
+ case kChapterExpression: {
const uint distance = ABS((int)_lastFrame - (int)_firstFrame);
const uint offset = MIN(distance, elapsed / 80);
_frame = _lastFrame >= _firstFrame ? _firstFrame + offset : _firstFrame - offset;
@@ -522,16 +532,16 @@ void RunawayOpening::drawNarrator(Graphics::ManagedSurface &screen) {
_narrator[0].draw(screen, _bodyFrame, 0, kRunawayViewportTop);
if (_headBank) {
uint frame = _speech.frame(_now) % 6;
- if (_chapter == 5 && _step == kChapter && _chapterVariation == 2) {
+ if (_step == kChapter && ((_chapter == 3 && _chapterVariation == 3) || (_chapter == 5 && _chapterVariation == 2))) {
frame += 10;
- } else if (_chapter == 5 && _step == kChapterGesture && _chapterVariation >= 2) {
+ } else if (_step == kChapterExpression) {
frame = _frame == 20 ? 0 : _frame;
}
_narrator[_headBank].draw(screen, frame, 0, kRunawayViewportTop);
}
if (_step == kMontage)
_video.draw(screen, Common::Rect(256, 232, 656, 466));
- if (!_chapterTitle.empty() && (_step == kChapter || _step == kChapterGesture)) {
+ if (!_chapterTitle.empty() && (_step == kChapter || _step == kChapterGesture || _step == kChapterExpression)) {
applyRunawayPatch(_chapterTitle, screen, kRunawayViewportTop);
}
}
@@ -604,7 +614,7 @@ void RunawayOpening::drawFilm(Graphics::ManagedSurface &screen) {
void RunawayOpening::draw(Graphics::ManagedSurface &screen) {
screen.clear();
- if (_step <= kLastNarration || _step == kChapter || _step == kChapterGesture)
+ if (_step <= kLastNarration || _step == kChapter || _step == kChapterGesture || _step == kChapterExpression)
drawNarrator(screen);
else if (_step == kCity || _step == kCityExit)
drawCity(screen);
diff --git a/engines/hollywood/runaway/scene2010.h b/engines/hollywood/runaway/scene2010.h
index 5370e90c459..80eff7a29fa 100644
--- a/engines/hollywood/runaway/scene2010.h
+++ b/engines/hollywood/runaway/scene2010.h
@@ -54,7 +54,7 @@ private:
kTurnToScreen, kJourney, kMontage, kTurnBack, kLastNarration,
kCity, kTitle, kAccident, kAccidentTitle, kAccidentEnd, kCityExit,
kFilm, kStayAway, kApproach, kUnconscious, kTurn, kHospital,
- kHitman, kReply, kFilmEnd, kChapter, kChapterGesture, kFinished
+ kHitman, kReply, kFilmEnd, kChapter, kChapterGesture, kChapterExpression, kFinished
};
void enter(Step step, uint32 now);
void advance();
diff --git a/engines/hollywood/runaway/scene8090.cpp b/engines/hollywood/runaway/scene8090.cpp
index d391f0ed514..f81aacf5c45 100644
--- a/engines/hollywood/runaway/scene8090.cpp
+++ b/engines/hollywood/runaway/scene8090.cpp
@@ -48,7 +48,8 @@ const RunawayResponse kResponses[] = {
};
const RunawayItemAction kItemActions[] = {
- {8090, 12, 4, 325} // Offer Oscar the sheriff's badge.
+ {8090, 12, 4, 325}, // Offer Oscar the sheriff's badge.
+ {8090, 22, 4, 314} // Offer raw tobacco leaves (native item 27).
};
} // End of anonymous namespace
@@ -317,6 +318,18 @@ RunawayRoomScene::ActionResult Scene8090::dispatchCustomSceneAction(uint16 actio
case 313: // Go inside to speak with Mama Dorita.
enterHouse(false);
break;
+ case 314: // Oscar chews tobacco; he does not smoke the untreated leaves.
+ if (!_restoredContent) {
+ executeItemAction(1);
+ break;
+ }
+ _oscar.setTalking(true);
+ _audio.stopEffect(1);
+ say(12);
+ say(12, 1, false, 1);
+ _town.rawTobaccoRefused = 1;
+ deferAction(400);
+ break;
case 320: // Visit Gina.
enterHouse(true);
break;
diff --git a/engines/hollywood/runaway/scene8240.cpp b/engines/hollywood/runaway/scene8240.cpp
index 3562dea0dc5..008ea11a5ca 100644
--- a/engines/hollywood/runaway/scene8240.cpp
+++ b/engines/hollywood/runaway/scene8240.cpp
@@ -271,14 +271,24 @@ RunawayRoomScene::ActionResult Scene8240::dispatchCustomSceneAction(uint16 actio
walkTo(Common::Point(742, 332), 5, false, true);
deferAction(420);
break;
- case 420: // Find nothing useful in the shed.
+ case 420: // Search the shed, optionally collecting another bundle of tobacco.
_audio.playEffect(18);
- say(8, 5);
- deferAction(421);
+ if (_restoredContent && !_inventory.contains(22)) {
+ say(8, 2);
+ deferAction(422);
+ } else {
+ say(8, 5);
+ deferAction(421);
+ }
break;
case 421: // Step back out of the gardening shed.
walkTo(Common::Point(855, 347), 3, false, true);
break;
+ case 422: // Take the dried tobacco leaves.
+ _inventory.add(22);
+ say(8, 3);
+ deferAction(421);
+ break;
case 311: // Recognize the artichoke carved into the column.
say(9, _town.artichokeSeen);
_town.artichokeSeen = 1;
diff --git a/engines/hollywood/runaway/ui.cpp b/engines/hollywood/runaway/ui.cpp
index 0b28cba0105..f8d0346f84f 100644
--- a/engines/hollywood/runaway/ui.cpp
+++ b/engines/hollywood/runaway/ui.cpp
@@ -109,6 +109,23 @@ bool RunawayUI::loadChapter(byte chapter) {
!readRunawayGlobalChunk(portraitChunk, animation) || !portrait.load(animation, 104) ||
!readRunawayGlobalChunk(portraitChunk + 4, animation) || !idlePortrait.load(animation, 32))
return false;
+ if (chapter == 6) {
+ // Reuse chapter four's tobacco art in the first free icon and cursor slots.
+ Graphics::ManagedSurface townIcons, townCursors;
+ if (!loadRunawaySurface(122, 80, iconHeights[3], townIcons) ||
+ !loadRunawaySurface(115, 904, 540, townCursors))
+ return false;
+ Graphics::ManagedSurface restoredIcons(80, icons.h + 80, kUIFormat);
+ restoredIcons.copyRectToSurface(icons, 0, 0, Common::Rect(0, 0, icons.w, icons.h));
+ restoredIcons.copyRectToSurface(townIcons, 0, icons.h, Common::Rect(0, 26 * 80, 80, 27 * 80));
+ icons = Common::move(restoredIcons);
+ for (uint i = 0; i < 2; ++i) {
+ const uint src = 93 + i, dst = 89 + i;
+ const uint x = (src % 15) * kCursorWidth, y = (src / 15) * kCursorWidth;
+ cursors.copyRectToSurface(townCursors, (dst % 15) * kCursorWidth, (dst / 15) * kCursorWidth,
+ Common::Rect(x, y, x + kCursorWidth, y + kCursorWidth));
+ }
+ }
_cursors = Common::move(cursors);
_icons = Common::move(icons);
_portrait = Common::move(portrait);
More information about the Scummvm-git-logs
mailing list