[Scummvm-git-logs] scummvm master -> 5708f630f7c528b3483f8180011ab1298d799a5e
alxpnv
a04198622 at gmail.com
Tue Sep 14 09:42:06 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c39383ffde ASYLUM: rework OGV playback
5708f630f7 ASYLUM: patch Chapter 2 Lockout bug
Commit: c39383ffdeef9ea6a715b349932115a2c1a1de05
https://github.com/scummvm/scummvm/commit/c39383ffdeef9ea6a715b349932115a2c1a1de05
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-09-14T12:43:55+03:00
Commit Message:
ASYLUM: rework OGV playback
Changed paths:
engines/asylum/asylum.cpp
engines/asylum/views/video.cpp
diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp
index 785c4b570d..3ec78664cd 100644
--- a/engines/asylum/asylum.cpp
+++ b/engines/asylum/asylum.cpp
@@ -83,9 +83,6 @@ AsylumEngine::AsylumEngine(OSystem *system, const ADGameDescription *gd) : Engin
SearchMan.addSubDirectoryMatching(gamePath, dataDir + "vids");
SearchMan.addSubDirectoryMatching(gamePath, dataDir + "music");
- if (checkGameVersion("Steam") || isAltDemo())
- ConfMan.setInt("scale_factor", 1);
-
// Initialize random number source
_rnd = new Common::RandomSource("asylum");
}
diff --git a/engines/asylum/views/video.cpp b/engines/asylum/views/video.cpp
index 06f002d062..2087db7339 100644
--- a/engines/asylum/views/video.cpp
+++ b/engines/asylum/views/video.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "engines/util.h"
+
#include "video/avi_decoder.h"
#include "video/smk_decoder.h"
#include "video/theora_decoder.h"
@@ -47,7 +49,6 @@ VideoPlayer::VideoPlayer(AsylumEngine *engine, Audio::Mixer *mixer) : _vm(engine
if (_vm->checkGameVersion("Steam")) {
#ifdef USE_THEORADEC
_decoder = new Video::TheoraDecoder();
- _decoder->setDefaultHighColorFormat(_vm->_system->getOverlayFormat());
Common::File paletteFile;
paletteFile.open("palette");
@@ -110,8 +111,8 @@ bool VideoPlayer::handleEvent(const AsylumEvent &evt) {
getText()->draw(0, 99, kTextCenter, Common::Point(10, y), 20, 620, text);
if (_vm->checkGameVersion("Steam")) {
- Graphics::Surface *st = getScreen()->getSurface()->convertTo(_vm->_system->getOverlayFormat(), _subtitlePalette);
- _vm->_system->copyRectToOverlay((const byte *)st->getBasePtr(0, 400), st->pitch, 0, 400, 640, 80);
+ Graphics::Surface *st = getScreen()->getSurface()->convertTo(g_system->getScreenFormat(), _subtitlePalette);
+ g_system->copyRectToScreen((const byte *)st->getBasePtr(0, 400), st->pitch, 0, 400, 640, 80);
st->free();
delete st;
}
@@ -126,7 +127,8 @@ bool VideoPlayer::handleEvent(const AsylumEvent &evt) {
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_KEYDOWN:
_done = true;
- getScreen()->clear();
+ if (!_vm->checkGameVersion("Steam") && !_vm->isAltDemo())
+ getScreen()->clear();
// Original set a value that does not seems to be used anywhere
return true;
@@ -178,7 +180,7 @@ void VideoPlayer::play(Common::String filename, bool showSubtitles) {
// TODO check flags and setup volume panning
// Load subtitles
- if (showSubtitles)
+ if (showSubtitles && !_vm->checkGameVersion("Demo"))
loadSubtitles();
// Setup playing
@@ -189,9 +191,10 @@ void VideoPlayer::play(Common::String filename, bool showSubtitles) {
int32 currentSubtitle = 0;
_decoder->start();
+
if (_vm->checkGameVersion("Steam") || _vm->isAltDemo()) {
- _vm->_system->showOverlay();
- _vm->_system->clearOverlay();
+ Graphics::PixelFormat decoderFormat = _decoder->getPixelFormat();
+ initGraphics(640, 480, &decoderFormat);
}
while (!_done && !Engine::shouldQuit() && !_decoder->endOfVideo()) {
@@ -203,13 +206,8 @@ void VideoPlayer::play(Common::String filename, bool showSubtitles) {
if (!frame)
continue;
- if (_vm->checkGameVersion("Steam")) {
- _vm->_system->copyRectToOverlay((const byte *)frame->getPixels(), frame->pitch, x, y, frame->w, frame->h);
- } else if (_vm->isAltDemo()) {
- Graphics::Surface *frame1 = frame->convertTo(_vm->_system->getOverlayFormat());
- _vm->_system->copyRectToOverlay((const byte *)frame1->getPixels(), frame1->pitch, x, y, frame1->w, frame1->h);
- frame1->free();
- delete frame1;
+ if (_vm->checkGameVersion("Steam") || _vm->isAltDemo()) {
+ g_system->copyRectToScreen((const byte *)frame->getPixels(), frame->pitch, x, y, frame->w, frame->h);
} else {
if (_decoder->hasDirtyPalette())
setupPalette();
@@ -235,15 +233,18 @@ void VideoPlayer::play(Common::String filename, bool showSubtitles) {
_vm->notify(EVENT_ASYLUM_SUBTITLE, currentSubtitle, 1);
}
- getScreen()->copyBackBufferToScreen();
+ if (!_vm->checkGameVersion("Steam") && !_vm->isAltDemo())
+ getScreen()->copyBackBufferToScreen();
g_system->updateScreen();
}
- g_system->delayMillis(10);
+
+ if (!_vm->checkGameVersion("Steam") && !_vm->isAltDemo())
+ g_system->delayMillis(10);
}
if (_vm->checkGameVersion("Steam") || _vm->isAltDemo())
- _vm->_system->hideOverlay();
+ initGraphics(640, 480);
_decoder->close();
_subtitles.clear();
Commit: 5708f630f7c528b3483f8180011ab1298d799a5e
https://github.com/scummvm/scummvm/commit/5708f630f7c528b3483f8180011ab1298d799a5e
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-09-14T12:43:56+03:00
Commit Message:
ASYLUM: patch Chapter 2 Lockout bug
Changed paths:
engines/asylum/resources/script.cpp
engines/asylum/resources/worldstats.cpp
diff --git a/engines/asylum/resources/script.cpp b/engines/asylum/resources/script.cpp
index de35270bfe..40f913aff1 100644
--- a/engines/asylum/resources/script.cpp
+++ b/engines/asylum/resources/script.cpp
@@ -261,6 +261,13 @@ void ScriptManager::load(Common::SeekableReadStream *stream) {
_scripts.push_back(script);
}
+
+ // Patch for Chapter 2 Lockout bug
+ if (_vm->checkGameVersion("Unpatched") && getWorld()->chapter == kChapter2) {
+ _scripts[ 3].commands[ 2].param1 = 1506;
+ _scripts[34].commands[13].param1 = 453;
+ _scripts[43].commands[ 9].param1 = 455;
+ }
}
void ScriptManager::saveLoadWithSerializer(Common::Serializer &s) {
diff --git a/engines/asylum/resources/worldstats.cpp b/engines/asylum/resources/worldstats.cpp
index 1a19d10dcd..9f8ed31fa7 100644
--- a/engines/asylum/resources/worldstats.cpp
+++ b/engines/asylum/resources/worldstats.cpp
@@ -271,6 +271,14 @@ load_inventory:
if (_vm->checkGameVersion("Demo"))
return;
+ // Patch for Chapter 2 Lockout bug
+ if (_vm->checkGameVersion("Unpatched") && chapter == kChapter2) {
+ ActionArea *area978 = actions[getActionAreaIndexById(978)];
+ area978->flagNums[0] = -556;
+ area978->flagNums[1] = -368;
+ area978->flagNums[2] = -50;
+ }
+
stream->seek((ACTIONS_MAX_COUNT - numActions) * ACTIONS_SIZE, SEEK_CUR);
field_E848C = stream->readSint32LE();
More information about the Scummvm-git-logs
mailing list