The GL stuff compiles now, but has some, err, issues..

This commit is contained in:
Zephaniah E. Hull 1999-12-27 17:18:40 +00:00
parent 85bd509bfc
commit 2e65feec71
20 changed files with 1044 additions and 161 deletions

View file

@ -35,13 +35,13 @@ else
RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations
endif
GL_CFLAGS=-DGLQUAKE -I$(X11_DIR)/include
GL_CFLAGS=-DGLQUAKE -I$(X11_DIR)/include -I/usr/include/glide
LDFLAGS=-lm
SVGA_LDFLAGS=$(LDFLAGS) -lvga
X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lX11 -lXext
GL_X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lGL -lX11 -lXext
GL_SVGA_LDFLAGS=-L$(X11_DIR)/lib -lvga -lMesaGL -lglide2x -lX11 -lXext
GL_GLX_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lGL -lX11 -lXext
GL_GLIDE_LDFLAGS=-L$(X11_DIR)/lib -lvga -lMesaGL -lglide2x -lX11 -lXext -ldl
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
@ -57,7 +57,7 @@ DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
SOFT_TARGETS=$(OBJ_DIR)/quake-svga \
$(OBJ_DIR)/quake-x
GL_TARGETS=$(OBJ_DIR)/quake-gl \
GL_TARGETS=$(OBJ_DIR)/quake-glx \
$(OBJ_DIR)/quake-glide
debug: debug-soft #debug-gl
@ -492,3 +492,267 @@ $(OBJ_DIR)/soft_obj/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c
$(OBJ_DIR)/soft_obj/vid_x.o: $(COMMON_DIR)/vid_x.c
$(DO_CC)
# ---------------------------------------------------------------------------
# GL Stuff..
# ---------------------------------------------------------------------------
GL_OBJS =\
$(OBJ_DIR)/gl_obj/cl_demo.o \
$(OBJ_DIR)/gl_obj/cl_input.o \
$(OBJ_DIR)/gl_obj/cl_main.o \
$(OBJ_DIR)/gl_obj/cl_parse.o \
$(OBJ_DIR)/gl_obj/cl_tent.o \
$(OBJ_DIR)/gl_obj/chase.o \
$(OBJ_DIR)/gl_obj/cmd.o \
$(OBJ_DIR)/gl_obj/common.o \
$(OBJ_DIR)/gl_obj/console.o \
$(OBJ_DIR)/gl_obj/crc.o \
$(OBJ_DIR)/gl_obj/cvar.o \
\
$(OBJ_DIR)/gl_obj/gl_draw.o \
$(OBJ_DIR)/gl_obj/gl_mesh.o \
$(OBJ_DIR)/gl_obj/gl_model.o \
$(OBJ_DIR)/gl_obj/gl_refrag.o \
$(OBJ_DIR)/gl_obj/gl_rlight.o \
$(OBJ_DIR)/gl_obj/gl_rmain.o \
$(OBJ_DIR)/gl_obj/gl_rmisc.o \
$(OBJ_DIR)/gl_obj/gl_rsurf.o \
$(OBJ_DIR)/gl_obj/gl_screen.o \
$(OBJ_DIR)/gl_obj/gl_test.o \
$(OBJ_DIR)/gl_obj/gl_warp.o \
\
$(OBJ_DIR)/gl_obj/host.o \
$(OBJ_DIR)/gl_obj/host_cmd.o \
$(OBJ_DIR)/gl_obj/keys.o \
$(OBJ_DIR)/gl_obj/menu.o \
$(OBJ_DIR)/gl_obj/mathlib.o \
$(OBJ_DIR)/gl_obj/net_dgrm.o \
$(OBJ_DIR)/gl_obj/net_loop.o \
$(OBJ_DIR)/gl_obj/net_main.o \
$(OBJ_DIR)/gl_obj/net_vcr.o \
$(OBJ_DIR)/gl_obj/net_udp.o \
$(OBJ_DIR)/gl_obj/net_bsd.o \
$(OBJ_DIR)/gl_obj/pr_cmds.o \
$(OBJ_DIR)/gl_obj/pr_edict.o \
$(OBJ_DIR)/gl_obj/pr_exec.o \
$(OBJ_DIR)/gl_obj/r_part.o \
$(OBJ_DIR)/gl_obj/sbar.o \
$(OBJ_DIR)/gl_obj/sv_main.o \
$(OBJ_DIR)/gl_obj/sv_phys.o \
$(OBJ_DIR)/gl_obj/sv_move.o \
$(OBJ_DIR)/gl_obj/sv_user.o \
$(OBJ_DIR)/gl_obj/zone.o \
$(OBJ_DIR)/gl_obj/view.o \
$(OBJ_DIR)/gl_obj/wad.o \
$(OBJ_DIR)/gl_obj/world.o \
$(OBJ_DIR)/gl_obj/cd_linux.o \
$(OBJ_DIR)/gl_obj/sys_linux.o \
$(OBJ_DIR)/gl_obj/snd_dma.o \
$(OBJ_DIR)/gl_obj/snd_mem.o \
$(OBJ_DIR)/gl_obj/snd_mix.o \
$(OBJ_DIR)/gl_obj/snd_linux.o
GL_AS_OBJS =\
$(OBJ_DIR)/gl_obj/math.o \
$(OBJ_DIR)/gl_obj/worlda.o \
$(OBJ_DIR)/gl_obj/snd_mixa.o \
$(OBJ_DIR)/gl_obj/sys_dosa.o
GL_GLX_OBJS = $(OBJ_DIR)/gl_obj/gl_vidlinuxglx.o
GL_GLIDE_OBJS = $(OBJ_DIR)/gl_obj/gl_vidlinux.o
$(OBJ_DIR)/quake-glx: $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLX_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLX_OBJS) $(GL_GLX_LDFLAGS)
$(OBJ_DIR)/quake-glide: $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLIDE_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLIDE_OBJS) $(GL_GLIDE_LDFLAGS)
$(OBJ_DIR)/gl_obj/cl_demo.o : $(UQ_DIR)/cl_demo.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cl_input.o : $(UQ_DIR)/cl_input.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cl_main.o : $(UQ_DIR)/cl_main.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cl_parse.o : $(UQ_DIR)/cl_parse.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cl_tent.o : $(UQ_DIR)/cl_tent.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/chase.o : $(UQ_DIR)/chase.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cmd.o : $(UQ_DIR)/cmd.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/common.o : $(UQ_DIR)/common.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/console.o : $(UQ_DIR)/console.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/crc.o : $(UQ_DIR)/crc.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cvar.o : $(UQ_DIR)/cvar.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_draw.o : $(UQ_DIR)/gl_draw.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_mesh.o : $(UQ_DIR)/gl_mesh.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_model.o : $(UQ_DIR)/gl_model.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_refrag.o : $(UQ_DIR)/gl_refrag.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_rlight.o : $(UQ_DIR)/gl_rlight.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_rmain.o : $(UQ_DIR)/gl_rmain.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_rmisc.o : $(UQ_DIR)/gl_rmisc.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_rsurf.o : $(UQ_DIR)/gl_rsurf.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_screen.o : $(UQ_DIR)/gl_screen.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_test.o : $(UQ_DIR)/gl_test.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_vidlinux.o : $(UQ_DIR)/gl_vidlinux.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_vidlinuxglx.o : $(COMMON_DIR)/gl_vidlinuxglx.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/gl_warp.o : $(UQ_DIR)/gl_warp.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/host.o : $(UQ_DIR)/host.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/host_cmd.o : $(UQ_DIR)/host_cmd.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/keys.o : $(UQ_DIR)/keys.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/menu.o : $(UQ_DIR)/menu.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/mathlib.o : $(COMMON_DIR)/mathlib.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_dgrm.o : $(UQ_DIR)/net_dgrm.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_loop.o : $(UQ_DIR)/net_loop.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_main.o : $(UQ_DIR)/net_main.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_vcr.o : $(UQ_DIR)/net_vcr.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_udp.o : $(UQ_DIR)/net_udp.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/net_bsd.o : $(UQ_DIR)/net_bsd.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/pr_cmds.o : $(UQ_DIR)/pr_cmds.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/pr_edict.o : $(UQ_DIR)/pr_edict.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/pr_exec.o : $(UQ_DIR)/pr_exec.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/r_part.o : $(UQ_DIR)/r_part.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sbar.o : $(UQ_DIR)/sbar.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sv_main.o : $(UQ_DIR)/sv_main.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sv_phys.o : $(UQ_DIR)/sv_phys.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sv_move.o : $(UQ_DIR)/sv_move.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sv_user.o : $(UQ_DIR)/sv_user.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/zone.o : $(COMMON_DIR)/zone.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/view.o : $(UQ_DIR)/view.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/wad.o : $(COMMON_DIR)/wad.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/world.o : $(UQ_DIR)/world.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/cd_linux.o : $(COMMON_DIR)/cd_linux.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/sys_linux.o : $(UQ_DIR)/sys_linux.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/snd_dma.o : $(COMMON_DIR)/snd_dma.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/snd_mem.o : $(COMMON_DIR)/snd_mem.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/snd_mix.o : $(COMMON_DIR)/snd_mix.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/snd_linux.o : $(COMMON_DIR)/snd_linux.c
$(DO_GL_CC)
$(OBJ_DIR)/gl_obj/math.o : $(COMMON_DIR)/math.s
$(DO_GL_AS)
$(OBJ_DIR)/gl_obj/worlda.o : $(UQ_DIR)/worlda.s
$(DO_GL_AS)
$(OBJ_DIR)/gl_obj/snd_mixa.o : $(COMMON_DIR)/snd_mixa.s
$(DO_GL_AS)
$(OBJ_DIR)/gl_obj/sys_dosa.o : $(UQ_DIR)/sys_dosa.s
$(DO_GL_AS)
#############################################################################
# MISC
#############################################################################
clean: clean-debug clean-release
@echo Done.
clean-debug:
-rm -rf $(BUILD_DEBUG_DIR)
clean-release:
-rm -rf $(BUILD_RELEASE_DIR)

View file

@ -178,26 +178,30 @@ float CL_KeyState (kbutton_t *key)
down = key->state & 1;
val = 0;
if (impulsedown && !impulseup)
if (impulsedown && !impulseup) {
if (down)
val = 0.5; // pressed and held this frame
else
val = 0; // I_Error ();
if (impulseup && !impulsedown)
}
if (impulseup && !impulsedown) {
if (down)
val = 0; // I_Error ();
else
val = 0; // released this frame
if (!impulsedown && !impulseup)
}
if (!impulsedown && !impulseup) {
if (down)
val = 1.0; // held the entire frame
else
val = 0; // up the entire frame
if (impulsedown && impulseup)
}
if (impulsedown && impulseup) {
if (down)
val = 0.75; // released and re-pressed this frame
else
val = 0.25; // pressed and released this frame
}
key->state &= 1; // clear impulses

View file

@ -419,7 +419,7 @@ if (bits&(1<<i))
if (bits & U_SKIN)
skin = MSG_ReadByte();
else
skin = ent->baseline.skinnum;
skin = ent->baseline.skin;
if (skin != ent->skinnum) {
ent->skinnum = skin;
if (num > 0 && num <= cl.maxclients)
@ -431,7 +431,7 @@ if (bits&(1<<i))
if (bits & U_SKIN)
ent->skinnum = MSG_ReadByte();
else
ent->skinnum = ent->baseline.skinnum;
ent->skinnum = ent->baseline.skin;
#endif
if (bits & U_EFFECTS)
@ -495,7 +495,7 @@ void CL_ParseBaseline (entity_t *ent)
ent->baseline.modelindex = MSG_ReadByte ();
ent->baseline.frame = MSG_ReadByte ();
ent->baseline.colormap = MSG_ReadByte();
ent->baseline.skinnum = MSG_ReadByte();
ent->baseline.skin = MSG_ReadByte();
for (i=0 ; i<3 ; i++)
{
ent->baseline.origin[i] = MSG_ReadCoord ();
@ -681,7 +681,7 @@ void CL_ParseStatic (void)
ent->model = cl.model_precache[ent->baseline.modelindex];
ent->frame = ent->baseline.frame;
ent->colormap = vid.colormap;
ent->skinnum = ent->baseline.skinnum;
ent->skinnum = ent->baseline.skin;
ent->effects = ent->baseline.effects;
VectorCopy (ent->baseline.origin, ent->origin);

View file

@ -110,7 +110,6 @@ int Scrap_AllocBlock (int w, int h, int *x, int *y)
{
int i, j;
int best, best2;
int bestx;
int texnum;
for (texnum=0 ; texnum<MAX_SCRAPS ; texnum++)
@ -145,6 +144,7 @@ int Scrap_AllocBlock (int w, int h, int *x, int *y)
}
Sys_Error ("Scrap_AllocBlock: full");
return 0;
}
int scrap_uploads;
@ -369,13 +369,13 @@ void Draw_Init (void)
{
int i;
qpic_t *cb;
byte *dest, *src;
byte *dest;//, *src;
int x, y;
char ver[40];
glpic_t *gl;
int start;
byte *ncdata;
int f, fstep;
//int f, fstep;
Cvar_RegisterVariable (&gl_nobind);
@ -496,10 +496,6 @@ smoothly scrolled off.
*/
void Draw_Character (int x, int y, int num)
{
byte *dest;
byte *source;
unsigned short *pusdest;
int drawline;
int row, col;
float frow, fcol, size;
@ -567,9 +563,6 @@ Draw_AlphaPic
*/
void Draw_AlphaPic (int x, int y, qpic_t *pic, float alpha)
{
byte *dest, *source;
unsigned short *pusdest;
int v, u;
glpic_t *gl;
if (scrap_dirty)
@ -604,9 +597,6 @@ Draw_Pic
*/
void Draw_Pic (int x, int y, qpic_t *pic)
{
byte *dest, *source;
unsigned short *pusdest;
int v, u;
glpic_t *gl;
if (scrap_dirty)
@ -634,10 +624,6 @@ Draw_TransPic
*/
void Draw_TransPic (int x, int y, qpic_t *pic)
{
byte *dest, *source, tbyte;
unsigned short *pusdest;
int v, u;
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
(unsigned)(y + pic->height) > vid.height)
{
@ -1090,8 +1076,6 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
{
int i, s;
qboolean noalpha;
int p;
static unsigned j;
int samples;
static unsigned char scaled[1024*512]; // [512*256];
int scaled_width, scaled_height;
@ -1233,8 +1217,7 @@ GL_LoadTexture
*/
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha)
{
qboolean noalpha;
int i, p, s;
int i;
gltexture_t *glt;
// see if the texture is allready present

View file

@ -199,13 +199,7 @@ void BuildTris (void)
{
int i, j, k;
int startv;
mtriangle_t *last, *check;
int m1, m2;
int striplength;
trivertx_t *v;
mtriangle_t *tv;
float s, t;
int index;
int len, bestlen, besttype;
int bestverts[1024];
int besttris[1024];
@ -290,13 +284,10 @@ GL_MakeAliasModelDisplayLists
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
{
int i, j;
maliasgroup_t *paliasgroup;
int *cmds;
trivertx_t *verts;
char cache[MAX_QPATH], fullpath[MAX_OSPATH], *c;
char cache[MAX_QPATH], fullpath[MAX_OSPATH];
FILE *f;
int len;
byte *data;
aliasmodel = m;
paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m);

View file

@ -1251,8 +1251,8 @@ Mod_LoadAliasFrame
*/
void * Mod_LoadAliasFrame (void * pin, maliasframedesc_t *frame)
{
trivertx_t *pframe, *pinframe;
int i, j;
trivertx_t *pinframe;
int i;
daliasframe_t *pdaliasframe;
pdaliasframe = (daliasframe_t *)pin;
@ -1413,7 +1413,6 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
int i, j, k;
char name[32];
int s;
byte *copy;
byte *skin;
byte *texels;
daliasskingroup_t *pinskingroup;
@ -1492,7 +1491,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
mdl_t *pinmodel;
stvert_t *pinstverts;
dtriangle_t *pintriangles;
int version, numframes, numskins;
int version, numframes;
int size;
daliasframetype_t *pframetype;
daliasskintype_t *pskintype;
@ -1656,10 +1655,8 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum)
{
dspriteframe_t *pinframe;
mspriteframe_t *pspriteframe;
int i, width, height, size, origin[2];
unsigned short *ppixout;
byte *ppixin;
char name[64];
int width, height, size, origin[2];
char name[64];
pinframe = (dspriteframe_t *)pin;

430
uquake/gl_model.h Normal file
View file

@ -0,0 +1,430 @@
/*
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __MODEL__
#define __MODEL__
#include "modelgen.h"
#include "spritegn.h"
/*
d*_t structures are on-disk representations
m*_t structures are in-memory
*/
// entity effects
#define EF_BRIGHTFIELD 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_DIMLIGHT 8
/*
==============================================================================
BRUSH MODELS
==============================================================================
*/
//
// in memory representation
//
// !!! if this is changed, it must be changed in asm_draw.h too !!!
typedef struct
{
vec3_t position;
} mvertex_t;
#define SIDE_FRONT 0
#define SIDE_BACK 1
#define SIDE_ON 2
// plane_t structure
// !!! if this is changed, it must be changed in asm_i386.h too !!!
typedef struct mplane_s
{
vec3_t normal;
float dist;
byte type; // for texture axis selection and fast side tests
byte signbits; // signx + signy<<1 + signz<<1
byte pad[2];
} mplane_t;
typedef struct texture_s
{
char name[16];
unsigned width, height;
int gl_texturenum;
struct msurface_s *texturechain; // for gl_texsort drawing
int anim_total; // total tenths in sequence ( 0 = no)
int anim_min, anim_max; // time for this frame min <=time< max
struct texture_s *anim_next; // in the animation sequence
struct texture_s *alternate_anims; // bmodels in frmae 1 use these
unsigned offsets[MIPLEVELS]; // four mip maps stored
} texture_t;
#define SURF_PLANEBACK 2
#define SURF_DRAWSKY 4
#define SURF_DRAWSPRITE 8
#define SURF_DRAWTURB 0x10
#define SURF_DRAWTILED 0x20
#define SURF_DRAWBACKGROUND 0x40
#define SURF_UNDERWATER 0x80
// !!! if this is changed, it must be changed in asm_draw.h too !!!
typedef struct
{
unsigned short v[2];
unsigned int cachededgeoffset;
} medge_t;
typedef struct
{
float vecs[2][4];
float mipadjust;
texture_t *texture;
int flags;
} mtexinfo_t;
#define VERTEXSIZE 7
typedef struct glpoly_s
{
struct glpoly_s *next;
struct glpoly_s *chain;
int numverts;
int flags; // for SURF_UNDERWATER
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
} glpoly_t;
typedef struct msurface_s
{
int visframe; // should be drawn when node is crossed
mplane_t *plane;
int flags;
int firstedge; // look up in model->surfedges[], negative numbers
int numedges; // are backwards edges
short texturemins[2];
short extents[2];
int light_s, light_t; // gl lightmap coordinates
glpoly_t *polys; // multiple if warped
struct msurface_s *texturechain;
mtexinfo_t *texinfo;
// lighting info
int dlightframe;
int dlightbits;
int lightmaptexturenum;
byte styles[MAXLIGHTMAPS];
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
qboolean cached_dlight; // true if dynamic light in cache
byte *samples; // [numstyles*surfsize]
} msurface_t;
typedef struct mnode_s
{
// common with leaf
int contents; // 0, to differentiate from leafs
int visframe; // node needs to be traversed if current
float minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
// node specific
mplane_t *plane;
struct mnode_s *children[2];
unsigned short firstsurface;
unsigned short numsurfaces;
} mnode_t;
typedef struct mleaf_s
{
// common with node
int contents; // wil be a negative contents number
int visframe; // node needs to be traversed if current
float minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
// leaf specific
byte *compressed_vis;
efrag_t *efrags;
msurface_t **firstmarksurface;
int nummarksurfaces;
int key; // BSP sequence number for leaf's contents
byte ambient_sound_level[NUM_AMBIENTS];
} mleaf_t;
// !!! if this is changed, it must be changed in asm_i386.h too !!!
typedef struct
{
dclipnode_t *clipnodes;
mplane_t *planes;
int firstclipnode;
int lastclipnode;
vec3_t clip_mins;
vec3_t clip_maxs;
} hull_t;
/*
==============================================================================
SPRITE MODELS
==============================================================================
*/
// FIXME: shorten these?
typedef struct mspriteframe_s
{
int width;
int height;
float up, down, left, right;
int gl_texturenum;
} mspriteframe_t;
typedef struct
{
int numframes;
float *intervals;
mspriteframe_t *frames[1];
} mspritegroup_t;
typedef struct
{
spriteframetype_t type;
mspriteframe_t *frameptr;
} mspriteframedesc_t;
typedef struct
{
int type;
int maxwidth;
int maxheight;
int numframes;
float beamlength; // remove?
void *cachespot; // remove?
mspriteframedesc_t frames[1];
} msprite_t;
/*
==============================================================================
ALIAS MODELS
Alias models are position independent, so the cache manager can move them.
==============================================================================
*/
typedef struct
{
int firstpose;
int numposes;
float interval;
trivertx_t bboxmin;
trivertx_t bboxmax;
int frame;
char name[16];
} maliasframedesc_t;
typedef struct
{
trivertx_t bboxmin;
trivertx_t bboxmax;
int frame;
} maliasgroupframedesc_t;
typedef struct
{
int numframes;
int intervals;
maliasgroupframedesc_t frames[1];
} maliasgroup_t;
// !!! if this is changed, it must be changed in asm_draw.h too !!!
typedef struct mtriangle_s {
int facesfront;
int vertindex[3];
} mtriangle_t;
#define MAX_SKINS 32
typedef struct {
int ident;
int version;
vec3_t scale;
vec3_t scale_origin;
float boundingradius;
vec3_t eyeposition;
int numskins;
int skinwidth;
int skinheight;
int numverts;
int numtris;
int numframes;
synctype_t synctype;
int flags;
float size;
int numposes;
int poseverts;
int posedata; // numposes*poseverts trivert_t
int commands; // gl command list with embedded s/t
int gl_texturenum[MAX_SKINS][4];
int texels[MAX_SKINS]; // only for player skins
maliasframedesc_t frames[1]; // variable sized
} aliashdr_t;
#define MAXALIASVERTS 1024
#define MAXALIASFRAMES 256
#define MAXALIASTRIS 2048
extern aliashdr_t *pheader;
extern stvert_t stverts[MAXALIASVERTS];
extern mtriangle_t triangles[MAXALIASTRIS];
extern trivertx_t *poseverts[MAXALIASFRAMES];
//===================================================================
//
// Whole model
//
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
#define EF_ROCKET 1 // leave a trail
#define EF_GRENADE 2 // leave a trail
#define EF_GIB 4 // leave a trail
#define EF_ROTATE 8 // rotate (bonus items)
#define EF_TRACER 16 // green split trail
#define EF_ZOMGIB 32 // small blood trail
#define EF_TRACER2 64 // orange split trail + rotate
#define EF_TRACER3 128 // purple trail
typedef struct model_s
{
char name[MAX_QPATH];
qboolean needload; // bmodels and sprites don't cache normally
modtype_t type;
int numframes;
synctype_t synctype;
int flags;
//
// volume occupied by the model graphics
//
vec3_t mins, maxs;
float radius;
//
// solid volume for clipping
//
qboolean clipbox;
vec3_t clipmins, clipmaxs;
//
// brush model
//
int firstmodelsurface, nummodelsurfaces;
int numsubmodels;
dmodel_t *submodels;
int numplanes;
mplane_t *planes;
int numleafs; // number of visible leafs, not counting 0
mleaf_t *leafs;
int numvertexes;
mvertex_t *vertexes;
int numedges;
medge_t *edges;
int numnodes;
mnode_t *nodes;
int numtexinfo;
mtexinfo_t *texinfo;
int numsurfaces;
msurface_t *surfaces;
int numsurfedges;
int *surfedges;
int numclipnodes;
dclipnode_t *clipnodes;
int nummarksurfaces;
msurface_t **marksurfaces;
hull_t hulls[MAX_MAP_HULLS];
int numtextures;
texture_t **textures;
byte *visdata;
byte *lightdata;
char *entities;
//
// additional model data
//
cache_user_t cache; // only access through Mod_Extradata
} model_t;
//============================================================================
void Mod_Init (void);
void Mod_ClearAll (void);
model_t *Mod_ForName (char *name, qboolean crash);
void *Mod_Extradata (model_t *mod); // handles caching
void Mod_TouchModel (char *name);
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
#endif // __MODEL__

View file

@ -135,8 +135,7 @@ void R_SplitEntityOnNode (mnode_t *node)
// NODE_MIXED
splitplane = node->plane;
// sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
sides = BoxOnPlaneSide(r_emins, r_emaxs, splitplane);
sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
if (sides == 3)
{

View file

@ -288,15 +288,9 @@ GL_DrawAliasFrame
*/
void GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum)
{
float s, t;
float l;
int i, j;
int index;
trivertx_t *v, *verts;
int list;
trivertx_t *verts;
int *order;
vec3_t point;
float *normal;
int count;
lastposenum = posenum;
@ -346,14 +340,9 @@ extern vec3_t lightspot;
void GL_DrawAliasShadow (aliashdr_t *paliashdr, int posenum)
{
float s, t, l;
int i, j;
int index;
trivertx_t *v, *verts;
int list;
trivertx_t *verts;
int *order;
vec3_t point;
float *normal;
float height, lheight;
int count;
@ -445,16 +434,14 @@ R_DrawAliasModel
*/
void R_DrawAliasModel (entity_t *e)
{
int i, j;
int i;
int lnum;
vec3_t dist;
float add;
model_t *clmodel;
vec3_t mins, maxs;
aliashdr_t *paliashdr;
trivertx_t *verts, *v;
int index;
float s, t, an;
float an;
int anim;
clmodel = currententity->model;
@ -809,10 +796,6 @@ R_SetupFrame
*/
void R_SetupFrame (void)
{
int edgecount;
vrect_t vrect;
float w, h;
// don't allow cheats in multiplayer
if (cl.maxclients > 1)
Cvar_Set ("r_fullbright", "0");
@ -864,8 +847,7 @@ R_SetupGL
void R_SetupGL (void)
{
float screenaspect;
float yfov;
int i;
//float yfov;
extern int glwidth, glheight;
int x, x2, y2, y, w, h;
@ -1103,8 +1085,8 @@ r_refdef must be set before the first call
*/
void R_RenderView (void)
{
double time1, time2;
GLfloat colors[4] = {(GLfloat) 0.0, (GLfloat) 0.0, (GLfloat) 1, (GLfloat) 0.20};
double time1 = 0, time2 = 0;
//GLfloat colors[4] = {(GLfloat) 0.0, (GLfloat) 0.0, (GLfloat) 1, (GLfloat) 0.20};
if (r_norefresh.value)
return;

View file

@ -106,7 +106,6 @@ Grab six views for environment mapping tests
void R_Envmap_f (void)
{
byte buffer[256*256*4];
char name[1024];
glDrawBuffer (GL_FRONT);
glReadBuffer (GL_FRONT);
@ -241,7 +240,6 @@ void R_TranslatePlayerSkin (int playernum)
int inwidth, inheight;
byte *inrow;
unsigned frac, fracstep;
extern byte **player_8bit_texels_tbl;
GL_DisableMultitexture();
@ -424,10 +422,8 @@ For program optimization
*/
void R_TimeRefresh_f (void)
{
int i;
int i;
float start, stop, time;
int startangle;
vrect_t vr;
glDrawBuffer (GL_FRONT);
glFinish ();

View file

@ -143,7 +143,6 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
byte *lightmap;
unsigned scale;
int maps;
int lightadj[4];
unsigned *bl;
surf->cached_dlight = (surf->dlightframe == r_framecount);
@ -411,11 +410,9 @@ void R_DrawSequentialPoly (msurface_t *s)
{
glpoly_t *p;
float *v;
int i;
int i;
texture_t *t;
vec3_t nv, dir;
float ss, ss2, length;
float s1, t1;
vec3_t nv;
glRect_t *theRect;
//
@ -594,7 +591,6 @@ void DrawGLWaterPoly (glpoly_t *p)
{
int i;
float *v;
float s, t, os, ot;
vec3_t nv;
GL_DisableMultitexture();
@ -618,7 +614,6 @@ void DrawGLWaterPolyLightmap (glpoly_t *p)
{
int i;
float *v;
float s, t, os, ot;
vec3_t nv;
GL_DisableMultitexture();
@ -831,11 +826,10 @@ Multitexture
*/
void R_RenderDynamicLightmaps (msurface_t *fa)
{
texture_t *t;
byte *base;
int maps;
glRect_t *theRect;
int smax, tmax;
int maps;
glRect_t *theRect;
int smax, tmax;
c_brush_polys++;
@ -1074,9 +1068,9 @@ R_DrawBrushModel
*/
void R_DrawBrushModel (entity_t *e)
{
int j, k;
int k;
vec3_t mins, maxs;
int i, numsurfaces;
int i;
msurface_t *psurf;
float dot;
mplane_t *pplane;
@ -1186,13 +1180,11 @@ R_RecursiveWorldNode
*/
void R_RecursiveWorldNode (mnode_t *node)
{
int i, c, side, *pindex;
vec3_t acceptpt, rejectpt;
int c, side;
mplane_t *plane;
msurface_t *surf, **mark;
mleaf_t *pleaf;
double d, dot;
vec3_t mins, maxs;
double dot;
if (node->contents == CONTENTS_SOLID)
return; // solid
@ -1313,7 +1305,6 @@ R_DrawWorld
void R_DrawWorld (void)
{
entity_t ent;
int i;
memset (&ent, 0, sizeof(ent));
ent.model = cl.worldmodel;
@ -1401,7 +1392,6 @@ int AllocBlock (int w, int h, int *x, int *y)
{
int i, j;
int best, best2;
int bestx;
int texnum;
for (texnum=0 ; texnum<MAX_LIGHTMAPS ; texnum++)
@ -1436,6 +1426,7 @@ int AllocBlock (int w, int h, int *x, int *y)
}
Sys_Error ("AllocBlock: full");
return 0;
}
@ -1451,16 +1442,11 @@ BuildSurfaceDisplayList
*/
void BuildSurfaceDisplayList (msurface_t *fa)
{
int i, lindex, lnumverts, s_axis, t_axis;
float dist, lastdist, lzi, scale, u, v, frac;
unsigned mask;
vec3_t local, transformed;
int t, i, lindex, lnumverts;
medge_t *pedges, *r_pedge;
mplane_t *pplane;
int vertpage, newverts, newpage, lastvert;
qboolean visible;
int vertpage;
float *vec;
float s, t;
float s;
glpoly_t *poly;
// reconstruct the polygon
@ -1529,7 +1515,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
{
vec3_t v1, v2;
float *prev, *this, *next;
float f;
prev = poly->verts[(i + lnumverts - 1) % lnumverts];
this = poly->verts[i];
@ -1571,7 +1556,7 @@ GL_CreateSurfaceLightmap
*/
void GL_CreateSurfaceLightmap (msurface_t *surf)
{
int smax, tmax, s, t, l, i;
int smax, tmax;
byte *base;
if (surf->flags & (SURF_DRAWSKY|SURF_DRAWTURB))

View file

@ -254,10 +254,9 @@ Internal use only
*/
static void SCR_CalcRefdef (void)
{
vrect_t vrect;
float size;
int h;
qboolean full = false;
qboolean full = false;
scr_fullupdate = 0; // force a background redraw
@ -820,9 +819,6 @@ needs almost the entire 256k of stack space!
*/
void SCR_UpdateScreen (void)
{
static float oldscr_viewsize;
vrect_t vrect;
if (block_drawing)
return;

View file

@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "GL/fxmesa.h"
#include <glide/sst1vid.h>
#define WARP_WIDTH 320
#define WARP_HEIGHT 200
@ -217,13 +218,10 @@ void VID_SetPalette (unsigned char *palette)
unsigned r,g,b;
unsigned v;
int r1,g1,b1;
int j,k,l,m;
int k;
unsigned short i;
unsigned *table;
FILE *f;
char s[255];
int dist, bestdist;
static qboolean palflag = false;
//
// 8 8 8 encoding
@ -343,8 +341,6 @@ GL_BeginRendering
*/
void GL_BeginRendering (int *x, int *y, int *width, int *height)
{
extern cvar_t gl_clear;
*x = *y = 0;
*width = scr_width;
*height = scr_height;
@ -482,22 +478,22 @@ void Init_KBD(void)
#define NUM_RESOLUTIONS 16
static int resolutions[NUM_RESOLUTIONS][3]={
320,200, GR_RESOLUTION_320x200,
320,240, GR_RESOLUTION_320x240,
400,256, GR_RESOLUTION_400x256,
400,300, GR_RESOLUTION_400x300,
512,384, GR_RESOLUTION_512x384,
640,200, GR_RESOLUTION_640x200,
640,350, GR_RESOLUTION_640x350,
640,400, GR_RESOLUTION_640x400,
640,480, GR_RESOLUTION_640x480,
800,600, GR_RESOLUTION_800x600,
960,720, GR_RESOLUTION_960x720,
856,480, GR_RESOLUTION_856x480,
512,256, GR_RESOLUTION_512x256,
1024,768, GR_RESOLUTION_1024x768,
1280,1024,GR_RESOLUTION_1280x1024,
1600,1200,GR_RESOLUTION_1600x1200
{320,200, GR_RESOLUTION_320x200},
{320,240, GR_RESOLUTION_320x240},
{400,256, GR_RESOLUTION_400x256},
{400,300, GR_RESOLUTION_400x300},
{512,384, GR_RESOLUTION_512x384},
{640,200, GR_RESOLUTION_640x200},
{640,350, GR_RESOLUTION_640x350},
{640,400, GR_RESOLUTION_640x400},
{640,480, GR_RESOLUTION_640x480},
{800,600, GR_RESOLUTION_800x600},
{960,720, GR_RESOLUTION_960x720},
{856,480, GR_RESOLUTION_856x480},
{512,256, GR_RESOLUTION_512x256},
{1024,768, GR_RESOLUTION_1024x768},
{1280,1024,GR_RESOLUTION_1280x1024},
{1600,1200,GR_RESOLUTION_1600x1200}
};
int findres(int *width, int *height)

View file

@ -146,11 +146,10 @@ can be done reasonably.
void GL_SubdivideSurface (msurface_t *fa)
{
vec3_t verts[64];
int numverts;
int i;
int lindex;
int numverts;
int i;
int lindex;
float *vec;
texture_t *t;
warpface = fa;
@ -273,10 +272,6 @@ will have them chained together.
*/
void EmitBothSkyLayers (msurface_t *fa)
{
int i;
int lindex;
float *vec;
GL_DisableMultitexture();
GL_Bind (solidskytexture);
@ -1039,7 +1034,6 @@ void R_InitSky (texture_t *mt)
unsigned transpix;
int r, g, b;
unsigned *rgba;
extern int skytexturenum;
src = (byte *)mt + mt->offsets[0];

253
uquake/glquake.h Normal file
View file

@ -0,0 +1,253 @@
/*
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// disable data conversion warnings
/*
#pragma warning(disable : 4244) // MIPS
#pragma warning(disable : 4136) // X86
#pragma warning(disable : 4051) // ALPHA
*/
#ifdef _WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
void GL_BeginRendering (int *x, int *y, int *width, int *height);
void GL_EndRendering (void);
#ifdef _WIN32
// Function prototypes for the Texture Object Extension routines
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
const GLboolean *);
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
const GLclampf *);
typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
extern BINDTEXFUNCPTR bindTexFunc;
extern DELTEXFUNCPTR delTexFunc;
extern TEXSUBIMAGEPTR TexSubImage2DFunc;
#endif
extern int texture_extension_number;
extern int texture_mode;
extern float gldepthmin, gldepthmax;
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha);
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha);
int GL_FindTexture (char *identifier);
typedef struct
{
float x, y, z;
float s, t;
float r, g, b;
} glvert_t;
extern glvert_t glv;
extern int glx, gly, glwidth, glheight;
#ifdef _WIN32
extern PROC glArrayElementEXT;
extern PROC glColorPointerEXT;
extern PROC glTexturePointerEXT;
extern PROC glVertexPointerEXT;
#endif
// r_local.h -- private refresh defs
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
// normalizing factor so player model works out to about
// 1 pixel per triangle
#define MAX_LBM_HEIGHT 480
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
#define SKYSHIFT 7
#define SKYSIZE (1 << SKYSHIFT)
#define SKYMASK (SKYSIZE - 1)
#define BACKFACE_EPSILON 0.01
void R_TimeRefresh_f (void);
void R_ReadPointFile_f (void);
texture_t *R_TextureAnimation (texture_t *base);
typedef struct surfcache_s
{
struct surfcache_s *next;
struct surfcache_s **owner; // NULL is an empty chunk of memory
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
int dlight;
int size; // including header
unsigned width;
unsigned height; // DEBUG only needed for debug
float mipscale;
struct texture_s *texture; // checked for animating textures
byte data[4]; // width*height elements
} surfcache_t;
typedef struct
{
pixel_t *surfdat; // destination for generated surface
int rowbytes; // destination logical width in bytes
msurface_t *surf; // description for surface to generate
fixed8_t lightadj[MAXLIGHTMAPS];
// adjust for lightmap levels for dynamic lighting
texture_t *texture; // corrected for animating textures
int surfmip; // mipmapped ratio of surface texels / world pixels
int surfwidth; // in mipmapped texels
int surfheight; // in mipmapped texels
} drawsurf_t;
typedef enum {
pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2
} ptype_t;
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
typedef struct particle_s
{
// driver-usable fields
vec3_t org;
float color;
// drivers never touch the following fields
struct particle_s *next;
vec3_t vel;
float ramp;
float die;
ptype_t type;
} particle_t;
//====================================================
extern entity_t r_worldentity;
extern qboolean r_cache_thrash; // compatability
extern vec3_t modelorg, r_entorigin;
extern entity_t *currententity;
extern int r_visframecount; // ??? what difs?
extern int r_framecount;
extern mplane_t frustum[4];
extern int c_brush_polys, c_alias_polys;
//
// view origin
//
extern vec3_t vup;
extern vec3_t vpn;
extern vec3_t vright;
extern vec3_t r_origin;
//
// screen size info
//
extern refdef_t r_refdef;
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
extern texture_t *r_notexture_mip;
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
extern qboolean envmap;
extern int currenttexture;
extern int cnttextures[2];
extern int particletexture;
extern int playertextures;
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
extern cvar_t r_norefresh;
extern cvar_t r_drawentities;
extern cvar_t r_drawworld;
extern cvar_t r_drawviewmodel;
extern cvar_t r_speeds;
extern cvar_t r_waterwarp;
extern cvar_t r_fullbright;
extern cvar_t r_lightmap;
extern cvar_t r_shadows;
extern cvar_t r_mirroralpha;
extern cvar_t r_wateralpha;
extern cvar_t r_dynamic;
extern cvar_t r_novis;
extern cvar_t gl_clear;
extern cvar_t gl_cull;
extern cvar_t gl_poly;
extern cvar_t gl_texsort;
extern cvar_t gl_smoothmodels;
extern cvar_t gl_affinemodels;
extern cvar_t gl_polyblend;
extern cvar_t gl_keeptjunctions;
extern cvar_t gl_reporttjunctions;
extern cvar_t gl_flashblend;
extern cvar_t gl_nocolors;
extern cvar_t gl_doubleeyes;
extern int gl_lightmap_format;
extern int gl_solid_format;
extern int gl_alpha_format;
extern cvar_t gl_max_size;
extern cvar_t gl_playermip;
extern int mirrortexturenum; // quake texturenum, not gltexturenum
extern qboolean mirror;
extern mplane_t *mirror_plane;
extern float r_world_matrix[16];
extern const char *gl_vendor;
extern const char *gl_renderer;
extern const char *gl_version;
extern const char *gl_extensions;
void R_TranslatePlayerSkin (int playernum);
void GL_Bind (int texnum);
// Multitexture
#define TEXTURE0_SGIS 0x835E
#define TEXTURE1_SGIS 0x835F
#ifndef _WIN32
#define APIENTRY /* */
#endif
typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
typedef void (APIENTRY *lpSelTexFUNC) (GLenum);
extern lpMTexFUNC qglMTexCoord2fSGIS;
extern lpSelTexFUNC qglSelectTextureSGIS;
extern qboolean gl_mtexable;
void GL_DisableMultitexture(void);
void GL_EnableMultitexture(void);

View file

@ -1516,7 +1516,7 @@ Host_Give_f
void Host_Give_f (void)
{
char *t;
int v, w;
int v;
eval_t *val;
if (cmd_source == src_command)

View file

@ -1989,17 +1989,19 @@ forward:
}
}
if (DirectConfig && (serialConfig_cursor == 3 || serialConfig_cursor == 4))
if (DirectConfig && (serialConfig_cursor == 3 || serialConfig_cursor == 4)) {
if (key == K_UPARROW)
serialConfig_cursor = 2;
else
serialConfig_cursor = 5;
}
if (SerialConfig && StartingGame && serialConfig_cursor == 4)
if (SerialConfig && StartingGame && serialConfig_cursor == 4) {
if (key == K_UPARROW)
serialConfig_cursor = 3;
else
serialConfig_cursor = 5;
}
}
//=============================================================================
@ -2362,11 +2364,12 @@ void M_LanConfig_Key (int key)
}
}
if (StartingGame && lanConfig_cursor == 2)
if (StartingGame && lanConfig_cursor == 2) {
if (key == K_UPARROW)
lanConfig_cursor = 1;
else
lanConfig_cursor = 0;
}
l = Q_atoi(lanConfig_portname);
if (l > 65535)

View file

@ -165,3 +165,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TE_IMPLOSION 14
#define TE_RAILTRAIL 15
#endif
typedef struct
{
vec3_t origin;
vec3_t angles;
int modelindex;
int frame;
int colormap;
int skin;
int effects;
} entity_state_t;

View file

@ -1166,13 +1166,12 @@ Sbar_DeathmatchOverlay
*/
void Sbar_MiniDeathmatchOverlay (void)
{
qpic_t *pic;
int i, k, l;
int top, bottom;
int x, y, f;
char num[12];
int i, k, l;
int top, bottom;
int x, y, f;
char num[12];
scoreboard_t *s;
int numlines;
int numlines;
if (vid.width < 512 || !sb_lines)
return;

View file

@ -493,7 +493,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
if (ent->baseline.colormap != ent->v.colormap)
bits |= U_COLORMAP;
if (ent->baseline.skinnum != ent->v.skin)
if (ent->baseline.skin != ent->v.skin)
bits |= U_SKIN;
if (ent->baseline.frame != ent->v.frame)
@ -943,7 +943,7 @@ void SV_CreateBaseline (void)
VectorCopy (svent->v.origin, svent->baseline.origin);
VectorCopy (svent->v.angles, svent->baseline.angles);
svent->baseline.frame = svent->v.frame;
svent->baseline.skinnum = svent->v.skin;
svent->baseline.skin = svent->v.skin;
if (entnum > 0 && entnum <= svs.maxclients)
{
svent->baseline.colormap = entnum;
@ -965,7 +965,7 @@ void SV_CreateBaseline (void)
MSG_WriteByte (&sv.signon, svent->baseline.modelindex);
MSG_WriteByte (&sv.signon, svent->baseline.frame);
MSG_WriteByte (&sv.signon, svent->baseline.colormap);
MSG_WriteByte (&sv.signon, svent->baseline.skinnum);
MSG_WriteByte (&sv.signon, svent->baseline.skin);
for (i=0 ; i<3 ; i++)
{
MSG_WriteCoord(&sv.signon, svent->baseline.origin[i]);