A little cleanup...

S_Init() is now where it belongs--outside of VID_Init().  I think I did
manage to update every target.  If I missed one, kill the sound.h include
and remove S_Init() from VID_Init().

New Cvar: r_sky, defaults to 0, turn it on if you want to use skyboxes.
Cvar r_skyname can actually be used now I _think_, need another skybox
to test it.  Quake2000's instructions were used in the skybox stuff but,
as all know by now, our tree is so different from anyone else's that I had
to redo a number of things.  But thanks all the same--cut the time spent
debugging it in half.  I also want to thank whoever did the night skybox
on the MegaTF page I used to test.  Looks great on start map!

New GL-specific Cvar: r_conspin, defaults to 0.  Turn it on.  You can turn
it off too.  Shamelessly ripped from QER.
This commit is contained in:
Joseph Carter 2000-03-02 19:57:24 +00:00
parent 54501eaed7
commit 8b18f9d56b
19 changed files with 96 additions and 119 deletions

16
AUTHORS
View file

@ -51,8 +51,12 @@ N: Joseph Carter
E: knghtbrd@debian.org
D: QW/Q1 tree merging
D: Autoconf support and portability
D: Documentation
D: Driver module support/design
D: User documentation
D: Development design
D: GL renderer fixes
D: Driver module support
D: Skybox implementation
D: Spinning console implementation
N: Peter Andreasen
E: pandr@pandr.dk
@ -183,3 +187,11 @@ E: jukka.sorjonen@asikkala.fi
D: Bug squasher (see below).
D: QW network protocol fixes.
D: Found out why our VERSION was messing things up..
N: Tane Piper
E: descent@barrysworld.com
D: GL skybox implementation tutorial
N: Nawfel Tricha
E: topaz@endorproductions.com
D: GL spinning console implementation tutorial

View file

@ -1,4 +1,5 @@
/*
cmd.h - Command buffer and command execution
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -23,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _CMD_H
#define _CMD_H
// cmd.h -- Command buffer and command execution
//===========================================================================

View file

@ -1,4 +1,5 @@
/*
common_quakedef.h - common header
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -22,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _COMMON_QUAKEDEF_H
#define _COMMON_QUAKEDEF_H
// quakedef.h -- primary header for client
#define QUAKE_GAME // as opposed to utilities
#include <config.h> // generated from config.h.in
@ -48,43 +47,9 @@ void VID_UnlockBuffer (void);
#define VID_UnlockBuffer()
#endif
#include "qtypes.h"
#include "qstructs.h"
#include <qtypes.h>
#include <qstructs.h>
/*
#include "common.h"
#include "bspfile.h"
#include "vid.h"
#include "sys.h"
#include "zone.h"
#include "mathlib.h"
#include "wad.h"
#include "draw.h"
#include "cvar.h"
#include "screen.h"
#include "net.h"
#include "protocol.h"
#include "cmd.h"
#include "sbar.h"
#include "sound.h"
#include "model.h"
#include "d_iface.h"
#include "render.h"
#include "client.h"
#include "input.h"
#include "keys.h"
#include "console.h"
#include "view.h"
#ifndef SERVERONLY
# include "menu.h"
#endif
#include "crc.h"
#include "cdaudio.h"
#include "cvars.h"
*/
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))

View file

@ -38,6 +38,7 @@ extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor;
cvar_t *gl_nobind;
cvar_t *gl_max_size;
cvar_t *gl_picmip;
cvar_t *gl_conspin;
byte *draw_chars; // 8*8 graphic characters
qpic_t *draw_disc;
@ -390,19 +391,14 @@ void Draw_Init (void)
{
int i;
qpic_t *cb;
// byte *dest;
// int x;
// char ver[40];
glpic_t *gl;
int start;
byte *ncdata;
// Cvar_RegisterVariable (&gl_nobind);
gl_nobind = Cvar_Get ("gl_nobind","0",0,"None");
// Cvar_RegisterVariable (&gl_max_size);
gl_max_size = Cvar_Get ("gl_max_size","1024",0,"None");
// Cvar_RegisterVariable (&gl_picmip);
gl_picmip = Cvar_Get ("gl_picmip","0",0,"None");
gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_NONE, "None");
// 3dfx can only handle 256 wide textures
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
@ -816,6 +812,7 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
glEnd ();
}
#define SPIN_HACK 1
/*
================
@ -833,11 +830,33 @@ void Draw_ConsoleBackground (int lines)
int x, i;
int y;
if (gl_conspin->value)
{
static float xangle = 0, xfactor = .3f, xstep = .005f;
glPushMatrix ();
glMatrixMode (GL_TEXTURE);
glPushMatrix ();
glLoadIdentity ();
xangle += 1.0f;
xfactor += xstep;
if (xfactor > 8 || xfactor < .3f)
xstep = -xstep;
glRotatef (xangle, 0, 0, 1);
glScalef (xfactor, xfactor, xfactor);
}
y = (vid.height * 3) >> 2;
if (lines > y)
Draw_Pic(0, lines-vid.height, conback);
else
Draw_AlphaPic (0, lines - vid.height, conback, (float)(1.2 * lines)/y);
Draw_AlphaPic (0, lines - vid.height, conback,
(float)(1.2 * lines)/y);
if (gl_conspin->value) {
glPopMatrix ();
glMatrixMode (GL_MODELVIEW);
glPopMatrix ();
}
// hack the version number directly into the pic
y = lines-14;
@ -1407,7 +1426,8 @@ int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolea
{
if (!strcmp (identifier, glt->identifier))
{
if (width != glt->width || height != glt->height)
if (width != glt->width
|| height != glt->height)
Sys_Error ("GL_LoadTexture: cache mismatch");
return gltextures[i].texnum;
}

View file

@ -107,6 +107,8 @@ cvar_t *r_fog;
cvar_t *r_volfog;
cvar_t *r_waterwarp;
cvar_t *r_waterripple;
cvar_t *r_sky;
cvar_t *r_skyname;
cvar_t *gl_finish;
cvar_t *gl_clear;

View file

@ -206,6 +206,8 @@ void R_Init (void)
r_volfog = Cvar_Get ("r_volfog","0",0,"None");
r_waterripple = Cvar_Get ("r_waterripple","0",0,"None");
r_clearcolor = Cvar_Get ("r_clearcolor","2",0,"None");
r_sky = Cvar_Get ("r_sky", "0", CVAR_NONE, "None");
r_skyname = Cvar_Get ("r_skyname", "sky", CVAR_NONE, "None");
gl_clear = Cvar_Get ("gl_clear","0",0,"None");
gl_texsort = Cvar_Get ("gl_texsort","1",0,"None");

View file

@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <glquake.h>
#include <cvar.h>
#include <console.h>
#include <sound.h>
#include <keys.h>
#include <menu.h>
#include <sys.h>
@ -122,7 +121,6 @@ int texture_extension_number = 1;
float gldepthmin, gldepthmax;
//cvar_t gl_ztrick = {"gl_ztrick", "0", CVAR_ARCHIVE};
cvar_t *gl_ztrick;
const char *gl_vendor;
@ -412,18 +410,11 @@ void VID_Init(unsigned char *palette)
Window root;
XVisualInfo *visinfo;
S_Init();
// Cvar_RegisterVariable(&vid_mode);
vid_mode = Cvar_Get ("vid_mode","0",0,"None");
// Cvar_RegisterVariable(&gl_ztrick);
gl_ztrick = Cvar_Get ("gl_ztrick","0",CVAR_ARCHIVE,"None");
// Cvar_RegisterVariable(&_windowed_mouse);
_windowed_mouse = Cvar_Get ("_windowed_mouse","0",CVAR_ARCHIVE,"None");
// Cvar_RegisterVariable(&vid_glx_fullscreen);
vid_glx_fullscreen = Cvar_Get ("vid_glx_fullscreen","0",0,"None");
#ifdef HAS_DGA
// Cvar_RegisterVariable(&vid_dga_mouseaccel);
vid_dga_mouseaccel = Cvar_Get("vid_dga_mouseaccel","1",CVAR_ARCHIVE,
"None");
#endif

View file

@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys.h>
#include <console.h>
#include <cvar.h>
#include <sound.h>
#include <lib_replace.h>
#include <stdio.h>
@ -409,8 +408,6 @@ void VID_Init(unsigned char *palette)
char gldir[MAX_OSPATH];
int width = 640, height = 480;
S_Init();
// Cvar_RegisterVariable (&vid_mode);
vid_mode = Cvar_Get ("vid_mode","5",0,"None");
// Cvar_RegisterVariable (&vid_redrawfull);

View file

@ -582,9 +582,7 @@ R_LoadSkys ( void ) {
int i;
QFile *f;
char name[64];
cvar_t *r_skyname;
r_skyname = Cvar_Get ("r_skyname","sky",CVAR_NONE, "");
for (i=0 ; i<6 ; i++) {
GL_Bind (SKY_TEX + i);
snprintf(name, sizeof(name), "gfx/env/%s%s.tga",
@ -820,7 +818,7 @@ R_DrawSkyChain (msurface_t *s) {
vec3_t verts[MAX_CLIP_VERTS];
glpoly_t *p;
if (1)
if (r_sky->value)
{
c_sky = 0;
GL_Bind(solidskytexture);
@ -917,9 +915,7 @@ int skytexorder[6] = {0,2,1,3,4,5};
void
R_DrawSkyBox (void) {
int i; //, j, k;
// vec3_t v;
// float s, t;
int i;
#if 0
glEnable (GL_BLEND);

View file

@ -36,9 +36,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <GL/gl.h>
#include <GL/glu.h>
#include "model.h"
#include "client.h"
#include "wad.h"
#include <model.h>
#include <client.h>
#include <wad.h>
void GL_BeginRendering (int *x, int *y, int *width, int *height);
void GL_EndRendering (void);
@ -186,6 +186,8 @@ extern cvar_t *r_fog;
extern cvar_t *r_waterwarp;
extern cvar_t *r_volfog;
extern cvar_t *r_waterripple;
extern cvar_t *r_sky;
extern cvar_t *r_skyname;
extern cvar_t *gl_clear;
extern cvar_t *gl_cull;

View file

@ -522,6 +522,15 @@ Host_InitVCR ( quakeparms_t *parms )
}
}
/*
Host_InitDisplay
Video initialization
*/
void
Host_InitDisplay ()
{
}
/*
Host_Init
@ -529,7 +538,7 @@ Host_InitVCR ( quakeparms_t *parms )
System Startup
*/
void
Host_Init ( quakeparms_t *parms)
Host_Init (quakeparms_t *parms)
{
COM_InitArgv (parms->argc, parms->argv);
@ -599,14 +608,12 @@ Host_Init ( quakeparms_t *parms)
if (!host_colormap)
Sys_Error ("Couldn't load gfx/colormap.lmp");
// plugin_load("./in_x11.so");
// Not the best place to load the plugin...
VID_Init(host_basepal);
IN_Init();
// DDOI - I made this so host.c wouldn't try to unload a plugin
// that it hasn't loaded. Could be done better I'm sure.
vid_initialized = true;
Host_InitDisplay();
S_Init();
Draw_Init();
SCR_Init();
R_Init();

View file

@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <d_local.h>
#include <stdio.h>
#include <stdlib.h>
@ -378,9 +378,6 @@ VID_Init(unsigned char *palette)
int w, h, d;
int err;
/* Sound gets initialized here */
S_Init();
#if 0
Cmd_AddCommand ("gamma", VID_Gamma_f);
#endif

View file

@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <quakedef.h>
#include <d_local.h>
#include <sound.h>
#include <keys.h>
#include <cvar.h>
#include <menu.h>
@ -239,9 +238,6 @@ void VID_Init(unsigned char *pal)
{
int pnum;
/* Initalize sound */
S_Init();
vid.width = GGI_AUTO;
vid.height = GGI_AUTO;

View file

@ -1,4 +1,5 @@
/*
vid_null.c - null video driver to aid porting efforts
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
@ -19,10 +20,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vid_null.c -- null video driver to aid porting efforts
#include "quakedef.h"
#include "d_local.h"
#include <quakedef.h>
#include <d_local.h>
viddef_t vid; // global video state

View file

@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <keys.h>
#include <quakedef.h>
#include <d_local.h>
#include <sound.h>
#include <cvar.h>
#include <draw.h>
#include <sys.h>
@ -94,8 +93,6 @@ void VID_Init (unsigned char *palette)
Uint32 flags;
S_Init();
// Load the SDL library
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_CDROM)<0) //|SDL_INIT_AUDIO|SDL_INIT_CDROM) < 0)
Sys_Error("VID: Couldn't load SDL: %s", SDL_GetError());

View file

@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <quakedef.h>
#include <common.h>
#include <d_local.h>
#include <sound.h>
#include <cvar.h>
#include <lib_replace.h>
#include <cmd.h>
@ -496,8 +495,6 @@ VID_Init(unsigned char *palette)
int err;
//plugin_load("in_svgalib.so");
/* Sound gets initialized here */
S_Init();
if (svgalib_inited) return;

View file

@ -1,4 +1,5 @@
/*
vid_win.c - Win32 video driver
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Portions Copyright (C) 1999,2000 Nelson Rush.
@ -20,12 +21,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vid_win.c -- Win32 video driver
#include "quakedef.h"
#include "winquake.h"
#include "d_local.h"
#include "resource.h"
#include <quakedef.h>
#include <winquake.h>
#include <d_local.h>
#include <resource.h>
#include <mgraph.h>
#include <screen.h>
#include <view.h>
@ -33,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <keys.h>
#include <cdaudio.h>
#include <lib_replace.h>
#include <sound.h>
#include <keys.h>
#include <cvar.h>
#include <menu.h>
@ -43,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <console.h>
#include <client.h>
#include <screen.h>
#include "plugin.h"
#include <plugin.h>
#ifndef CDS_FULLSCREEN
@ -2244,7 +2243,6 @@ void VID_Init (unsigned char *palette)
hide_window = true;
VID_SetMode (MODE_WINDOWED, palette);
hide_window = false;
S_Init ();
vid_initialized = true;

View file

@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <quakedef.h>
#include <d_local.h>
#include <sound.h>
#include <keys.h>
#include <cvar.h>
#include <menu.h>
@ -485,9 +484,8 @@ void VID_Init (unsigned char *palette)
int template_mask;
//plugin_load("in_x11.so");
S_Init(); // sound is initialized here
Cmd_AddCommand("gamma", VID_Gamma_f);
// Cmd_AddCommand("gamma", VID_Gamma_f);
for (i=0; i < 256; i++) vid_gamma[i] = i;
vid.width = 320;