[Scummvm-git-logs] scummvm master -> a851b6650c0b2a9a85eae80b6c19a5fd0b81b3cc
sluicebox
noreply at scummvm.org
Fri Nov 7 02:52:38 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
fae6a1f4da PRIVATE: Set view screen picture when playing video
a851b6650c PRIVATE: Add diary setting names for all game versions
Commit: fae6a1f4daee25d4cc5a3afea5b59e3cd42c006e
https://github.com/scummvm/scummvm/commit/fae6a1f4daee25d4cc5a3afea5b59e3cd42c006e
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-06T18:52:33-08:00
Commit Message:
PRIVATE: Set view screen picture when playing video
The correct picture is now shown when pausing a video
Changed paths:
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index ec77f04f57a..18c2dddb6bc 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -1581,6 +1581,59 @@ void PrivateEngine::playVideo(const Common::String &name) {
loadSubtitles(path);
_videoDecoder->start();
+
+ // set the view screen based on the video, unless playing from diary
+ if (_currentSetting != "kDiaryMiddle") {
+ Common::String videoViewScreen = getVideoViewScreen(name);
+ if (!videoViewScreen.empty()) {
+ _nextVS = videoViewScreen;
+ }
+ }
+}
+
+Common::String PrivateEngine::getVideoViewScreen(Common::String video) {
+ video = convertPath(video).toString();
+
+ // find the separator
+ const char *separators[] = { "/animatio/", "/" };
+ size_t separatorPos = Common::String::npos;
+ size_t separatorLength = Common::String::npos;
+ for (uint i = 0; i < ARRAYSIZE(separators); i++) {
+ separatorPos = video.find(separators[i]);
+ if (separatorPos != Common::String::npos) {
+ separatorLength = strlen(separators[i]);
+ break;
+ }
+ }
+ if (separatorPos == Common::String::npos) {
+ return "";
+ }
+
+ // find the video suffix. these suffixes are from the executable.
+ size_t suffixPos = Common::String::npos;
+ const char *suffixes[] = { "ys.smk", "xs.smk", "a.smk", "s.smk", ".smk" };
+ for (uint i = 0; i < ARRAYSIZE(suffixes); i++) {
+ if (video.hasSuffix(suffixes[i])) {
+ suffixPos = video.size() - strlen(suffixes[i]);
+ break;
+ }
+ }
+ if (suffixPos == Common::String::npos) {
+ return "";
+ }
+
+ // build the view screen picture name
+ Common::String picture = Common::String::format(
+ "\"inface/views/%s/%s.bmp\"",
+ video.substr(0, separatorPos).c_str(),
+ video.substr(separatorPos + separatorLength, suffixPos - (separatorPos + separatorLength)).c_str());
+
+ // not every video has a picture
+ if (!Common::File::exists(convertPath(picture))) {
+ return "";
+ }
+
+ return picture;
}
void PrivateEngine::skipVideo() {
diff --git a/engines/private/private.h b/engines/private/private.h
index 4962c1c1d96..adc1c1523b8 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -218,7 +218,8 @@ public:
Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
- Common::Path convertPath(const Common::String &);
+ static Common::Path convertPath(const Common::String &name);
+ static Common::String getVideoViewScreen(Common::String video);
void playVideo(const Common::String &);
void skipVideo();
void destroyVideo();
Commit: a851b6650c0b2a9a85eae80b6c19a5fd0b81b3cc
https://github.com/scummvm/scummvm/commit/a851b6650c0b2a9a85eae80b6c19a5fd0b81b3cc
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-06T18:52:33-08:00
Commit Message:
PRIVATE: Add diary setting names for all game versions
Changed paths:
engines/private/funcs.cpp
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index d9f0ca5b1e0..31ac7443fc6 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -99,7 +99,7 @@ static void fDiaryGoLoc(ArgArray args) {
ExitInfo e;
e.rect = *args[1].u.rect;
- e.nextSetting = "kDiaryMiddle";
+ e.nextSetting = g_private->getDiaryMiddleSetting();
if (args[0].u.val) {
e.cursor = "kTurnRight";
@@ -116,14 +116,14 @@ static void fDiaryPageTurn(ArgArray args) {
debugC(1, kPrivateDebugScript, "DiaryPageTurn(%d, ..)", args[0].u.val);
ExitInfo e;
- e.nextSetting = "kDiaryMiddle";
+ e.nextSetting = g_private->getDiaryMiddleSetting();
e.rect = *args[1].u.rect;
if (args[0].u.val == 1) {
e.cursor = "kTurnRight";
if ((uint)g_private->_currentDiaryPage == g_private->_diaryPages.size() - 1) {
- e.nextSetting = "kDiaryLastPage";
+ e.nextSetting = g_private->getDiaryLastPageSetting();
}
g_private->_diaryNextPageExit = e;
@@ -131,7 +131,7 @@ static void fDiaryPageTurn(ArgArray args) {
e.cursor = "kTurnLeft";
if (g_private->_currentDiaryPage == 0) {
- e.nextSetting = "kDiaryTOC";
+ e.nextSetting = g_private->getDiaryTOCSetting();
}
g_private->_diaryPrevPageExit = e;
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 18c2dddb6bc..332333f2569 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -668,6 +668,27 @@ Common::String PrivateEngine::getMainDesktopSetting() {
return "k183";
}
+Common::String PrivateEngine::getDiaryTOCSetting() {
+ if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR) && _platform != Common::kPlatformMacintosh)
+ return "kDiaryTOC";
+
+ return "k185";
+}
+
+Common::String PrivateEngine::getDiaryMiddleSetting() {
+ if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR) && _platform != Common::kPlatformMacintosh)
+ return "kDiaryMiddle";
+
+ return "k186";
+}
+
+Common::String PrivateEngine::getDiaryLastPageSetting() {
+ if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR) && _platform != Common::kPlatformMacintosh)
+ return "kDiaryLastPage";
+
+ return "k187";
+}
+
Common::String PrivateEngine::getPoliceIndexVariable() {
if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR) && _platform != Common::kPlatformMacintosh)
return "kPoliceIndex";
@@ -895,7 +916,7 @@ bool PrivateEngine::selectMemory(const Common::Point &mousePos) {
if (inMask(_memoryMasks[i].surf, mousePos)) {
clearAreas();
_nextMovie = _diaryPages[_currentDiaryPage].memories[i].movie;
- _nextSetting = "kDiaryMiddle";
+ _nextSetting = getDiaryMiddleSetting();
return true;
}
}
@@ -1583,7 +1604,7 @@ void PrivateEngine::playVideo(const Common::String &name) {
_videoDecoder->start();
// set the view screen based on the video, unless playing from diary
- if (_currentSetting != "kDiaryMiddle") {
+ if (_currentSetting != getDiaryMiddleSetting()) {
Common::String videoViewScreen = getVideoViewScreen(name);
if (!videoViewScreen.empty()) {
_nextVS = videoViewScreen;
@@ -1975,7 +1996,7 @@ void PrivateEngine::loadLocations(const Common::Rect &rect) {
MaskInfo m;
m.surf = loadMask(s, rect.left + 120, rect.top + offset, true);
m.cursor = g_private->getExitCursor();
- m.nextSetting = "kDiaryMiddle";
+ m.nextSetting = getDiaryMiddleSetting();
m.flag1 = nullptr;
m.flag2 = nullptr;
_masks.push_front(m);
@@ -2006,7 +2027,7 @@ void PrivateEngine::loadMemories(const Common::Rect &rect, uint rightPageOffset,
MaskInfo m;
m.surf = loadMask(_diaryPages[_currentDiaryPage].memories[i].image, rect.left + horizontalOffset, rect.top + currentVerticalOffset, true);
m.cursor = g_private->getExitCursor();
- m.nextSetting = "kDiaryMiddle";
+ m.nextSetting = getDiaryMiddleSetting();
m.flag1 = nullptr;
m.flag2 = nullptr;
_masks.push_front(m);
diff --git a/engines/private/private.h b/engines/private/private.h
index adc1c1523b8..32096b37208 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -272,6 +272,9 @@ public:
Common::String getPauseMovieSetting();
Common::String getGoIntroSetting();
Common::String getMainDesktopSetting();
+ Common::String getDiaryTOCSetting();
+ Common::String getDiaryMiddleSetting();
+ Common::String getDiaryLastPageSetting();
Common::String getPOGoBustMovieSetting();
Common::String getPoliceBustFromMOSetting();
Common::String getAlternateGameVariable();
More information about the Scummvm-git-logs
mailing list