[Super-tux-commit] supertux/src background.cpp,1.8,1.9
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-06-12 15:49:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6826/src Modified Files: background.cpp Log Message: Fixed the scrolling issue. Forgot that the DrawingContext used by gradient was global and so keep the translation point with the scrolling. Gradient caching should work just fine now. Index: background.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/background.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- background.cpp 10 Jun 2004 15:50:01 -0000 1.8 +++ background.cpp 12 Jun 2004 15:48:50 -0000 1.9 @@ -109,7 +109,12 @@ if(use_gl) context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0); else + { + context.push_transform(); + context.set_translation(Vector(0, 0)); context.draw_surface(image, Vector(0, 0), LAYER_BACKGROUND0); + context.pop_transform(); + } } else if(type == IMAGE) { int sx = int(-context.get_translation().x * speed) % image->w - image->w; |