New grow and skid sounds from remaxim
[supertux.git] / src / video / sdl_renderer.cpp
index a48d7f9..b02d0a1 100644 (file)
@@ -130,6 +130,8 @@ namespace SDL
 {
   Renderer::Renderer()
   {
+    ::Renderer::instance_ = this;
+
     const SDL_VideoInfo *info = SDL_GetVideoInfo();
     log_info << "Hardware surfaces are " << (info->hw_available ? "" : "not ") << "available." << std::endl;
     log_info << "Hardware to hardware blits are " << (info->blit_hw ? "" : "not ") << "accelerated." << std::endl;
@@ -143,8 +145,9 @@ namespace SDL
     int flags = SDL_SWSURFACE | SDL_ANYFORMAT;
     if(config->use_fullscreen)
       flags |= SDL_FULLSCREEN;
-    int width = config->screenwidth;
-    int height = config->screenheight;
+    
+    int width  = 800; //FIXME: config->screenwidth;
+    int height = 600; //FIXME: config->screenheight;
 
     screen = SDL_SetVideoMode(width, height, 0, flags);
     if(screen == 0) {
@@ -154,6 +157,9 @@ namespace SDL
       throw std::runtime_error(msg.str());
     }
 
+    numerator   = 1;
+    denominator = 1;
+    /* FIXME: 
     float xfactor = (float) config->screenwidth / SCREEN_WIDTH;
     float yfactor = (float) config->screenheight / SCREEN_HEIGHT;
     if(xfactor < yfactor)
@@ -166,7 +172,7 @@ namespace SDL
       numerator = config->screenheight;
       denominator = SCREEN_HEIGHT;
     }
-
+    */
     if(texture_manager == 0)
       texture_manager = new TextureManager();
   }
@@ -192,7 +198,7 @@ namespace SDL
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     SDL_Rect *src_rect = surface_data->get_src_rect(effect);
     SDL_Rect dst_rect;
@@ -254,13 +260,13 @@ namespace SDL
     DrawingEffect effect = request.drawing_effect;
     if (surface->get_flipx()) effect = HORIZONTAL_FLIP;
 
-    SDL_Surface *transform = sdltexture->get_transform(Color(1.0, 1.0, 1.0), effect);
+    SDL_Surface *transform = sdltexture->get_transform(request.color, effect);
 
     // get and check SDL_Surface
     if (transform == 0) {
       std::cerr << "Warning: Tried to draw NULL surface, skipped draw" << std::endl;
       return;
-    }  
+    }
 
     int ox, oy;
     if (effect == HORIZONTAL_FLIP)
@@ -435,4 +441,10 @@ namespace SDL
   {
     SDL_Flip(screen);
   }
+
+  void
+  Renderer::resize(int, int)
+  {
+    
+  }
 }