Bugfix: Fixed the visible black pixel, for instance, when jumping facing left.
[supertux.git] / lib / video / surface.cpp
index 1c69e3f..c72b5a3 100644 (file)
@@ -194,12 +194,21 @@ Surface::reload()
   {
     w = impl->w;
     h = impl->h;
+    for(std::vector<SurfaceData::Filter>::iterator i =
+        data.applied_filters.begin(); i != data.applied_filters.end();
+        i++)
+      impl->apply_filter(i->type, i->color);
   }
 }
 
 void Surface::apply_filter(int filter, Color color)
 {
 impl->apply_filter(filter, color);
+
+SurfaceData::Filter apply_filter;
+apply_filter.type = filter;
+apply_filter.color = color;
+data.applied_filters.push_back(apply_filter);
 }
 
 Surface::~Surface()
@@ -267,7 +276,7 @@ if(filter == HORIZONTAL_FLIP_FILTER)
   src.h = dst.h = sur_copy->h;
   for(int x = 0; x < sur_copy->w; x++)
     {
-    src.x = x; dst.x = sur_copy->w - x;
+    src.x = x; dst.x = sur_copy->w-1 - x;
     SDL_BlitSurface(sur_copy, &src, surface, &dst);
     }
 
@@ -775,9 +784,6 @@ SurfaceOpenGL::draw_part(float sx, float sy, float x, float y, float w, float h,
 int
 SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, Uint32 effect)
 {
-  if(effect & SEMI_TRANSPARENT)
-    alpha = 128;
-
   float pw = power_of_two(sw);
   float ph = power_of_two(sh);