From 1dda48408548b7c260d4157f41d38ff93fd9ab96 Mon Sep 17 00:00:00 2001
From: erysdren <[EMAIL REDACTED]>
Date: Wed, 7 Jan 2026 07:22:20 -0600
Subject: [PATCH] haiku: update modelist logic
---
src/video/haiku/SDL_bmodes.cc | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
index d589efe8a4001..813432ebd291a 100644
--- a/src/video/haiku/SDL_bmodes.cc
+++ b/src/video/haiku/SDL_bmodes.cc
@@ -244,13 +244,16 @@ void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
uint32 count, i;
/* 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_AddDisplayMode(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_AddDisplayMode(display, &mode);
+ }
}
}
free(bmodes); /* This should not be SDL_free() */