aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDenis Kasak2009-06-19 00:15:28 +0000
committerDenis Kasak2009-06-19 00:15:28 +0000
commitf15adff4d8d31d2cf2de149a39e228d6c2fa72bf (patch)
tree202dd0f97cc698af7430c074d4017776dd9a14db /engines
parentadef44e4519c1f553062b1f213028e8e1afe0512 (diff)
downloadscummvm-rg350-f15adff4d8d31d2cf2de149a39e228d6c2fa72bf.tar.gz
scummvm-rg350-f15adff4d8d31d2cf2de149a39e228d6c2fa72bf.tar.bz2
scummvm-rg350-f15adff4d8d31d2cf2de149a39e228d6c2fa72bf.zip
Updated the demo animation to use the new Surface features (transparency, dirty rects). Changed background to light grey. A transparent string is now drawn over the dragon sprite.
svn-id: r41658
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/draci.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 8d018ee023..6769d70300 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -130,12 +130,12 @@ int DraciEngine::go() {
_screen->setPalette(f->_data, 0, kNumColours);
- // Fill screen with white
- _screen->fillScreen(255);
+ // Fill screen with light grey
+ _screen->fillScreen(225);
// Draw big string
Common::String testString = "Testing, testing, read all about it!";
- Graphics::Surface *surf = _screen->getSurface();
+ Surface *surf = _screen->getSurface();
_font->drawString(surf, testString,
(kScreenWidth - _font->getStringWidth(testString, 1)) / 2, 130, 1);
@@ -160,13 +160,26 @@ int DraciEngine::go() {
return 0;
}
+ testString = "I'm transparent";
for (unsigned int t = 0; t < 25; ++t) {
debugC(5, kDraciGeneralDebugLevel, "Drawing frame %d...", t);
// Load frame to memory
f = ar[t];
Sprite sp(f->_data, f->_length, ((kScreenWidth - 50) / 2), 60, true);
- _screen->drawSprite(sp);
+
+ // Delete previous frame
+ Common::Rect r(sp._x, sp._y, sp._x + sp._width, sp._y + sp._height);
+ _screen->drawRect(r, 225);
+
+ // Draw dragon
+ sp.draw(surf);
+
+ // Draw transparent text over dragon
+ _font->setColour(kDefaultTransparent);
+ _font->drawString(surf, testString,
+ (kScreenWidth - _font->getStringWidth(testString, 1)) / 2, 80, 1);
+
_screen->copyToScreen();
_system->delayMillis(100);