Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16091/src
Modified Files:
background.cpp
Log Message:
This is an implementation that creates a gradient Surface, in order to speed up the gradient drawing.
But it is working even slower in SDL, and doesn't work at all in OpenGL.
Just committed, in the hope that someone finds the problem.
Index: background.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/background.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- background.cpp 9 Jun 2004 05:23:19 -0000 1.6
+++ background.cpp 10 Jun 2004 14:09:49 -0000 1.7
@@ -95,13 +95,17 @@
type = GRADIENT;
gradient_top = top;
gradient_bottom = bottom;
+
+ delete image;
+ image = new Surface(top, bottom, screen->w, screen->h);
}
void
Background::draw(DrawingContext& context)
{
if(type == GRADIENT) {
- context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0);
+ context.draw_surface(image, Vector(0, 0), LAYER_BACKGROUND0);
+// context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0);
} else if(type == IMAGE) {
int sx = int(-context.get_translation().x * speed)
% image->w - image->w;
|