Mercurial > fife-parpg
changeset 285:37d2b163ef5a
* Replaced preprocessor variable __linux__ with __unix__
* Wrapped entire content of setNativeCursor() within preprocessor directives (should fix #354)
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 19 Jun 2009 17:36:16 +0000 |
parents | ea2c6960bbc8 |
children | bbabe4942150 |
files | engine/core/video/cursor.cpp |
diffstat | 1 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/core/video/cursor.cpp Fri Jun 19 17:14:26 2009 +0000 +++ b/engine/core/video/cursor.cpp Fri Jun 19 17:36:16 2009 +0000 @@ -25,7 +25,7 @@ #include <sdl.h> #endif -#if defined( __linux__ ) +#if defined( __unix__ ) #include <X11/Xcursor/Xcursor.h> #endif @@ -59,7 +59,7 @@ #endif -#if defined( __linux__ ) +#if defined( __unix__ ) // Stops the compiler from confusing it with FIFE:Cursor typedef Cursor XCursor; @@ -211,7 +211,7 @@ break; } -#elif defined( __linux__ ) +#elif defined( __unix__ ) switch (cursor_id) { case NC_ARROW: return 68; @@ -257,15 +257,12 @@ } void Cursor::setNativeCursor(unsigned int cursor_id) { -#if !defined( WIN32 ) && !defined(__linux__) - return; -#endif - +#if defined( WIN32 ) || defined(__unix__) // Check if a value in NativeCursors is requested cursor_id = getNativeId(cursor_id); // Load cursor -#if defined( __linux__ ) +#if defined( __unix__ ) static Display* dsp = XOpenDisplay(NULL); XCursor xCursor = XcursorShapeLoadCursor(dsp, cursor_id); if (xCursor == 0) { @@ -323,7 +320,7 @@ curs2->hot_y = static_cast<Sint16>(iconinfo.yHotspot); } -#elif defined(__linux__) +#elif defined(__unix__) cursor->x_cursor = xCursor; XSync(dsp, false); #endif @@ -331,5 +328,6 @@ m_native_cursor = curs2; SDL_SetCursor(curs2); +#endif // WIN32 || __unix__ } }