Xbox buildfixes

This commit is contained in:
Ethan Lee 2024-08-04 15:31:15 -04:00
parent 4b3a80bb73
commit 4bea89e945
3 changed files with 7 additions and 2 deletions

View File

@ -473,12 +473,14 @@ int WIN_VideoInit(SDL_VideoDevice *_this)
if (SUCCEEDED(hr)) {
data->coinitialized = SDL_TRUE;
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
hr = OleInitialize(NULL);
if (SUCCEEDED(hr)) {
data->oleinitialized = SDL_TRUE;
} else {
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "OleInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality\n", (unsigned int)hr);
}
#endif /* !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) */
} else {
SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, "CoInitialize() failed: 0x%.8x, using fallback drag-n-drop functionality\n", (unsigned int)hr);
}
@ -543,10 +545,12 @@ void WIN_VideoQuit(SDL_VideoDevice *_this)
WIN_SetRawMouseEnabled(_this, SDL_FALSE);
WIN_SetRawKeyboardEnabled(_this, SDL_FALSE);
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
if (data->oleinitialized) {
OleUninitialize();
data->oleinitialized = SDL_FALSE;
}
#endif /* !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) */
if (data->coinitialized) {
WIN_CoUninitialize();
data->coinitialized = SDL_FALSE;

View File

@ -380,7 +380,9 @@ struct SDL_VideoData
int render;
SDL_bool coinitialized;
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
SDL_bool oleinitialized;
#endif /* !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) */
DWORD clipboard_count;

View File

@ -589,11 +589,10 @@ static void CleanupWindowData(SDL_VideoDevice *_this, SDL_Window *window)
if (data) {
SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, WIN_MouseRelativeModeCenterChanged, data);
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
if (data->drop_target) {
WIN_AcceptDragAndDrop(window, SDL_FALSE);
}
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
if (data->ICMFileName) {
SDL_free(data->ICMFileName);
}