aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2007-06-21 05:10:42 +0000
committerTravis Howell2007-06-21 05:10:42 +0000
commit64cafa0270e0e912c3efe04b660e264833a3e7f8 (patch)
tree787c5e7be5fc441095d7487bcbdd254b4e78ad89 /engines
parent89b2cf75e22fd76b48e9e27d70ba617d5b2468b6 (diff)
downloadscummvm-rg350-64cafa0270e0e912c3efe04b660e264833a3e7f8.tar.gz
scummvm-rg350-64cafa0270e0e912c3efe04b660e264833a3e7f8.tar.bz2
scummvm-rg350-64cafa0270e0e912c3efe04b660e264833a3e7f8.zip
Fix regressions, due to buffer changes and cleanup.
svn-id: r27578
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.h7
-rw-r--r--engines/agos/animation.cpp9
-rw-r--r--engines/agos/draw.cpp33
-rw-r--r--engines/agos/gfx.cpp2
-rw-r--r--engines/agos/vga.cpp2
-rw-r--r--engines/agos/vga_ww.cpp8
6 files changed, 38 insertions, 23 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 7858cf99dd..8fb80810c4 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1158,7 +1158,7 @@ protected:
void restoreBackGround();
void saveBackGround(VgaSprite *vsp);
- void clearSurfaces(uint num_lines);
+ void clearSurfaces();
void displayScreen();
void dumpVideoScript(const byte *src, bool one_opcode_only);
@@ -1169,7 +1169,10 @@ protected:
void dumpSingleBitmap(int file, int image, const byte *offs, int w, int h, byte base);
void dumpBitmap(const char *filename, const byte *offs, int w, int h, int flags, const byte *palette, byte base);
- void fillBackGroundFromBack(uint lines);
+ void fillBackFromBackGround(uint16 height, uint16 width);
+ void fillBackFromFront();
+ void fillBackGroundFromBack();
+ void fillBackGroundFromFront();
virtual void doOutput(const byte *src, uint len);
void clsCheck(WindowBlock *window);
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index c36af7aa9c..8748cff54e 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -141,7 +141,7 @@ void MoviePlayer::play() {
// Resolution is smaller in Amiga verison so always clear screen
if (_width == 384 && _height == 280) {
- _vm->_system->clearScreen();
+ _vm->clearSurfaces();
}
_ticks = _vm->_system->getMillis();
@@ -156,16 +156,15 @@ void MoviePlayer::play() {
_vm->o_killAnimate();
if (_vm->getBitFlag(41)) {
- Graphics::Surface *screen = _vm->_system->lockScreen();
- memcpy(_vm->_backBuf, (byte *)screen->pixels, _frameSize);
- _vm->_system->unlockScreen();
+ _vm->fillBackFromFront();
} else {
uint8 palette[1024];
memset(palette, 0, sizeof(palette));
- _vm->clearSurfaces(480);
+ _vm->clearSurfaces();
_vm->_system->setPalette(palette, 0, 256);
}
+ _vm->fillBackGroundFromBack();
_vm->_fastFadeOutFlag = true;
}
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index af6597ca69..c11d864648 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -656,7 +656,7 @@ void AGOSEngine::scrollScreen() {
_scrollY += _scrollFlag;
vcWriteVar(250, _scrollY);
- memcpy(_backBuf, _backGroundBuf, _screenHeight * _scrollWidth);
+ fillBackFromBackGround(_screenHeight, _scrollWidth);
} else {
if (_scrollFlag < 0) {
memmove(dst + 8, dst, _screenWidth * _scrollHeight - 8);
@@ -684,7 +684,7 @@ void AGOSEngine::scrollScreen() {
if (getGameType() == GType_SIMON2) {
memcpy(_window4BackScn, _backGroundBuf, _scrollHeight * _screenWidth);
} else {
- memcpy(_backBuf, _backGroundBuf, _scrollHeight * _screenWidth);
+ fillBackFromBackGround(_scrollHeight, _screenWidth);
}
setMoveRect(0, 0, 320, _scrollHeight);
@@ -709,17 +709,32 @@ void AGOSEngine::scrollScreen() {
}
}
-void AGOSEngine::clearSurfaces(uint num_lines) {
- Graphics::Surface *screen = _system->lockScreen();
+void AGOSEngine::clearSurfaces() {
+ _system->clearScreen();
- memset((byte *)screen->pixels, 0, num_lines * _screenWidth);
- memset(_backBuf, 0, num_lines * _screenWidth);
+ if (_backBuf) {
+ memset(_backBuf, 0, _screenHeight * _screenWidth);
+ }
+}
+
+void AGOSEngine::fillBackFromBackGround(uint16 height, uint16 width) {
+ memcpy(_backBuf, _backGroundBuf, height * width);
+}
+void AGOSEngine::fillBackFromFront() {
+ Graphics::Surface *screen = _system->lockScreen();
+ memcpy(_backBuf, (byte *)screen->pixels, _screenHeight * _screenWidth);
_system->unlockScreen();
}
-void AGOSEngine::fillBackGroundFromBack(uint lines) {
- memcpy(_backGroundBuf, _backBuf, lines * _screenWidth);
+void AGOSEngine::fillBackGroundFromBack() {
+ memcpy(_backGroundBuf, _backBuf, _screenHeight * _screenWidth);
+}
+
+void AGOSEngine::fillBackGroundFromFront() {
+ Graphics::Surface *screen = _system->lockScreen();
+ memcpy(_backGroundBuf, (byte *)screen->pixels, _screenHeight * _screenWidth);
+ _system->unlockScreen();
}
void AGOSEngine::setMoveRect(uint16 x, uint16 y, uint16 width, uint16 height) {
@@ -750,7 +765,7 @@ void AGOSEngine::displayScreen() {
memcpy((byte *)screen->pixels, getBackBuf(), _screenWidth * _screenHeight);
if (getGameId() != GID_DIMP)
- memcpy(getBackBuf(), getBackGround(), _screenWidth * _screenHeight);
+ fillBackFromBackGround(_screenHeight, _screenWidth);
} else {
if (_window4Flag == 2) {
_window4Flag = 0;
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 28c10c0f1e..2b530fdcd6 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -1301,7 +1301,7 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vga_res_id) {
setImage(vga_res_id);
if (getGameType() == GType_FF || getGameType() == GType_PP) {
- fillBackGroundFromBack(_screenHeight);
+ fillBackGroundFromBack();
_syncFlag2 = 1;
} else {
_copyScnFlag = 2;
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 4f400fa1fb..b5c4b1edbf 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -1217,7 +1217,7 @@ void AGOSEngine::vc36_setWindowImage() {
uint16 windowNum = vcReadNextWord();
if (getGameType() == GType_FF || getGameType() == GType_PP) {
- memcpy(_backGroundBuf, _backBuf, _screenHeight * _screenWidth);
+ fillBackGroundFromFront();
} else {
setWindowImage(windowNum, vga_res);
}
diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp
index a14129cc72..cd39e2dc8a 100644
--- a/engines/agos/vga_ww.cpp
+++ b/engines/agos/vga_ww.cpp
@@ -234,13 +234,11 @@ void AGOSEngine::vc62_fastFadeOut() {
delay(5);
}
- if (getGameType() == GType_FF || getGameType() == GType_PP) {
- clearSurfaces(_screenHeight);
- } else if (getGameType() == GType_WW) {
- _system->clearScreen();
+ if (getGameType() == GType_WW || getGameType() == GType_FF || getGameType() == GType_PP) {
+ clearSurfaces();
} else {
if (_windowNum != 4) {
- _system->clearScreen();
+ clearSurfaces();
}
}
}