aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-08 21:33:03 +0100
committerWillem Jan Palenstijn2015-12-23 21:33:58 +0100
commitcf020db741294c54dab66a0ed652bdee565d44d5 (patch)
treedb9f4307cf64712d8ccb0bd38d332366214c7086 /engines/lab
parent9015cf72a326e5bac2eeb311b257690a01d4bc26 (diff)
downloadscummvm-rg350-cf020db741294c54dab66a0ed652bdee565d44d5.tar.gz
scummvm-rg350-cf020db741294c54dab66a0ed652bdee565d44d5.tar.bz2
scummvm-rg350-cf020db741294c54dab66a0ed652bdee565d44d5.zip
LAB: Converted DisplayMan::_dispBitMap to a pointer.
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/anim.cpp22
-rw-r--r--engines/lab/dispman.cpp25
-rw-r--r--engines/lab/dispman.h3
3 files changed, 27 insertions, 23 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index ac1ab3e3ef..5f7797493b 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -71,7 +71,7 @@ Anim::Anim(LabEngine *vm) : _vm(vm) {
_doBlack = false;
_diffWidth = 0;
_diffHeight = 0;
- DrawBitMap = &_vm->_graphics->_dispBitMap;
+ DrawBitMap = _vm->_graphics->_dispBitMap;
for (int i = 0; i < 3 * 256; i++)
_diffPalette[i] = 0;
@@ -87,12 +87,12 @@ void Anim::diffNextFrame(bool onlyDiffData) {
// Already done.
return;
- if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO) {
- _vm->_graphics->_dispBitMap._planes[0] = _vm->_graphics->getCurrentDrawingBuffer();
- _vm->_graphics->_dispBitMap._planes[1] = _vm->_graphics->_dispBitMap._planes[0] + 0x10000;
- _vm->_graphics->_dispBitMap._planes[2] = _vm->_graphics->_dispBitMap._planes[1] + 0x10000;
- _vm->_graphics->_dispBitMap._planes[3] = _vm->_graphics->_dispBitMap._planes[2] + 0x10000;
- _vm->_graphics->_dispBitMap._planes[4] = _vm->_graphics->_dispBitMap._planes[3] + 0x10000;
+ if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) {
+ _vm->_graphics->_dispBitMap->_planes[0] = _vm->_graphics->getCurrentDrawingBuffer();
+ _vm->_graphics->_dispBitMap->_planes[1] = _vm->_graphics->_dispBitMap->_planes[0] + 0x10000;
+ _vm->_graphics->_dispBitMap->_planes[2] = _vm->_graphics->_dispBitMap->_planes[1] + 0x10000;
+ _vm->_graphics->_dispBitMap->_planes[3] = _vm->_graphics->_dispBitMap->_planes[2] + 0x10000;
+ _vm->_graphics->_dispBitMap->_planes[4] = _vm->_graphics->_dispBitMap->_planes[3] + 0x10000;
}
_vm->_event->mouseHide();
@@ -130,7 +130,7 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_isAnim = (_frameNum >= 3) && (!_playOnce);
_curBit = 0;
- if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO)
+ if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO)
_vm->_graphics->screenUpdate();
// done with the next frame.
@@ -177,13 +177,13 @@ void Anim::diffNextFrame(bool onlyDiffData) {
break;
case 20L:
- _vm->_utils->unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap._planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, false);
+ _vm->_utils->unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, false);
_curBit++;
_diffFile += _size;
break;
case 21L:
- _vm->_utils->unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap._planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, true);
+ _vm->_utils->unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, true);
_curBit++;
_diffFile += _size;
break;
@@ -224,7 +224,7 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_vm->_music->updateMusic();
_vm->waitTOF();
- if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO)
+ if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO)
didTOF = true;
}
}
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index d3ad191f64..df42f173ef 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -61,10 +61,13 @@ DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) {
for (int i = 0; i < 256 * 3; i++)
_curvgapal[i] = 0;
+
+ _dispBitMap = new BitMap;
}
DisplayMan::~DisplayMan() {
freePict();
+ delete _dispBitMap;
}
// From readPict.c. Reads in pictures and animations from disk.
@@ -90,9 +93,9 @@ void DisplayMan::readPict(const char *filename, bool playOnce, bool onlyDiffData
if (!_vm->_music->_doNotFilestopSoundEffect)
_vm->_music->stopSoundEffect();
- _dispBitMap._bytesPerRow = _screenWidth;
- _dispBitMap._rows = _screenHeight;
- _dispBitMap._flags = BITMAPF_VIDEO;
+ _dispBitMap->_bytesPerRow = _screenWidth;
+ _dispBitMap->_rows = _screenHeight;
+ _dispBitMap->_flags = BITMAPF_VIDEO;
_vm->_anim->readDiff(_curBitmap, playOnce, onlyDiffData);
}
@@ -110,14 +113,14 @@ byte *DisplayMan::readPictToMem(const char *filename, uint16 x, uint16 y) {
if (!_vm->_music->_doNotFilestopSoundEffect)
_vm->_music->stopSoundEffect();
- _dispBitMap._bytesPerRow = x;
- _dispBitMap._rows = y;
- _dispBitMap._flags = BITMAPF_NONE;
- _dispBitMap._planes[0] = _curBitmap;
- _dispBitMap._planes[1] = _dispBitMap._planes[0] + 0x10000;
- _dispBitMap._planes[2] = _dispBitMap._planes[1] + 0x10000;
- _dispBitMap._planes[3] = _dispBitMap._planes[2] + 0x10000;
- _dispBitMap._planes[4] = _dispBitMap._planes[3] + 0x10000;
+ _dispBitMap->_bytesPerRow = x;
+ _dispBitMap->_rows = y;
+ _dispBitMap->_flags = BITMAPF_NONE;
+ _dispBitMap->_planes[0] = _curBitmap;
+ _dispBitMap->_planes[1] = _dispBitMap->_planes[0] + 0x10000;
+ _dispBitMap->_planes[2] = _dispBitMap->_planes[1] + 0x10000;
+ _dispBitMap->_planes[3] = _dispBitMap->_planes[2] + 0x10000;
+ _dispBitMap->_planes[4] = _dispBitMap->_planes[3] + 0x10000;
_vm->_anim->readDiff(_curBitmap, true);
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
index a04d142f8d..5ce4923ec4 100644
--- a/engines/lab/dispman.h
+++ b/engines/lab/dispman.h
@@ -33,6 +33,7 @@
namespace Lab {
+struct BitMap;
class LabEngine;
class Image;
@@ -158,7 +159,7 @@ public:
byte *_currentDisplayBuffer;
bool _doNotDrawMessage;
uint16 *FadePalette;
- BitMap _dispBitMap;
+ BitMap *_dispBitMap;
};
} // End of namespace Lab