summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i_video.c15
-rw-r--r--src/m_config.c2
-rw-r--r--src/setup/display.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/i_video.c b/src/i_video.c
index 7c739c17..5debedb8 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -194,7 +194,7 @@ int screen_height = SCREENHEIGHT;
// Color depth.
-int screen_bpp = 8;
+int screen_bpp = 0;
// Automatically adjust video settings if the selected mode is
// not a valid video mode.
@@ -1462,6 +1462,19 @@ static void AutoAdjustColorDepth(void)
const SDL_VideoInfo *info;
int flags;
+ // If screen_bpp=0, we should use the current (default) pixel depth.
+ // Fetch it from SDL.
+
+ if (screen_bpp == 0)
+ {
+ info = SDL_GetVideoInfo();
+
+ if (info != NULL && info->vfmt != NULL)
+ {
+ screen_bpp = info->vfmt->BitsPerPixel;
+ }
+ }
+
if (fullscreen)
{
flags = SDL_FULLSCREEN;
diff --git a/src/m_config.c b/src/m_config.c
index 8bfbde9f..02817041 100644
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -747,6 +747,8 @@ static default_t extra_defaults_list[] =
//!
// Color depth of the screen, in bits.
+ // If this is set to zero, the color depth will be automatically set
+ // on startup to the machine's default/native color depth.
//
CONFIG_VARIABLE_INT(screen_bpp),
diff --git a/src/setup/display.c b/src/setup/display.c
index da440fce..4e2231d7 100644
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -106,7 +106,7 @@ static int aspect_ratio_correct = 1;
static int fullscreen = 1;
static int screen_width = 320;
static int screen_height = 200;
-static int screen_bpp = 8;
+static int screen_bpp = 0;
static int startup_delay = 1000;
static int usegamma = 0;