aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/video_v2.cpp
diff options
context:
space:
mode:
authorSven Hesse2007-01-29 17:04:37 +0000
committerSven Hesse2007-01-29 17:04:37 +0000
commit36a54218b16cef112909bb5362f5d85615368fab (patch)
tree867039305d23d9a71da10c93a1a223d4318487f9 /engines/gob/video_v2.cpp
parent9a7c1c9baf56f28e78acdff45bf6d573daa89a2f (diff)
downloadscummvm-rg350-36a54218b16cef112909bb5362f5d85615368fab.tar.gz
scummvm-rg350-36a54218b16cef112909bb5362f5d85615368fab.tar.bz2
scummvm-rg350-36a54218b16cef112909bb5362f5d85615368fab.zip
- Another attempt at fixing the immediately-closing notepad heisenbug (#1621089)
- Implemented wide surfaces + scrolling - Some clean-up svn-id: r25253
Diffstat (limited to 'engines/gob/video_v2.cpp')
-rw-r--r--engines/gob/video_v2.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp
index f11b94de93..ce5cfa938e 100644
--- a/engines/gob/video_v2.cpp
+++ b/engines/gob/video_v2.cpp
@@ -40,7 +40,8 @@ Video_v2::Video_v2(GobEngine *vm) : Video_v1(vm) {
void Video_v2::waitRetrace(int16) {
CursorMan.showMouse((_vm->_draw->_showCursor & 2) != 0);
if (_vm->_draw->_frontSurface) {
- g_system->copyRectToScreen(_vm->_draw->_frontSurface->vidPtr, 320, 0, 0, 320, 200);
+ g_system->copyRectToScreen(_vm->_draw->_frontSurface->vidPtr + _scrollOffset,
+ _surfWidth, 0, 0, 320, 200);
g_system->updateScreen();
}
}
@@ -97,7 +98,7 @@ Video::SurfaceDesc *Video_v2::initSurfDesc(int16 vidMode, int16 width, int16 hei
if (flags & RETURN_PRIMARY)
return _vm->_draw->_frontSurface;
- if (vidMode != 0x13)
+ if ((vidMode != 0x13) && (vidMode != 0x14))
error("Video::initSurfDesc: Only VGA 0x13 mode is supported!");
if ((flags & PRIMARY_SURFACE) == 0)
@@ -129,8 +130,8 @@ Video::SurfaceDesc *Video_v2::initSurfDesc(int16 vidMode, int16 width, int16 hei
assert(descPtr);
if (descPtr->vidPtr != 0)
delete[] descPtr->vidPtr;
- vidMem = new byte[320 * 200];
- memset(vidMem, 0, 64000);
+ vidMem = new byte[_surfWidth * 200];
+ memset(vidMem, 0, _surfWidth * 200);
} else {
if (flags & DISABLE_SPR_ALLOC) {
descPtr = new SurfaceDesc;
@@ -177,7 +178,7 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
if (!destDesc)
return 1;
- if ((destDesc->vidMode & 0x7f) != 0x13)
+ if (((destDesc->vidMode & 0x7f) != 0x13) && ((destDesc->vidMode & 0x7f) != 0x14))
error("Video::spriteUncompressor: Video mode 0x%x is not supported!",
destDesc->vidMode & 0x7f);
@@ -203,12 +204,6 @@ char Video_v2::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
srcPtr = sprBuf + 3;
sourceLeft = READ_LE_UINT32(srcPtr);
- // TODO: Needed until wide/scrolling surfaces are supported...
- if ((x + srcWidth) >= destDesc->width)
- x = 0;
- if ((y + srcHeight) >= destDesc->height)
- y = 0;
-
destPtr = destDesc->vidPtr + destDesc->width * y + x;
curWidth = 0;