From dc6775ae0b7cb9aa96d630e6e0abdb6c44e1b82c Mon Sep 17 00:00:00 2001
From: erysdren <[EMAIL REDACTED]>
Date: Wed, 7 Jan 2026 07:24:02 -0600
Subject: [PATCH] haiku: update modelist logic
---
src/video/haiku/SDL_bmodes.cc | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
index 0f31191ffd3d2..4d4d6db5b83c6 100644
--- a/src/video/haiku/SDL_bmodes.cc
+++ b/src/video/haiku/SDL_bmodes.cc
@@ -243,22 +243,26 @@ bool HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
display_mode this_bmode;
display_mode *bmodes;
uint32 count, i;
+ bool r = false;
// Get graphics-hardware supported modes
- if (bscreen.GetModeList(&bmodes, &count) == B_OK && bscreen.GetMode(&this_bmode) == B_OK)
+ if (bscreen.GetModeList(&bmodes, &count) == B_OK)
{
- for (i = 0; i < count; ++i) {
- // FIXME: Apparently there are errors with colorspace changes
- if (bmodes[i].space == this_bmode.space) {
- _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
- SDL_AddFullscreenDisplayMode(display, &mode);
+ if (bscreen.GetMode(&this_bmode) == B_OK)
+ {
+ for (i = 0; i < count; ++i) {
+ // FIXME: Apparently there are errors with colorspace changes
+ if (bmodes[i].space == this_bmode.space) {
+ _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
+ SDL_AddFullscreenDisplayMode(display, &mode);
+ }
}
+ r = true;
}
free(bmodes); // This should NOT be SDL_free()
- return true;
}
- return false;
+ return r;
}