Fix Xbox link error from IsRectEmpty

(cherry picked from commit 376a3cd100)
This commit is contained in:
Caleb Cornett
2023-05-20 13:09:46 -04:00
committed by Sam Lantinga
parent 1ee9a437f9
commit 2001a891c4
4 changed files with 12 additions and 4 deletions

View File

@@ -333,6 +333,11 @@ 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);
}
#endif /* defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) */
/*

View File

@@ -153,6 +153,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
}