- 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 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 Save Games
---------- ----------

View file

@ -10,6 +10,8 @@ AM_CONFIG_HEADER(config.h)
dnl get the build and target hosts dnl get the build and target hosts
AC_CANONICAL_SYSTEM 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 dnl set the program and version
AM_INIT_AUTOMAKE(quake2, 0.1) AM_INIT_AUTOMAKE(quake2, 0.1)

View file

@ -18,9 +18,13 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * 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 #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
@ -588,3 +592,5 @@ void x86_TimerStop( void );
void x86_TimerInit( unsigned long smallest, unsigned longest ); void x86_TimerInit( unsigned long smallest, unsigned longest );
unsigned long *x86_TimerGetHistogram( void ); unsigned long *x86_TimerGetHistogram( void );
#endif #endif
#endif /* __CLIENT_H__ */

View file

@ -18,7 +18,8 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * 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 #ifdef HAVE_CONFIG_H
@ -1486,10 +1487,7 @@ void Qcommon_Init (int argc, char **argv)
dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET); dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET);
#endif #endif
/* lose the arch s = va("%s %s %s", VERSION, __DATE__, BUILDHOST);
s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
*/
s = va("%s %s %s", VERSION, __DATE__, BUILDSTRING);
Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET); Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET);

View file

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

View file

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

View file

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

View file

@ -44,7 +44,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <errno.h>
/* merged from sys_*.c -- jaq */ /* merged from sys_*.c -- jaq
#if defined(__linux__) || defined(__sgi) #if defined(__linux__) || defined(__sgi)
#include <mntent.h> #include <mntent.h>
#elif defined(__FreeBSD__) || defined(__bsd__) || defined (__NetBSD__) #elif defined(__FreeBSD__) || defined(__bsd__) || defined (__NetBSD__)
@ -52,24 +52,11 @@
#elif defined(sun) #elif defined(sun)
#include <sys/file.h> #include <sys/file.h>
#endif #endif
*/
/* libtool dynamic loader */ /* libtool dynamic loader */
#include <ltdl.h> #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 "qcommon.h"
#include "game.h" #include "game.h"
#include "rw.h" #include "rw.h"

View file

@ -1,85 +1,38 @@
/* /* $Id$
Copyright (C) 1997-2001 Id Software, Inc. *
* definitions common between client and server, but not the game dll
This program is free software; you can redistribute it and/or *
modify it under the terms of the GNU General Public License * Copyright (C) 1997-2001 Id Software, Inc.
as published by the Free Software Foundation; either version 2 * Copyright (c) 2002 The Quakeforge Project.
of the License, or (at your option) any later version. *
* This program is free software; you can redistribute it and/or
This program is distributed in the hope that it will be useful, * modify it under the terms of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of * as published by the Free Software Foundation; either version 2
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * of the License, or (at your option) any later version.
*
See the GNU General Public License for more details. * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
You should have received a copy of the GNU General Public License * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
along with this program; if not, write to the Free Software *
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 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" #include "gcc_attr.h"
// qcommon.h -- definitions common between client and server, but not game.dll
#include "q_shared.h" #include "q_shared.h"
/* we define this in config.h now */
/* #define VERSION 3.21 */
#define BASEDIRNAME "baseq2" #define BASEDIRNAME "baseq2"
#ifdef WIN32 typedef struct sizebuf_s {
qboolean allowoverflow; /* if false, do a Com_Error */
#ifdef NDEBUG qboolean overflowed; /* set to true if the buffer size failed */
#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
byte * data; byte * data;
int maxsize; int maxsize;
int cursize; int cursize;
@ -90,7 +43,7 @@ void SZ_Init (sizebuf_t *buf, byte *data, int length);
void SZ_Clear(sizebuf_t * buf); void SZ_Clear(sizebuf_t * buf);
void * SZ_GetSpace(sizebuf_t * buf, int length); void * SZ_GetSpace(sizebuf_t * buf, int length);
void SZ_Write(sizebuf_t * buf, void * data, 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_Shutdown (char *finalmsg, qboolean reconnect);
void SV_Frame (int msec); void SV_Frame (int msec);
#endif /* __QCOMMON_H__ */
//char *strlwr (char *); // FIXME: is this needed?

View file

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

View file

@ -35,25 +35,16 @@
qboolean QGL_Init( const char *dllname ); qboolean QGL_Init( const char *dllname );
void QGL_Shutdown( void ); void QGL_Shutdown( void );
/* for windos' benefit */
#ifndef APIENTRY #ifndef APIENTRY
# define APIENTRY # define APIENTRY
#endif #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__ #ifdef __FreeBSD__
extern void *qwglGetProcAddress(char *symbol); extern void *qwglGetProcAddress(char *symbol);
#endif #endif
*/
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
@ -444,7 +435,7 @@ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed,
#endif #endif
/* FIXME: this ifdef sucks */ /* FIXME: this ifdef sucks */
#if defined __linux__ || defined __FreeBSD__ /*#if defined __linux__ || defined __FreeBSD__*/
// local function in dll // local function in dll
//#ifndef qwglGetProcAddress // FIXME //#ifndef qwglGetProcAddress // FIXME
@ -457,23 +448,22 @@ void APIENTRY Fake_glColorTableEXT( GLenum target, GLenum internalformat,
GLsizei width, GLenum format, GLenum type, GLsizei width, GLenum format, GLenum type,
const GLvoid *table ); 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 *); extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
#endif /*#endif*/
/* deprecated */ /* deprecated */
#define GL_TEXTURE0_SGIS 0x835E #define GL_TEXTURE0_SGIS 0x835E
#define GL_TEXTURE1_SGIS 0x835F #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_MIN_EXT 0x8126
#define GL_POINT_SIZE_MAX_EXT 0x8127 #define GL_POINT_SIZE_MAX_EXT 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 #define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
@ -489,6 +479,7 @@ extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
#define GL_TEXTURE1_ARB 0x84C1 #define GL_TEXTURE1_ARB 0x84C1
#endif // FIXME: end of glext.h defines #endif // FIXME: end of glext.h defines
*/
extern int GL_Texture0, GL_Texture1; extern int GL_Texture0, GL_Texture1;

View file

@ -16,9 +16,13 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * 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 <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.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 ); rserr_t SWimp_SetMode( unsigned int *pwidth, unsigned int *pheight, int mode, qboolean fullscreen );
void SWimp_AppActivate( qboolean active ); void SWimp_AppActivate( qboolean active );
#endif /* __R_LOCAL_H__ */

View file

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

View file

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