[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.9,1.10 hotspot.cxx
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.9,1.10 hotspot.cxx,1.4,1.5 hotspot.hxx,1.4,1.5 spot_map.cxx,1.17,1.18 |
Date: |
17 Sep 2002 21:45:58 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv7007
Modified Files:
game_session.cxx hotspot.cxx hotspot.hxx spot_map.cxx
Log Message:
- some small bugfixes
- removed the useless limitation to multiple of tile_size mapsize
Index: game_session.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/game_session.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- game_session.cxx 14 Sep 2002 19:06:33 -0000 1.9
+++ game_session.cxx 17 Sep 2002 21:45:56 -0000 1.10
@@ -21,14 +21,25 @@
#include "true_server.hxx"
#include "game_session.hxx"
#include "game_session_result.hxx"
+#include "timer.hxx"
#include "plf.hxx"
PingusGameSession::PingusGameSession (std::string arg_filename)
- : filename (arg_filename),
- plf(PLF::create (filename)),
- server (new TrueServer (plf)),
- client (new Client(server))
+ : filename (arg_filename)
{
+ Timer timer;
+
+ timer.start();
+ plf = PLF::create (filename);
+ std::cout << "Timer: Level loading took: " << timer.stop() << std::endl;
+
+ timer.start();
+ server = new TrueServer (plf);
+ std::cout << "Timer: TrueServer creation took: " << timer.stop() <<
std::endl;
+
+ timer.start();
+ client = new Client(server);
+ std::cout << "Timer: Client creation took: " << timer.stop() << std::endl;
}
PingusGameSession::~PingusGameSession ()
Index: hotspot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hotspot.cxx 4 Sep 2002 20:30:28 -0000 1.4
+++ hotspot.cxx 17 Sep 2002 21:45:56 -0000 1.5
@@ -23,30 +23,23 @@
#include "pingus_resource.hxx"
Hotspot::Hotspot(const HotspotData& spot)
+ : HotspotData(spot)
{
+ sprite = Sprite(desc);
+ //sprite.set_align_center();
+
if (verbose > 2)
std::cout << "Creating Hotspot" << std::endl;
pos = spot.pos;
para = spot.para;
- speed = spot.speed;
-
- surface = PingusResource::load_surface(spot.desc);
-
- if (speed != -1)
- {
- count.set_size(surface.get_num_frames());
- count.set_speed(speed);
- count = 0;
- }
}
void
Hotspot::draw (GraphicContext& gc)
{
// FIXME: para support doesnn't work correctly
- gc.draw (surface, pos * para, static_cast<int>(count));
- ++count;
+ gc.draw (sprite, pos * para);
}
/* EOF */
Index: hotspot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hotspot.hxx 4 Sep 2002 19:40:19 -0000 1.4
+++ hotspot.hxx 17 Sep 2002 21:45:56 -0000 1.5
@@ -25,15 +25,15 @@
#include "worldobj.hxx"
#include "anim_counter.hxx"
#include "hotspot_data.hxx"
+#include "sprite.hxx"
class Hotspot : public HotspotData,
public WorldObj
{
private:
- CL_Surface surface;
- int speed;
+ Sprite sprite;
float para;
- AnimCounter count;
+
public:
Hotspot(const HotspotData& spot);
Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- spot_map.cxx 17 Sep 2002 16:23:30 -0000 1.17
+++ spot_map.cxx 17 Sep 2002 21:45:56 -0000 1.18
@@ -113,26 +113,24 @@
// tile_size are allowed, anything else wouldn't fit very well on
// the colmap
- // FIXME: This is dirty cruft, the engine should be able to handle
- // FIXME: all world_sizes and simply display the tiles partly
if ((width % tile_size) != 0)
{
- std::cout << "Warrning: Width is not a multible of " << tile_size <<
std::endl;
width += (tile_size - (width % tile_size));
- std::cout << "Warning: Fixing height to: " << width << std::endl;
}
if ((height % tile_size) != 0)
{
- std::cout << "Warning: Width is not a multible of " << tile_size <<
std::endl;
height += (tile_size - (height % tile_size));
- std::cout << "Warning: Fixing height to: " << height << std::endl;
}
// Allocating tile map
tile.resize(width/tile_size);
for(TileIter i=0; i < tile.size(); ++i)
tile[i].resize(height/tile_size);
+
+ // fix the height back to the correct values
+ width = plf->get_width();
+ height = plf->get_height();
}
PingusSpotMap::~PingusSpotMap(void)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.9,1.10 hotspot.cxx,1.4,1.5 hotspot.hxx,1.4,1.5 spot_map.cxx,1.17,1.18,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.35,1.36
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/data/levels Lev4.xml,1.3,1.4 Stair.xml,1.2,1.3 belt1-grumbel.xml,1.1,1.2 bla.xml,1.1,1.2 blockers-timpany-tutorial.xml,1.6,1.7 cages.xml,1.3,1.4 candy-lukis.xml,1.1,1.2 candy1.xml,1.3,1.4 climber-tutorial-lukis.xml,1.1,1.2 desert1.xml,1.5,1.6 desert2.xml,1.3,1.4 editor_tut.xml,1.3,1.4 foliage1.xml,1.3,1.4 future1-jgoebbert.xml,1.1,1.2 future2-jgoebbert.xml,1.2,1.3 future3-jgoebbert.xml,1.1,1.2 hellmouth11-grumbel.xml,1.3,1.4 hellmouth14-grumbel.xml,1.1,1.2 hellmouth15-grumbel.xml,1.1,1.2 hellmouth16-grumbel.xml,1.2,1.3 hellmouth19-grumbel.xml,1.3,1.4 hellmouth21-grumbel.xml,1.1,1.2 hellmouth5-grumbel.xml,1.3,1.4 hellmouth6-grumbel.xml,1.3,1.4 hellmouth8-grumbel.xml,1.3,1.4 hellmouth9-grumbel.xml,1.3,1.4 iceblock-grumbel1.xml,1.3,1.4 industrial3-grumbel.xml,1.1,1.2 industrial4-grumbel.xml,1.1,1.2 intersec.xml,1.2,1.3 isle1-grumbel.xml,1.1,1.2 jewel.xml,1.2,1.3 jungle-crisscross-timpany.xml,1.3,1.4 level10.xml,1.7,1.8 level9.xml,1.8,1.9 lonely.xml,1.2,1.3 mud1-grumbel.xml,1.1,1.2 mud2-grumbel.xml,1.1,1.2 mud3-grumbel.xml,1.1,1.2 mud4-grumbel.xml,1.1,1.2 pyramid1-yingwan.xml,1.1,1.2 pyramid2-yingwan.xml,1.1,1.2 real5.xml,1.3,1.4 real6.xml,1.4,1.5 rinse.xml,1.3,1.4 snow-lukis.xml,1.2,1.3 snow7-grumbel.xml,1.1,1.2 sortie4-grumbel.xml,1.1,1.2 space1.xml,1.3,1.4 space2.xml,1.3,1.4 space4-grumbel.xml,1.5,1.6 stone-castle-timpany.xml,1.1,1.2 stone.xml,1.2,1.3 stone11-grumbel.xml,1.1,1.2 stone12-grumbel.xml,1.1,1.2 stone3-grumbel.xml,1.1,1.2 stone4-grumbel.xml,1.1,1.2 stone5-grumbel.xml,1.1,1.2 stone6-grumbel.xml,1.1,1.2 stone7-grumbel.xml,1.1,1.2 stone8-grumbel.xml,1.1,1.2 xmas-complex-timpany.xml,1.2,1.3
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_event.cxx,1.35,1.36
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/data/levels Lev4.xml,1.3,1.4 Stair.xml,1.2,1.3 belt1-grumbel.xml,1.1,1.2 bla.xml,1.1,1.2 blockers-timpany-tutorial.xml,1.6,1.7 cages.xml,1.3,1.4 candy-lukis.xml,1.1,1.2 candy1.xml,1.3,1.4 climber-tutorial-lukis.xml,1.1,1.2 desert1.xml,1.5,1.6 desert2.xml,1.3,1.4 editor_tut.xml,1.3,1.4 foliage1.xml,1.3,1.4 future1-jgoebbert.xml,1.1,1.2 future2-jgoebbert.xml,1.2,1.3 future3-jgoebbert.xml,1.1,1.2 hellmouth11-grumbel.xml,1.3,1.4 hellmouth14-grumbel.xml,1.1,1.2 hellmouth15-grumbel.xml,1.1,1.2 hellmouth16-grumbel.xml,1.2,1.3 hellmouth19-grumbel.xml,1.3,1.4 hellmouth21-grumbel.xml,1.1,1.2 hellmouth5-grumbel.xml,1.3,1.4 hellmouth6-grumbel.xml,1.3,1.4 hellmouth8-grumbel.xml,1.3,1.4 hellmouth9-grumbel.xml,1.3,1.4 iceblock-grumbel1.xml,1.3,1.4 industrial3-grumbel.xml,1.1,1.2 industrial4-grumbel.xml,1.1,1.2 intersec.xml,1.2,1.3 isle1-grumbel.xml,1.1,1.2 jewel.xml,1.2,1.3 jungle-crisscross-timpany.xml,1.3,1.4 level10.xml,1.7,1.8 level9.xml,1.8,1.9 lonely.xml,1.2,1.3 mud1-grumbel.xml,1.1,1.2 mud2-grumbel.xml,1.1,1.2 mud3-grumbel.xml,1.1,1.2 mud4-grumbel.xml,1.1,1.2 pyramid1-yingwan.xml,1.1,1.2 pyramid2-yingwan.xml,1.1,1.2 real5.xml,1.3,1.4 real6.xml,1.4,1.5 rinse.xml,1.3,1.4 snow-lukis.xml,1.2,1.3 snow7-grumbel.xml,1.1,1.2 sortie4-grumbel.xml,1.1,1.2 space1.xml,1.3,1.4 space2.xml,1.3,1.4 space4-grumbel.xml,1.5,1.6 stone-castle-timpany.xml,1.1,1.2 stone.xml,1.2,1.3 stone11-grumbel.xml,1.1,1.2 stone12-grumbel.xml,1.1,1.2 stone3-grumbel.xml,1.1,1.2 stone4-grumbel.xml,1.1,1.2 stone5-grumbel.xml,1.1,1.2 stone6-grumbel.xml,1.1,1.2 stone7-grumbel.xml,1.1,1.2 stone8-grumbel.xml,1.1,1.2 xmas-complex-timpany.xml,1.2,1.3
- Index(es):