[Scummvm-cvs-logs] SF.net SVN: scummvm: [27833] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Jul 1 21:28:32 CEST 2007
Revision: 27833
http://scummvm.svn.sourceforge.net/scummvm/?rev=27833&view=rev
Author: peres001
Date: 2007-07-01 12:28:32 -0700 (Sun, 01 Jul 2007)
Log Message:
-----------
Introduced new flatBlitCnv to reduce code duplication.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/zone.cpp
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-07-01 18:40:35 UTC (rev 27832)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-07-01 19:28:32 UTC (rev 27833)
@@ -474,6 +474,18 @@
//
// 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);
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2007-07-01 18:40:35 UTC (rev 27832)
+++ scummvm/trunk/engines/parallaction/graphics.h 2007-07-01 19:28:32 UTC (rev 27833)
@@ -204,7 +204,9 @@
// 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);
void setBlackPalette();
Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp 2007-07-01 18:40:35 UTC (rev 27832)
+++ scummvm/trunk/engines/parallaction/zone.cpp 2007-07-01 19:28:32 UTC (rev 27833)
@@ -216,22 +216,13 @@
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::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 @@
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++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list