Fix Xbox link error from IsRectEmpty

This commit is contained in:
Caleb Cornett
2023-05-20 13:09:46 -04:00
committed by Sam Lantinga
parent d7a56b93d5
commit 376a3cd100
4 changed files with 13 additions and 4 deletions

View File

@@ -331,6 +331,12 @@ void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
winrect->bottom = sdlrect->y + sdlrect->h - 1;
}
BOOL WIN_IsRectEmpty(const RECT *rect)
{
/* Calculating this manually because UWP and Xbox do not support Win32 IsRectEmpty. */
return (rect->right <= rect->left) || (rect->bottom <= rect->top);
}
/* Win32-specific SDL_RunApp(), which does most of the SDL_main work,
based on SDL_windows_main.c, placed in the public domain by Sam Lantinga 4/13/98 */
#ifdef __WIN32__

View File

@@ -151,6 +151,9 @@ extern BOOL WIN_IsEqualIID(REFIID a, REFIID b);
extern void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect);
extern void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect);
/* Returns SDL_TRUE if the rect is empty */
extern BOOL WIN_IsRectEmpty(const RECT *rect);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}