From 62b7442c7d1494a6b5f20add7822ef01d78bbc97 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Fri, 27 Apr 2018 21:44:04 -0400 Subject: [PATCH] Updates PlatformCursorController to use full set of SDL cursors. Adds support for the SDL_SYSTEM_CURSOR_WAITARROW and SDL_SYSTEM_CURSOR_NO. --- Engine/source/windowManager/platformCursorController.h | 3 +++ Engine/source/windowManager/sdl/sdlCursorController.cpp | 5 +++-- Engine/source/windowManager/win32/win32CursorController.cpp | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Engine/source/windowManager/platformCursorController.h b/Engine/source/windowManager/platformCursorController.h index 686f4d390..4bd969a5c 100644 --- a/Engine/source/windowManager/platformCursorController.h +++ b/Engine/source/windowManager/platformCursorController.h @@ -76,6 +76,9 @@ public: curResizeNESW, curResizeNWSE, curHand, + curWaitArrow, + curNoNo, + numPlatformCursors }; public: diff --git a/Engine/source/windowManager/sdl/sdlCursorController.cpp b/Engine/source/windowManager/sdl/sdlCursorController.cpp index dca1f04be..601df4e19 100644 --- a/Engine/source/windowManager/sdl/sdlCursorController.cpp +++ b/Engine/source/windowManager/sdl/sdlCursorController.cpp @@ -41,7 +41,8 @@ static struct { U32 id; SDL_SystemCursor resourceID; SDL_Cursor *cursor;} sgCurs { PlatformCursorController::curResizeNESW, SDL_SYSTEM_CURSOR_SIZENESW, NULL }, { PlatformCursorController::curResizeNWSE, SDL_SYSTEM_CURSOR_SIZENWSE, NULL }, { PlatformCursorController::curHand, SDL_SYSTEM_CURSOR_HAND, NULL }, - { 0, SDL_SYSTEM_CURSOR_NO, NULL }, + { PlatformCursorController::curWaitArrow, SDL_SYSTEM_CURSOR_WAITARROW, NULL }, + { PlatformCursorController::curNoNo, SDL_SYSTEM_CURSOR_NO, NULL }, }; @@ -90,7 +91,7 @@ void PlatformCursorControllerSDL::setCursorShape(U32 cursorID) { SDL_Cursor* cursor = NULL; - for(S32 i = 0; sgCursorShapeMap[i].resourceID != SDL_SYSTEM_CURSOR_NO; ++i) + for(S32 i = 0; i < numPlatformCursors; ++i) { if(cursorID == sgCursorShapeMap[i].id) { diff --git a/Engine/source/windowManager/win32/win32CursorController.cpp b/Engine/source/windowManager/win32/win32CursorController.cpp index ba19b0979..25e024e65 100644 --- a/Engine/source/windowManager/win32/win32CursorController.cpp +++ b/Engine/source/windowManager/win32/win32CursorController.cpp @@ -43,7 +43,8 @@ static struct { U32 id; LPTSTR resourceID; } sgCursorShapeMap[]= { PlatformCursorController::curResizeNESW, IDC_SIZENESW }, { PlatformCursorController::curResizeNWSE, IDC_SIZENWSE }, { PlatformCursorController::curHand, IDC_HAND }, - { 0, 0 }, + { PlatformCursorController::curWaitArrow, IDC_WAIT }, + { PlatformCursorController::curNoNo, IDC_NO }, }; //static const EnumTable::Enums curManagerShapesEnums[] = @@ -129,7 +130,7 @@ void Win32CursorController::setCursorShape(U32 cursorID) { LPTSTR resourceID = NULL; - for(S32 i = 0;sgCursorShapeMap[i].resourceID != NULL;++i) + for(S32 i = 0; i < numPlatformCursors; ++i) { if(cursorID == sgCursorShapeMap[i].id) {