solve FIXMEs in SDL_video.c
parent
e5c599f8c6
commit
ac3349faaf
|
@ -694,10 +694,14 @@ SDL_GetDisplayName(int displayIndex)
|
|||
int
|
||||
SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
|
||||
CHECK_DISPLAY_INDEX(displayIndex, -1);
|
||||
|
||||
if (rect) {
|
||||
SDL_VideoDisplay *display = &_this->displays[displayIndex];
|
||||
if (!rect)
|
||||
return SDL_InvalidParamError("rect");
|
||||
|
||||
display = &_this->displays[displayIndex];
|
||||
|
||||
if (_this->GetDisplayBounds) {
|
||||
if (_this->GetDisplayBounds(_this, display, rect) == 0) {
|
||||
|
@ -715,8 +719,7 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)
|
|||
}
|
||||
rect->w = display->current_mode.w;
|
||||
rect->h = display->current_mode.h;
|
||||
}
|
||||
return 0; /* !!! FIXME: should this be an error if (rect==NULL) ? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -729,10 +732,14 @@ ParseDisplayUsableBoundsHint(SDL_Rect *rect)
|
|||
int
|
||||
SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
|
||||
CHECK_DISPLAY_INDEX(displayIndex, -1);
|
||||
|
||||
if (rect) {
|
||||
SDL_VideoDisplay *display = &_this->displays[displayIndex];
|
||||
if (!rect)
|
||||
return SDL_InvalidParamError("rect");
|
||||
|
||||
display = &_this->displays[displayIndex];
|
||||
|
||||
if ((displayIndex == 0) && ParseDisplayUsableBoundsHint(rect)) {
|
||||
return 0;
|
||||
|
@ -746,8 +753,6 @@ SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect)
|
|||
|
||||
/* Oh well, just give the entire display bounds. */
|
||||
return SDL_GetDisplayBounds(displayIndex, rect);
|
||||
}
|
||||
return 0; /* !!! FIXME: should this be an error if (rect==NULL) ? */
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue