pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldobjs info_box.cxx,1.13,1.14 info


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjs info_box.cxx,1.13,1.14 info_box.hxx,1.11,1.12
Date: 17 Sep 2002 16:23:32 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv21935/worldobjs

Modified Files:
        info_box.cxx info_box.hxx 
Log Message:
- fixed crash bug in the infobox
- removed lots of obsolete cruft from the spotmap
- old-style groundpieces should be handled correctly now (not much tested, so 
handle with care)

Index: info_box.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/info_box.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- info_box.cxx        14 Sep 2002 19:06:34 -0000      1.13
+++ info_box.cxx        17 Sep 2002 16:23:30 -0000      1.14
@@ -23,6 +23,7 @@
 #include "../graphic_context.hxx"
 #include "../pingu.hxx"
 #include "../pingu_holder.hxx"
+#include "../fonts.hxx"
 #include "../world.hxx"
 #include "../worldobjsdata/info_box_data.hxx"
 #include "info_box.hxx"
@@ -30,9 +31,11 @@
 namespace WorldObjs {
 
 InfoBox::InfoBox (WorldObjsData::InfoBoxData* data_)
-  : is_open (false),
-    data(new WorldObjsData::InfoBoxData(*data_))
+  : data(new WorldObjsData::InfoBoxData(*data_)),
+    sprite("infobox", "worldobjs"),
+    is_open (false)
 {
+  sprite.set_align_center_bottom ();
 }
 
 InfoBox::~InfoBox ()
@@ -51,16 +54,16 @@
 
   if (is_open)
     {
-      int width = data->font->get_text_width(data->info_text.c_str());
+      int width = Fonts::pingus_small->get_text_width(data->info_text.c_str());
       int border = 6;
       gc.draw_line(data->pos, data->pos + CL_Vector(0, 0 - 100), 0.0f, 1.0f, 
0.0f, 1.0f);
       gc.draw(data->sprite, data->pos);
       CL_Display::fill_rect(x_pos - width/2 - border,
                             y_pos - border,
                            x_pos + width/2 + border,
-                           y_pos + data->font->get_height() + border,
+                           y_pos + Fonts::pingus_small->get_height() + border,
                            0.0, 0.0, 0.0, 1.0);
-      data->font->print_center(x_pos, y_pos, data->info_text.c_str()); 
+      gc.print_center(Fonts::pingus_small, x_pos, y_pos, 
data->info_text.c_str()); 
     }
   else
     {

Index: info_box.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/info_box.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- info_box.hxx        14 Sep 2002 19:06:34 -0000      1.11
+++ info_box.hxx        17 Sep 2002 16:23:30 -0000      1.12
@@ -32,8 +32,9 @@
 class InfoBox : public WorldObj
 {
 private:
-  bool is_open;
   WorldObjsData::InfoBoxData* const data;
+  Sprite sprite;
+  bool is_open;
 
 public:
   InfoBox (WorldObjsData::InfoBoxData* data_);





reply via email to

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