don't adjust aspect-ratio in non-fullscreen modes, removed a few unneeded headers
authorMatthias Braun <matze@braunis.de>
Mon, 16 Apr 2007 17:48:28 +0000 (17:48 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 16 Apr 2007 17:48:28 +0000 (17:48 +0000)
SVN-Revision: 4986

src/console.cpp
src/gui/mousecursor.cpp
src/main.cpp
src/sprite/sprite.hpp
src/video/drawing_context.hpp

index 2a7dbdc..d636f67 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <iostream>
 #include <SDL_timer.h>
+#include <SDL_keyboard.h>
 #include "console.hpp"
 #include "video/drawing_context.hpp"
 #include "video/surface.hpp"
index b2010c5..ba2da77 100644 (file)
@@ -19,6 +19,9 @@
 
 #include <config.h>
 
+#include <SDL_events.h>
+#include <SDL_mouse.h>
+
 #include "video/drawing_context.hpp"
 #include "gui/mousecursor.hpp"
 #include "main.hpp"
@@ -31,15 +34,11 @@ MouseCursor::MouseCursor(std::string cursor_file) : mid_x(0), mid_y(0)
   cursor = new Surface(cursor_file);
 
   cur_state = MC_NORMAL;
-
-  SDL_ShowCursor(SDL_DISABLE);
 }
 
 MouseCursor::~MouseCursor()
 {
   delete cursor;
-
-  SDL_ShowCursor(SDL_ENABLE);
 }
 
 int MouseCursor::state()
index a715926..8a7ba54 100644 (file)
@@ -411,11 +411,13 @@ void init_video()
   }
 #endif
 
+  SDL_ShowCursor(0);
+
   double aspect_ratio = config->aspect_ratio;
 
   // try to guess aspect ratio of monitor if needed
   if (aspect_ratio <= 0) {
-    if(desktop_width > 0) {
+    if(config->use_fullscreen && desktop_width > 0) {
       aspect_ratio = static_cast<double>(desktop_width) / static_cast<double>(desktop_height);
     } else {
       aspect_ratio = 4.0 / 3.0;
index b85b62e..a3edb33 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <string>
 #include <assert.h>
-#include <SDL.h>
 
 #include "math/vector.hpp"
 #include "math/rect.hpp"
@@ -32,7 +31,6 @@
 
 class Surface;
 class DrawingContext;
-class Color;
 class Blend;
 
 class Sprite
index b742b37..296ea8e 100644 (file)
 
 #include <vector>
 #include <string>
+#include <memory>
+
 #include <stdint.h>
 
 #include <GL/gl.h>
-#include <SDL.h>
-#include <stdint.h>
-#include <memory>
+#include <SDL_video.h>
 
 #include "obstack/obstack.h"
 #include "math/vector.hpp"