Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / gui / mousecursor.cpp
index 3a87321..f9a000d 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
 //
 //  This program is distributed in the hope that it will be useful,
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  GNU General Public License for more details.
 //
 //  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#include <config.h>
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "gui/mousecursor.hpp"
 
-#include <SDL_events.h>
-#include <SDL_mouse.h>
+#include <SDL.h>
 
-#include "video/surface.hpp"
+#include "supertux/main.hpp"
 #include "video/drawing_context.hpp"
-#include "main.hpp"
 
 MouseCursor* MouseCursor::current_ = 0;
-extern SDL_Surface* screen;
+extern SDL_Surface* g_screen;
 
 MouseCursor::MouseCursor(std::string cursor_file) : mid_x(0), mid_y(0)
 {
@@ -67,8 +60,8 @@ void MouseCursor::draw(DrawingContext& context)
   int x,y,w,h;
   Uint8 ispressed = SDL_GetMouseState(&x,&y);
 
-  x = int(x * float(SCREEN_WIDTH)/screen->w);
-  y = int(y * float(SCREEN_HEIGHT)/screen->h);
+  x = int(x * float(SCREEN_WIDTH)/g_screen->w);
+  y = int(y * float(SCREEN_HEIGHT)/g_screen->h);
 
   w = (int) cursor->get_width();
   h = (int) (cursor->get_height() / MC_STATES_NB);
@@ -83,5 +76,7 @@ void MouseCursor::draw(DrawingContext& context)
   }
 
   context.draw_surface_part(cursor, Vector(0, h*cur_state),
-          Vector(w, h), Vector(x-mid_x, y-mid_y), LAYER_GUI+100);
+                            Vector(w, h), Vector(x-mid_x, y-mid_y), LAYER_GUI+100);
 }
+
+/* EOF */