aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2008-01-28 19:56:29 +0000
committerNicola Mettifogo2008-01-28 19:56:29 +0000
commit68fc3f1deea7600790e91b90edb7b4586dc91ae9 (patch)
tree9e9cfb3a1bc412ab7b988f3a10793e0ca7af2887 /engines
parentb80419efb4177fb3cd5d8e2ace3d08d5840fdcc0 (diff)
downloadscummvm-rg350-68fc3f1deea7600790e91b90edb7b4586dc91ae9.tar.gz
scummvm-rg350-68fc3f1deea7600790e91b90edb7b4586dc91ae9.tar.bz2
scummvm-rg350-68fc3f1deea7600790e91b90edb7b4586dc91ae9.zip
Removed usage of kBitFront and kBitBack. Only the old kBit2 buffer is kept to store the background picture.
svn-id: r30687
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/exec_ns.cpp21
-rw-r--r--engines/parallaction/graphics.cpp68
-rw-r--r--engines/parallaction/graphics.h2
-rw-r--r--engines/parallaction/gui_ns.cpp2
-rw-r--r--engines/parallaction/parallaction.cpp1
-rw-r--r--engines/parallaction/parallaction.h2
-rw-r--r--engines/parallaction/parallaction_br.cpp16
-rw-r--r--engines/parallaction/parallaction_ns.cpp4
8 files changed, 10 insertions, 106 deletions
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp
index 93a0e9ab25..d9edf5c2d3 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -360,27 +360,6 @@ void Parallaction_ns::drawAnimations() {
}
-void Parallaction_ns::eraseAnimations() {
- debugC(9, kDebugExec, "eraseAnimations");
-
- for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) {
-
- Animation *a = *it;
-
- if (((a->_flags & kFlagsActive) == 0) && ((a->_flags & kFlagsRemove) == 0)) continue;
-
- Common::Rect r(a->width(), a->height());
- r.moveTo(a->_oldPos);
- _gfx->restoreBackground(r);
-
- a->_oldPos.x = a->_left;
- a->_oldPos.y = a->_top;
- }
-
- return;
-}
-
-
void Parallaction_ns::runScripts() {
debugC(9, kDebugExec, "runScripts");
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index eba8dfff39..2869dc5c8e 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -380,9 +380,6 @@ void Gfx::updateScreen() {
void Gfx::swapBuffers() {
- Graphics::Surface *temp = _buffers[kBitFront];
- _buffers[kBitFront] = _buffers[kBitBack];
- _buffers[kBitBack] = temp;
updateScreen();
return;
}
@@ -393,27 +390,19 @@ void Gfx::swapBuffers() {
//
void Gfx::clearScreen(Gfx::Buffers buffer) {
memset(_buffers[buffer]->pixels, 0, _vm->_screenSize);
-
- if (buffer == kBitFront) updateScreen();
-
- return;
}
void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) {
memcpy(_buffers[dstbuffer]->pixels, _buffers[srcbuffer]->pixels, _vm->_screenSize);
-
- return;
}
void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) {
if (mask) {
uint16 z = queryMask(y);
- blitCnv(&surf, x, y, z, kBitBack);
blitCnv(&surf, x, y, z, kBit2);
} else {
- flatBlitCnv(&surf, x, y, kBitBack);
flatBlitCnv(&surf, x, y, kBit2);
}
@@ -797,37 +786,11 @@ void Gfx::setFont(Font *font) {
_font = font;
}
-void Gfx::restoreBackground(const Common::Rect& r) {
-
- int16 left = r.left;
- int16 top = r.top;
- int16 width = r.width();
- int16 height = r.height();
-
- if (left < 0) left = 0;
- if (top < 0) top = 0;
-
- if (left >= _backgroundWidth) return;
- if (top >= _backgroundHeight) return;
-
- if (left+width >= _backgroundWidth) width = _backgroundWidth - left;
- if (top+height >= _backgroundHeight) height = _backgroundHeight - top;
-
- Common::Rect q(width, height);
- q.moveTo(left, top);
-
- copyRect(kBitBack, q, (byte*)_buffers[kBit2]->getBasePtr(q.left, q.top), _backgroundWidth);
-
- return;
-}
-
-
void Gfx::setBackground(Graphics::Surface *surface) {
_buffers[kBit2] = surface;
initBuffers(surface->w, surface->h);
- copyScreen(kBit2, kBitBack);
}
void Gfx::setMask(MaskBuffer *buffer) {
@@ -880,9 +843,6 @@ Gfx::Gfx(Parallaction* vm) :
_buffers[kBit2] = 0;
_depthMask = 0;
- _buffers[kBitFront] = 0;
- _buffers[kBitBack] = 0;
-
initBuffers(_vm->_screenWidth, _vm->_screenHeight);
setPalette(_palette);
@@ -923,38 +883,10 @@ void Gfx::initBuffers(int w, int h) {
_backgroundWidth = w;
_backgroundHeight = h;
- if (!_buffers[kBitFront]) {
- _buffers[kBitFront] = new Graphics::Surface;
- }
-
- if (!_buffers[kBitBack]) {
- _buffers[kBitBack] = new Graphics::Surface;
- }
-
- if (_buffers[kBitFront]->w != w || _buffers[kBitFront]->h != h) {
- _buffers[kBitFront]->create(w, h, 1);
- }
-
- if (_buffers[kBitBack]->w != w || _buffers[kBitBack]->h != h) {
- _buffers[kBitBack]->create(w, h, 1);
- }
-
}
void Gfx::freeBuffers() {
- if (_buffers[kBitFront]) {
- _buffers[kBitFront]->free();
- delete _buffers[kBitFront];
- }
-
- if (_buffers[kBitBack]) {
- _buffers[kBitBack]->free();
- delete _buffers[kBitBack];
- }
-
- _buffers[kBitFront] = 0;
- _buffers[kBitBack] = 0;
}
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 2791285320..a898fd7840 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -349,8 +349,6 @@ class Gfx {
public:
enum Buffers {
// bit buffers
- kBitFront,
- kBitBack,
kBit2
};
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index 12bf07bab4..625cc8b8ab 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -388,7 +388,7 @@ int Parallaction_ns::guiSelectCharacter() {
_disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0");
- showSlide("password"); // loads background into kBitBack buffer
+ showSlide("password");
const uint16 (*keys)[PASSWORD_LEN] = (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_LANG_MULT)) ? _amigaKeys : _pcKeys;
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 57a1cc6e96..5f5414032d 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -284,7 +284,6 @@ void Parallaction::runGame() {
}
if (_inputMode == kInputModeGame) {
- eraseAnimations();
runScripts();
walk();
drawAnimations();
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 8cfddd889b..cc78415223 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -491,7 +491,6 @@ public:
virtual void runScripts() = 0;
virtual void walk() = 0;
virtual void drawAnimations() = 0;
- virtual void eraseAnimations() = 0;
void beep();
@@ -655,7 +654,6 @@ protected:
void runScripts();
void walk();
void drawAnimations();
- void eraseAnimations();
// location parser
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 60f95eab6b..0b1d0006e8 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -144,7 +144,7 @@ int Parallaction_br::go() {
}
void Parallaction_br::splash(const char *name) {
-
+#if 0
BackgroundInfo info;
_gfx->clearScreen(Gfx::kBitFront);
@@ -163,7 +163,7 @@ void Parallaction_br::splash(const char *name) {
_system->delayMillis(20);
}
info.bg.free();
-
+#endif
return;
}
@@ -186,9 +186,9 @@ void Parallaction_br::invertMenuItem(Graphics::Surface &surf) {
int Parallaction_br::showMenu() {
// TODO: filter menu entries according to progress in game
-
+#if 0
_gfx->clearScreen(Gfx::kBitFront);
-
+#endif
BackgroundInfo info;
Graphics::Surface _menuItems[7];
@@ -212,11 +212,11 @@ int Parallaction_br::showMenu() {
kMenuPart3,
kMenuPart4
};
-
+#if 0
_disk->loadSlide(info, "tbra");
_gfx->setPalette(info.palette);
_gfx->flatBlitCnv(&info.bg, 20, 50, Gfx::kBitFront);
-
+#endif
int availItems = 4 + _progress;
for (int i = 0; i < availItems; i++)
@@ -251,12 +251,12 @@ int Parallaction_br::showMenu() {
invertMenuItem(_menuItems[oldSelectedItem]);
Common::Rect r(MENUITEM_WIDTH, MENUITEM_HEIGHT);
-
+#if 0
for (int i = 0; i < availItems; i++) {
r.moveTo(MENUITEMS_X, MENUITEMS_Y + i * 20);
_gfx->copyRect(Gfx::kBitFront, r, (byte*)_menuItems[i].pixels, _menuItems[i].pitch);
}
-
+#endif
oldSelectedItem = selectedItem;
}
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 72a01d3d90..54bbc088e2 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -248,7 +248,7 @@ void Parallaction_ns::switchBackground(const char* background, const char* mask)
uint16 v2 = 0;
if (!scumm_stricmp(background, "final")) {
- _gfx->clearScreen(Gfx::kBitBack);
+ _gfx->clearScreen(Gfx::kBit2);
for (uint16 _si = 0; _si < 32; _si++) {
pal.setEntry(_si, v2, v2, v2);
v2 += 4;
@@ -323,8 +323,6 @@ void Parallaction_ns::changeLocation(char *location) {
}
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
_gfx->setBlackPalette();
_gfx->updateScreen();