Update of /cvsroot/super-tux/supertux/src/object
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18135/src/object
Modified Files:
oneup.cpp
Log Message:
started work on a collision grid class to speedup collision detection. Doesn't work for moving objects yet, but brings speed in area42 from 5fps back to 100fps on my box (still I get 300-400fps in other levels)
Index: oneup.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/object/oneup.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- oneup.cpp 23 Nov 2004 16:47:26 -0000 1.2
+++ oneup.cpp 29 Nov 2004 16:03:33 -0000 1.3
@@ -4,6 +4,7 @@
#include "resources.h"
#include "player.h"
#include "scene.h"
+#include "sector.h"
#include "special/sprite_manager.h"
#include "video/drawing_context.h"
@@ -23,6 +24,9 @@
void
OneUp::action(float elapsed_time)
{
+ if(!Sector::current()->inside(bbox))
+ remove_me();
+
movement = physic.get_movement(elapsed_time);
}
|