Skip to content

Commit 1dda484

Browse files
erysdrenicculus
authored andcommitted
haiku: update modelist logic
1 parent e14514f commit 1dda484

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/video/haiku/SDL_bmodes.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,16 @@ void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
244244
uint32 count, i;
245245

246246
/* Get graphics-hardware supported modes */
247-
if (bscreen.GetModeList(&bmodes, &count) == B_OK && bscreen.GetMode(&this_bmode) == B_OK)
247+
if (bscreen.GetModeList(&bmodes, &count) == B_OK)
248248
{
249-
for (i = 0; i < count; ++i) {
250-
// FIXME: Apparently there are errors with colorspace changes
251-
if (bmodes[i].space == this_bmode.space) {
252-
_BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
253-
SDL_AddDisplayMode(display, &mode);
249+
if (bscreen.GetMode(&this_bmode) == B_OK)
250+
{
251+
for (i = 0; i < count; ++i) {
252+
// FIXME: Apparently there are errors with colorspace changes
253+
if (bmodes[i].space == this_bmode.space) {
254+
_BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
255+
SDL_AddDisplayMode(display, &mode);
256+
}
254257
}
255258
}
256259
free(bmodes); /* This should not be SDL_free() */

0 commit comments

Comments
 (0)