pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2923 - branches/pingus_sdl/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2923 - branches/pingus_sdl/src
Date: Wed, 15 Aug 2007 14:56:02 +0200

Author: grumbel
Date: 2007-08-15 14:56:01 +0200 (Wed, 15 Aug 2007)
New Revision: 2923

Modified:
   branches/pingus_sdl/src/credits.cpp
   branches/pingus_sdl/src/credits.hpp
Log:
- added clipping to Credit screen

Modified: branches/pingus_sdl/src/credits.cpp
===================================================================
--- branches/pingus_sdl/src/credits.cpp 2007-08-15 02:45:57 UTC (rev 2922)
+++ branches/pingus_sdl/src/credits.cpp 2007-08-15 12:56:01 UTC (rev 2923)
@@ -63,6 +63,7 @@
 
 Credits::Credits()
 {
+  scene_context = new SceneContext();
   fast_scrolling = false;
   background = Resource::load_sprite("core/menu/startscreenbg");
   background.scale(Display::get_width(), Display::get_height());
@@ -235,7 +236,8 @@
 
 Credits::~Credits ()
 {
-       StatManager::instance()->set_bool("credits-seen", true);
+  StatManager::instance()->set_bool("credits-seen", true);
+  delete scene_context;
 }
 
 void
@@ -272,23 +274,22 @@
                 static_cast<float>(Display::get_height()/2 + 110),
                                                                _("Exit"));
   
-  // FIXME: Doesn't work here, due to DrawingContext, needs a little
-  // more work to get fixed properly
-  // Display::push_cliprect(Rect(0,
-  // static_cast<int>(gc.get_height()/2-225), 600,
-  // static_cast<int>(gc.get_height()/2+200)));
   yof = 0;
 
+  scene_context->clear();
+  scene_context->set_cliprect(Rect(0,
+                                   static_cast<int>(gc.get_height()/2-225), 
600,
+                                   static_cast<int>(gc.get_height()/2+200)));
   for (std::vector<std::string>::iterator i = credits.begin(); i != 
credits.end(); ++i)
     {
       switch ((*i)[0])
        {
        case '-':
-         gc.print_center(font, x, (y + yof), i->substr(1));
+         scene_context->color().print_center(font, x, (y + yof), i->substr(1));
          yof += font.get_height() + 5;
          break;
        case '_':
-         gc.print_center(font_small, x, (y + yof), i->substr(1));
+         scene_context->color().print_center(font_small, x, (y + yof), 
i->substr(1));
          yof += font_small.get_height() + 5;
          break;
        case 'n':
@@ -299,7 +300,7 @@
          break;
        }
     }
-  //Display::pop_cliprect();
+  gc.draw(new SceneContextDrawingRequest(scene_context, Vector3f(0,0,100)));
 }
 
 void

Modified: branches/pingus_sdl/src/credits.hpp
===================================================================
--- branches/pingus_sdl/src/credits.hpp 2007-08-15 02:45:57 UTC (rev 2922)
+++ branches/pingus_sdl/src/credits.hpp 2007-08-15 12:56:01 UTC (rev 2923)
@@ -24,6 +24,7 @@
 #include <vector>
 #include "gui/gui_screen.hpp"
 #include "font.hpp"
+#include "display/scene_context.hpp"
 #include "sprite.hpp"
 
 class Credits : public GUIScreen
@@ -31,6 +32,8 @@
 private:
   static Credits* instance_;
 
+  SceneContext* scene_context;
+
   bool fast_scrolling;
   Sprite background;
   Sprite pingu;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]