[Top][All Lists]
[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_);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs info_box.cxx,1.13,1.14 info_box.hxx,1.11,1.12,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata info_box_data.cxx,1.3,1.4 info_box_data.hxx,1.1,1.2
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.101,1.102 col_map.cxx,1.9,1.10 col_map.hxx,1.7,1.8 config.hxx,1.4,1.5 spot_map.cxx,1.16,1.17 spot_map.hxx,1.6,1.7 xml_plf.cxx,1.20,1.21 plf_parser.cxx,1.4,NONE plf_parser.hxx,1.4,NONE plf_preview.cxx,1.2,NONE plf_preview.hxx,1.5,NONE
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata info_box_data.cxx,1.3,1.4 info_box_data.hxx,1.1,1.2
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.101,1.102 col_map.cxx,1.9,1.10 col_map.hxx,1.7,1.8 config.hxx,1.4,1.5 spot_map.cxx,1.16,1.17 spot_map.hxx,1.6,1.7 xml_plf.cxx,1.20,1.21 plf_parser.cxx,1.4,NONE plf_parser.hxx,1.4,NONE plf_preview.cxx,1.2,NONE plf_preview.hxx,1.5,NONE
- Index(es):