From f15adff4d8d31d2cf2de149a39e228d6c2fa72bf Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 19 Jun 2009 00:15:28 +0000 Subject: 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 --- engines/draci/draci.cpp | 21 +++++++++++++++++---- 1 file 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); -- cgit v1.2.3