ref: 4ec7c7b066c4754b8ef8b01397111f6177b0d9b2
parent: 95b8e84325654d5024b602b5e974447bef5e37fd
author: Simon Howard <[email protected]>
date: Fri May 26 11:37:09 EDT 2006
Add an option to disable autoadjusting the video mode. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 532
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 526 2006-05-25 20:18:19Z fraggle $
+// $Id: i_video.c 532 2006-05-26 15:37:09Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -175,7 +175,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 526 2006-05-25 20:18:19Z fraggle $";
+rcsid[] = "$Id: i_video.c 532 2006-05-26 15:37:09Z fraggle $";
#include <SDL.h>
#include <ctype.h>
@@ -231,18 +231,27 @@
static boolean native_surface;
+// Automatically adjust video settings if the selected mode is
+// not a valid video mode.
+
+int autoadjust_video_settings = 1;
+
// Run in full screen mode? (int type for config code)
+
int fullscreen = FULLSCREEN_ON;
// Time to wait for the screen to settle on startup before starting the
// game (ms)
+
int startup_delay = 0;
// Grab the mouse? (int type for config code)
+
int grabmouse = true;
// Flag indicating whether the screen is currently visible:
// when the screen isnt visible, don't render the screen
+
boolean screenvisible;
// Blocky mode,
@@ -249,6 +258,7 @@
// replace each 320x200 pixel with screenmultiply*screenmultiply pixels.
// According to Dave Taylor, it still is a bonehead thing
// to use ....
+
int screenmultiply = 1;
// disk image data and background overwritten by the disk to be
@@ -1085,7 +1095,7 @@
if (screenmultiply > 4)
screenmultiply = 4;
- if (fullscreen)
+ if (fullscreen && autoadjust_video_settings)
{
int oldw, oldh;
int old_fullscreen, old_screenmultiply;
@@ -1138,6 +1148,11 @@
printf("\tletterbox mode on (fullscreen=2)\n");
if (screenmultiply != old_screenmultiply)
printf("\tscreenmultiply=%i\n", screenmultiply);
+
+ printf("NOTE: Your video settings have been adjusted. "
+ "To disable this behavior,\n"
+ "set autoadjust_video_settings to 0 in your "
+ "configuration file.");
}
if (!CheckValidFSMode())
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.h 484 2006-05-19 20:01:59Z fraggle $
+// $Id: i_video.h 532 2006-05-26 15:37:09Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -60,9 +60,10 @@
void I_SetWindowCaption(void);
void I_SetWindowIcon(void);
+extern int autoadjust_video_settings;
extern boolean screenvisible;
extern int screenmultiply;
-extern boolean fullscreen;
+extern int fullscreen;
extern boolean grabmouse;
extern float mouse_acceleration;
extern int startup_delay;
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_misc.c 484 2006-05-19 20:01:59Z fraggle $
+// $Id: m_misc.c 532 2006-05-26 15:37:09Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -106,7 +106,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: m_misc.c 484 2006-05-19 20:01:59Z fraggle $";
+rcsid[] = "$Id: m_misc.c 532 2006-05-26 15:37:09Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
@@ -395,16 +395,17 @@
static default_t extra_defaults_list[] =
{
- {"grabmouse", &grabmouse},
- {"fullscreen", &fullscreen},
- {"screenmultiply", &screenmultiply},
- {"novert", &novert},
- {"mouse_acceleration", &mouse_acceleration, DEFAULT_FLOAT},
- {"show_endoom", &show_endoom},
- {"vanilla_savegame_limit", &vanilla_savegame_limit},
- {"startup_delay", &startup_delay},
+ {"autoadjust_video_settings", &autoadjust_video_settings},
+ {"fullscreen", &fullscreen},
+ {"startup_delay", &startup_delay},
+ {"screenmultiply", &screenmultiply},
+ {"grabmouse", &grabmouse},
+ {"novert", &novert},
+ {"mouse_acceleration", &mouse_acceleration, DEFAULT_FLOAT},
+ {"show_endoom", &show_endoom},
+ {"vanilla_savegame_limit", &vanilla_savegame_limit},
#ifdef FEATURE_MULTIPLAYER
- {"player_name", &net_player_name, DEFAULT_STRING},
+ {"player_name", &net_player_name, DEFAULT_STRING},
#endif
};