[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx,1.4,
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx,1.4,1.5 teleporter.cxx,1.14,1.15 teleporter.hxx,1.16,1.17 |
Date: |
7 Oct 2002 23:04:09 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv7255
Modified Files:
surface_background.cxx teleporter.cxx teleporter.hxx
Log Message:
fixed teleporter
Index: surface_background.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/surface_background.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- surface_background.cxx 1 Oct 2002 19:53:46 -0000 1.4
+++ surface_background.cxx 7 Oct 2002 23:04:06 -0000 1.5
@@ -37,12 +37,7 @@
data(new WorldObjsData::SurfaceBackgroundData(data_))
{
- Timer timer;
-
- if (verbose) {
- timer.start();
- std::cout << "Creating Background..." << std::flush;
- }
+ Timer timer("Background creation");
if (data->color.alpha > 1.0)
std::cout << "Background: Warning dim larger than 1.0 are no longer
supported" << std::endl;
@@ -101,8 +96,7 @@
std::cout << "Background: data->stretch_y: " << data->stretch_y <<
std::endl;
}
- if (verbose)
- std::cout << "done" << timer.stop() << std::endl;
+ timer.stop();
}
SurfaceBackground::~SurfaceBackground ()
Index: teleporter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/teleporter.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- teleporter.cxx 4 Oct 2002 13:46:56 -0000 1.14
+++ teleporter.cxx 7 Oct 2002 23:04:06 -0000 1.15
@@ -28,15 +28,16 @@
namespace WorldObjs {
Teleporter::Teleporter (const WorldObjsData::TeleporterData& data_)
- : data(new WorldObjsData::TeleporterData(data_))
-
+ : data(new WorldObjsData::TeleporterData(data_)),
+ sprite("teleporter", "worldobjs", 20.0f, Sprite::NONE, Sprite::ONCE),
+ target_sprite("teleportertarget", "worldobjs", 15.0f, Sprite::NONE,
Sprite::ONCE)
{
- data->sprite.set_align_center_bottom();
- data->target_sprite.set_align_center();
+ sprite.set_align_center_bottom();
+ target_sprite.set_align_center();
//FIXME: we need a Sprite::set_frame()
- std::cout << "Teleporter: pos: " << data->pos.x << " " << data->pos.y << "
" << data->pos.z << std::endl;
+ //std::cout << "Teleporter: pos: " << data->pos.x << " " << data->pos.y <<
" " << data->pos.z << std::endl;
}
Teleporter::~Teleporter ()
@@ -53,15 +54,15 @@
void
Teleporter::draw (GraphicContext& gc)
{
- gc.draw(data->sprite, data->pos);
- gc.draw(data->target_sprite, data->target_pos);
+ gc.draw(sprite, data->pos);
+ gc.draw(target_sprite, data->target_pos);
}
void
Teleporter::update ()
{
- data->sprite.update();
- data->target_sprite.update();
+ sprite.update();
+ target_sprite.update();
PinguHolder* holder = world->get_pingus();
@@ -70,9 +71,9 @@
if ( (*pingu)->get_x() > data->pos.x - 3 && (*pingu)->get_x() <
data->pos.x + 3
&& (*pingu)->get_y() > data->pos.y - 52 && (*pingu)->get_y() <
data->pos.y)
{
- (*pingu)->set_pos (static_cast<int>(data->target_pos.x),
static_cast<int>(data->target_pos.y));
- data->sprite.reset ();
- data->target_sprite.reset ();
+ (*pingu)->set_pos (data->target_pos.x, data->target_pos.y);
+ sprite.reset ();
+ target_sprite.reset ();
}
}
}
Index: teleporter.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/teleporter.hxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- teleporter.hxx 1 Oct 2002 19:53:46 -0000 1.16
+++ teleporter.hxx 7 Oct 2002 23:04:06 -0000 1.17
@@ -32,6 +32,9 @@
{
private:
WorldObjsData::TeleporterData* const data;
+ Sprite sprite;
+ Sprite target_sprite;
+
public:
Teleporter (const WorldObjsData::TeleporterData& data_);
~Teleporter ();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx,1.4,1.5 teleporter.cxx,1.14,1.15 teleporter.hxx,1.16,1.17,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs groundpiece_obj.cxx,1.3,1.4
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata teleporter_data.cxx,1.6,1.7 teleporter_data.hxx,1.3,1.4
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs groundpiece_obj.cxx,1.3,1.4
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata teleporter_data.cxx,1.6,1.7 teleporter_data.hxx,1.3,1.4
- Index(es):