[Scummvm-git-logs] scummvm master -> 742edc40ec17cfdb397d914d9f812014c55560f5
fracturehill
76959842+fracturehill at users.noreply.github.com
Fri May 7 20:18:58 UTC 2021
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:
3013d07e81 NANCY: Implement PlaySoundPanFrameAnchorAndDie action record
7ac4cb807a NANCY: Fix PlayDigiSoundAndDie action record in The Vampire Diaries
913f4502a6 NANCY: Implement palette change action record types
9ede2f3c91 NANCY: Fix single frame with wrong palette in The Vampire Diaries
1876fd745a NANCY: Fix disabled input after state change
805d7615a0 NANCY: Show correct exit cursor
de43aa79c1 NANCY: Disable sticky cursor in The Vampire Diaries
742edc40ec NANCY: Add detection for Russian variant of Secrets Can Kill
Commit: 3013d07e8182c422612d6685b4871f12ffa460db
https://github.com/scummvm/scummvm/commit/3013d07e8182c422612d6685b4871f12ffa460db
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:51+03:00
Commit Message:
NANCY: Implement PlaySoundPanFrameAnchorAndDie action record
Implemented the PlaySoundPanFrameAnchorAndDie action record
type and added support for panning audio to the sound manager.
Changed paths:
engines/nancy/action/recordtypes.cpp
engines/nancy/action/recordtypes.h
engines/nancy/commontypes.cpp
engines/nancy/commontypes.h
engines/nancy/sound.cpp
engines/nancy/sound.h
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/action/recordtypes.cpp b/engines/nancy/action/recordtypes.cpp
index ea6c61f1ed..6030527c92 100644
--- a/engines/nancy/action/recordtypes.cpp
+++ b/engines/nancy/action/recordtypes.cpp
@@ -516,7 +516,15 @@ void PlayDigiSoundAndDie::execute() {
}
void PlaySoundPanFrameAnchorAndDie::readData(Common::SeekableReadStream &stream) {
- stream.skip(0x20);
+ _sound.read(stream, SoundDescription::kDIGI);
+ stream.skip(2);
+}
+
+void PlaySoundPanFrameAnchorAndDie::execute() {
+ g_nancy->_sound->loadSound(_sound, true);
+ g_nancy->_sound->playSound(_sound);
+ g_nancy->_sound->calculatePanForAllSounds();
+ _isDone = true;
}
void PlaySoundMultiHS::readData(Common::SeekableReadStream &stream) {
diff --git a/engines/nancy/action/recordtypes.h b/engines/nancy/action/recordtypes.h
index 219d610677..a095bed7f9 100644
--- a/engines/nancy/action/recordtypes.h
+++ b/engines/nancy/action/recordtypes.h
@@ -457,10 +457,12 @@ protected:
virtual Common::String getRecordTypeName() const override { return "PlayDigiSoundAndDie"; }
};
-class PlaySoundPanFrameAnchorAndDie : public Unimplemented {
+class PlaySoundPanFrameAnchorAndDie : public ActionRecord {
public:
virtual void readData(Common::SeekableReadStream &stream) override;
+ virtual void execute() override;
+ SoundDescription _sound;
protected:
virtual Common::String getRecordTypeName() const override { return "PlaySoundPanFrameAnchorAndDie"; }
};
diff --git a/engines/nancy/commontypes.cpp b/engines/nancy/commontypes.cpp
index 3708e4b6cb..a07b7a962c 100644
--- a/engines/nancy/commontypes.cpp
+++ b/engines/nancy/commontypes.cpp
@@ -97,7 +97,9 @@ void SoundDescription::read(Common::SeekableReadStream &stream, Type type) {
}
stream.skip(2);
volume = stream.readUint16LE();
- stream.skip(6);
+ stream.skip(2);
+ panAnchorFrame = stream.readUint16LE();
+ stream.skip(2);
}
} // End of namespace Nancy
diff --git a/engines/nancy/commontypes.h b/engines/nancy/commontypes.h
index 09b185701a..fb895493bc 100644
--- a/engines/nancy/commontypes.h
+++ b/engines/nancy/commontypes.h
@@ -118,6 +118,7 @@ struct SoundDescription {
uint16 channelID = 0;
uint16 numLoops = 0;
uint16 volume = 0;
+ uint16 panAnchorFrame = 0;
void read(Common::SeekableReadStream &stream, Type type);
};
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 21bca8b87c..1dfaa9981c 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -30,6 +30,8 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
+#include "engines/nancy/state/scene.h"
+
namespace Nancy {
enum SoundType {
@@ -284,7 +286,7 @@ SoundManager::~SoundManager() {
stopAllSounds();
}
-void SoundManager::loadSound(const SoundDescription &description) {
+void SoundManager::loadSound(const SoundDescription &description, bool panning) {
if (description.name == "NO SOUND") {
return;
}
@@ -293,13 +295,16 @@ void SoundManager::loadSound(const SoundDescription &description) {
_mixer->stopHandle(_channels[description.channelID].handle);
}
- delete _channels[description.channelID].stream;
- _channels[description.channelID].stream = nullptr;
+ Channel &chan = _channels[description.channelID];
- _channels[description.channelID].name = description.name;
- _channels[description.channelID].numLoops = description.numLoops;
- _channels[description.channelID].volume = description.volume;
+ delete chan.stream;
+ chan.stream = nullptr;
+ chan.name = description.name;
+ chan.numLoops = description.numLoops;
+ chan.volume = description.volume;
+ chan.panAnchorFrame = description.panAnchorFrame;
+ chan.isPanning = panning;
Common::SeekableReadStream *file = SearchMan.createReadStreamForMember(description.name + (g_nancy->getGameType() == kGameTypeVampire ? ".dwd" : ".his"));
if (file) {
@@ -404,6 +409,28 @@ void SoundManager::stopAllSounds() {
}
}
+void SoundManager::calculatePanForAllSounds() {
+ uint16 viewportFrameID = NancySceneState.getSceneInfo().frameID;
+ const State::Scene::SceneSummary &sceneSummary = NancySceneState.getSceneSummary();
+ for (uint i = 0; i < 31; ++i) {
+ Channel &chan = _channels[i];
+ if (chan.isPanning) {
+ switch (sceneSummary.totalViewAngle) {
+ case 180:
+ _mixer->setChannelBalance(chan.handle, CLIP<int32>((viewportFrameID - chan.panAnchorFrame) * sceneSummary.soundPanPerFrame * 364, -32768, 32767) / 256);
+ break;
+ case 360:
+ // TODO
+ _mixer->setChannelBalance(chan.handle, 0);
+ break;
+ default:
+ _mixer->setChannelBalance(chan.handle, 0);
+ break;
+ }
+ }
+ }
+}
+
void SoundManager::stopAndUnloadSpecificSounds() {
// TODO missing if
diff --git a/engines/nancy/sound.h b/engines/nancy/sound.h
index 21c34d4f47..64c8db8847 100644
--- a/engines/nancy/sound.h
+++ b/engines/nancy/sound.h
@@ -47,7 +47,7 @@ public:
void loadCommonSounds();
// Load a sound into a channel without starting it
- void loadSound(const SoundDescription &description);
+ void loadSound(const SoundDescription &description, bool panning = false);
void playSound(uint16 channelID);
void playSound(const SoundDescription &description);
@@ -65,6 +65,8 @@ public:
void stopSound(const SoundDescription &description);
void stopSound(const Common::String &chunkName);
void stopAllSounds();
+
+ void calculatePanForAllSounds();
// Used when changing scenes
void stopAndUnloadSpecificSounds();
@@ -77,6 +79,8 @@ protected:
Audio::Mixer::SoundType type;
uint16 numLoops = 0;
uint volume = 0;
+ uint16 panAnchorFrame = 0;
+ bool isPanning = false;
Audio::SeekableAudioStream *stream = nullptr;
Audio::SoundHandle handle;
};
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 937fc8a383..b5d86f322a 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -70,8 +70,11 @@ void Scene::SceneSummary::read(Common::SeekableReadStream &stream) {
sound.read(stream, SoundDescription::kScene);
ser.skip(6);
- ser.syncAsByte(dontWrap);
- ser.skip(9);
+ ser.syncAsUint16LE(dontWrap);
+ ser.syncAsUint16LE(soundWrapAroundPan);
+ ser.syncAsUint16LE(soundPanPerFrame);
+ ser.syncAsUint16LE(totalViewAngle);
+ ser.syncAsUint16LE(horizontalScrollDelta);
ser.syncAsUint16LE(verticalScrollDelta);
ser.syncAsUint16LE(horizontalEdgeSize);
ser.syncAsUint16LE(verticalEdgeSize);
@@ -567,6 +570,14 @@ void Scene::run() {
// Update the UI elements and handle input
NancyInput input = g_nancy->_input->getInput();
_viewport.handleInput(input);
+
+ _sceneState.currentScene.verticalOffset = _viewport.getCurVerticalScroll();
+
+ if (_sceneState.currentScene.frameID != _viewport.getCurFrame()) {
+ _sceneState.currentScene.frameID = _viewport.getCurFrame();
+ g_nancy->_sound->calculatePanForAllSounds();
+ }
+
_actionManager.handleInput(input);
_menuButton->handleInput(input);
_helpButton->handleInput(input);
@@ -585,9 +596,6 @@ void Scene::run() {
requestStateChange(NancyState::kHelp);
}
- _sceneState.currentScene.frameID = _viewport.getCurFrame();
- _sceneState.currentScene.verticalOffset = _viewport.getCurVerticalScroll();
-
// Handle invisible map button
for (uint i = 0; i < ARRAYSIZE(g_nancy->getConstants().mapAccessSceneIDs); ++i) {
if (g_nancy->getConstants().mapAccessSceneIDs[i] == -1) {
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 197e32ea9b..90cca8acae 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -95,7 +95,10 @@ public:
SoundDescription sound;
//
NancyFlag dontWrap;
- //
+ uint16 soundWrapAroundPan;
+ uint16 soundPanPerFrame;
+ uint16 totalViewAngle;
+ uint16 horizontalScrollDelta;
uint16 verticalScrollDelta;
uint16 horizontalEdgeSize;
uint16 verticalEdgeSize;
Commit: 7ac4cb807a513286e8af3bc89357d38dc5828c82
https://github.com/scummvm/scummvm/commit/7ac4cb807a513286e8af3bc89357d38dc5828c82
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:51+03:00
Commit Message:
NANCY: Fix PlayDigiSoundAndDie action record in The Vampire Diaries
PlayDigiSoundAndDie now loads correctly in The Vampire Diaries.
Changed paths:
engines/nancy/action/recordtypes.cpp
diff --git a/engines/nancy/action/recordtypes.cpp b/engines/nancy/action/recordtypes.cpp
index 6030527c92..8e6d30b5a7 100644
--- a/engines/nancy/action/recordtypes.cpp
+++ b/engines/nancy/action/recordtypes.cpp
@@ -484,6 +484,12 @@ void ShowInventoryItem::onPause(bool pause) {
void PlayDigiSoundAndDie::readData(Common::SeekableReadStream &stream) {
_sound.read(stream, SoundDescription::kDIGI);
_sceneChange.readData(stream);
+
+ if (g_nancy->getGameType() == kGameTypeVampire) {
+ stream.skip(1);
+ _sceneChange.doNotStartSound = stream.readUint16LE();
+ }
+
_flagOnTrigger.label = stream.readSint16LE();
_flagOnTrigger.flag = (NancyFlag)stream.readByte();
stream.skip(2);
Commit: 913f4502a6f761b7c636b5a8f605ba35cb1a3429
https://github.com/scummvm/scummvm/commit/913f4502a6f761b7c636b5a8f605ba35cb1a3429
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:52+03:00
Commit Message:
NANCY: Implement palette change action record types
Implemented the PaletteThisScene and PaletteNextScene action record
types, which change the viewport video's palette in TVD.
Changed paths:
engines/nancy/action/recordtypes.cpp
engines/nancy/action/recordtypes.h
engines/nancy/graphics.cpp
engines/nancy/graphics.h
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
engines/nancy/ui/viewport.cpp
engines/nancy/ui/viewport.h
diff --git a/engines/nancy/action/recordtypes.cpp b/engines/nancy/action/recordtypes.cpp
index 8e6d30b5a7..c4e765ff9b 100644
--- a/engines/nancy/action/recordtypes.cpp
+++ b/engines/nancy/action/recordtypes.cpp
@@ -113,11 +113,35 @@ void HotMultiframeMultisceneChange::readData(Common::SeekableReadStream &stream)
}
void PaletteThisScene::readData(Common::SeekableReadStream &stream) {
- stream.skip(6);
+ _paletteID = stream.readByte();
+ _unknownEnum = stream.readByte();
+ _paletteStart = stream.readUint16LE();
+ _paletteSize = stream.readUint16LE();
+}
+
+void PaletteThisScene::execute() {
+ NancySceneState.getSceneInfo().paletteID = _paletteID;
+ const State::Scene::SceneSummary &ssum = NancySceneState.getSceneSummary();
+
+ if (_unknownEnum > 1 && _unknownEnum < 3) {
+ // Not sure what the difference is between the 3 types
+ NancySceneState.getViewport().setPalette(ssum.palettes[_paletteID], _paletteStart, _paletteSize);
+ } else {
+ NancySceneState.getViewport().setPalette(ssum.palettes[_paletteID]);
+ }
+
+ finishExecution();
}
void PaletteNextScene::readData(Common::SeekableReadStream &stream) {
- stream.skip(6);
+ // Structure is the same as PaletteThisScene, but the original engine only uses the palette ID
+ _paletteID = stream.readByte();
+ stream.skip(5);
+}
+
+void PaletteNextScene::execute() {
+ NancySceneState.getNextSceneInfo().paletteID = _paletteID;
+ _isDone = true;
}
void StartFrameNextScene::readData(Common::SeekableReadStream &stream) {
diff --git a/engines/nancy/action/recordtypes.h b/engines/nancy/action/recordtypes.h
index a095bed7f9..8b6c56509f 100644
--- a/engines/nancy/action/recordtypes.h
+++ b/engines/nancy/action/recordtypes.h
@@ -86,17 +86,26 @@ protected:
virtual Common::String getRecordTypeName() const override { return "HotMultiframeMultisceneChange"; }
};
-class PaletteThisScene : public Unimplemented {
+class PaletteThisScene : public ActionRecord {
public:
virtual void readData(Common::SeekableReadStream &stream) override;
+ virtual void execute() override;
+
+ byte _paletteID;
+ byte _unknownEnum; // enum w values 1-3
+ uint16 _paletteStart;
+ uint16 _paletteSize;
protected:
virtual Common::String getRecordTypeName() const override { return "PaletteThisScene"; }
};
-class PaletteNextScene : public Unimplemented {
+class PaletteNextScene : public ActionRecord {
public:
virtual void readData(Common::SeekableReadStream &stream) override;
+ virtual void execute() override;
+
+ byte _paletteID;
protected:
virtual Common::String getRecordTypeName() const override { return "PaletteNextScene"; }
@@ -463,6 +472,7 @@ public:
virtual void execute() override;
SoundDescription _sound;
+
protected:
virtual Common::String getRecordTypeName() const override { return "PlaySoundPanFrameAnchorAndDie"; }
};
diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index 5dadf47d56..a893bef928 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -130,6 +130,16 @@ void GraphicsManager::loadSurfacePalette(Graphics::ManagedSurface &inSurf, const
}
}
+void GraphicsManager::loadSurfacePalette(Graphics::ManagedSurface &inSurf, const Common::String paletteFilename, uint paletteStart, uint paletteSize) {
+ Common::File f;
+ if (f.open(paletteFilename + ".bmp")) {
+ Image::BitmapDecoder dec;
+ if (dec.loadStream(f)) {
+ inSurf.setPalette(dec.getPalette(), paletteStart, paletteSize);
+ }
+ }
+}
+
void GraphicsManager::copyToManaged(const Graphics::Surface &src, Graphics::ManagedSurface &dst, bool verticalFlip, bool doubleSize) {
if (dst.w != (doubleSize ? src.w * 2 : src.w) || dst.h != (doubleSize ? src.h * 2 : src.h)) {
const uint32 *palette = dst.getPalette();
diff --git a/engines/nancy/graphics.h b/engines/nancy/graphics.h
index 94a052f7f2..bde11a62c9 100644
--- a/engines/nancy/graphics.h
+++ b/engines/nancy/graphics.h
@@ -54,6 +54,7 @@ public:
uint getTransColor();
static void loadSurfacePalette(Graphics::ManagedSurface &inSurf, const Common::String paletteFilename);
+ static void loadSurfacePalette(Graphics::ManagedSurface &inSurf, const Common::String paletteFilename, uint paletteStart, uint paletteSize);
static void copyToManaged(const Graphics::Surface &src, Graphics::ManagedSurface &dst, bool verticalFlip = false, bool doubleSize = false);
static void copyToManaged(void *src, Graphics::ManagedSurface &dst, uint srcW, uint srcH, const Graphics::PixelFormat &format, bool verticalFlip = false, bool doubleSize = false);
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index b5d86f322a..f3bef6c105 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -63,9 +63,12 @@ void Scene::SceneSummary::read(Common::SeekableReadStream &stream) {
// Load the palette data in The Vampire Diaries
ser.skip(4, kGameTypeVampire, kGameTypeVampire);
- ser.syncBytes((byte *)buf, 10, kGameTypeVampire, kGameTypeVampire);
- videoPaletteFile = buf;
- ser.skip(0x14, kGameTypeVampire, kGameTypeVampire);
+ if (ser.getVersion() == kGameTypeVampire) {
+ palettes.resize(3);
+ readFilename(stream, palettes[0]);
+ readFilename(stream, palettes[1]);
+ readFilename(stream, palettes[2]);
+ }
sound.read(stream, SoundDescription::kScene);
@@ -479,6 +482,8 @@ void Scene::load() {
_sceneState.nextScene.verticalOffset,
_sceneState.doNotStartSound == true ? "true" : "false");
+ _sceneState.currentScene = _sceneState.nextScene;
+
// Search for Action Records, maximum for a scene is 30
Common::SeekableReadStream *actionRecordChunk = nullptr;
@@ -491,19 +496,16 @@ void Scene::load() {
}
_viewport.loadVideo(_sceneState.summary.videoFile,
- _sceneState.nextScene.frameID,
- _sceneState.nextScene.verticalOffset,
+ _sceneState.currentScene.frameID,
+ _sceneState.currentScene.verticalOffset,
_sceneState.summary.dontWrap,
_sceneState.summary.videoFormat,
- _sceneState.summary.videoPaletteFile);
+ _sceneState.summary.palettes.size() ? _sceneState.summary.palettes[_sceneState.currentScene.paletteID] : Common::String());
if (_viewport.getFrameCount() <= 1) {
_viewport.disableEdges(kLeft | kRight);
}
- _sceneState.currentScene.verticalOffset = _sceneState.nextScene.verticalOffset;
- _sceneState.currentScene.frameID = _sceneState.nextScene.frameID;
-
if (_sceneState.summary.videoFormat == 1) {
// TODO
} else if (_sceneState.summary.videoFormat == 2) {
@@ -521,8 +523,8 @@ void Scene::load() {
}
}
- _sceneState.currentScene = _sceneState.nextScene;
_timers.sceneTime = 0;
+ _sceneState.nextScene.paletteID = 0;
_state = kStartSound;
}
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 90cca8acae..ba9c48f225 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -63,6 +63,7 @@ struct SceneInfo {
uint16 sceneID = 0;
uint16 frameID = 0;
uint16 verticalOffset = 0;
+ uint16 paletteID = 0;
};
// The game state that handles all of the gameplay
@@ -90,7 +91,7 @@ public:
Common::String videoFile;
//
uint16 videoFormat;
- Common::String videoPaletteFile;
+ Common::Array<Common::String> palettes;
Common::String audioFile;
SoundDescription sound;
//
@@ -168,6 +169,7 @@ public:
Action::ActionManager &getActionManager() { return _actionManager; }
SceneInfo &getSceneInfo() { return _sceneState.currentScene; }
+ SceneInfo &getNextSceneInfo() { return _sceneState.nextScene; }
const SceneSummary &getSceneSummary() const { return _sceneState.summary; }
void setActivePrimaryVideo(Action::PlayPrimaryVideoChan0 *activeVideo);
diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp
index 6ed902bf9a..e1f1aea139 100644
--- a/engines/nancy/ui/viewport.cpp
+++ b/engines/nancy/ui/viewport.cpp
@@ -197,7 +197,7 @@ void Viewport::loadVideo(const Common::String &filename, uint frameNr, uint vert
if (palette.size()) {
GraphicsManager::loadSurfacePalette(_drawSurface, palette);
- GraphicsManager::loadSurfacePalette(_fullFrame, palette);
+ _fullFrame.setPalette(_drawSurface.getPalette(), 0, 256);
}
_movementLastFrame = 0;
@@ -205,6 +205,18 @@ void Viewport::loadVideo(const Common::String &filename, uint frameNr, uint vert
_dontWrap = dontWrap;
}
+void Viewport::setPalette(const Common::String &paletteName) {
+ GraphicsManager::loadSurfacePalette(_drawSurface, paletteName);
+ _fullFrame.setPalette(_drawSurface.getPalette(), 0, 256);
+ _needsRedraw = true;
+}
+
+void Viewport::setPalette(const Common::String &paletteName, uint paletteStart, uint paletteSize) {
+ GraphicsManager::loadSurfacePalette(_drawSurface, paletteName, paletteStart, paletteSize);
+ _fullFrame.setPalette(_drawSurface.getPalette(), 0, 256);
+ _needsRedraw = true;
+}
+
void Viewport::setFrame(uint frameNr) {
assert(frameNr < _decoder.getFrameCount());
diff --git a/engines/nancy/ui/viewport.h b/engines/nancy/ui/viewport.h
index 3b307ceedc..c28628cf3f 100644
--- a/engines/nancy/ui/viewport.h
+++ b/engines/nancy/ui/viewport.h
@@ -56,6 +56,8 @@ public:
void handleInput(NancyInput &input);
void loadVideo(const Common::String &filename, uint frameNr = 0, uint verticalScroll = 0, NancyFlag dontWrap = kFalse, uint16 format = 2, const Common::String &palette = Common::String());
+ void setPalette(const Common::String &paletteName);
+ void setPalette(const Common::String &paletteName, uint paletteStart, uint paletteSize);
void setFrame(uint frameNr);
void setNextFrame();
Commit: 9ede2f3c916932ea9d2fbfca917030bf6b299dec
https://github.com/scummvm/scummvm/commit/9ede2f3c916932ea9d2fbfca917030bf6b299dec
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:52+03:00
Commit Message:
NANCY: Fix single frame with wrong palette in The Vampire Diaries
Fixed an issue where the screen would render with an incorrect
palette once before switching to the correct one in TVD.
Changed paths:
engines/nancy/state/scene.cpp
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index f3bef6c105..9e22276132 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -123,6 +123,7 @@ void Scene::process() {
// fall through
case kLoad:
load();
+ run(); // Extra run() call to fix the single frame with a wrong palette in TVD
// fall through
case kStartSound:
_state = kRun;
@@ -436,7 +437,6 @@ void Scene::init() {
// Load savefile directly from the launcher
int saveSlot = ConfMan.getInt("save_slot");
if (saveSlot >= 0 && saveSlot <= g_nancy->getMetaEngine()->getMaximumSaveSlot()) {
- // Set to Scene but do not do the loading yet
g_nancy->loadGameState(saveSlot);
}
} else {
Commit: 1876fd745ab9a18df65b995f33c7a57af02bea90
https://github.com/scummvm/scummvm/commit/1876fd745ab9a18df65b995f33c7a57af02bea90
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:52+03:00
Commit Message:
NANCY: Fix disabled input after state change
Fixed an edge case where input would stay disabled after changing the
game state, rendering the game unplayable.
Changed paths:
engines/nancy/input.cpp
diff --git a/engines/nancy/input.cpp b/engines/nancy/input.cpp
index bad1c93b56..2a7e9d11e0 100644
--- a/engines/nancy/input.cpp
+++ b/engines/nancy/input.cpp
@@ -50,9 +50,7 @@ void InputManager::processEvents() {
}
break;
case EVENT_CUSTOM_ENGINE_ACTION_START:
- if (_inputBeginState == NancyState::kNone) {
- _inputBeginState = g_nancy->getState();
- }
+ _inputBeginState = g_nancy->getState();
switch (event.customType) {
case kNancyActionLeftClick:
Commit: 805d7615a081af3db0e25ee066d80ae07b454932
https://github.com/scummvm/scummvm/commit/805d7615a081af3db0e25ee066d80ae07b454932
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:52+03:00
Commit Message:
NANCY: Show correct exit cursor
In TVD the exit cursor gets replaced when holding an item, whereas
nancy1 always shows it. This commit makes both games follow their
respective correct behavior.
Changed paths:
engines/nancy/cursor.cpp
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 84784a6123..fdd4988bff 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -83,6 +83,12 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
case kHotspotArrow:
_curCursorID = 5;
break;
+ case kExit:
+ if (g_nancy->getGameType() != kGameTypeVampire) {
+ _curCursorID = 3;
+ break;
+ }
+ // fall through
default: {
uint itemsOffset = 0;
if (itemID == -1) {
Commit: de43aa79c1b2a1157d7b3c2d5cd975b056b1b0af
https://github.com/scummvm/scummvm/commit/de43aa79c1b2a1157d7b3c2d5cd975b056b1b0af
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:52+03:00
Commit Message:
NANCY: Disable sticky cursor in The Vampire Diaries
TVD doesn't have a sticky cursor when clicking the viewport edges,
and the feature is now disabled for that game.
Changed paths:
engines/nancy/ui/viewport.cpp
diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp
index e1f1aea139..5dc5a03314 100644
--- a/engines/nancy/ui/viewport.cpp
+++ b/engines/nancy/ui/viewport.cpp
@@ -58,7 +58,9 @@ void Viewport::handleInput(NancyInput &input) {
byte direction = 0;
// Make cursor sticky when scrolling the viewport
- if (input.input & (NancyInput::kLeftMouseButton | NancyInput::kRightMouseButton) && _stickyCursorPos.x > -1) {
+ if ( g_nancy->getGameType() != kGameTypeVampire &&
+ input.input & (NancyInput::kLeftMouseButton | NancyInput::kRightMouseButton)
+ && _stickyCursorPos.x > -1) {
g_system->warpMouse(_stickyCursorPos.x, _stickyCursorPos.y);
input.mousePos = _stickyCursorPos;
}
Commit: 742edc40ec17cfdb397d914d9f812014c55560f5
https://github.com/scummvm/scummvm/commit/742edc40ec17cfdb397d914d9f812014c55560f5
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2021-05-07T23:09:53+03:00
Commit Message:
NANCY: Add detection for Russian variant of Secrets Can Kill
Added a detection entry for the Russian translation of Nancy Drew:
Secrets Can Kill.
Changed paths:
A engines/nancy/dialogueresponses.cpp
A engines/nancy/dialogueresponses.h
engines/nancy/detection.cpp
engines/nancy/nancy.cpp
diff --git a/engines/nancy/detection.cpp b/engines/nancy/detection.cpp
index 6024ba3dcb..14e8c111ff 100644
--- a/engines/nancy/detection.cpp
+++ b/engines/nancy/detection.cpp
@@ -28,6 +28,7 @@
const char *const directoryGlobs[] = {
"game",
"iff",
+ "cifTree",
0
};
@@ -67,6 +68,17 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
},
Nancy::kGameTypeNancy1
},
+ { // MD5 by fracturehill
+ {
+ "nancy1", 0,
+ AD_ENTRY1s("ciftree.dat", "e1cd21841ab1b83a0ea0755ce0254cbc", 4480956),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ Nancy::kGameTypeNancy1
+ },
{ // MD5 by waltervn
{
"nancy2", 0,
diff --git a/engines/nancy/dialogueresponses.cpp b/engines/nancy/dialogueresponses.cpp
new file mode 100644
index 0000000000..cf7585db9d
--- /dev/null
+++ b/engines/nancy/dialogueresponses.cpp
@@ -0,0 +1,149 @@
+/* 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
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "engines/nancy/nancy.h"
+#include "engines/nancy/dialogueresponses.h"
+
+#include "engines/nancy/state/scene.h"
+
+namespace Nancy {
+
+struct ResponseInFile {
+ uint address;
+ uint scene;
+};
+
+static const ResponseInFile nancy1ResponsesDaryl[] = {
+ { 0xB2820, 0x7C },
+ { 0xB27E4, 0x7F },
+ { 0xB279C, 0x81 },
+ { 0xB2730, 0x83 },
+ { 0xB26D4, 0x84 },
+ { 0xB25CC, 0x86 },
+ { 0xB2534, 0x8B },
+ { 0xB24D0, 0x8D },
+ { 0xB2438, 0x8F },
+ { 0xB239C, 0x90 },
+ { 0xB2300, 0x91 },
+ { 0xB228C, 0x92 },
+ { 0xB21D0, 0x96 },
+ { 0xB2170, 0x97 },
+ { 0xB20D0, 0x9C },
+ { 0xB2074, 0x93 },
+ { 0xB2038, 0x94 },
+ { 0xB1FE0, 0x95 }
+};
+
+static const ResponseInFile nancy1ResponsesConnie[] = {
+ { 0xB2BC4, 0xE9 },
+ { 0xB2B6C, 0xEA },
+ { 0xB2B34, 0xEB },
+ { 0xB2AF4, 0xEC },
+ { 0xB2A9C, 0xED },
+ { 0xB29E0, 0xEE },
+ { 0xB26D4, 0xEF },
+ { 0xB2948, 0xF0 },
+ { 0xB28A8, 0xF5 },
+ { 0xB2864, 0xE7 }
+};
+
+static const ResponseInFile nancy1ResponsesHal[] = {
+ { 0xB2EB0, 0x1B3 },
+ { 0xB27E4, 0x1B5 },
+ { 0xB2E54, 0x1B6 },
+ { 0xB2E0C, 0x1B7 },
+ { 0xB2DB4, 0x1B9 },
+ { 0xB2D28, 0x1BA },
+ { 0xB26D4, 0x1BB },
+ { 0xB2CA8, 0x1BC },
+ { 0xB2C0C, 0x1BE }
+};
+
+static const ResponseInFile nancy1ResponsesHulk[] = {
+ { 0xB3144, 0x14D },
+ { 0xB2B34, 0x150 },
+ { 0xB30B8, 0x153 },
+ { 0xB2E0C, 0x154 },
+ { 0xB306C, 0x155 },
+ { 0xB26D4, 0x156 },
+ { 0xB3008, 0x157 },
+ { 0xB2F90, 0x158 },
+ { 0xB2EF0, 0x159 }
+};
+
+#define ADD_RESPONSE(x) responses.push_back(PlayerResponse()); responses.back().sceneChange.sceneID = x.scene; responses.back().sceneChange.doNotStartSound = true; addresses.push_back(x.address);
+
+const Common::Array<PlayerResponse> getResponsesNancy1(uint characterID) {
+ Common::Array<PlayerResponse> responses;
+ Common::Array<uint> addresses;
+ State::Scene &scene = NancySceneState;
+
+ switch (characterID) {
+ case 0: // Daryl
+ if ( scene.getEventFlag(0x1D, kTrue) &&
+ scene.getEventFlag(0x39, kFalse)) {
+ ADD_RESPONSE(nancy1ResponsesDaryl[0])
+ }
+
+ if ( scene.getEventFlag(0x13, kTrue) &&
+ scene.getEventFlag(0x37, kFalse)) {
+ ADD_RESPONSE(nancy1ResponsesDaryl[1])
+ }
+
+ if ( scene.getEventFlag(0xB, kTrue) &&
+ scene.getEventFlag(0x38, kFalse)) {
+ ADD_RESPONSE(nancy1ResponsesDaryl[2])
+ }
+
+ if ( scene.getEventFlag(0, kTrue) &&
+ scene.getEventFlag(1, kFalse) &&
+ scene.getEventFlag(0x68, kFalse)) {
+ ADD_RESPONSE(nancy1ResponsesDaryl[3])
+ }
+
+
+
+ break;
+ case 1: // Connie
+
+ break;
+ case 2: // Hal
+
+ break;
+ case 3: // Hulk
+
+ break;
+ }
+
+ return responses;
+}
+
+const Common::Array<PlayerResponse> getResponses(const uint characterID) {
+ switch (g_nancy->getGameType()) {
+ case kGameTypeNancy1:
+ return getResponsesNancy1(characterID);
+ default:
+ return Common::Array<PlayerResponse>();
+ }
+}
+
+} // End of namespace Nancy
diff --git a/engines/nancy/dialogueresponses.h b/engines/nancy/dialogueresponses.h
new file mode 100644
index 0000000000..f22780271a
--- /dev/null
+++ b/engines/nancy/dialogueresponses.h
@@ -0,0 +1,40 @@
+/* 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
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef NANCY_DIALOGUERESPONSES_H
+#define NANCY_DIALOGUERESPONSES_H
+
+#include "engines/nancy/commontypes.h"
+
+namespace Nancy {
+
+struct PlayerResponse {
+ Common::String text;
+ Common::String soundName;
+ SceneChangeDescription sceneChange;
+};
+
+const Common::Array<PlayerResponse> getResponses(const uint characterID);
+
+} // End of namespace Nancy
+
+#endif // NANCY_DIALOGUERESPONSES_H
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index afc9f8d784..02fc2cd266 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -192,6 +192,8 @@ void NancyEngine::setState(NancyState::NancyState state, NancyState::NancyState
s->onStateEnter();
}
+ _input->forceCleanInput();
+
return;
}
case NancyState::kCheat:
@@ -297,6 +299,7 @@ void NancyEngine::bootGameEngine() {
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "game");
SearchMan.addSubDirectoryMatching(gameDataDir, "datafiles");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "ciftree");
SearchMan.addSubDirectoryMatching(gameDataDir, "hdsound");
SearchMan.addSubDirectoryMatching(gameDataDir, "cdsound");
SearchMan.addSubDirectoryMatching(gameDataDir, "hdvideo");
More information about the Scummvm-git-logs
mailing list