From 3426cb7d4681d4fbedce3599b7ac896b9301b114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20A=2E=20A=CC=81lvarez?= Date: Sun, 10 Nov 2019 14:16:33 +0100 Subject: [PATCH] add all video modes when rootless --- BasiliskII/src/SDL/video_sdl2.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/SDL/video_sdl2.cpp b/BasiliskII/src/SDL/video_sdl2.cpp index a514baec..8dec5feb 100644 --- a/BasiliskII/src/SDL/video_sdl2.cpp +++ b/BasiliskII/src/SDL/video_sdl2.cpp @@ -1484,8 +1484,14 @@ bool VideoInit(bool classic) } #ifdef VIDEO_ROOTLESS } else if (display_type == DISPLAY_ROOTLESS) { - for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++) - add_mode(display_type, default_width, default_height, 0x80, TrivialBytesPerRow(default_width, (video_depth)d), d); + for (int i = 0; video_modes[i].w != 0; i++) { + const int w = video_modes[i].w; + const int h = video_modes[i].h; + if (i > 0 && (w >= default_width || h >= default_height)) + continue; + for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++) + add_mode(display_type, w, h, video_modes[i].resolution_id, TrivialBytesPerRow(w, (video_depth)d), d); + } #endif }