- Noted the requirement for automake 1.6 in the README

- Got configure to work out the BUILDSTRING (now BUILDHOST)
  for common.c
- Code cleanups.
This commit is contained in:
Jamie Wilkinson 2002-07-05 12:41:58 +00:00
parent 101e724922
commit abc8f0841e
17 changed files with 397 additions and 487 deletions

3
README
View file

@ -5,7 +5,8 @@ Compiling
---------
If you are checking this out from CVS, run the bootstrap command first to set
up configure. Then follow the instructions in INSTALL.
up configure. You will need autoconf 2.50, automake 1.6, libtool 1.4, or
greater. Then follow the instructions in INSTALL.
Save Games
----------

View file

@ -10,6 +10,8 @@ AM_CONFIG_HEADER(config.h)
dnl get the build and target hosts
AC_CANONICAL_SYSTEM
AC_DEFINE_UNQUOTED(BUILDHOST, "${target_cpu}-${target_os}",
[Set to the canonical name of the target machine])
dnl set the program and version
AM_INIT_AUTOMAKE(quake2, 0.1)

View file

@ -18,9 +18,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __CLIENT_H__
#define __CLIENT_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@ -588,3 +592,5 @@ void x86_TimerStop( void );
void x86_TimerInit( unsigned long smallest, unsigned longest );
unsigned long *x86_TimerGetHistogram( void );
#endif
#endif /* __CLIENT_H__ */

View file

@ -18,7 +18,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
@ -1486,10 +1487,7 @@ void Qcommon_Init (int argc, char **argv)
dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET);
#endif
/* lose the arch
s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
*/
s = va("%s %s %s", VERSION, __DATE__, BUILDSTRING);
s = va("%s %s %s", VERSION, __DATE__, BUILDHOST);
Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET);

View file

@ -1,36 +1,32 @@
/*
gcc_attr.h
GCC __attribute__ protection for lame compilers.
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
/* $Id$
*
* GCC __attribute__ protection for lame compilers.
*
* Copyright (C) 1996-1997 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307, USA
*/
#ifndef __gcc_attr_h
#define __gcc_attr_h
#ifndef __GCC_ATTR_H__
#define __GCC_ATTR_H__
#ifndef __GNUC__
# define __attribute__(x)
#endif
#endif // __gcc_attr_h
#endif /* __GCC_ATTR_H__ */

View file

@ -16,7 +16,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifdef _WIN32

View file

@ -1,4 +1,6 @@
/* $Id$
*
* entry point for the OpenGL refresher
*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) 2002 The Quakeforge Project.
@ -16,7 +18,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <ctype.h>

View file

@ -1,33 +1,40 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* $Id$
*
* key number enumeration to be passed to Key_Event
*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) 2002 The Quakeforge Project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
//
// these are the key numbers that should be passed to Key_Event
//
#ifndef __KEYS_H__
#define __KEYS_H__
/* numbers are specified so that key bindings remain compatible with
* user configurations */
enum QKEYS {
K_TAB = 9,
K_ENTER = 13,
K_ESCAPE = 27,
K_SPACE = 32,
// normal keys should be passed as lowercased ascii
/* normal keys should be passed as lowercased ascii */
K_BACKSPACE = 127,
K_UPARROW = 128,
@ -73,27 +80,24 @@ enum QKEYS {
K_KP_MINUS = 173,
K_KP_PLUS = 174,
//
// mouse buttons generate virtual keys
//
/* mouse buttons generate virtual keys */
K_MOUSE1 = 200,
K_MOUSE2 = 201,
K_MOUSE3 = 202,
K_MOUSE4 = 241,
K_MOUSE5 = 242,
//
// joystick buttons
//
/* joystick buttons */
K_JOY1 = 203,
K_JOY2 = 204,
K_JOY3 = 205,
K_JOY4 = 206,
//
// aux keys are for multi-buttoned joysticks to generate so they can use
// the normal binding process
//
/* aux keys are for multi-buttoned joysticks to generate so they
* can use the normal binding process */
K_AUX1 = 207,
K_AUX2 = 208,
K_AUX3 = 209,
@ -149,3 +153,5 @@ void Key_WriteBindings (FILE *f);
void Key_SetBinding(int keynum, char * binding);
void Key_ClearStates(void);
int Key_GetKey(void);
#endif /* __KEYS_H__ */

View file

@ -44,7 +44,7 @@
#include <sys/mman.h>
#include <errno.h>
/* merged from sys_*.c -- jaq */
/* merged from sys_*.c -- jaq
#if defined(__linux__) || defined(__sgi)
#include <mntent.h>
#elif defined(__FreeBSD__) || defined(__bsd__) || defined (__NetBSD__)
@ -52,24 +52,11 @@
#elif defined(sun)
#include <sys/file.h>
#endif
*/
/* libtool dynamic loader */
#include <ltdl.h>
/* merged from sys_bsd.c -- jaq */
#ifndef RTLD_NOW
#define RTLD_NOW RTLD_LAZY
#endif
/* merged from sys_bsd.c -- jaq */
#ifdef __OpenBSD__
#define dlsym(X, Y) dlsym(X, "_"##Y)
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "qcommon.h"
#include "game.h"
#include "rw.h"

View file

@ -1,85 +1,38 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* $Id$
*
* definitions common between client and server, but not the game dll
*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) 2002 The Quakeforge Project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __QCOMMON_H__
#define __QCOMMON_H__
#include "gcc_attr.h"
// qcommon.h -- definitions common between client and server, but not game.dll
#include "q_shared.h"
/* we define this in config.h now */
/* #define VERSION 3.21 */
#define BASEDIRNAME "baseq2"
#ifdef WIN32
#ifdef NDEBUG
#define BUILDSTRING "Win32 RELEASE"
#else
#define BUILDSTRING "Win32 DEBUG"
#endif
/*
#ifdef _M_IX86
#define CPUSTRING "x86"
#elif defined _M_ALPHA
#define CPUSTRING "AXP"
#endif
*/
#elif defined(__linux__) || defined(__bsd__) || defined (__FreeBSD__) || defined (__NetBSD__)
#define BUILDSTRING "Linux"
/*
#ifdef __i386__
#define CPUSTRING "i386"
#elif defined __alpha__
#define CPUSTRING "axp"
#else
#define CPUSTRING "Unknown"
#endif
*/
#elif defined __sun__
#define BUILDSTRING "Solaris"
/*
#ifdef __i386__
#define CPUSTRING "i386"
#else
#define CPUSTRING "sparc"
#endif
*/
#else // !WIN32
#define BUILDSTRING "NON-WIN32"
/* #define CPUSTRING "NON-WIN32" */
#endif
/* all that crud above should die -- jaq */
#define CPUSTRING ARCH
//============================================================================
typedef struct sizebuf_s
{
qboolean allowoverflow; // if false, do a Com_Error
qboolean overflowed; // set to true if the buffer size failed
typedef struct sizebuf_s {
qboolean allowoverflow; /* if false, do a Com_Error */
qboolean overflowed; /* set to true if the buffer size failed */
byte * data;
int maxsize;
int cursize;
@ -90,7 +43,7 @@ void SZ_Init (sizebuf_t *buf, byte *data, int length);
void SZ_Clear(sizebuf_t * buf);
void * SZ_GetSpace(sizebuf_t * buf, int length);
void SZ_Write(sizebuf_t * buf, void * data, int length);
void SZ_Print (sizebuf_t *buf, char *data); // strcats onto the sizebuf
void SZ_Print(sizebuf_t * buf, char * data); /* strcats onto the sizebuf */
//============================================================================
@ -854,6 +807,4 @@ void SV_Init (void);
void SV_Shutdown (char *finalmsg, qboolean reconnect);
void SV_Frame (int msec);
//char *strlwr (char *); // FIXME: is this needed?
#endif /* __QCOMMON_H__ */

View file

@ -1,35 +1,30 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* $Id$
*
* quake file formats
*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
//
// qfiles.h: quake file formats
// This file must be identical in the quake and utils directories
//
#ifndef __QFILES_H__
#define __QFILES_H__
/*
========================================================================
The .pak files are just a linear collapse of a directory tree
========================================================================
*/
/* The .pak files are just a linear collapse of a directory tree */
#define IDPAKHEADER (('K'<<24)+('C'<<16)+('A'<<8)+'P')
@ -480,3 +475,5 @@ typedef struct
int numareaportals;
int firstareaportal;
} darea_t;
#endif /* __QFILES_H__ */

View file

@ -35,25 +35,16 @@
qboolean QGL_Init( const char *dllname );
void QGL_Shutdown( void );
/* for windos' benefit */
#ifndef APIENTRY
# define APIENTRY
#endif
/*
#ifdef __OpenBSD__ || __FreeBSD__
#define GPA(X) dlsym(glw_state.OpenGLLib, "_"##X)
#else
#define GPA(X) dlsym(glw_state.OpenGLLib, X)
#endif
#ifndef qwglGetProcAddress
#define qwglGetProcAddress(X) (glw_state.OpenGLLib ? GPA(X) : NULL)
#endif
*/
#ifdef __FreeBSD__
extern void *qwglGetProcAddress(char *symbol);
#endif
*/
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
@ -444,7 +435,7 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed,
#endif
/* FIXME: this ifdef sucks */
#if defined __linux__ || defined __FreeBSD__
/*#if defined __linux__ || defined __FreeBSD__*/
// local function in dll
//#ifndef qwglGetProcAddress // FIXME
@ -457,23 +448,22 @@ void APIENTRY Fake_glColorTableEXT( GLenum target, GLenum internalformat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *table );
#endif // linux
/*#endif // linux */
#if defined(__linux__) || defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__)
/*#if defined(__linux__) || defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__)*/
extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
#endif
/*#endif*/
/* deprecated */
#define GL_TEXTURE0_SGIS 0x835E
#define GL_TEXTURE1_SGIS 0x835F
#if 0 // FIXME: these are in glext.h, delete after testing
/*
** extension constants
*/
#if 0 // FIXME: these are in glext.h, delete after testing
// extension constants
#define GL_POINT_SIZE_MIN_EXT 0x8126
#define GL_POINT_SIZE_MAX_EXT 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
@ -489,6 +479,7 @@ extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
#define GL_TEXTURE1_ARB 0x84C1
#endif // FIXME: end of glext.h defines
*/
extern int GL_Texture0, GL_Texture1;

View file

@ -16,9 +16,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __R_LOCAL_H__
#define __R_LOCAL_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -847,3 +851,4 @@ void SWimp_Shutdown( void );
rserr_t SWimp_SetMode( unsigned int *pwidth, unsigned int *pheight, int mode, qboolean fullscreen );
void SWimp_AppActivate( qboolean active );
#endif /* __R_LOCAL_H__ */

View file

@ -1,24 +1,29 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* $Id$
*
* video refresher header
*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) 2002 The Quakeforge Project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __REF_H
#define __REF_H
#ifndef __REF_H__
#define __REF_H__
#include "qcommon.h"
#include "gcc_attr.h"
@ -228,4 +233,4 @@ typedef struct
// this is the only function actually exported at the linker level
typedef refexport_t (*GetRefAPI_t) (refimport_t);
#endif // __REF_H
#endif /* __REF_H__ */

View file

@ -18,7 +18,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __RW_H__
@ -31,7 +32,7 @@ extern void (*KBD_Init_fp)(Key_Event_fp_t fp);
extern void (*KBD_Close_fp)(void);
typedef struct in_state {
// Pointers to functions back in client, set by vid_so
/* Pointers to functions back in client, set by vid_so */
void (*IN_CenterView_fp)(void);
Key_Event_fp_t Key_Event_fp;
vec_t *viewangles;

View file

@ -20,7 +20,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
@ -34,9 +35,11 @@
#include <assert.h>
/*
#ifdef HAVE_DLOPEN
# include <dlfcn.h> // ELF dl loader
#endif
*/
#include <sys/stat.h>
#include <unistd.h>
@ -45,44 +48,25 @@
/* libtool dynamic loader */
#include <ltdl.h>
/* merged in from bsd -- jaq */
/*
#ifndef RTLD_NOW
#define RTLD_NOW RTLD_LAZY
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#ifdef __OpenBSD__
#define dlsym(X, Y) dlsym(X, "_"##Y)
#endif
*/
#include "client.h"
#include "rw.h"
// Structure containing functions exported from refresh DLL
/* Structure containing functions exported from refresh DLL */
refexport_t re;
/* merged from irix/vid_so.c -- jaq */
/*
#ifdef REF_HARD_LINKED
refexport_t GetRefAPI(refimport_t rimp);
#endif
*/
/* Console variables that we need to access from this module */
cvar_t * vid_gamma; /* gamma value */
cvar_t * vid_ref; /* name of refresher dll */
cvar_t * vid_xpos; /* window position x */
cvar_t * vid_ypos; /* window position y */
cvar_t * vid_fullscreen; /* fullscreen on or off */
// Console variables that we need to access from this module
cvar_t *vid_gamma;
cvar_t *vid_ref; // Name of Refresh DLL loaded
cvar_t *vid_xpos; // X coordinate of window position
cvar_t *vid_ypos; // Y coordinate of window position
cvar_t *vid_fullscreen;
/* global video state; used by other modules */
viddef_t viddef;
/* Handle to refresh DLL */
lt_dlhandle reflib_library = NULL;
// Global variables used internally by this module
viddef_t viddef; // global video state; used by other modules
lt_dlhandle reflib_library = NULL; // Handle to refresh DLL
qboolean reflib_active = 0;
#define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )
@ -206,27 +190,18 @@ qboolean VID_GetModeInfo( unsigned int *width, unsigned int *height, int mode )
/*
** VID_NewWindow
*/
void VID_NewWindow ( int width, int height)
{
void VID_NewWindow(int width, int height) {
viddef.width = width;
viddef.height = height;
}
void VID_FreeReflib (void)
{
void VID_FreeReflib(void) {
if (reflib_library) {
if (KBD_Close_fp)
KBD_Close_fp();
if (RW_IN_Shutdown_fp)
RW_IN_Shutdown_fp();
/* merged from irix/vid_so.c -- jaq */
/*
#ifndef REF_HARD_LINKED
*/
lt_dlclose(reflib_library);
/*
#endif
*/
}
KBD_Init_fp = NULL;
@ -388,38 +363,27 @@ qboolean VID_LoadRefresh(char * name) {
return true;
}
/*
============
VID_CheckChanges
This function gets called once just before drawing each frame, and it's sole purpose in life
is to check to see if any of the video mode parameters have changed, and if they have to
update the rendering DLL and/or video mode to match.
============
*/
void VID_CheckChanges (void)
{
/* This function gets called once just before drawing each frame, and
* its sole purpose in life is to check to see if any of the video mode
* parameters have changed, and if they have to update the rendering DLL
* and/or video mode to match. */
void VID_CheckChanges(void) {
char name[100];
cvar_t *sw_mode;
if ( vid_ref->modified )
{
if (vid_ref->modified) {
S_StopAllSounds();
}
while (vid_ref->modified)
{
/*
** refresh has changed
*/
while (vid_ref->modified) {
/* refresher has changed */
vid_ref->modified = false;
vid_fullscreen->modified = true;
cl.refresh_prepped = false;
cls.disable_screen = true;
sprintf(name, "ref_%s", vid_ref->string);
if ( !VID_LoadRefresh( name ) )
{
if (!VID_LoadRefresh(name)) {
if (strcmp(vid_ref->string, "soft") == 0 ||
strcmp(vid_ref->string, "softx") == 0) {
Com_Printf("Refresh failed\n");
@ -439,17 +403,13 @@ void VID_CheckChanges (void)
else
Cvar_Set("vid_ref", "soft");
/*
** drop the console if we fail to load a refresh
*/
if ( cls.key_dest != key_console )
{
/* drop the console if we fail to load a refresh */
if (cls.key_dest != key_console) {
Con_ToggleConsole_f();
}
}
cls.disable_screen = false;
}
}
/*