aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen_lok.cpp
diff options
context:
space:
mode:
authorMax Horn2009-04-11 09:57:57 +0000
committerMax Horn2009-04-11 09:57:57 +0000
commit5749b363d58d49c79db0a63f7eb136b34e3c641f (patch)
tree558f31601b4eee6c753a196f65c5af05b7c806e4 /engines/kyra/screen_lok.cpp
parent728745767294ecc3abf7fcb730370ff8951999ed (diff)
downloadscummvm-rg350-5749b363d58d49c79db0a63f7eb136b34e3c641f.tar.gz
scummvm-rg350-5749b363d58d49c79db0a63f7eb136b34e3c641f.tar.bz2
scummvm-rg350-5749b363d58d49c79db0a63f7eb136b34e3c641f.zip
KYRA: Replaced Rect class by Common::Rect; replaced dirty rect handling code by code similiar to the one used in SAGA and the frontend GUI code
svn-id: r39929
Diffstat (limited to 'engines/kyra/screen_lok.cpp')
-rw-r--r--engines/kyra/screen_lok.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp
index da88abc61f..314e4c46ae 100644
--- a/engines/kyra/screen_lok.cpp
+++ b/engines/kyra/screen_lok.cpp
@@ -28,7 +28,6 @@
namespace Kyra {
-#define BITBLIT_RECTS 10
Screen_LoK::Screen_LoK(KyraEngine_LoK *vm, OSystem *system)
: Screen(vm, system) {
@@ -36,8 +35,6 @@ Screen_LoK::Screen_LoK(KyraEngine_LoK *vm, OSystem *system)
}
Screen_LoK::~Screen_LoK() {
- delete[] _bitBlitRects;
-
for (int i = 0; i < ARRAYSIZE(_saveLoadPage); ++i) {
delete[] _saveLoadPage[i];
_saveLoadPage[i] = 0;
@@ -56,9 +53,7 @@ bool Screen_LoK::init() {
if (!Screen::init())
return false;
- _bitBlitRects = new Rect[BITBLIT_RECTS];
- assert(_bitBlitRects);
- memset(_bitBlitRects, 0, sizeof(Rect)*BITBLIT_RECTS);
+ memset(_bitBlitRects, 0, sizeof(_bitBlitRects));
_bitBlitNum = 0;
memset(_saveLoadPage, 0, sizeof(_saveLoadPage));
memset(_saveLoadPageOvl, 0, sizeof(_saveLoadPageOvl));
@@ -104,19 +99,19 @@ void Screen_LoK::addBitBlitRect(int x, int y, int w, int h) {
if (_bitBlitNum >= BITBLIT_RECTS)
error("too many bit blit rects");
- _bitBlitRects[_bitBlitNum].x = x;
- _bitBlitRects[_bitBlitNum].y = y;
- _bitBlitRects[_bitBlitNum].x2 = w;
- _bitBlitRects[_bitBlitNum].y2 = h;
+ _bitBlitRects[_bitBlitNum].left = x;
+ _bitBlitRects[_bitBlitNum].top = y;
+ _bitBlitRects[_bitBlitNum].right = x + w;
+ _bitBlitRects[_bitBlitNum].bottom = y + h;
++_bitBlitNum;
}
void Screen_LoK::bitBlitRects() {
debugC(9, kDebugLevelScreen, "Screen_LoK::bitBlitRects()");
- Rect *cur = _bitBlitRects;
+ Common::Rect *cur = _bitBlitRects;
while (_bitBlitNum) {
_bitBlitNum--;
- copyRegion(cur->x, cur->y, cur->x, cur->y, cur->x2, cur->y2, 2, 0);
+ copyRegion(cur->left, cur->top, cur->left, cur->top, cur->width(), cur->height(), 2, 0);
++cur;
}
}