[Scummvm-git-logs] scummvm master -> fa2c913d04025d02e45de89fdcc525597efc2d5a
alxpnv
a04198622 at gmail.com
Tue Oct 19 12:16:29 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
110af4fae4 ASYLUM: slow down puzzle animations
b1adfb3f25 ASYLUM: fix Load Game screen shaking
5fc91f2682 ASYLUM: fix Theora playback in OpenGL mode
fa2c913d04 ASYLUM: add workaround for multipage dialogs
Commit: 110af4fae432125d8e7ce1c6688df0c5cf87b636
https://github.com/scummvm/scummvm/commit/110af4fae432125d8e7ce1c6688df0c5cf87b636
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-10-19T15:18:26+03:00
Commit Message:
ASYLUM: slow down puzzle animations
Changed paths:
engines/asylum/puzzles/board.cpp
engines/asylum/puzzles/board.h
engines/asylum/puzzles/clock.cpp
engines/asylum/puzzles/clock.h
engines/asylum/puzzles/fisherman.cpp
engines/asylum/puzzles/fisherman.h
engines/asylum/puzzles/hivecontrol.cpp
engines/asylum/puzzles/hivecontrol.h
engines/asylum/puzzles/hivemachine.cpp
engines/asylum/puzzles/hivemachine.h
engines/asylum/puzzles/morguedoor.cpp
engines/asylum/puzzles/morguedoor.h
engines/asylum/puzzles/pipes.cpp
engines/asylum/puzzles/pipes.h
engines/asylum/puzzles/puzzle.cpp
engines/asylum/puzzles/puzzle.h
engines/asylum/puzzles/tictactoe.cpp
engines/asylum/puzzles/tictactoe.h
engines/asylum/puzzles/timemachine.cpp
engines/asylum/puzzles/timemachine.h
engines/asylum/puzzles/vcr.cpp
engines/asylum/puzzles/vcr.h
engines/asylum/puzzles/wheel.cpp
engines/asylum/puzzles/wheel.h
engines/asylum/system/screen.h
diff --git a/engines/asylum/puzzles/board.cpp b/engines/asylum/puzzles/board.cpp
index 06784ff487..07a1fb5a80 100644
--- a/engines/asylum/puzzles/board.cpp
+++ b/engines/asylum/puzzles/board.cpp
@@ -106,19 +106,12 @@ void PuzzleBoard::updateScreen() {
getScreen()->draw(getWorld()->graphicResourceIds[_data.backgroundIndex]);
drawText();
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
-}
-
-bool PuzzleBoard::update(const AsylumEvent &) {
- updateCursor();
-
if (!_solved)
playSound();
if (_vm->isGameFlagNotSet(_data.gameFlag)) {
if (strcmp(_solvedText, _data.solvedText))
- return true;
+ return;
if (_solved) {
if (!getSound()->isPlaying(MAKE_RESOURCE(kResourcePackSpeech, 1))) {
@@ -134,8 +127,6 @@ bool PuzzleBoard::update(const AsylumEvent &) {
getSound()->playSound(MAKE_RESOURCE(kResourcePackSpeech, 1), false, Config.voiceVolume);
}
}
-
- return true;
}
bool PuzzleBoard::mouseRightDown(const AsylumEvent &) {
diff --git a/engines/asylum/puzzles/board.h b/engines/asylum/puzzles/board.h
index a3b1afe9df..6969b2116c 100644
--- a/engines/asylum/puzzles/board.h
+++ b/engines/asylum/puzzles/board.h
@@ -85,7 +85,6 @@ private:
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
bool activate(const AsylumEvent &evt) { return updateScreen(), true; }
- bool update(const AsylumEvent &evt);
virtual bool mouseRightDown(const AsylumEvent &evt);
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/asylum/puzzles/clock.cpp b/engines/asylum/puzzles/clock.cpp
index c23fbf77d4..ac8c40f1df 100644
--- a/engines/asylum/puzzles/clock.cpp
+++ b/engines/asylum/puzzles/clock.cpp
@@ -85,7 +85,7 @@ bool PuzzleClock::init(const AsylumEvent &) {
return true;
}
-bool PuzzleClock::update(const AsylumEvent &evt) {
+void PuzzleClock::updateScreen() {
// Draw elements
getScreen()->clearGraphicsInQueue();
getScreen()->draw(getWorld()->graphicResourceIds[5]);
@@ -108,18 +108,15 @@ bool PuzzleClock::update(const AsylumEvent &evt) {
_frameIndexes[2] %= GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[3]);
}
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
-
if (_rightButtonClicked) {
getScreen()->clear();
_vm->switchEventHandler(getScene());
} else {
- if (_vm->isGameFlagSet(kGameFlag511))
+ if (_vm->isGameFlagSet(kGameFlag511)) {
+ AsylumEvent evt;
mouseRightDown(evt);
+ }
}
-
- return true;
}
bool PuzzleClock::mouseLeftDown(const AsylumEvent &) {
diff --git a/engines/asylum/puzzles/clock.h b/engines/asylum/puzzles/clock.h
index 88bb381218..9ef50929b1 100644
--- a/engines/asylum/puzzles/clock.h
+++ b/engines/asylum/puzzles/clock.h
@@ -48,7 +48,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/fisherman.cpp b/engines/asylum/puzzles/fisherman.cpp
index d7f16ca9f4..475b6f5164 100644
--- a/engines/asylum/puzzles/fisherman.cpp
+++ b/engines/asylum/puzzles/fisherman.cpp
@@ -87,9 +87,7 @@ bool PuzzleFisherman::init(const AsylumEvent &evt) {
return mouseLeftDown(evt);
}
-bool PuzzleFisherman::update(const AsylumEvent &) {
- updateCursor();
-
+void PuzzleFisherman::updateScreen() {
// Draw background
getScreen()->clearGraphicsInQueue();
getScreen()->fillRect(0, 0, 640, 480, 251);
@@ -101,10 +99,7 @@ bool PuzzleFisherman::update(const AsylumEvent &) {
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[40 + i], 0, &puzzleFishermanPolygons[i], kDrawFlagNone, 0, 1);
}
- getScreen()->drawGraphicsInQueue();
-
_allowClick = true;
- getScreen()->copyBackBufferToScreen();
if (_resetPressed) {
++_pauseTimer;
@@ -137,8 +132,6 @@ bool PuzzleFisherman::update(const AsylumEvent &) {
_vm->switchEventHandler(getScene());
}
}
-
- return true;
}
bool PuzzleFisherman::mouseLeftDown(const AsylumEvent &evt) {
diff --git a/engines/asylum/puzzles/fisherman.h b/engines/asylum/puzzles/fisherman.h
index dd5961a549..e2bf76933b 100644
--- a/engines/asylum/puzzles/fisherman.h
+++ b/engines/asylum/puzzles/fisherman.h
@@ -49,7 +49,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool key(const AsylumEvent &evt) { return keyExit(evt); }
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/hivecontrol.cpp b/engines/asylum/puzzles/hivecontrol.cpp
index cf666a3a5a..2744b91419 100644
--- a/engines/asylum/puzzles/hivecontrol.cpp
+++ b/engines/asylum/puzzles/hivecontrol.cpp
@@ -129,25 +129,6 @@ bool PuzzleHiveControl::init(const AsylumEvent &) {
return true;
}
-bool PuzzleHiveControl::update(const AsylumEvent &evt) {
- updateCursor();
- updateScreen();
-
- if (!_data_457260 && !_data_457264)
- playSound();
-
- if (_counter) {
- if (_counter < 30 || getSound()->isPlaying(getWorld()->graphicResourceIds[83])) {
- ++_counter;
- } else {
- mouseRightDown(evt);
- getCursor()->show();
- }
- }
-
- return true;
-}
-
bool PuzzleHiveControl::mouseLeftDown(const AsylumEvent &) {
if (_currentControl != kControlNone)
return true;
@@ -334,7 +315,6 @@ Control PuzzleHiveControl::findControl() {
}
void PuzzleHiveControl::updateScreen() {
- getScreen()->clear();
getScreen()->clearGraphicsInQueue();
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[28], 0, Common::Point(0, 0), kDrawFlagNone, 0, 3);
@@ -461,8 +441,18 @@ void PuzzleHiveControl::updateScreen() {
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[kElementSwirlRim], _frameIndexes[kElementSwirlRim], Common::Point(458, 278), kDrawFlagNone, 0, 2);
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
+ if (!_data_457260 && !_data_457264)
+ playSound();
+
+ if (_counter) {
+ if (_counter < 30 || getSound()->isPlaying(getWorld()->graphicResourceIds[83])) {
+ ++_counter;
+ } else {
+ AsylumEvent evt;
+ mouseRightDown(evt);
+ getCursor()->show();
+ }
+ }
}
void PuzzleHiveControl::playSound() {
diff --git a/engines/asylum/puzzles/hivecontrol.h b/engines/asylum/puzzles/hivecontrol.h
index 9cf9553aff..c324fdc3b2 100644
--- a/engines/asylum/puzzles/hivecontrol.h
+++ b/engines/asylum/puzzles/hivecontrol.h
@@ -103,7 +103,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
@@ -112,7 +112,6 @@ private:
//////////////////////////////////////////////////////////////////////////
void updateCursor();
Control findControl();
- void updateScreen();
void playSound();
void reset();
bool hitTest1(Control control, const Common::Point &point, const Common::Point &location);
diff --git a/engines/asylum/puzzles/hivemachine.cpp b/engines/asylum/puzzles/hivemachine.cpp
index 2b1b578767..78e5232f52 100644
--- a/engines/asylum/puzzles/hivemachine.cpp
+++ b/engines/asylum/puzzles/hivemachine.cpp
@@ -68,13 +68,6 @@ bool PuzzleHiveMachine::init(const AsylumEvent &) {
return true;
}
-bool PuzzleHiveMachine::update(const AsylumEvent &) {
- updateScreen();
- updateCursor();
-
- return true;
-}
-
bool PuzzleHiveMachine::mouseLeftDown(const AsylumEvent &) {
if (_rectIndex != -1 && _counterRed == 0) {
_soundingNote = MusicalNote(_rectIndex);
@@ -149,7 +142,6 @@ int32 PuzzleHiveMachine::findRect() {
}
void PuzzleHiveMachine::updateScreen() {
- getScreen()->clear();
getScreen()->clearGraphicsInQueue();
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[8], 0, Common::Point(0, 0), kDrawFlagNone, 0, 2);
@@ -195,9 +187,6 @@ void PuzzleHiveMachine::updateScreen() {
_frameIndex = (_frameIndex + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[13]);
if (_counterKey)
_frameIndex1 = (_frameIndex1 + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[18]);
-
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
}
void PuzzleHiveMachine::playSound() {
diff --git a/engines/asylum/puzzles/hivemachine.h b/engines/asylum/puzzles/hivemachine.h
index 29b2d04425..b7a96fcd97 100644
--- a/engines/asylum/puzzles/hivemachine.h
+++ b/engines/asylum/puzzles/hivemachine.h
@@ -58,7 +58,6 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/morguedoor.cpp b/engines/asylum/puzzles/morguedoor.cpp
index 228fa59dcd..432106640f 100644
--- a/engines/asylum/puzzles/morguedoor.cpp
+++ b/engines/asylum/puzzles/morguedoor.cpp
@@ -102,9 +102,7 @@ bool PuzzleMorgueDoor::init(const AsylumEvent &evt) {
return mouseLeftDown(evt);
}
-bool PuzzleMorgueDoor::update(const AsylumEvent &) {
- updateCursor();
-
+void PuzzleMorgueDoor::updateScreen() {
// Draw elements
getScreen()->clearGraphicsInQueue();
getScreen()->fillRect(0, 0, 640, 480, 252);
@@ -128,12 +126,7 @@ bool PuzzleMorgueDoor::update(const AsylumEvent &) {
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[31], (uint32)_frameIndexes[kTopGear], Common::Point(276, 67), kDrawFlagNone, 0, 1);
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[32], (uint32)_frameIndexes[kBottomGear], Common::Point(278, 378), kDrawFlagNone, 0, 1);
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
-
updateState();
-
- return true;
}
bool PuzzleMorgueDoor::mouseLeftDown(const AsylumEvent &evt) {
diff --git a/engines/asylum/puzzles/morguedoor.h b/engines/asylum/puzzles/morguedoor.h
index 6f5fb97e65..d617dcafc0 100644
--- a/engines/asylum/puzzles/morguedoor.h
+++ b/engines/asylum/puzzles/morguedoor.h
@@ -75,7 +75,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool key(const AsylumEvent &evt) { return keyExit(evt); }
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightUp(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/pipes.cpp b/engines/asylum/puzzles/pipes.cpp
index d2ec5a7317..732494b1b5 100644
--- a/engines/asylum/puzzles/pipes.cpp
+++ b/engines/asylum/puzzles/pipes.cpp
@@ -338,8 +338,7 @@ bool PuzzlePipes::init(const AsylumEvent &) {
return true;
}
-bool PuzzlePipes::update(const AsylumEvent &) {
- getScreen()->clear();
+void PuzzlePipes::updateScreen() {
getScreen()->clearGraphicsInQueue();
getScreen()->addGraphicToQueue(getWorld()->graphicResourceIds[1], 0, Common::Point(0, 0), kDrawFlagNone, 0, 4);
@@ -420,10 +419,6 @@ bool PuzzlePipes::update(const AsylumEvent &) {
}
}
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
- updateCursor();
-
if (_isLeverReady) {
if (!_levelFlags[4])
_vm->setGameFlag((GameFlag)(96 + checkFlags()));
@@ -433,8 +428,6 @@ bool PuzzlePipes::update(const AsylumEvent &) {
_vm->switchEventHandler(getScene());
}
-
- return true;
}
bool PuzzlePipes::mouseLeftDown(const AsylumEvent &) {
diff --git a/engines/asylum/puzzles/pipes.h b/engines/asylum/puzzles/pipes.h
index 761cca9bfc..518ea2ffd3 100644
--- a/engines/asylum/puzzles/pipes.h
+++ b/engines/asylum/puzzles/pipes.h
@@ -186,7 +186,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/puzzle.cpp b/engines/asylum/puzzles/puzzle.cpp
index 1d2bd5eafb..bf5ad06d0a 100644
--- a/engines/asylum/puzzles/puzzle.cpp
+++ b/engines/asylum/puzzles/puzzle.cpp
@@ -78,6 +78,33 @@ bool Puzzle::handleEvent(const AsylumEvent &evt) {
return false;
}
+bool Puzzle::update(const AsylumEvent &evt) {
+ uint32 ticks = _vm->getTick();
+
+ updateCursor();
+
+ if (!getSharedData()->getFlag(kFlagRedraw)) {
+ updateScreen();
+
+ getSharedData()->setFlag(kFlagRedraw, true);
+ }
+
+ if (ticks > getSharedData()->getNextScreenUpdate()) {
+ if (getSharedData()->getFlag(kFlagRedraw)) {
+ if (!getScreen()->isGraphicQueueEmpty())
+ getScreen()->drawGraphicsInQueue();
+ getScreen()->copyBackBufferToScreen();
+
+ getSharedData()->setEventUpdate(getSharedData()->getEventUpdate() ^ 1);
+
+ getSharedData()->setFlag(kFlagRedraw, false);
+ getSharedData()->setNextScreenUpdate(ticks + 55);
+ }
+ }
+
+ return true;
+}
+
bool Puzzle::keyExit(const AsylumEvent &evt) {
_vm->switchEventHandler(getScene());
diff --git a/engines/asylum/puzzles/puzzle.h b/engines/asylum/puzzles/puzzle.h
index 8d766dd8f6..fef3a1c13f 100644
--- a/engines/asylum/puzzles/puzzle.h
+++ b/engines/asylum/puzzles/puzzle.h
@@ -56,7 +56,9 @@ protected:
// Event Handling
//////////////////////////////////////////////////////////////////////////
virtual bool init(const AsylumEvent &evt) = 0;
- virtual bool update(const AsylumEvent &evt) = 0;
+ virtual bool update(const AsylumEvent &evt);
+ virtual void updateScreen() {};
+ virtual void updateCursor() {};
virtual bool activate(const AsylumEvent &evt) { return true; }
virtual bool key(const AsylumEvent &evt) { return true; }
virtual bool mouseLeftUp(const AsylumEvent &evt) { return true; }
diff --git a/engines/asylum/puzzles/tictactoe.cpp b/engines/asylum/puzzles/tictactoe.cpp
index 6afa5cca5d..4537e459a6 100644
--- a/engines/asylum/puzzles/tictactoe.cpp
+++ b/engines/asylum/puzzles/tictactoe.cpp
@@ -114,7 +114,7 @@ bool PuzzleTicTacToe::init(const AsylumEvent &) {
return true;
}
-bool PuzzleTicTacToe::update(const AsylumEvent &) {
+void PuzzleTicTacToe::updateScreen() {
if (_ticker) {
++_ticker;
@@ -137,10 +137,6 @@ bool PuzzleTicTacToe::update(const AsylumEvent &) {
getScreen()->draw(getWorld()->graphicResourceIds[0]);
drawField();
getScene()->updateAmbientSounds();
-
- getScreen()->copyBackBufferToScreen();
-
- return true;
}
bool PuzzleTicTacToe::mouseLeftDown(const AsylumEvent &evt) {
diff --git a/engines/asylum/puzzles/tictactoe.h b/engines/asylum/puzzles/tictactoe.h
index eebfade0d1..f6b9e7d92d 100644
--- a/engines/asylum/puzzles/tictactoe.h
+++ b/engines/asylum/puzzles/tictactoe.h
@@ -59,7 +59,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool key(const AsylumEvent &evt) { return keyExit(evt); }
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/timemachine.cpp b/engines/asylum/puzzles/timemachine.cpp
index f996b08a1e..362198472d 100644
--- a/engines/asylum/puzzles/timemachine.cpp
+++ b/engines/asylum/puzzles/timemachine.cpp
@@ -124,9 +124,7 @@ bool PuzzleTimeMachine::init(const AsylumEvent &evt) {
return true;
}
-bool PuzzleTimeMachine::update(const AsylumEvent &) {
- updateCursor();
-
+void PuzzleTimeMachine::updateScreen() {
// Draw screen elements
getScreen()->clearGraphicsInQueue();
getScreen()->fillRect(0, 0, 640, 480, 115);
@@ -172,10 +170,6 @@ bool PuzzleTimeMachine::update(const AsylumEvent &) {
_leftButtonClicked = true;
- // Draw to screen
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
-
// Check for puzzle completion
if (_counter > 30 && _vm->isGameFlagSet(kGameFlag925)) {
getCursor()->hide();
@@ -201,8 +195,6 @@ bool PuzzleTimeMachine::update(const AsylumEvent &) {
_frameIndexes[5] = (_frameIndexes[5] + 1) % _frameCounts[5];
}
-
- return true;
}
bool PuzzleTimeMachine::mouseLeftDown(const AsylumEvent &evt) {
diff --git a/engines/asylum/puzzles/timemachine.h b/engines/asylum/puzzles/timemachine.h
index 3472af890a..fdcc16dd69 100644
--- a/engines/asylum/puzzles/timemachine.h
+++ b/engines/asylum/puzzles/timemachine.h
@@ -60,7 +60,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool key(const AsylumEvent &evt) { return keyExit(evt); }
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/puzzles/vcr.cpp b/engines/asylum/puzzles/vcr.cpp
index 840a8703dd..e4f14b26e1 100644
--- a/engines/asylum/puzzles/vcr.cpp
+++ b/engines/asylum/puzzles/vcr.cpp
@@ -86,29 +86,6 @@ bool PuzzleVCR::init(const AsylumEvent &) {
return true;
}
-bool PuzzleVCR::update(const AsylumEvent &evt) {
- uint32 ticks = _vm->getTick();
-
- if (!getSharedData()->getFlag(kFlagRedraw)) {
- updateScreen(evt);
-
- getSharedData()->setFlag(kFlagRedraw, true);
- }
-
- if (ticks > getSharedData()->getNextScreenUpdate()) {
- if (getSharedData()->getFlag(kFlagRedraw)) {
- getScreen()->copyBackBufferToScreen();
-
- getSharedData()->setEventUpdate(getSharedData()->getEventUpdate() ^ 1);
-
- getSharedData()->setFlag(kFlagRedraw, false);
- getSharedData()->setNextScreenUpdate(ticks + 55);
- }
- }
-
- return true;
-}
-
bool PuzzleVCR::key(const AsylumEvent &evt) {
getSound()->stop(getWorld()->graphicResourceIds[47]);
getScreen()->clearGraphicsInQueue();
@@ -297,9 +274,7 @@ bool PuzzleVCR::mouseRightDown(const AsylumEvent &) {
//////////////////////////////////////////////////////////////////////////
// Drawing
//////////////////////////////////////////////////////////////////////////
-void PuzzleVCR::updateScreen(const AsylumEvent &) {
- updateCursor();
-
+void PuzzleVCR::updateScreen() {
// Draw background
getScreen()->clearGraphicsInQueue();
getScreen()->fillRect(0, 0, 640, 480, 252);
@@ -324,7 +299,6 @@ void PuzzleVCR::updateScreen(const AsylumEvent &) {
if (_isAccomplished) {
getCursor()->show();
getScreen()->draw(getWorld()->graphicResourceIds[0]);
- getScreen()->drawGraphicsInQueue();
getScreen()->clearDefaultColor();
for (int16 barSize = 0; barSize < 84; barSize += 4) {
@@ -356,8 +330,6 @@ void PuzzleVCR::updateScreen(const AsylumEvent &) {
int paletteId = _vm->checkGameVersion("Demo") ? 20 : 28;
getScreen()->setPalette(MAKE_RESOURCE(kResourcePackTowerCells, paletteId));
getScreen()->setGammaLevel(MAKE_RESOURCE(kResourcePackTowerCells, paletteId));
- } else {
- getScreen()->drawGraphicsInQueue();
}
}
diff --git a/engines/asylum/puzzles/vcr.h b/engines/asylum/puzzles/vcr.h
index 97fd729c0d..182cf63d44 100644
--- a/engines/asylum/puzzles/vcr.h
+++ b/engines/asylum/puzzles/vcr.h
@@ -106,7 +106,6 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
bool key(const AsylumEvent &evt);
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseLeftUp(const AsylumEvent &evt);
@@ -115,7 +114,7 @@ private:
//////////////////////////////////////////////////////////////////////////
// Drawing
//////////////////////////////////////////////////////////////////////////
- void updateScreen(const AsylumEvent &evt);
+ void updateScreen();
void updateCursor();
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/asylum/puzzles/wheel.cpp b/engines/asylum/puzzles/wheel.cpp
index 1e129db2fb..aa3ff5aa27 100644
--- a/engines/asylum/puzzles/wheel.cpp
+++ b/engines/asylum/puzzles/wheel.cpp
@@ -128,9 +128,7 @@ bool PuzzleWheel::init(const AsylumEvent &) {
return true;
}
-bool PuzzleWheel::update(const AsylumEvent &) {
- updateCursor();
-
+void PuzzleWheel::updateScreen() {
getScreen()->clearGraphicsInQueue();
getScreen()->draw(getWorld()->graphicResourceIds[0]);
@@ -251,13 +249,9 @@ bool PuzzleWheel::update(const AsylumEvent &) {
//////////////////////////////////////////////////////////////////////////
// Show elements on screen
getScene()->drawRain();
- getScreen()->drawGraphicsInQueue();
- getScreen()->copyBackBufferToScreen();
// Check for completion
checkFlags();
-
- return true;
}
bool PuzzleWheel::mouseLeftDown(const AsylumEvent &) {
diff --git a/engines/asylum/puzzles/wheel.h b/engines/asylum/puzzles/wheel.h
index fcbd93b307..7098dd9594 100644
--- a/engines/asylum/puzzles/wheel.h
+++ b/engines/asylum/puzzles/wheel.h
@@ -55,7 +55,7 @@ private:
// Event Handling
//////////////////////////////////////////////////////////////////////////
bool init(const AsylumEvent &evt);
- bool update(const AsylumEvent &evt);
+ void updateScreen();
bool mouseLeftDown(const AsylumEvent &evt);
bool mouseRightDown(const AsylumEvent &evt);
diff --git a/engines/asylum/system/screen.h b/engines/asylum/system/screen.h
index a150d17d1b..1d8381768d 100644
--- a/engines/asylum/system/screen.h
+++ b/engines/asylum/system/screen.h
@@ -125,6 +125,7 @@ public:
void drawGraphicsInQueue();
void clearGraphicsInQueue();
void deleteGraphicFromQueue(ResourceId resourceId);
+ bool isGraphicQueueEmpty() { return _queueItems.empty(); }
// Used by Video
void copyToBackBuffer(const byte *buffer, int32 pitch, int16 x, int16 y, uint16 width, uint16 height, bool mirrored = false);
Commit: b1adfb3f25011d3ac0b71141170c8a4046be2802
https://github.com/scummvm/scummvm/commit/b1adfb3f25011d3ac0b71141170c8a4046be2802
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-10-19T15:18:26+03:00
Commit Message:
ASYLUM: fix Load Game screen shaking
Reported by Attx
Changed paths:
engines/asylum/views/menu.cpp
diff --git a/engines/asylum/views/menu.cpp b/engines/asylum/views/menu.cpp
index 62adc8bb7d..3f3b29b758 100644
--- a/engines/asylum/views/menu.cpp
+++ b/engines/asylum/views/menu.cpp
@@ -731,34 +731,42 @@ void Menu::showThumbnail(int index) {
int x, y;
int overlayWidth = g_system->getOverlayWidth(),
overlayHeight = g_system->getOverlayHeight();
- Graphics::Surface *screen, *screen1, *thumbnail1;
+ Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
+ Graphics::Surface overlay, *thumbnail1;
x = (index < 6 ? 150 : 470) * overlayWidth / 640;
y = (179 + (index % 6) * 29) * overlayHeight / 480;
- screen = getScreen()->getSurface().convertTo(g_system->getOverlayFormat(), getScreen()->getPalette());
- if (overlayWidth != 640 || overlayHeight != 480)
- screen1 = screen->scale(overlayWidth, overlayHeight);
- else
- screen1 = screen;
- thumbnail1 = thumbnail->convertTo(g_system->getOverlayFormat());
- screen1->copyRectToSurface(thumbnail1->getPixels(), thumbnail1->pitch, x, y, thumbnail1->w, thumbnail1->h);
+ overlay.create(overlayWidth, overlayHeight, overlayFormat);
+ if (!g_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) {
+ Graphics::Surface *screen = getScreen()->getSurface().convertTo(overlayFormat, getScreen()->getPalette());
+ overlay.copyRectToSurface(screen->getPixels(), screen->pitch, 0, 0, 640, 480);
+ screen->free();
+ delete screen;
+ }
+
+ thumbnail1 = thumbnail->convertTo(overlayFormat);
+ overlay.copyRectToSurface(thumbnail1->getPixels(), thumbnail1->pitch, x, y, thumbnail1->w, thumbnail1->h);
- g_system->copyRectToOverlay(screen1->getPixels(), screen1->pitch, 0, 0, screen1->w, screen1->h);
+ g_system->copyRectToOverlay(overlay.getPixels(), overlay.pitch, 0, 0, overlay.w, overlay.h);
g_system->showOverlay();
- screen->free();
- screen1->free();
+ overlay.free();
thumbnail1->free();
- if (screen != screen1)
- delete screen1;
- delete screen;
delete thumbnail1;
}
void Menu::updateLoadGame() {
Common::Point cursor = getCursor()->position();
+ if (g_system->isOverlayVisible()
+ && g_system->getFeatureState(OSystem::kFeatureFullscreenMode)
+ && ConfMan.get("gfx_mode") == "opengl") {
+
+ cursor.x *= 640.0 / g_system->getOverlayWidth();
+ cursor.y *= 480.0 / g_system->getOverlayHeight();
+ }
+
char text[100];
if (_dword_455C80) {
Commit: 5fc91f26827ab794fbfb76c2ae022435493b4df4
https://github.com/scummvm/scummvm/commit/5fc91f26827ab794fbfb76c2ae022435493b4df4
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-10-19T15:18:27+03:00
Commit Message:
ASYLUM: fix Theora playback in OpenGL mode
Changed paths:
engines/asylum/views/video.cpp
diff --git a/engines/asylum/views/video.cpp b/engines/asylum/views/video.cpp
index 893ae44378..4df557fb51 100644
--- a/engines/asylum/views/video.cpp
+++ b/engines/asylum/views/video.cpp
@@ -192,7 +192,8 @@ void VideoPlayer::play(const Common::String &filename, bool showSubtitles) {
_decoder->start();
if (_vm->checkGameVersion("Steam") || _vm->isAltDemo()) {
- Graphics::PixelFormat decoderFormat = _decoder->getPixelFormat();
+ Graphics::PixelFormat decoderFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ _decoder->setDefaultHighColorFormat(decoderFormat);
initGraphics(640, 480, &decoderFormat);
}
Commit: fa2c913d04025d02e45de89fdcc525597efc2d5a
https://github.com/scummvm/scummvm/commit/fa2c913d04025d02e45de89fdcc525597efc2d5a
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-10-19T15:18:27+03:00
Commit Message:
ASYLUM: add workaround for multipage dialogs
Reported by Attx
Changed paths:
engines/asylum/resources/encounters.cpp
diff --git a/engines/asylum/resources/encounters.cpp b/engines/asylum/resources/encounters.cpp
index 92d6753d28..34edcd4a4f 100644
--- a/engines/asylum/resources/encounters.cpp
+++ b/engines/asylum/resources/encounters.cpp
@@ -1193,6 +1193,10 @@ void Encounter::drawSubtitle(char *text, ResourceId font, int16 y) {
_data_455B3C = _data_455B70 / 8 + 1;
_data_455BF0 = 0;
_tick = _vm->getTick() + 1000 * (getResource()->get(_soundResourceId/*getSpeech()->getSoundResourceId()*/)->size / 11025) / (uint16)_data_455B3C; // TODO replace with speech
+
+ // WORKAROUND: Handle multipage dialogs
+ if (_data_455B70 - 1 > 8)
+ _tick -= 1000 * ((_data_455B70 - 1) % 8);
}
getText()->draw(_data_455BF0, 7, kTextCenter, Common::Point(x, y), 16, width, text);
More information about the Scummvm-git-logs
mailing list