diff --git a/src/level.cpp b/src/level.cpp index 7cf3143..3faa066 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -84,6 +84,7 @@ const int kCursorHeight = 32; extern MBoolean useNewTitle; +#if USE_CURSOR_SPRITE static void InsertCursor( MPoint mouseHere, SDL_Surface* scratch, SDL_Surface* surface ) { SkittlesFontPtr cursorFont = GetFont( picFont ); @@ -114,6 +115,7 @@ static void RemoveCursor( MPoint mouseHere, SDL_Surface* scratch, SDL_Surface* s SDLU_BlitSurface( scratch, &cursorBackSDLRect, surface, &cursorFrontSDLRect ); } +#endif static void GameStartMenuRepaint() { @@ -126,7 +128,9 @@ void GameStartMenu( void ) // multiple times in a row, thanks to "redo". Put initializations after redo. SDL_Surface* gameStartSurface; SDL_Surface* gameStartDrawSurface; +#if USE_CURSOR_SPRITE SDL_Surface* cursorBackSurface; +#endif SDL_Rect backdropSDLRect = { 0, 0, 640, 480 }; SDL_Rect cursorBackSDLRect = { 0, 0, kCursorWidth, kCursorHeight }; SDL_Rect destSDLRect; @@ -181,8 +185,12 @@ void GameStartMenu( void ) black = SDL_MapRGB( gameStartSurface->format, 0, 0, 0 ); // make cursor backing store +#if USE_CURSOR_SPRITE cursorBackSurface = SDLU_InitSurface( &cursorBackSDLRect, 32 ); SDL_FillRect( cursorBackSurface, &cursorBackSDLRect, black ); +#else + SDL_ShowCursor( 1 ); +#endif // make drawing surface gameStartDrawSurface = SDLU_InitSurface( &backdropSDLRect, 32 ); @@ -279,11 +287,13 @@ void GameStartMenu( void ) SDLU_AcquireSurface( gameStartDrawSurface ); // Take the cursor out of the scene +#if USE_CURSOR_SPRITE RemoveCursor( mouse, cursorBackSurface, gameStartDrawSurface ); drawRect[kCursor].top = mouse.v; drawRect[kCursor].left = mouse.h; drawRect[kCursor].bottom = mouse.v + kCursorHeight; drawRect[kCursor].right = mouse.h + kCursorWidth; +#endif // Inverted rectangles mean "nothing to do." drawRect[kLeftSide].top = drawRect[kRightSide].top = drawRect[kGlow].top = @@ -486,11 +496,13 @@ void GameStartMenu( void ) } // Reinsert the cursor into the scene +#if USE_CURSOR_SPRITE InsertCursor( mouse, cursorBackSurface, gameStartDrawSurface ); drawRect[kCursor].top = min( drawRect[kCursor].top, mouse.v ); drawRect[kCursor].left = min( drawRect[kCursor].left, mouse.h ); drawRect[kCursor].bottom = max( drawRect[kCursor].bottom, mouse.v + kCursorHeight ); drawRect[kCursor].right = max( drawRect[kCursor].right, mouse.h + kCursorWidth ); +#endif // Copy down everything if( shouldFullRepaint ) @@ -534,6 +546,12 @@ void GameStartMenu( void ) { selected = kTitleItemQuit; } + else + { +#if !USE_CURSOR_SPRITE + SDL_ShowCursor( 0 ); +#endif + } switch( selected ) { @@ -547,7 +565,9 @@ void GameStartMenu( void ) SDL_FreeSurface( gameStartSurface ); SDL_FreeSurface( gameStartDrawSurface ); +#if USE_CURSOR_SPRITE SDL_FreeSurface( cursorBackSurface ); +#endif QuickFadeOut( NULL ); diff --git a/src/main.cpp b/src/main.cpp index 0e79955..c140bfe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -560,7 +560,7 @@ void CenterRectOnScreen( MRect *rect, double locationX, double locationY ) void ReserveMonitor( void ) { - SDL_ShowCursor( SDL_DISABLE ); +// SDL_ShowCursor( SDL_DISABLE ); SDL_SetHint(SDL_HINT_RENDER_VSYNC, "1"); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, crispUpscaling? "0": "best"); diff --git a/src/pause.cpp b/src/pause.cpp index 29f78a7..71c2462 100644 --- a/src/pause.cpp +++ b/src/pause.cpp @@ -462,6 +462,7 @@ static MBoolean DrawDialogBox( MBoolean larger, int animationType, int *target, return animationStageComplete; } +#if USE_CURSOR_SPRITE static void DrawDialogCursor( MRect *pauseRect, int *shade ) { MPoint p, q; @@ -482,6 +483,7 @@ static void DrawDialogCursor( MRect *pauseRect, int *shade ) SDLU_ReleaseSurface( drawSurface ); } +#endif static void DrawDialogLogo( MRect *pauseRect, int shade ) { @@ -1051,6 +1053,10 @@ void HandleDialog( int type ) lastPauseRect.bottom = lastPauseRect.right = -9999; SDLU_StartWatchingTyping(); + +#if !USE_CURSOR_SPRITE + SDL_ShowCursor( 1 ); +#endif DoFullRepaint = ItsTimeToRedraw; @@ -1076,6 +1082,10 @@ void HandleDialog( int type ) if( DialogSelected[dialogType]( &dialogItem, inASCII, inSDLKey ) ) { +#if !USE_CURSOR_SPRITE + SDL_ShowCursor( 0 ); +#endif + dialogStage = kClosing; dialogTarget = 0; } @@ -1121,9 +1131,11 @@ void HandleDialog( int type ) // ... and animation is complete so add content DialogDraw[dialogType]( &dialogItem, dialogShade ); - + +#if USE_CURSOR_SPRITE // ... and cursor DrawDialogCursor( &pauseRect, &dialogShade ); +#endif } SurfaceCurveEdges( drawSurface, &pauseRect );