diff options
author | Matthew Hoops | 2012-03-20 14:18:57 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-03-20 14:49:16 -0400 |
commit | 71756bdf4eae5ba9cc3f329b85e894f04640aaef (patch) | |
tree | 40d464262da107ab5eed82f198685209161ebac1 /engines/kyra/screen_lol.cpp | |
parent | 03eba05b09e5c9e5a351f8111185934b92a3fed3 (diff) | |
parent | 3c3576a224b92c703b4e8ea20008ac8a069980dd (diff) | |
download | scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.tar.gz scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.tar.bz2 scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/kyra/screen_lol.cpp')
-rw-r--r-- | engines/kyra/screen_lol.cpp | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 6d0460e0a1..08b232f400 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -31,7 +31,7 @@ namespace Kyra { -Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system), _vm(vm) { +Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system, vm->gameFlags().use16ColorMode ? _screenDimTable16C : _screenDimTable256C, _screenDimTableCount), _vm(vm) { _paletteOverlay1 = new uint8[0x100]; _paletteOverlay2 = new uint8[0x100]; _grayOverlay = new uint8[0x100]; @@ -43,14 +43,9 @@ Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system), _levelOverlays[i] = new uint8[256]; _fadeFlag = 2; - _curDimIndex = 0; } Screen_LoL::~Screen_LoL() { - for (int i = 0; i < _screenDimTableCount; i++) - delete _customDimTable[i]; - delete[] _customDimTable; - for (int i = 0; i < 8; i++) delete[] _levelOverlays[i]; @@ -59,39 +54,6 @@ Screen_LoL::~Screen_LoL() { delete[] _grayOverlay; } -bool Screen_LoL::init() { - if (Screen::init()) { - _screenDimTable = _use16ColorMode ? _screenDimTable16C : _screenDimTable256C; - _customDimTable = new ScreenDim*[_screenDimTableCount]; - memset(_customDimTable, 0, sizeof(ScreenDim *)* _screenDimTableCount); - return true; - } - return false; -} - - -void Screen_LoL::setScreenDim(int dim) { - assert(dim < _screenDimTableCount); - _curDim = _customDimTable[dim] ? (const ScreenDim *)_customDimTable[dim] : &_screenDimTable[dim]; - _curDimIndex = dim; -} - -const ScreenDim *Screen_LoL::getScreenDim(int dim) { - assert(dim < _screenDimTableCount); - return _customDimTable[dim] ? (const ScreenDim *)_customDimTable[dim] : &_screenDimTable[dim]; -} - -void Screen_LoL::modifyScreenDim(int dim, int x, int y, int w, int h) { - delete _customDimTable[dim]; - _customDimTable[dim] = new ScreenDim; - memcpy(_customDimTable[dim], &_screenDimTable[dim], sizeof(ScreenDim)); - _customDimTable[dim]->sx = x; - _customDimTable[dim]->sy = y; - _customDimTable[dim]->w = w; - _customDimTable[dim]->h = h; - setScreenDim(dim); -} - void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) { if (!format) return; @@ -142,8 +104,8 @@ void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, u x -= getTextWidth(buffer); if ((flags & 0x00F0) == 0x20) { - printText(buffer, x-1, y, c3, c2); - printText(buffer, x, y+1, c3, c2); + printText(buffer, x - 1, y, c3, c2); + printText(buffer, x, y + 1, c3, c2); } printText(buffer, x, y, c1, c2); |