From 06111415b117fc47b5b8bf6396d855616778f3b0 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 14 Jul 2005 00:41:48 +0000 Subject: Committed resource manager cleanup patch by Doener, and properly implemented the custom mouse cursor option, which is now also dynamically changeable through the setup window. --- src/graphics.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'src/graphics.cpp') diff --git a/src/graphics.cpp b/src/graphics.cpp index 16b8f67b..5eae65bf 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -31,8 +31,7 @@ extern volatile int framesToDraw; SDL_Surface *screen; -Graphics::Graphics(): - mouseCursor(NULL) +Graphics::Graphics() { if (useOpenGL) { #ifdef USE_OPENGL @@ -53,19 +52,6 @@ Graphics::Graphics(): #endif } - if (config.getValue("cursor", 1) == 1) - { - // Hide the system mouse cursor - SDL_ShowCursor(SDL_DISABLE); - - // Load the mouse cursor - ResourceManager *resman = ResourceManager::getInstance(); - mouseCursor = resman->getImage("graphics/gui/mouse.png"); - if (!mouseCursor) { - logger->error("Unable to load mouse cursor."); - } - } - // Initialize for drawing _beginDraw(); } @@ -74,8 +60,6 @@ Graphics::~Graphics() { // Deinitialize for drawing _endDraw(); - - mouseCursor->decRef(); } int Graphics::getWidth() @@ -140,17 +124,6 @@ void Graphics::drawImageRect( void Graphics::updateScreen() { - int mouseX, mouseY; - Uint8 button = SDL_GetMouseState(&mouseX, &mouseY); - - if (SDL_GetAppState() & SDL_APPMOUSEFOCUS || button & SDL_BUTTON(1)) - { - // Draw mouse before flipping - if (mouseCursor != NULL) { - mouseCursor->draw(screen, mouseX - 5, mouseY - 2); - } - } - if (useOpenGL) { #ifdef USE_OPENGL glFlush(); -- cgit v1.2.3-70-g09d2