Ignore the gradient Surface (cache) when in OpenGL (as asked by Ryan).
authorRicardo Cruz <rick2@aeiou.pt>
Thu, 10 Jun 2004 15:50:01 +0000 (15:50 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Thu, 10 Jun 2004 15:50:01 +0000 (15:50 +0000)
SVN-Revision: 1463

src/background.cpp

index 65d7be7..830c422 100644 (file)
@@ -104,8 +104,12 @@ void
 Background::draw(DrawingContext& context)
 {
   if(type == GRADIENT) {
-    context.draw_surface(image, Vector(0, 0), LAYER_BACKGROUND0);
-//    context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0);
+    /* In case we are using OpenGL just draw the gradient, else (software mode)
+        use the cache. */
+    if(use_gl)
+      context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0);
+    else
+      context.draw_surface(image, Vector(0, 0), LAYER_BACKGROUND0);
   } else if(type == IMAGE) {
     int sx = int(-context.get_translation().x * speed)
       % image->w - image->w;