Update INSTALL to tell users to do CMAKE_BUILD_TYPE=DEBUG rather that DEBUG=ON
authorTim Goya <tuxdev103@gmail.com>
Sun, 2 Nov 2008 19:23:07 +0000 (19:23 +0000)
committerTim Goya <tuxdev103@gmail.com>
Sun, 2 Nov 2008 19:23:07 +0000 (19:23 +0000)
SVN-Revision: 5819

INSTALL
src/video/gl_renderer.cpp
src/video/renderer.hpp
src/video/sdl_renderer.cpp

diff --git a/INSTALL b/INSTALL
index dcce186..92a616e 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -111,7 +111,7 @@ INSTALLING UNDER LINUX/UNIX USING CMAKE
         Generates Makefiles that print all commands prior to executing them.
     -Dxxx_LIBRARY=/path/to/library.so -Dxxx_INCLUDE_DIR=/path/to/headerfiles
         Manually specify the installation directory of a library.
         Generates Makefiles that print all commands prior to executing them.
     -Dxxx_LIBRARY=/path/to/library.so -Dxxx_INCLUDE_DIR=/path/to/headerfiles
         Manually specify the installation directory of a library.
-    -DDEBUG=ON
+    -DCMAKE_BUILD_TYPE=DEBUG
         Enables debug mode and compiles extra debug symbols into the SuperTux
         executable. This is useful when sending in bug reports to the
         developers.
         Enables debug mode and compiles extra debug symbols into the SuperTux
         executable. This is useful when sending in bug reports to the
         developers.
index 1d062c4..275d559 100644 (file)
@@ -134,8 +134,6 @@ Renderer::Renderer()
   : desktop_width(-1),
     desktop_height(-1)
 {
   : desktop_width(-1),
     desktop_height(-1)
 {
-  ::Renderer::instance_ = this;
-
 #if SDL_MAJOR_VERSION > 1 || SDL_MINOR_VERSION > 2 || (SDL_MINOR_VERSION == 2 && SDL_PATCHLEVEL >= 10)
   // unfortunately only newer SDLs have these infos.
   // This must be called before SDL_SetVideoMode() or it will return
 #if SDL_MAJOR_VERSION > 1 || SDL_MINOR_VERSION > 2 || (SDL_MINOR_VERSION == 2 && SDL_PATCHLEVEL >= 10)
   // unfortunately only newer SDLs have these infos.
   // This must be called before SDL_SetVideoMode() or it will return
index 2839492..b04d0dc 100644 (file)
@@ -55,11 +55,6 @@ public:
   virtual void flip() = 0;
   virtual void resize(int w, int h) = 0;
   virtual void apply_config() = 0;
   virtual void flip() = 0;
   virtual void resize(int w, int h) = 0;
   virtual void apply_config() = 0;
-
-  static Renderer* instance() { assert(instance_); return instance_; }
-  
-protected:
-  static Renderer* instance_;
 };
 
 #endif
 };
 
 #endif
index b02d0a1..4be1dd0 100644 (file)
@@ -130,8 +130,6 @@ namespace SDL
 {
   Renderer::Renderer()
   {
 {
   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;
     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,11 +141,20 @@ namespace SDL
     log_info << "Color fills are " << (info->blit_fill ? "" : "not ") << "accelerated." << std::endl;
 
     int flags = SDL_SWSURFACE | SDL_ANYFORMAT;
     log_info << "Color fills are " << (info->blit_fill ? "" : "not ") << "accelerated." << std::endl;
 
     int flags = SDL_SWSURFACE | SDL_ANYFORMAT;
+    int width;
+    int height;
     if(config->use_fullscreen)
     if(config->use_fullscreen)
+    {
       flags |= SDL_FULLSCREEN;
       flags |= SDL_FULLSCREEN;
-    
-    int width  = 800; //FIXME: config->screenwidth;
-    int height = 600; //FIXME: config->screenheight;
+      width  = config->fullscreen_width;
+      height = config->fullscreen_height;
+    }
+    else
+    {
+      flags |= SDL_RESIZABLE;
+      width  = config->window_width;
+      height = config->window_height;
+    }
 
     screen = SDL_SetVideoMode(width, height, 0, flags);
     if(screen == 0) {
 
     screen = SDL_SetVideoMode(width, height, 0, flags);
     if(screen == 0) {
@@ -159,20 +166,18 @@ namespace SDL
 
     numerator   = 1;
     denominator = 1;
 
     numerator   = 1;
     denominator = 1;
-    /* FIXME: 
-    float xfactor = (float) config->screenwidth / SCREEN_WIDTH;
-    float yfactor = (float) config->screenheight / SCREEN_HEIGHT;
+    float xfactor = (float) width / SCREEN_WIDTH;
+    float yfactor = (float) height / SCREEN_HEIGHT;
     if(xfactor < yfactor)
     {
     if(xfactor < yfactor)
     {
-      numerator = config->screenwidth;
+      numerator = width;
       denominator = SCREEN_WIDTH;
     }
     else
     {
       denominator = SCREEN_WIDTH;
     }
     else
     {
-      numerator = config->screenheight;
+      numerator = height;
       denominator = SCREEN_HEIGHT;
     }
       denominator = SCREEN_HEIGHT;
     }
-    */
     if(texture_manager == 0)
       texture_manager = new TextureManager();
   }
     if(texture_manager == 0)
       texture_manager = new TextureManager();
   }