# HG changeset patch # User cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1245432976 0 # Node ID 37d2b163ef5a22f74c5dfae76d01937a232518b5 # Parent ea2c6960bbc8a383841a839358d12c2f31c5415e * Replaced preprocessor variable __linux__ with __unix__ * Wrapped entire content of setNativeCursor() within preprocessor directives (should fix #354) diff -r ea2c6960bbc8 -r 37d2b163ef5a engine/core/video/cursor.cpp --- 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 #endif -#if defined( __linux__ ) +#if defined( __unix__ ) #include #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(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__ } }