Update of /cvsroot/super-tux/supertux/lib/video
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5941/lib/video
Modified Files:
drawing_context.cpp font.cpp screen.cpp surface.cpp
Log Message:
The BIG COMMIT(tm)
This is it, expect a broken supertux I only fixed the most annoying issues so
far, lots more are still waiting in the TODO list, but I had to bring this stuff
to cvs sometime. Changes:
- Completely new collision detection scheme, which collides all objects with
each other once per frame, instead of single objects manually testing for
collisions
- New collision detection routines which support slopes and provide additional
info on collisions: penetration depth, hit normal vector
- Lots of general cleanup/refactoring
- Splitted the monolithic badguy class and reimplemented most of them as single
classes with a badguy base class.
- Splitted the monolithic Special class into several classes
- Rewrote the timer and all timing related stuff to work on float and seconds
(not like the mixup before where you had frame_ratio, msecs and secs in
different parts of the app)
- Support for unisolid tiles
- Created a flying platform prototype (doesn't work completely yet)
- rename InteractiveObjects to triggers and implemented a new sequence trigger,
(only supported sequence is endsequence at the moment)
- transformed the bonusblocks and bricks into objects
Index: font.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- font.cpp 16 Oct 2004 11:20:28 -0000 1.13
+++ font.cpp 20 Nov 2004 22:14:37 -0000 1.14
@@ -18,6 +18,8 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
+#include <config.h>
+
#include <cstdlib>
#include <cstring>
Index: screen.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/video/screen.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- screen.cpp 27 Aug 2004 20:34:56 -0000 1.5
+++ screen.cpp 20 Nov 2004 22:14:37 -0000 1.6
@@ -17,6 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <config.h>
+
#include <iostream>
#include <cstdio>
#include <cstdlib>
@@ -36,7 +38,6 @@
#include "../video/screen.h"
#include "../app/globals.h"
#include "../video/drawing_context.h"
-#include "../special/base.h"
#include "../math/vector.h"
using namespace SuperTux;
Index: drawing_context.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/video/drawing_context.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- drawing_context.cpp 24 Sep 2004 18:13:27 -0000 1.9
+++ drawing_context.cpp 20 Nov 2004 22:14:36 -0000 1.10
@@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <config.h>
+
#include <algorithm>
#include <cassert>
#include <iostream>
@@ -29,9 +31,9 @@
DrawingContext::DrawingContext()
{
-transform.draw_effect = NONE_EFFECT;
-transform.zoom = 1;
-transform.alpha = 255;
+ transform.draw_effect = NONE_EFFECT;
+ transform.zoom = 1;
+ transform.alpha = 255;
}
DrawingContext::~DrawingContext()
@@ -50,6 +52,11 @@
request.layer = layer;
request.request_data = const_cast<Surface*> (surface);
request.pos = transform.apply(position);
+
+ if(request.pos.x >= screen->w || request.pos.y >= screen->h
+ || request.pos.x + surface->w < 0 || request.pos.y + surface->h < 0)
+ return;
+
request.drawing_effect = drawing_effect;
request.drawing_effect = transform.draw_effect | drawing_effect;
request.zoom = transform.zoom;
Index: surface.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- surface.cpp 23 Oct 2004 11:30:12 -0000 1.13
+++ surface.cpp 20 Nov 2004 22:14:37 -0000 1.14
@@ -18,6 +18,8 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
+#include <config.h>
+
#include <cassert>
#include <iostream>
#include <algorithm>
|