From a6db4d8004da5ad985a5ff26c0c01976a5618449 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 16 Jul 2005 19:26:59 +0000 Subject: Updated changelog, got rid of remaining extern SDL_Surface *screen cases, fixed double free and cleaned up a bit. --- src/gui/window.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/gui/window.cpp') diff --git a/src/gui/window.cpp b/src/gui/window.cpp index e6a55ea0..158e9272 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -22,13 +22,11 @@ */ #include "window.h" +#include "gui.h" #include "../resources/resourcemanager.h" #include "../log.h" #include "../main.h" -// TODO Check if we can get rid of this -extern SDL_Surface *screen; - WindowContainer *Window::windowContainer = NULL; int Window::instances = 0; ImageRect Window::border; @@ -302,26 +300,26 @@ void Window::mouseMotion(int x, int y) newDim.y = 0; } - if (newDim.x + newDim.width > screen->w) + if (newDim.x + newDim.width > guiGraphics->getWidth()) { if (mMouseResize) { - newDim.width = screen->w - newDim.x; + newDim.width = guiGraphics->getWidth() - newDim.x; } else { - newDim.x = screen->w - newDim.width; + newDim.x = guiGraphics->getWidth() - newDim.width; } } - if (newDim.y + newDim.height > screen->h) + if (newDim.y + newDim.height > guiGraphics->getHeight()) { if (mMouseResize) { - newDim.height = screen->h - newDim.y; + newDim.height = guiGraphics->getHeight() - newDim.y; } else { - newDim.y = screen->h - newDim.height; + newDim.y = guiGraphics->getHeight() - newDim.height; } } -- cgit v1.2.3-70-g09d2