[Scummvm-git-logs] scummvm master -> fb974e7f6598eb6a2945c2e9fb72ad357fa7b65d
sev-
noreply at scummvm.org
Wed Sep 28 19:59:17 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6d2986cee7 GROOVIE: subtitle file names prepend with GJD name to be compatible with 25th Annv files
0e81f7744f GROOVIE: fix subtitle timestamps
fb974e7f65 GROOVIE: fix subtitles remove unreachable line
Commit: 6d2986cee719e313f7715b873c732aba112f36ec
https://github.com/scummvm/scummvm/commit/6d2986cee719e313f7715b873c732aba112f36ec
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2022-09-28T21:59:10+02:00
Commit Message:
GROOVIE: subtitle file names prepend with GJD name to be compatible with 25th Annv files
Changed paths:
engines/groovie/resource.cpp
engines/groovie/resource.h
engines/groovie/script.cpp
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp
index 067a5333bf7..8663a1b5e96 100644
--- a/engines/groovie/resource.cpp
+++ b/engines/groovie/resource.cpp
@@ -81,6 +81,15 @@ Common::SeekableReadStream *ResMan::open(const ResInfo &resInfo) {
return file;
}
+Common::String ResMan::getGjdName(const ResInfo &resInfo) {
+ if (resInfo.gjd >= _gjds.size()) {
+ error("Groovie::Resource: Unknown GJD %d", resInfo.gjd);
+ return Common::String();
+ }
+
+ return _gjds[resInfo.gjd];
+}
+
void ResMan::dumpResource(const Common::String &fileName) {
uint32 fileRef = getRef(fileName);
dumpResource(fileRef, fileName);
diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h
index 946192ab3d2..2977ed8488a 100644
--- a/engines/groovie/resource.h
+++ b/engines/groovie/resource.h
@@ -47,6 +47,7 @@ public:
void dumpResource(uint32 fileRef, const Common::String &fileName);
void dumpResource(Common::SeekableReadStream *inFile, const Common::String &fileName, bool dispose = true);
+ Common::String getGjdName(const ResInfo &resInfo);
virtual uint32 getRef(Common::String name) = 0;
virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0;
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 58be183e8a5..c92dfad7319 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -955,13 +955,14 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
ResInfo info;
_vm->_resMan->getResInfo(fileref, info);
- // Remove the extension and add ".txt"
- info.filename.deleteLastChar();
- info.filename.deleteLastChar();
- info.filename.deleteLastChar();
- info.filename += "txt";
-
- _vm->_videoPlayer->loadSubtitles(info.filename.c_str());
+ // Prepend the GJD name and remove the extension
+ Common::String subtitleName = _vm->_resMan->getGjdName(info);
+ subtitleName = subtitleName.substr(0, subtitleName.size() - 4);
+ subtitleName.toUppercase();
+ // add the filename without the extension, then add the .txt extension
+ subtitleName += "-" + info.filename.substr(0, info.filename.size() - 3) + "txt";
+
+ _vm->_videoPlayer->loadSubtitles(subtitleName.c_str());
} else {
error("Groovie::Script: Couldn't open file");
return true;
Commit: 0e81f7744fe505c4eefb25da847c2345c5d9ef28
https://github.com/scummvm/scummvm/commit/0e81f7744fe505c4eefb25da847c2345c5d9ef28
Author: Die4Ever (die4ever2005 at gmail.com)
Date: 2022-09-28T21:59:10+02:00
Commit Message:
GROOVIE: fix subtitle timestamps
Changed paths:
engines/groovie/video/player.cpp
engines/groovie/video/player.h
diff --git a/engines/groovie/video/player.cpp b/engines/groovie/video/player.cpp
index 4404c8de8a8..681d0818208 100644
--- a/engines/groovie/video/player.cpp
+++ b/engines/groovie/video/player.cpp
@@ -33,6 +33,8 @@ VideoPlayer::VideoPlayer(GroovieEngine *vm) :
_vm(vm), _syst(vm->_system), _file(nullptr), _audioStream(nullptr), _fps(0), _overrideSpeed(false), _flags(0),
_begunPlaying(false), _millisBetweenFrames(0), _lastFrameTime(0), _frameTimeDrift(0) {
+ _startTime = _syst->getMillis();
+
int16 h = g_system->getOverlayHeight();
_subtitles.setBBox(Common::Rect(20, h - 120, g_system->getOverlayWidth() - 20, h - 20));
@@ -44,6 +46,7 @@ bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) {
_file = file;
_flags = flags;
_overrideSpeed = false;
+ _startTime = _syst->getMillis();
stopAudioStream();
_fps = loadInternal();
@@ -87,7 +90,7 @@ bool VideoPlayer::playFrame() {
}
uint32 currTime = _syst->getMillis();
- _subtitles.drawSubtitle(currTime - _frameTimeDrift);
+ _subtitles.drawSubtitle(currTime - _startTime);
// The file has been completely processed
if (end) {
diff --git a/engines/groovie/video/player.h b/engines/groovie/video/player.h
index 2f8c947de3f..9a55a35808f 100644
--- a/engines/groovie/video/player.h
+++ b/engines/groovie/video/player.h
@@ -73,6 +73,7 @@ private:
float _millisBetweenFrames;
uint32 _lastFrameTime;
float _frameTimeDrift;
+ uint32 _startTime;
Video::Subtitles _subtitles;
Commit: fb974e7f6598eb6a2945c2e9fb72ad357fa7b65d
https://github.com/scummvm/scummvm/commit/fb974e7f6598eb6a2945c2e9fb72ad357fa7b65d
Author: Die4Ever (30947252+Die4Ever at users.noreply.github.com)
Date: 2022-09-28T21:59:10+02:00
Commit Message:
GROOVIE: fix subtitles remove unreachable line
Changed paths:
engines/groovie/resource.cpp
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp
index 8663a1b5e96..6c3f15b5937 100644
--- a/engines/groovie/resource.cpp
+++ b/engines/groovie/resource.cpp
@@ -84,7 +84,6 @@ Common::SeekableReadStream *ResMan::open(const ResInfo &resInfo) {
Common::String ResMan::getGjdName(const ResInfo &resInfo) {
if (resInfo.gjd >= _gjds.size()) {
error("Groovie::Resource: Unknown GJD %d", resInfo.gjd);
- return Common::String();
}
return _gjds[resInfo.gjd];
More information about the Scummvm-git-logs
mailing list