pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2599 - in trunk/src: . components worldmap


From: jave27
Subject: [Pingus-CVS] r2599 - in trunk/src: . components worldmap
Date: Tue, 17 Jan 2006 02:32:24 +0100

Author: jave27
Date: 2006-01-17 02:32:05 +0100 (Tue, 17 Jan 2006)
New Revision: 2599

Modified:
   trunk/src/components/playfield.cxx
   trunk/src/components/playfield.hxx
   trunk/src/result_screen.cxx
   trunk/src/start_screen.cxx
   trunk/src/worldmap/worldmap.cxx
Log:
Fixed a bunch of screen resolution issues.  Some are hacks, but still 
much better than previously.



Modified: trunk/src/components/playfield.cxx
===================================================================
--- trunk/src/components/playfield.cxx  2006-01-17 00:55:33 UTC (rev 2598)
+++ trunk/src/components/playfield.cxx  2006-01-17 01:32:05 UTC (rev 2599)
@@ -47,7 +47,6 @@
 {
   world              = client->get_server()->get_world();
   mouse_scrolling    = false;
-  needs_clear_screen = false;
 
   state.set_limit(CL_Rect(CL_Point(0, 0), CL_Size(world->get_width(), 
world->get_height())));
 }
@@ -68,20 +67,12 @@
   cap.set_pingu(current_pingu);
   cap.draw(*scene_context);
   
+       // Blank out the entire window in case the screen resolution is larger
+       // than the current level.
+       gc.draw_fillrect(0, 0, CL_Display::get_width(), 
CL_Display::get_height(),
+               CL_Color::black, -15000);
   world->draw(*scene_context);
  
-  if (needs_clear_screen)
-    {
-      for(std::vector<CL_Rect>::iterator i = clipping_rectangles.begin();
-         i != clipping_rectangles.end();
-         i++)
-       {
-         CL_Display::fill_rect(CL_Rect(i->left, i->top,
-                                        i->right + 1, i->bottom + 1),
-                               CL_Color(0, 0, 0));
-       }
-    }
-
   // Draw the scrolling band
   if (mouse_scrolling && !drag_drop_scrolling)
     {
@@ -258,4 +249,3 @@
 } // namespace Pingus
 
 /* EOF */
-

Modified: trunk/src/components/playfield.hxx
===================================================================
--- trunk/src/components/playfield.hxx  2006-01-17 00:55:33 UTC (rev 2598)
+++ trunk/src/components/playfield.hxx  2006-01-17 01:32:05 UTC (rev 2599)
@@ -53,7 +53,6 @@
 
   Pingu* current_pingu;
   bool mouse_scrolling;
-  bool needs_clear_screen;
   int scroll_speed;
 
   CL_Point scroll_center;

Modified: trunk/src/result_screen.cxx
===================================================================
--- trunk/src/result_screen.cxx 2006-01-17 00:55:33 UTC (rev 2598)
+++ trunk/src/result_screen.cxx 2006-01-17 01:32:05 UTC (rev 2599)
@@ -19,10 +19,12 @@
 
 #include <iostream>
 #include <ClanLib/Core/System/clanstring.h>
+#include <ClanLib/Display/sprite_description.h>
 #include "gettext.h"
 #include "gui/surface_button.hxx"
 #include "gui/gui_manager.hxx"
 #include "gui/screen_manager.hxx"
+#include "blitter.hxx"
 #include "res_descriptor.hxx"
 #include "resource.hxx"
 #include "fonts.hxx"
@@ -140,8 +142,18 @@
 ResultScreenComponent::ResultScreenComponent(Result arg_result)
   : result(arg_result)
 {
-  background = Resource::load_sprite("core/menu/startscreenbg");
-
+       if (CL_Display::get_width() == 800 && CL_Display::get_height() == 600)
+       background = Resource::load_sprite("core/menu/startscreenbg");
+       else
+       {
+               CL_PixelBuffer pb = 
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
+                       "core/menu/startscreenbg"), CL_Display::get_width(), 
CL_Display::get_height());
+               CL_SpriteDescription desc;
+               desc.add_frame(pb);
+               background = CL_Sprite(desc);
+       }
+       background.set_alignment(origin_center);
+       
   chalk_pingus.push_back(Resource::load_sprite("core/misc/chalk_pingu1"));
   chalk_pingus.push_back(Resource::load_sprite("core/misc/chalk_pingu2"));
   chalk_pingus.push_back(Resource::load_sprite("core/misc/chalk_pingu3"));

Modified: trunk/src/start_screen.cxx
===================================================================
--- trunk/src/start_screen.cxx  2006-01-17 00:55:33 UTC (rev 2598)
+++ trunk/src/start_screen.cxx  2006-01-17 01:32:05 UTC (rev 2599)
@@ -19,10 +19,12 @@
 
 #include <iostream>
 #include <ClanLib/Core/System/clanstring.h>
+#include <ClanLib/Display/sprite_description.h>
 #include "gui/gui_manager.hxx"
 #include "gui/surface_button.hxx"
 #include "gui/component.hxx"
 #include "gui/screen_manager.hxx"
+#include "blitter.hxx"
 #include "gettext.h"
 #include "game_session.hxx"
 #include "globals.hxx"
@@ -129,7 +131,16 @@
 StartScreenComponent::StartScreenComponent(const PingusLevel& p)
   : plf(p)
 {
-  background = Resource::load_sprite("core/menu/startscreenbg");
+       if (CL_Display::get_width() == 800 && CL_Display::get_height() == 600)
+       background = Resource::load_sprite("core/menu/startscreenbg");
+       else
+       {
+               CL_PixelBuffer pb = 
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
+                       "core/menu/startscreenbg"), CL_Display::get_width(), 
CL_Display::get_height());
+               CL_SpriteDescription desc;
+               desc.add_frame(pb);
+               background = CL_Sprite(desc);
+       }
   background.set_alignment(origin_center);
   time_str = GameTime::ticks_to_realtime_string(plf.get_time());
 }
@@ -137,7 +148,6 @@
 void
 StartScreenComponent::draw(DrawingContext& gc)
 {
-  //gc.clear(0,0,0);
   background.draw(CL_Display::get_width()/2,CL_Display::get_height()/2);
 
   int left_x  = CL_Display::get_width()/2 - 120;

Modified: trunk/src/worldmap/worldmap.cxx
===================================================================
--- trunk/src/worldmap/worldmap.cxx     2006-01-17 00:55:33 UTC (rev 2598)
+++ trunk/src/worldmap/worldmap.cxx     2006-01-17 01:32:05 UTC (rev 2599)
@@ -182,6 +182,12 @@
 
   gc_state.push(*display_gc);
 
+       // Blank out the screen in case the screen resolution is larger than
+       // the worldmap picture.
+       // FIXME:  Should probably scale everything to match the resolution 
instead.
+       gc.draw_fillrect(0, 0, CL_Display::get_width(), 
CL_Display::get_height(),
+               CL_Color::black, -15000);
+               
   for (DrawableLst::iterator i = drawables.begin (); i != drawables.end (); 
++i)
     {
       (*i)->draw(*display_gc);





reply via email to

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