X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=misc%2Fbuilddeps%2Fwin32%2Fsdl%2Finclude%2FSDL2%2FSDL_rect.h;h=bbcb9a3b8a2ddffaabc6c3557fe901b2bdffbe54;hb=c40448285437999d5a83a3c9adb62c58ba8640bc;hp=0a95a3344958b82eaf7296407c69726503a7ec5d;hpb=becc6d482266e3dc2d0ffd6451a50d75ff9ee462;p=xonotic%2Fxonotic.git diff --git a/misc/builddeps/win32/sdl/include/SDL2/SDL_rect.h b/misc/builddeps/win32/sdl/include/SDL2/SDL_rect.h index 0a95a334..bbcb9a3b 100644 --- a/misc/builddeps/win32/sdl/include/SDL2/SDL_rect.h +++ b/misc/builddeps/win32/sdl/include/SDL2/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,6 +43,7 @@ extern "C" { * \brief The structure that defines a point * * \sa SDL_EnclosePoints + * \sa SDL_PointInRect */ typedef struct SDL_Point { @@ -66,6 +67,15 @@ typedef struct SDL_Rect int w, h; } SDL_Rect; +/** + * \brief Returns true if point resides inside a rectangle. + */ +SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) +{ + return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; +} + /** * \brief Returns true if the rectangle has no area. */