[Scummvm-cvs-logs] SF.net SVN: scummvm: [30689] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Mon Jan 28 21:40:06 CET 2008
Revision: 30689
http://scummvm.svn.sourceforge.net/scummvm/?rev=30689&view=rev
Author: peres001
Date: 2008-01-28 12:40:05 -0800 (Mon, 28 Jan 2008)
Log Message:
-----------
Cleanup (step 1).
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/callables_ns.cpp
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/gui_ns.cpp
scummvm/trunk/engines/parallaction/parallaction.cpp
Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp 2008-01-28 20:06:40 UTC (rev 30688)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp 2008-01-28 20:40:05 UTC (rev 30689)
@@ -428,7 +428,7 @@
}
void Parallaction_ns::_c_testResult(void *parm) {
- _gfx->swapBuffers();
+ _gfx->updateScreen();
_disk->selectArchive("disk1");
parseLocation("common");
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2008-01-28 20:06:40 UTC (rev 30688)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2008-01-28 20:40:05 UTC (rev 30689)
@@ -379,12 +379,7 @@
}
-void Gfx::swapBuffers() {
- updateScreen();
- return;
-}
-
//
// graphic primitives
//
@@ -393,17 +388,13 @@
}
-void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) {
- memcpy(_buffers[dstbuffer]->pixels, _buffers[srcbuffer]->pixels, _vm->_screenSize);
-}
-
void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) {
if (mask) {
uint16 z = queryMask(y);
- blitCnv(&surf, x, y, z, kBit2);
+ blitCnv(&surf, x, y, z);
} else {
- flatBlitCnv(&surf, x, y, kBit2);
+ flatBlitCnv(&surf, x, y);
}
}
@@ -682,61 +673,23 @@
}
-//
-// Cnv management
-//
-void Gfx::flatBlitCnv(Frames *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer) {
- Graphics::Surface scnv;
- Common::Rect r;
-
- cnv->getRect(frame, r);
-
- scnv.w = r.width();
- scnv.h = r.height();
- scnv.pixels = cnv->getData(frame);
-
- flatBlitCnv(&scnv, x, y, buffer);
-}
-
-void Gfx::flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y, Gfx::Buffers buffer) {
+void Gfx::flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y) {
Common::Rect r(cnv->w, cnv->h);
r.moveTo(x, y);
- blt(r, (byte*)cnv->pixels, _buffers[buffer], BUFFER_FOREGROUND, 0);
+ blt(r, (byte*)cnv->pixels, _buffers[kBit2], BUFFER_FOREGROUND, 0);
}
-void Gfx::blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer) {
+void Gfx::blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z) {
Common::Rect r(cnv->w, cnv->h);
r.moveTo(x, y);
- blt(r, (byte*)cnv->pixels, _buffers[buffer], z, 0);
+ blt(r, (byte*)cnv->pixels, _buffers[kBit2], z, 0);
}
-void Gfx::backupDoorBackground(DoorData *data, int16 x, int16 y) {
-}
-void Gfx::backupGetBackground(GetData *data, int16 x, int16 y) {
-
-}
-
-//
-// restores background according to specified frame
-//
-void Gfx::restoreDoorBackground(const Common::Rect& r, byte *data, byte* background) {
-
-}
-
-
-//
-// copies a rectangular bitmap on the background
-//
-void Gfx::restoreGetBackground(const Common::Rect& r, byte *data) {
-
-}
-
-
void Gfx::getStringExtent(char *text, uint16 maxwidth, int16* width, int16* height) {
uint16 lines = 0;
@@ -790,7 +743,8 @@
void Gfx::setBackground(Graphics::Surface *surface) {
_buffers[kBit2] = surface;
- initBuffers(surface->w, surface->h);
+ _backgroundWidth = surface->w;
+ _backgroundHeight = surface->h;
}
void Gfx::setMask(MaskBuffer *buffer) {
@@ -809,13 +763,6 @@
return;
}
-void Gfx::copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch) {
- byte *d = (byte*)_buffers[dstbuffer]->getBasePtr(r.left, r.top);
- copyRect(r.width(), r.height(), d, _backgroundWidth, src, pitch);
- return;
-}
-
-
void Gfx::grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch) {
byte *s = (byte*)_buffers[srcbuffer]->getBasePtr(r.left, r.top);
copyRect(r.width(), r.height(), dst, pitch, s, _backgroundWidth);
@@ -843,7 +790,9 @@
_buffers[kBit2] = 0;
_depthMask = 0;
- initBuffers(_vm->_screenWidth, _vm->_screenHeight);
+ // FIXME: screen size must be decoupled from background size
+ _backgroundWidth = _vm->_screenWidth;
+ _backgroundHeight = _vm->_screenHeight;
setPalette(_palette);
@@ -870,26 +819,14 @@
Gfx::~Gfx() {
- freeBuffers();
-
freeBackground();
delete _backgroundInfo;
return;
}
-void Gfx::initBuffers(int w, int h) {
- _backgroundWidth = w;
- _backgroundHeight = h;
-}
-
-void Gfx::freeBuffers() {
-
-}
-
-
int Gfx::setItem(Frames* frames, uint16 x, uint16 y) {
int id = _numItems;
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2008-01-28 20:06:40 UTC (rev 30688)
+++ scummvm/trunk/engines/parallaction/graphics.h 2008-01-28 20:40:05 UTC (rev 30689)
@@ -384,14 +384,6 @@
// cut/paste
void patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask = false);
- void flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y, Gfx::Buffers buffer);
- void flatBlitCnv(Frames *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer);
- void blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer);
- void restoreBackground(const Common::Rect& r);
- void backupDoorBackground(DoorData *data, int16 x, int16 y);
- void restoreDoorBackground(const Common::Rect& r, byte *data, byte* background);
- void backupGetBackground(GetData *data, int16 x, int16 y);
- void restoreGetBackground(const Common::Rect& r, byte *data);
int setLocationBalloon(char *text, bool endGame);
int setDialogueBalloon(char *text, uint16 winding, byte textColor);
@@ -407,8 +399,6 @@
// low level surfaces
void clearScreen(Gfx::Buffers buffer);
- void copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer);
- void copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch);
void grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch);
void floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color);
void invertRect(Gfx::Buffers buffer, const Common::Rect& r);
@@ -424,7 +414,6 @@
// misc
uint16 queryMask(uint16 v);
- void swapBuffers();
void updateScreen();
void setBackground(Graphics::Surface *surf);
void setMask(MaskBuffer *buffer);
@@ -505,6 +494,10 @@
void drawText(Graphics::Surface* surf, uint16 x, uint16 y, const char *text, byte color);
bool drawWrappedText(Graphics::Surface* surf, char *text, byte color, int16 wrapwidth);
+
+ void flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y);
+ void blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z);
+
void blt(const Common::Rect& r, byte *data, Graphics::Surface *surf, uint16 z, byte transparentColor);
};
Modified: scummvm/trunk/engines/parallaction/gui_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_ns.cpp 2008-01-28 20:06:40 UTC (rev 30688)
+++ scummvm/trunk/engines/parallaction/gui_ns.cpp 2008-01-28 20:40:05 UTC (rev 30689)
@@ -194,7 +194,7 @@
setBackground("test", NULL, NULL);
- _gfx->swapBuffers();
+ _gfx->updateScreen();
uint id[4];
id[0] = _gfx->createLabel(_menuFont, v14[0], 1);
@@ -427,7 +427,7 @@
if (_si != -1) {
_gfx->grabRect((byte*)block.pixels, codeTrueBlocks[_si], Gfx::kBit2, BLOCK_WIDTH);
- _gfx->flatBlitCnv(&block, _di * SLOT_WIDTH + SLOT_X, SLOT_Y, Gfx::kBit2);
+ _gfx->patchBackground(block, _di * SLOT_WIDTH + SLOT_X, SLOT_Y, false);
if (keys[0][_di] == _si) {
points[0]++;
@@ -455,7 +455,7 @@
break;
}
- _gfx->flatBlitCnv(&v14, SLOT_X, SLOT_Y, Gfx::kBit2);
+ _gfx->patchBackground(v14, SLOT_X, SLOT_Y, false);
_gfx->hideLabel(id[0]);
_gfx->showLabel(id[1], 60, 30);
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2008-01-28 20:06:40 UTC (rev 30688)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2008-01-28 20:40:05 UTC (rev 30689)
@@ -302,7 +302,7 @@
}
_gfx->animatePalette();
- _gfx->swapBuffers();
+ _gfx->updateScreen();
g_system->delayMillis(30);
}
@@ -784,7 +784,7 @@
runScripts();
drawAnimations();
- _gfx->swapBuffers();
+ _gfx->updateScreen();
showLocationComment(_location._comment, false);
waitUntilLeftClick();
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