aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/graphics.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-01-28 17:28:16 +0000
committerNicola Mettifogo2008-01-28 17:28:16 +0000
commit56eed45317dd643528b3980ff7f899fbf0be7bc4 (patch)
treea8bb8cc0e0ff47815d85ca37ad1e04bb8db1661a /engines/parallaction/graphics.cpp
parent3c2c16c705b41e0186cd203bc303a0902bf3059e (diff)
downloadscummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.tar.gz
scummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.tar.bz2
scummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.zip
Move low level background management into Gfx.
svn-id: r30681
Diffstat (limited to 'engines/parallaction/graphics.cpp')
-rw-r--r--engines/parallaction/graphics.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 2ed4a99405..6479a796d2 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -345,6 +345,7 @@ void Gfx::drawBalloons() {
}
void Gfx::updateScreen() {
+#if 0
if (_halfbrite) {
Graphics::Surface *surf = g_system->lockScreen();
byte *src = (byte*)_buffers[kBitFront]->pixels;
@@ -359,6 +360,8 @@ void Gfx::updateScreen() {
} else {
g_system->copyRectToScreen((const byte*)_buffers[kBitFront]->pixels, _buffers[kBitFront]->pitch, _screenX, _screenY, _vm->_screenWidth, _vm->_screenHeight);
}
+#endif
+ g_system->copyRectToScreen((const byte*)_buffers[kBit2]->pixels, _buffers[kBit2]->pitch, _screenX, _screenY, _vm->_screenWidth, _vm->_screenHeight);
Graphics::Surface *surf = g_system->lockScreen();
drawGfxObjects(*surf);
@@ -900,6 +903,7 @@ Gfx::Gfx(Parallaction* vm) :
_hbCircleRadius = 0;
_font = NULL;
+ _backgroundInfo = new BackgroundInfo;
return;
}
@@ -908,6 +912,9 @@ Gfx::~Gfx() {
freeBuffers();
+ freeBackground();
+ delete _backgroundInfo;
+
return;
}
@@ -1173,4 +1180,41 @@ bool Gfx::drawWrappedText(Graphics::Surface* surf, char *text, byte color, int16
}
+void Gfx::freeBackground() {
+
+ if (!_backgroundInfo)
+ return;
+
+ _backgroundInfo->bg.free();
+ _backgroundInfo->mask.free();
+ _backgroundInfo->path.free();
+
+}
+
+void Gfx::setBackground(uint type, const char* name, const char* mask, const char* path) {
+
+ if (type == kBackgroundLocation) {
+
+ _disk->loadScenery(*_backgroundInfo, name, mask, path);
+
+ setPalette(_backgroundInfo->palette);
+ _palette.clone(_backgroundInfo->palette);
+ setBackground(&_backgroundInfo->bg);
+
+ if (_backgroundInfo->mask.data)
+ setMask(&_backgroundInfo->mask);
+
+ } else {
+
+ _disk->loadSlide(*_backgroundInfo, name);
+
+ setPalette(_backgroundInfo->palette);
+ setBackground(&_backgroundInfo->bg);
+
+ }
+
+ return;
+}
+
+
} // namespace Parallaction