aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-07-01 19:28:32 +0000
committerNicola Mettifogo2007-07-01 19:28:32 +0000
commit675227e81f8a2bb4f6048c9517f586e112565e37 (patch)
treec65768b75aa2cd2d909afec631870fe9d1a3abd5 /engines
parent7bf493939b7e8ed97fd855695326214f401aa0c1 (diff)
downloadscummvm-rg350-675227e81f8a2bb4f6048c9517f586e112565e37.tar.gz
scummvm-rg350-675227e81f8a2bb4f6048c9517f586e112565e37.tar.bz2
scummvm-rg350-675227e81f8a2bb4f6048c9517f586e112565e37.zip
Introduced new flatBlitCnv to reduce code duplication.
svn-id: r27833
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/graphics.cpp12
-rw-r--r--engines/parallaction/graphics.h2
-rw-r--r--engines/parallaction/zone.cpp27
3 files changed, 19 insertions, 22 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 2f6b0ad3b8..ebdc4187f5 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -474,6 +474,18 @@ void Gfx::setMousePointer(int16 index) {
//
// Cnv management
//
+void Gfx::flatBlitCnv(Cnv *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer) {
+
+ StaticCnv scnv;
+
+ scnv._width = cnv->_width;
+ scnv._height = cnv->_height;
+ scnv._data0 = cnv->getFramePtr(frame);
+ scnv._data1 = NULL; // _questioner->field_8[v60->_mood & 0xF];
+
+ flatBlitCnv(&scnv, x, y, buffer);
+}
+
void Gfx::flatBlitCnv(StaticCnv *cnv, int16 x, int16 y, Gfx::Buffers buffer) {
Common::Rect r(cnv->_width, cnv->_height);
r.moveTo(x, y);
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 5459bde55b..0cc78de393 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -204,6 +204,8 @@ public:
// DOS version didn't make use of it, but it is probably needed for Amiga stuff.
void flatBlitCnv(StaticCnv *cnv, int16 x, int16 y, Gfx::Buffers buffer);
void blitCnv(StaticCnv *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer);
+ void flatBlitCnv(Cnv *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer);
+
// palette
void setPalette(Palette palette, uint32 first = FIRST_BASE_COLOR, uint32 num = BASE_PALETTE_COLORS);
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index 7d74a6a59f..0536f890fa 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -216,22 +216,13 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
strcpy(vC8, _tokens[1]);
- StaticCnv vE0;
u->door->_cnv = _disk->loadFrames(vC8);
-
- vE0._width = u->door->_cnv->_width;
- vE0._height = u->door->_cnv->_height;
-
uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1);
- vE0._data0 = u->door->_cnv->getFramePtr(_ax);
-
-// _ax = (z->_flags & kFlagsClosed ? 0 : 1);
-// vE0._data1 = doorcnv->field_8[_ax];
- u->door->_background = (byte*)malloc(vE0._width*vE0._height);
+ u->door->_background = (byte*)malloc(u->door->_cnv->_width * u->door->_cnv->_height);
_gfx->backupDoorBackground(u->door, z->_left, z->_top);
- _gfx->flatBlitCnv(&vE0, z->_left, z->_top, Gfx::kBitBack);
+ _gfx->flatBlitCnv(u->door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack);
}
if (!scumm_stricmp(_tokens[0], "startpos")) {
@@ -304,14 +295,8 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
void Parallaction::displayCharacterComment(ExamineData *data) {
if (data->_description == NULL) return;
- StaticCnv v3C;
- v3C._width = _char._talk->_width;
- v3C._height = _char._talk->_height;
- v3C._data0 = _char._talk->getFramePtr(0);
- v3C._data1 = NULL; //_talk->field_8[0];
-
_gfx->setFont(kFontDialogue);
- _gfx->flatBlitCnv(&v3C, 190, 80, Gfx::kBitFront);
+ _gfx->flatBlitCnv(_char._talk, 0, 190, 80, Gfx::kBitFront);
int16 v26, v28;
_gfx->getStringExtent(data->_description, 130, &v28, &v26);
@@ -441,10 +426,8 @@ void jobToggleDoor(void *parm, Job *j) {
uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1);
- v14._data0 = z->u.door->_cnv->getFramePtr(_ax);
-
- _vm->_gfx->flatBlitCnv(&v14, z->_left, z->_top, Gfx::kBitBack);
- _vm->_gfx->flatBlitCnv(&v14, z->_left, z->_top, Gfx::kBit2);
+ _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack);
+ _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2);
}
count++;