I wonder how many things this will break...

Anyway, made the renderer more modular (multiple gl renderers in the same binary, supported properly - menu still needs work).
Rewrote parm1-16 handling, and added support for 17-32.
Lightstyle smoothing cvar: r_lightstylesmooth


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1113 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-06-22 17:10:13 +00:00
parent f64645ff6d
commit 39990c213d
22 changed files with 990 additions and 1251 deletions

View file

@ -28,12 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <dinput.h> #include <dinput.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#ifdef AVAIL_DX7
#pragma comment (lib, "../libs/dxsdk7/lib/dxguid.lib")
#else
#pragma comment (lib, "dxguid.lib") #pragma comment (lib, "dxguid.lib")
#endif #endif
#endif
#define DINPUT_BUFFERSIZE 16 #define DINPUT_BUFFERSIZE 16
#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d) #define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)

View file

@ -115,3 +115,93 @@ void Draw_FunString(int x, int y, unsigned char *str);
#define Mod_Q1LeafPVS Mod_LeafPVS #define Mod_Q1LeafPVS Mod_LeafPVS
qbyte *Mod_LeafPVS (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer); qbyte *Mod_LeafPVS (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer);
#endif #endif
typedef struct {
char *description;
char *name[4];
r_qrenderer_t rtype;
mpic_t *(*Draw_PicFromWad) (char *name);
mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_CachePic) (char *path);
mpic_t *(*Draw_SafeCachePic) (char *path);
void (*Draw_Init) (void);
void (*Draw_ReInit) (void);
void (*Draw_Character) (int x, int y, unsigned int num);
void (*Draw_ColouredCharacter) (int x, int y, unsigned int num);
void (*Draw_String) (int x, int y, const qbyte *str);
void (*Draw_Alt_String) (int x, int y, const qbyte *str);
void (*Draw_Crosshair) (void);
void (*Draw_DebugChar) (qbyte num);
void (*Draw_Pic) (int x, int y, mpic_t *pic);
void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
void (*Draw_TransPic) (int x, int y, mpic_t *pic);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void (*Draw_ConsoleBackground) (int lines);
void (*Draw_EditorBackground) (int lines);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, int c);
void (*Draw_FadeScreen) (void);
void (*Draw_BeginDisc) (void);
void (*Draw_EndDisc) (void);
void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
void (*Draw_ImageColours) (float r, float g, float b, float a);
void (*R_Init) (void);
void (*R_DeInit) (void);
void (*R_ReInit) (void);
void (*R_RenderView) (void); // must set r_refdef first
void (*R_InitSky) (struct texture_s *mt); // called at level load
qboolean (*R_CheckSky) (void);
void (*R_SetSky) (char *name, float rotate, vec3_t axis);
void (*R_NewMap) (void);
void (*R_PreNewMap) (void);
int (*R_LightPoint) (vec3_t point);
void (*R_PushDlights) (void);
void (*R_AddStain) (vec3_t org, float red, float green, float blue, float radius);
void (*R_LessenStains) (void);
void (*Media_ShowFrameBGR_24_Flip) (qbyte *framedata, int inwidth, int inheight); //input is bottom up...
void (*Media_ShowFrameRGBA_32) (qbyte *framedata, int inwidth, int inheight); //top down
void (*Media_ShowFrame8bit) (qbyte *framedata, int inwidth, int inheight, qbyte *palette); //paletted topdown (framedata is 8bit indexes into palette)
void (*Mod_Init) (void);
void (*Mod_ClearAll) (void);
struct model_s *(*Mod_ForName) (char *name, qboolean crash);
struct model_s *(*Mod_FindName) (char *name);
void *(*Mod_Extradata) (struct model_s *mod); // handles caching
void (*Mod_TouchModel) (char *name);
struct mleaf_s *(*Mod_PointInLeaf) (float *p, struct model_s *model);
qbyte *(*Mod_Q1LeafPVS) (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer);
void (*Mod_NowLoadExternal) (void);
void (*Mod_Think) (void);
qboolean(*Mod_GetTag) (struct model_s *model, int tagnum, int frame1, int frame2, float f2ness, float f1time, float f2time, float *result);
int (*Mod_TagNumForName) (struct model_s *model, char *name);
qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
void (*VID_DeInit) (void);
void (*VID_HandlePause) (qboolean pause);
void (*VID_LockBuffer) (void);
void (*VID_UnlockBuffer) (void);
void (*D_BeginDirectRect) (int x, int y, qbyte *pbitmap, int width, int height);
void (*D_EndDirectRect) (int x, int y, int width, int height);
void (*VID_ForceLockState) (int lk);
int (*VID_ForceUnlockedAndReturnState) (void);
void (*VID_SetPalette) (unsigned char *palette);
void (*VID_ShiftPalette) (unsigned char *palette);
char *(*VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight);
void (*VID_SetWindowCaption) (char *msg);
void (*SCR_UpdateScreen) (void);
char *alignment;
} rendererinfo_t;

View file

@ -171,7 +171,7 @@ typedef struct part_type_s {
float timelimit; float timelimit;
enum {PT_NORMAL, PT_BEAM, PT_DECAL} type; enum {PT_NORMAL, PT_SPARK, PT_SPARKFAN, PT_TEXTUREDSPARK, PT_BEAM, PT_DECAL} type;
enum {BM_MERGE, BM_ADD, BM_SUBTRACT} blendmode; enum {BM_MERGE, BM_ADD, BM_SUBTRACT} blendmode;
float rotationstartmin, rotationstartrand; float rotationstartmin, rotationstartrand;
@ -654,6 +654,12 @@ void P_ParticleEffect_f(void)
{ {
if (!strcmp(value, "beam")) if (!strcmp(value, "beam"))
ptype->type = PT_BEAM; ptype->type = PT_BEAM;
else if (!strcmp(value, "spark"))
ptype->type = PT_SPARK;
else if (!strcmp(value, "sparkfan") || !strcmp(value, "trianglefan"))
ptype->type = PT_SPARKFAN;
else if (!strcmp(value, "texturedspark"))
ptype->type = PT_TEXTUREDSPARK;
else if (!strcmp(value, "decal")) else if (!strcmp(value, "decal"))
ptype->type = PT_DECAL; ptype->type = PT_DECAL;
else else
@ -844,6 +850,16 @@ void P_ParticleEffect_f(void)
if (ptype->friction) if (ptype->friction)
ptype->flags |= PT_FRICTION; ptype->flags |= PT_FRICTION;
if (ptype->type == PT_NORMAL && !ptype->texname)
ptype->type = PT_SPARK;
if (ptype->type == PT_SPARK)
{
if (*ptype->texname)
ptype->type = PT_TEXTUREDSPARK;
if (ptype->scale)
ptype->type = PT_SPARKFAN;
}
if (ptype->rampmode && !ptype->ramp) if (ptype->rampmode && !ptype->ramp)
{ {
ptype->rampmode = RAMP_NONE; ptype->rampmode = RAMP_NONE;
@ -2824,12 +2840,6 @@ void GL_DrawTexturedParticle(particle_t *p, part_type_t *type)
if (lasttype != type) if (lasttype != type)
{ {
if (type-part_type>=numparticletypes||type-part_type<0) //FIXME:! Work out why this is needed...
{
Con_Printf("Serious bug alert\n");
return;
}
lasttype = type; lasttype = type;
qglEnd(); qglEnd();
qglEnable(GL_TEXTURE_2D); qglEnable(GL_TEXTURE_2D);
@ -2985,7 +2995,7 @@ void GL_DrawTrifanParticle(particle_t *p, part_type_t *type)
qglBegin (GL_TRIANGLES); qglBegin (GL_TRIANGLES);
} }
void GL_DrawSparkedParticle(particle_t *p, part_type_t *type) void GL_DrawLineSparkParticle(particle_t *p, part_type_t *type)
{ {
if (lasttype != type) if (lasttype != type)
{ {
@ -3014,7 +3024,56 @@ void GL_DrawSparkedParticle(particle_t *p, part_type_t *type)
p->rgb[2], p->rgb[2],
0); 0);
qglVertex3f (p->org[0]-p->vel[0]/10, p->org[1]-p->vel[1]/10, p->org[2]-p->vel[2]/10); qglVertex3f (p->org[0]-p->vel[0]/10, p->org[1]-p->vel[1]/10, p->org[2]-p->vel[2]/10);
}
void GL_DrawTexturedSparkParticle(particle_t *p, part_type_t *type)
{
vec3_t v, cr, o2, point;
if (lasttype != type)
{
lasttype = type;
qglEnd();
qglEnable(GL_TEXTURE_2D);
GL_Bind(type->texturenum);
if (type->blendmode == BM_ADD) //addative
qglBlendFunc(GL_SRC_ALPHA, GL_ONE);
// else if (type->blendmode == BM_SUBTRACT) //subtractive
// qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
else
qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
qglShadeModel(GL_SMOOTH);
qglBegin(GL_QUADS);
}
qglColor4f (p->rgb[0],
p->rgb[1],
p->rgb[2],
p->alpha);
VectorSubtract(r_refdef.vieworg, p->org, v);
CrossProduct(v, p->vel, cr);
VectorNormalize(cr);
VectorMA(p->org, -p->scale/2, cr, point);
qglTexCoord2f(0, 0);
qglVertex3fv(point);
VectorMA(p->org, p->scale/2, cr, point);
qglTexCoord2f(0, 1);
qglVertex3fv(point);
VectorMA(p->org, 0.1, p->vel, o2);
VectorSubtract(r_refdef.vieworg, o2, v);
CrossProduct(v, p->vel, cr);
VectorNormalize(cr);
VectorMA(o2, p->scale/2, cr, point);
qglTexCoord2f(1, 1);
qglVertex3fv(point);
VectorMA(o2, -p->scale/2, cr, point);
qglTexCoord2f(1, 0);
qglVertex3fv(point);
} }
void GL_DrawSketchSparkParticle(particle_t *p, part_type_t *type) void GL_DrawSketchSparkParticle(particle_t *p, part_type_t *type)
@ -3364,7 +3423,7 @@ void SWD_DrawParticleBeam(beamseg_t *beam, part_type_t *type)
} }
#endif #endif
void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void sparklineparticles(particle_t*,part_type_t*), void sparkfanparticles(particle_t*,part_type_t*), void beamparticlest(beamseg_t*,part_type_t*), void beamparticlesut(beamseg_t*,part_type_t*), void drawdecalparticles(clippeddecal_t*,part_type_t*)) void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void sparklineparticles(particle_t*,part_type_t*), void sparkfanparticles(particle_t*,part_type_t*), void sparktexturedparticles(particle_t*,part_type_t*), void beamparticlest(beamseg_t*,part_type_t*), void beamparticlesut(beamseg_t*,part_type_t*), void drawdecalparticles(clippeddecal_t*,part_type_t*))
{ {
RSpeedMark(); RSpeedMark();
@ -3489,12 +3548,21 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
} }
else else
{ {
if (*type->texname) switch(type->type)
{
default:
pdraw = texturedparticles; pdraw = texturedparticles;
else if (type->scale || type->scaledelta) break;
pdraw = sparkfanparticles; case PT_SPARK:
else
pdraw = sparklineparticles; pdraw = sparklineparticles;
break;
case PT_SPARKFAN:
pdraw = sparkfanparticles;
break;
case PT_TEXTUREDSPARK:
pdraw = sparktexturedparticles;
break;
}
} }
if (!type->die) if (!type->die)
@ -3756,7 +3824,7 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
} }
} }
if (type->type == PT_NORMAL) if (type->type < PT_BEAM)
RQ_AddDistReorder((void*)pdraw, p, type, p->org); RQ_AddDistReorder((void*)pdraw, p, type, p->org);
} }
@ -3877,9 +3945,9 @@ void P_DrawParticles (void)
qglEnable(GL_POLYGON_OFFSET_FILL); qglEnable(GL_POLYGON_OFFSET_FILL);
qglBegin(GL_QUADS); qglBegin(GL_QUADS);
if (r_drawflat.value == 2) if (r_drawflat.value == 2)
DrawParticleTypes(GL_DrawSketchParticle, GL_DrawSketchSparkParticle, GL_DrawSketchSparkParticle, GL_DrawParticleBeam_Textured, GL_DrawParticleBeam_Untextured, GL_DrawClippedDecal); DrawParticleTypes(GL_DrawSketchParticle, GL_DrawSketchSparkParticle, GL_DrawSketchSparkParticle, GL_DrawSketchSparkParticle, GL_DrawParticleBeam_Textured, GL_DrawParticleBeam_Untextured, GL_DrawClippedDecal);
else else
DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawSparkedParticle, GL_DrawTrifanParticle, GL_DrawParticleBeam_Textured, GL_DrawParticleBeam_Untextured, GL_DrawClippedDecal); DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawLineSparkParticle, GL_DrawTrifanParticle, GL_DrawTexturedSparkParticle, GL_DrawParticleBeam_Textured, GL_DrawParticleBeam_Untextured, GL_DrawClippedDecal);
qglEnd(); qglEnd();
qglDisable(GL_POLYGON_OFFSET_FILL); qglDisable(GL_POLYGON_OFFSET_FILL);
@ -3901,7 +3969,7 @@ void P_DrawParticles (void)
#ifdef SWQUAKE #ifdef SWQUAKE
if (qrenderer == QR_SOFTWARE) if (qrenderer == QR_SOFTWARE)
{ {
DrawParticleTypes(SWD_DrawParticleBlob, SWD_DrawParticleSpark, SWD_DrawParticleSpark, SWD_DrawParticleBeam, SWD_DrawParticleBeam, NULL); DrawParticleTypes(SWD_DrawParticleBlob, SWD_DrawParticleSpark, SWD_DrawParticleSpark, SWD_DrawParticleSpark, SWD_DrawParticleBeam, SWD_DrawParticleBeam, NULL);
RSpeedRemark(); RSpeedRemark();
D_StartParticles(); D_StartParticles();

View file

@ -162,6 +162,7 @@ qboolean GLR_CheckSky(void);
void GLR_AddEfrags (entity_t *ent); void GLR_AddEfrags (entity_t *ent);
void GLR_RemoveEfrags (entity_t *ent); void GLR_RemoveEfrags (entity_t *ent);
void GLR_PreNewMap(void);
void GLR_NewMap (void); void GLR_NewMap (void);
void GLR_PushDlights (void); void GLR_PushDlights (void);
@ -173,8 +174,23 @@ void GLR_LessenStains(void);
void MediaGL_ShowFrame8bit(qbyte *framedata, int inwidth, int inheight, qbyte *palette); void MediaGL_ShowFrame8bit(qbyte *framedata, int inwidth, int inheight, qbyte *palette);
void MediaGL_ShowFrameRGBA_32(qbyte *framedata, int inwidth, int inheight); //top down void MediaGL_ShowFrameRGBA_32(qbyte *framedata, int inwidth, int inheight); //top down
void MediaGL_ShowFrameBGR_24_Flip(qbyte *framedata, int inwidth, int inheight); //input is bottom up... void MediaGL_ShowFrameBGR_24_Flip(qbyte *framedata, int inwidth, int inheight); //input is bottom up...
void GLR_SetSky (char *name, float rotate, vec3_t axis);
qboolean GLR_CheckSky(void);
void GLR_AddStain(vec3_t org, float red, float green, float blue, float radius);
void GLR_LessenStains(void);
void GLVID_DeInit (void);
void GLR_DeInit (void);
void GLSCR_DeInit (void);
int GLR_LightPoint (vec3_t p);
#endif #endif
#if defined(SWQUAKE) #if defined(SWQUAKE)
void SWR_Init (void); void SWR_Init (void);
void SWR_InitTextures (void); void SWR_InitTextures (void);
@ -199,6 +215,17 @@ void SWR_LessenStains(void);
void MediaSW_ShowFrame8bit(qbyte *framedata, int inwidth, int inheight, qbyte *palette); void MediaSW_ShowFrame8bit(qbyte *framedata, int inwidth, int inheight, qbyte *palette);
void MediaSW_ShowFrameRGBA_32(qbyte *framedata, int inwidth, int inheight); //top down void MediaSW_ShowFrameRGBA_32(qbyte *framedata, int inwidth, int inheight); //top down
void MediaSW_ShowFrameBGR_24_Flip(qbyte *framedata, int inwidth, int inheight); //input is bottom up... void MediaSW_ShowFrameBGR_24_Flip(qbyte *framedata, int inwidth, int inheight); //input is bottom up...
void SWR_SetSky (char *name, float rotate, vec3_t axis);
qboolean SWR_CheckSky(void);
void SWR_AddStain(vec3_t org, float red, float green, float blue, float radius);
void SWR_LessenStains(void);
void SWVID_Shutdown (void);
void SWR_DeInit (void);
void SWSCR_DeInit (void);
int SWR_LightPoint (vec3_t p);
#endif #endif
void R_AddEfrags (entity_t *ent); void R_AddEfrags (entity_t *ent);
@ -327,6 +354,8 @@ extern cvar_t gl_polyblend;
extern cvar_t gl_keeptjunctions; extern cvar_t gl_keeptjunctions;
extern cvar_t gl_reporttjunctions; extern cvar_t gl_reporttjunctions;
extern cvar_t r_flashblend; extern cvar_t r_flashblend;
extern cvar_t r_lightstylesmooth;
extern cvar_t r_lightstylespeed;
extern cvar_t gl_nocolors; extern cvar_t gl_nocolors;
extern cvar_t gl_load24bit; extern cvar_t gl_load24bit;
extern cvar_t gl_finish; extern cvar_t gl_finish;

View file

@ -10,30 +10,6 @@
qboolean vid_isfullscreen; qboolean vid_isfullscreen;
//move to headers
void GLR_SetSky (char *name, float rotate, vec3_t axis);
qboolean GLR_CheckSky(void);
void GLR_AddStain(vec3_t org, float red, float green, float blue, float radius);
void GLR_LessenStains(void);
void SWR_SetSky (char *name, float rotate, vec3_t axis);
qboolean SWR_CheckSky(void);
void SWR_AddStain(vec3_t org, float red, float green, float blue, float radius);
void SWR_LessenStains(void);
void GLVID_DeInit (void);
void GLR_DeInit (void);
void GLSCR_DeInit (void);
void SWVID_Shutdown (void);
void SWR_DeInit (void);
void SWSCR_DeInit (void);
int SWR_LightPoint (vec3_t p);
int GLR_LightPoint (vec3_t p);
void GLR_PreNewMap(void);
#define VIDCOMMANDGROUP "Video config" #define VIDCOMMANDGROUP "Video config"
#define GRAPHICALNICETIES "Graphical Nicaties" //or eyecandy, which ever you prefer. #define GRAPHICALNICETIES "Graphical Nicaties" //or eyecandy, which ever you prefer.
#define BULLETENVARS "BulletenBoard controls" #define BULLETENVARS "BulletenBoard controls"
@ -101,7 +77,7 @@ cvar_t _vid_wait_override = {"_vid_wait_override", "0", NULL, CVAR_ARCHIVE|CVAR
static cvar_t vid_stretch = {"vid_stretch","1", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; static cvar_t vid_stretch = {"vid_stretch","1", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH};
//cvar_t _windowed_mouse = {"_windowed_mouse","1", CVAR_ARCHIVE}; //cvar_t _windowed_mouse = {"_windowed_mouse","1", CVAR_ARCHIVE};
static cvar_t gl_driver = {"gl_driver","", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; //opengl library static cvar_t gl_driver = {"gl_driver","", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; //opengl library
cvar_t vid_renderer = {"vid_renderer", "", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; cvar_t vid_renderer = {"vid_renderer", "", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; //see R_RestartRenderer_f for the effective default 'if (newr.renderer == -1)'.
static cvar_t vid_bpp = {"vid_bpp", "32", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; static cvar_t vid_bpp = {"vid_bpp", "32", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH};
static cvar_t vid_allow_modex = {"vid_allow_modex", "1", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH}; static cvar_t vid_allow_modex = {"vid_allow_modex", "1", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH};
@ -197,6 +173,8 @@ extern cvar_t r_mirroralpha;
extern cvar_t r_wateralpha; extern cvar_t r_wateralpha;
cvar_t r_dynamic = {"r_dynamic","1"}; cvar_t r_dynamic = {"r_dynamic","1"};
cvar_t r_flashblend = {"gl_flashblend","0"}; cvar_t r_flashblend = {"gl_flashblend","0"};
cvar_t r_lightstylesmooth = {"r_lightstylesmooth", "0"};
cvar_t r_lightstylespeed = {"r_lightstylespeed", "10"};
extern cvar_t r_novis; extern cvar_t r_novis;
extern cvar_t r_netgraph; extern cvar_t r_netgraph;
@ -462,6 +440,8 @@ void Renderer_Init(void)
Cvar_Register(&r_dodgytgafiles, "Bug fixes"); Cvar_Register(&r_dodgytgafiles, "Bug fixes");
Cvar_Register(&r_loadlits, GRAPHICALNICETIES); Cvar_Register(&r_loadlits, GRAPHICALNICETIES);
Cvar_Register(&r_lightstylesmooth, GRAPHICALNICETIES);
Cvar_Register(&r_lightstylespeed, GRAPHICALNICETIES);
Cvar_Register(&r_stains, GRAPHICALNICETIES); Cvar_Register(&r_stains, GRAPHICALNICETIES);
Cvar_Register(&r_stainfadetime, GRAPHICALNICETIES); Cvar_Register(&r_stainfadetime, GRAPHICALNICETIES);
@ -630,99 +610,14 @@ r_qrenderer_t qrenderer=-1;
char *q_renderername = "Non-Selected renderer"; char *q_renderername = "Non-Selected renderer";
rendererinfo_t dedicatedrendererinfo = {
struct { //ALL builds need a 'none' renderer, as 0.
char *name[4]; "Dedicated server",
r_qrenderer_t rtype;
mpic_t *(*Draw_PicFromWad) (char *name);
mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_CachePic) (char *path);
mpic_t *(*Draw_SafeCachePic) (char *path);
void (*Draw_Init) (void);
void (*Draw_ReInit) (void);
void (*Draw_Character) (int x, int y, unsigned int num);
void (*Draw_ColouredCharacter) (int x, int y, unsigned int num);
void (*Draw_String) (int x, int y, const qbyte *str);
void (*Draw_Alt_String) (int x, int y, const qbyte *str);
void (*Draw_Crosshair) (void);
void (*Draw_DebugChar) (qbyte num);
void (*Draw_Pic) (int x, int y, mpic_t *pic);
void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
void (*Draw_TransPic) (int x, int y, mpic_t *pic);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void (*Draw_ConsoleBackground) (int lines);
void (*Draw_EditorBackground) (int lines);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, int c);
void (*Draw_FadeScreen) (void);
void (*Draw_BeginDisc) (void);
void (*Draw_EndDisc) (void);
void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
void (*Draw_ImageColours) (float r, float g, float b, float a);
void (*R_Init) (void);
void (*R_DeInit) (void);
void (*R_ReInit) (void);
void (*R_RenderView) (void); // must set r_refdef first
void (*R_InitSky) (struct texture_s *mt); // called at level load
qboolean (*R_CheckSky) (void);
void (*R_SetSky) (char *name, float rotate, vec3_t axis);
void (*R_NewMap) (void);
void (*R_PreNewMap) (void);
int (*R_LightPoint) (vec3_t point);
void (*R_PushDlights) (void);
void (*R_AddStain) (vec3_t org, float red, float green, float blue, float radius);
void (*R_LessenStains) (void);
void (*Media_ShowFrameBGR_24_Flip) (qbyte *framedata, int inwidth, int inheight); //input is bottom up...
void (*Media_ShowFrameRGBA_32) (qbyte *framedata, int inwidth, int inheight); //top down
void (*Media_ShowFrame8bit) (qbyte *framedata, int inwidth, int inheight, qbyte *palette); //paletted topdown (framedata is 8bit indexes into palette)
void (*Mod_Init) (void);
void (*Mod_ClearAll) (void);
struct model_s *(*Mod_ForName) (char *name, qboolean crash);
struct model_s *(*Mod_FindName) (char *name);
void *(*Mod_Extradata) (struct model_s *mod); // handles caching
void (*Mod_TouchModel) (char *name);
struct mleaf_s *(*Mod_PointInLeaf) (float *p, struct model_s *model);
qbyte *(*Mod_Q1LeafPVS) (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer);
void (*Mod_NowLoadExternal) (void);
void (*Mod_Think) (void);
qboolean(*Mod_GetTag) (model_t *model, int tagnum, int frame1, int frame2, float f2ness, float f1time, float f2time, float *result);
int (*Mod_TagNumForName) (struct model_s *model, char *name);
qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
void (*VID_DeInit) (void);
void (*VID_HandlePause) (qboolean pause);
void (*VID_LockBuffer) (void);
void (*VID_UnlockBuffer) (void);
void (*D_BeginDirectRect) (int x, int y, qbyte *pbitmap, int width, int height);
void (*D_EndDirectRect) (int x, int y, int width, int height);
void (*VID_ForceLockState) (int lk);
int (*VID_ForceUnlockedAndReturnState) (void);
void (*VID_SetPalette) (unsigned char *palette);
void (*VID_ShiftPalette) (unsigned char *palette);
char *(*VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight);
void (*VID_SetWindowCaption) (char *msg);
void (*SCR_UpdateScreen) (void);
char *alignment;
} rendererinfo[] = {
{ //ALL builds need a 'none' renderer, as 0.
{ {
"none", "none",
"dedicated", "dedicated",
"terminal", "terminal",
"sw" "sv"
}, },
QR_NONE, QR_NONE,
@ -828,10 +723,12 @@ struct {
NULL, //SCR_UpdateScreen; NULL, //SCR_UpdateScreen;
"" ""
} };
rendererinfo_t *pdedicatedrendererinfo = &dedicatedrendererinfo;
#ifdef SWQUAKE #ifdef SWQUAKE
, rendererinfo_t softwarerendererinfo = {
{ "Software rendering",
{ {
"sw", "sw",
"software", "software",
@ -920,24 +817,18 @@ struct {
SWSCR_UpdateScreen, SWSCR_UpdateScreen,
"" ""
} };
#else rendererinfo_t *psoftwarerendererinfo = &softwarerendererinfo;
,
{
{
NULL
}
}
#endif #endif
#ifdef RGLQUAKE #ifdef RGLQUAKE
, rendererinfo_t openglrendererinfo = {
{ "OpenGL",
{ {
"gl", "gl",
"opengl", "opengl",
"hardware", "hardware",
}, },
QR_SOFTWARE, QR_OPENGL,
GLDraw_PicFromWad, GLDraw_PicFromWad,
@ -1026,21 +917,27 @@ struct {
GLSCR_UpdateScreen, GLSCR_UpdateScreen,
"" ""
} };
#else rendererinfo_t *popenglrendererinfo = &openglrendererinfo;
, #endif
rendererinfo_t *pd3drendererinfo;
rendererinfo_t **rendererinfo[] =
{ {
{ &pdedicatedrendererinfo,
NULL #ifdef SWQUAKE
} &psoftwarerendererinfo,
} #endif
#ifdef RGLQUAKE
&popenglrendererinfo,
&pd3drendererinfo,
#endif #endif
}; };
typedef struct vidmode_s typedef struct vidmode_s
{ {
const char *description; const char *description;
@ -1190,7 +1087,7 @@ void M_Menu_Video_f (void)
#endif #endif
#ifdef RGLQUAKE #ifdef RGLQUAKE
"OpenGL", "OpenGL",
#ifdef AVAIL_DX7 #ifdef USE_D3D
"Direct3D", "Direct3D",
#endif #endif
#endif #endif
@ -1232,7 +1129,7 @@ void M_Menu_Video_f (void)
#if defined(SWQUAKE) && defined(RGLQUAKE) #if defined(SWQUAKE) && defined(RGLQUAKE)
if (qrenderer == QR_OPENGL) if (qrenderer == QR_OPENGL)
{ {
#ifdef AVAIL_DX7 #ifdef USE_D3D
if (!strcmp(vid_renderer.string, "d3d")) if (!strcmp(vid_renderer.string, "d3d"))
i = 2; i = 2;
else else
@ -1241,7 +1138,7 @@ void M_Menu_Video_f (void)
} }
else else
#endif #endif
#if defined(RGLQUAKE) && defined(AVAIL_DX7) #if defined(RGLQUAKE) && defined(USE_D3D)
if (!strcmp(vid_renderer.string, "d3d")) if (!strcmp(vid_renderer.string, "d3d"))
i = 1; i = 1;
else else
@ -1291,88 +1188,96 @@ void M_Menu_Video_f (void)
void R_SetRenderer(int wanted) void R_SetRenderer(int wanted)
{ {
qrenderer = wanted; rendererinfo_t *ri;
if (wanted<0) if (wanted<0)
wanted=QR_NONE; { //-1 is used so we know when we've applied something instead of never setting anything.
q_renderername = rendererinfo[wanted].name[0]; wanted=0;
qrenderer = -1;
}
else
qrenderer = (*rendererinfo[wanted])->rtype;
Draw_PicFromWad = rendererinfo[wanted].Draw_PicFromWad; ri = (*rendererinfo[wanted]);
Draw_SafePicFromWad = rendererinfo[wanted].Draw_SafePicFromWad; //Not supported
Draw_CachePic = rendererinfo[wanted].Draw_CachePic;
Draw_SafeCachePic = rendererinfo[wanted].Draw_SafeCachePic;
Draw_Init = rendererinfo[wanted].Draw_Init;
Draw_ReInit = rendererinfo[wanted].Draw_Init;
Draw_Character = rendererinfo[wanted].Draw_Character;
Draw_ColouredCharacter = rendererinfo[wanted].Draw_ColouredCharacter;
Draw_String = rendererinfo[wanted].Draw_String;
Draw_Alt_String = rendererinfo[wanted].Draw_Alt_String;
Draw_Crosshair = rendererinfo[wanted].Draw_Crosshair;
Draw_DebugChar = rendererinfo[wanted].Draw_DebugChar;
Draw_Pic = rendererinfo[wanted].Draw_Pic;
Draw_SubPic = rendererinfo[wanted].Draw_SubPic;
Draw_TransPic = rendererinfo[wanted].Draw_TransPic;
Draw_TransPicTranslate = rendererinfo[wanted].Draw_TransPicTranslate;
Draw_ConsoleBackground = rendererinfo[wanted].Draw_ConsoleBackground;
Draw_EditorBackground = rendererinfo[wanted].Draw_EditorBackground;
Draw_TileClear = rendererinfo[wanted].Draw_TileClear;
Draw_Fill = rendererinfo[wanted].Draw_Fill;
Draw_FadeScreen = rendererinfo[wanted].Draw_FadeScreen;
Draw_BeginDisc = rendererinfo[wanted].Draw_BeginDisc;
Draw_EndDisc = rendererinfo[wanted].Draw_EndDisc;
Draw_ScalePic = rendererinfo[wanted].Draw_ScalePic;
Draw_Image = rendererinfo[wanted].Draw_Image; q_renderername = ri->name[0];
Draw_ImageColours = rendererinfo[wanted].Draw_ImageColours;
R_Init = rendererinfo[wanted].R_Init; Draw_PicFromWad = ri->Draw_PicFromWad;
R_DeInit = rendererinfo[wanted].R_DeInit; Draw_SafePicFromWad = ri->Draw_SafePicFromWad; //Not supported
R_RenderView = rendererinfo[wanted].R_RenderView; Draw_CachePic = ri->Draw_CachePic;
R_NewMap = rendererinfo[wanted].R_NewMap; Draw_SafeCachePic = ri->Draw_SafeCachePic;
R_PreNewMap = rendererinfo[wanted].R_PreNewMap; Draw_Init = ri->Draw_Init;
R_LightPoint = rendererinfo[wanted].R_LightPoint; Draw_ReInit = ri->Draw_Init;
R_PushDlights = rendererinfo[wanted].R_PushDlights; Draw_Character = ri->Draw_Character;
R_InitSky = rendererinfo[wanted].R_InitSky; Draw_ColouredCharacter = ri->Draw_ColouredCharacter;
R_CheckSky = rendererinfo[wanted].R_CheckSky; Draw_String = ri->Draw_String;
R_SetSky = rendererinfo[wanted].R_SetSky; Draw_Alt_String = ri->Draw_Alt_String;
Draw_Crosshair = ri->Draw_Crosshair;
Draw_DebugChar = ri->Draw_DebugChar;
Draw_Pic = ri->Draw_Pic;
Draw_SubPic = ri->Draw_SubPic;
Draw_TransPic = ri->Draw_TransPic;
Draw_TransPicTranslate = ri->Draw_TransPicTranslate;
Draw_ConsoleBackground = ri->Draw_ConsoleBackground;
Draw_EditorBackground = ri->Draw_EditorBackground;
Draw_TileClear = ri->Draw_TileClear;
Draw_Fill = ri->Draw_Fill;
Draw_FadeScreen = ri->Draw_FadeScreen;
Draw_BeginDisc = ri->Draw_BeginDisc;
Draw_EndDisc = ri->Draw_EndDisc;
Draw_ScalePic = ri->Draw_ScalePic;
R_AddStain = rendererinfo[wanted].R_AddStain; Draw_Image = ri->Draw_Image;
R_LessenStains = rendererinfo[wanted].R_LessenStains; Draw_ImageColours = ri->Draw_ImageColours;
VID_Init = rendererinfo[wanted].VID_Init; R_Init = ri->R_Init;
VID_DeInit = rendererinfo[wanted].VID_DeInit; R_DeInit = ri->R_DeInit;
VID_HandlePause = rendererinfo[wanted].VID_HandlePause; R_RenderView = ri->R_RenderView;
VID_LockBuffer = rendererinfo[wanted].VID_LockBuffer; R_NewMap = ri->R_NewMap;
VID_UnlockBuffer = rendererinfo[wanted].VID_UnlockBuffer; R_PreNewMap = ri->R_PreNewMap;
D_BeginDirectRect = rendererinfo[wanted].D_BeginDirectRect; R_LightPoint = ri->R_LightPoint;
D_EndDirectRect = rendererinfo[wanted].D_EndDirectRect; R_PushDlights = ri->R_PushDlights;
VID_ForceLockState = rendererinfo[wanted].VID_ForceLockState; R_InitSky = ri->R_InitSky;
VID_ForceUnlockedAndReturnState = rendererinfo[wanted].VID_ForceUnlockedAndReturnState; R_CheckSky = ri->R_CheckSky;
VID_SetPalette = rendererinfo[wanted].VID_SetPalette; R_SetSky = ri->R_SetSky;
VID_ShiftPalette = rendererinfo[wanted].VID_ShiftPalette;
VID_GetRGBInfo = rendererinfo[wanted].VID_GetRGBInfo;
Media_ShowFrame8bit = rendererinfo[wanted].Media_ShowFrame8bit; R_AddStain = ri->R_AddStain;
Media_ShowFrameRGBA_32 = rendererinfo[wanted].Media_ShowFrameRGBA_32; R_LessenStains = ri->R_LessenStains;
Media_ShowFrameBGR_24_Flip = rendererinfo[wanted].Media_ShowFrameBGR_24_Flip;
Mod_Init = rendererinfo[wanted].Mod_Init; VID_Init = ri->VID_Init;
Mod_Think = rendererinfo[wanted].Mod_Think; VID_DeInit = ri->VID_DeInit;
Mod_ClearAll = rendererinfo[wanted].Mod_ClearAll; VID_HandlePause = ri->VID_HandlePause;
Mod_ForName = rendererinfo[wanted].Mod_ForName; VID_LockBuffer = ri->VID_LockBuffer;
Mod_FindName = rendererinfo[wanted].Mod_FindName; VID_UnlockBuffer = ri->VID_UnlockBuffer;
Mod_Extradata = rendererinfo[wanted].Mod_Extradata; D_BeginDirectRect = ri->D_BeginDirectRect;
Mod_TouchModel = rendererinfo[wanted].Mod_TouchModel; D_EndDirectRect = ri->D_EndDirectRect;
VID_ForceLockState = ri->VID_ForceLockState;
VID_ForceUnlockedAndReturnState = ri->VID_ForceUnlockedAndReturnState;
VID_SetPalette = ri->VID_SetPalette;
VID_ShiftPalette = ri->VID_ShiftPalette;
VID_GetRGBInfo = ri->VID_GetRGBInfo;
Mod_PointInLeaf = rendererinfo[wanted].Mod_PointInLeaf; Media_ShowFrame8bit = ri->Media_ShowFrame8bit;
Mod_Q1LeafPVS = rendererinfo[wanted].Mod_Q1LeafPVS; Media_ShowFrameRGBA_32 = ri->Media_ShowFrameRGBA_32;
Mod_NowLoadExternal = rendererinfo[wanted].Mod_NowLoadExternal; Media_ShowFrameBGR_24_Flip = ri->Media_ShowFrameBGR_24_Flip;
Mod_GetTag = rendererinfo[wanted].Mod_GetTag; Mod_Init = ri->Mod_Init;
Mod_TagNumForName = rendererinfo[wanted].Mod_TagNumForName; Mod_Think = ri->Mod_Think;
Mod_ClearAll = ri->Mod_ClearAll;
Mod_ForName = ri->Mod_ForName;
Mod_FindName = ri->Mod_FindName;
Mod_Extradata = ri->Mod_Extradata;
Mod_TouchModel = ri->Mod_TouchModel;
Mod_PointInLeaf = ri->Mod_PointInLeaf;
Mod_Q1LeafPVS = ri->Mod_Q1LeafPVS;
Mod_NowLoadExternal = ri->Mod_NowLoadExternal;
Mod_GetTag = ri->Mod_GetTag;
Mod_TagNumForName = ri->Mod_TagNumForName;
SCR_UpdateScreen = rendererinfo[wanted].SCR_UpdateScreen; SCR_UpdateScreen = ri->SCR_UpdateScreen;
} }
static qbyte default_quakepal[768] = static qbyte default_quakepal[768] =
@ -1477,6 +1382,8 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
{ {
#ifdef SWQUAKE #ifdef SWQUAKE
float f; float f;
if (qrenderer == QR_SOFTWARE) //glquake doesn't care
{
data = host_colormap = BZ_Malloc(256*VID_GRADES+sizeof(int)); data = host_colormap = BZ_Malloc(256*VID_GRADES+sizeof(int));
//let's try making one. this is probably caused by running out of baseq2. //let's try making one. this is probably caused by running out of baseq2.
for (j = 0; j < VID_GRADES; j++) for (j = 0; j < VID_GRADES; j++)
@ -1490,7 +1397,8 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
data[i] = i; data[i] = i;
data+=256; data+=256;
} }
#endif //glquake doesn't really care. }
#endif
vid.fullbright=0; vid.fullbright=0;
} }
@ -1521,7 +1429,7 @@ TRACE(("dbg: R_ApplyRenderer: Palette loaded\n"));
} }
TRACE(("dbg: R_ApplyRenderer: vid applied\n")); TRACE(("dbg: R_ApplyRenderer: vid applied\n"));
#ifdef RGLQUAKE #ifdef RGLQUAKE //fixme: should we scrap this in favor of only hardware gamma?
if (qrenderer == QR_OPENGL) if (qrenderer == QR_OPENGL)
GLV_UpdatePalette(); GLV_UpdatePalette();
#endif #endif
@ -1544,7 +1452,10 @@ TRACE(("dbg: R_ApplyRenderer: screen inited\n"));
else else
{ {
#ifdef CLIENTONLY #ifdef CLIENTONLY
Host_Error("Tried setting dedicated mode\n"); Sys_Error("Tried setting dedicated mode\n");
//we could support this, but there's no real reason to actually do so.
//fixme: despite the checks in the setrenderer command, we can still get here via a config using vid_renderer.
#else #else
TRACE(("dbg: R_ApplyRenderer: isDedicated = true\n")); TRACE(("dbg: R_ApplyRenderer: isDedicated = true\n"));
isDedicated = true; isDedicated = true;
@ -1750,6 +1661,7 @@ TRACE(("dbg: R_ApplyRenderer: efrags\n"));
void R_RestartRenderer_f (void) void R_RestartRenderer_f (void)
{ {
int i, j;
rendererstate_t oldr; rendererstate_t oldr;
rendererstate_t newr; rendererstate_t newr;
#ifdef MENU_DAT #ifdef MENU_DAT
@ -1773,8 +1685,25 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
newr.rate = vid_refreshrate.value; newr.rate = vid_refreshrate.value;
Q_strncpyz(newr.glrenderer, gl_driver.string, sizeof(newr.glrenderer)); Q_strncpyz(newr.glrenderer, gl_driver.string, sizeof(newr.glrenderer));
if (!*vid_renderer.string) newr.renderer = -1;
for (i = 0; i < sizeof(rendererinfo)/sizeof(rendererinfo[0]); i++)
{ {
if (!*rendererinfo[i])
continue; //not valid in this build. :(
for (j = 4-1; j >= 0; j--)
{
if (!(*rendererinfo[i])->name[j])
continue;
if (!stricmp((*rendererinfo[i])->name[j], vid_renderer.string))
{
newr.renderer = i;
break;
}
}
}
if (newr.renderer == -1)
{
Con_Printf("vid_renderer unset or invalid. Using default.\n");
//gotta do this after main hunk is saved off. //gotta do this after main hunk is saved off.
#if defined(RGLQUAKE) && defined(SWQUAKE) #if defined(RGLQUAKE) && defined(SWQUAKE)
Cmd_ExecuteString("setrenderer sw 8\n", RESTRICT_LOCAL); Cmd_ExecuteString("setrenderer sw 8\n", RESTRICT_LOCAL);
@ -1788,37 +1717,6 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
return; return;
} }
#ifdef SWQUAKE
if (!stricmp(vid_renderer.string, "sw") || !stricmp(vid_renderer.string, "software"))
newr.renderer = QR_SOFTWARE;
else
#endif
#ifdef RGLQUAKE
if (!stricmp(vid_renderer.string, "gl") || !stricmp(vid_renderer.string, "opengl"))
newr.renderer = QR_OPENGL;
else
#endif
#if defined(RGLQUAKE) && defined(AVAIL_DX7)
if (!stricmp(vid_renderer.string, "d3d") || !stricmp(vid_renderer.string, "dx"))
{
newr.renderer = QR_OPENGL; //direct3d is done via a gl->d3d wrapper.
Q_strncpyz(newr.glrenderer, "d3d", sizeof(newr.glrenderer));
}
else
#endif
#ifndef CLIENTONLY
if (!stricmp(vid_renderer.string, "sv") || !stricmp(vid_renderer.string, "dedicated"))
newr.renderer = QR_NONE;
else
#endif
#if defined(SWQUAKE)
newr.renderer = QR_SOFTWARE;
#elif defined(RGLQUAKE)
newr.renderer = QR_OPENGL;
#else
#error "no default renderer"
#endif
TRACE(("dbg: R_RestartRenderer_f renderer %i\n", newr.renderer)); TRACE(("dbg: R_RestartRenderer_f renderer %i\n", newr.renderer));
memcpy(&oldr, &currentrendererstate, sizeof(rendererstate_t)); memcpy(&oldr, &currentrendererstate, sizeof(rendererstate_t));
@ -1832,12 +1730,13 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
} }
else else
{ {
//failed, try dedicated as a last ditch effort to avoid having to edit configs.
newr.renderer = QR_NONE; newr.renderer = QR_NONE;
if (R_ApplyRenderer(&newr)) if (R_ApplyRenderer(&newr))
{ {
TRACE(("dbg: R_RestartRenderer_f going to dedicated\n")); TRACE(("dbg: R_RestartRenderer_f going to dedicated\n"));
Con_Printf("\n================================\n"); Con_Printf("\n================================\n");
Con_Printf("^1Video mode switch failed. Old mode wasn't supported either. Console forced.\nChange vid_mode to a compatable mode, and then use the setrenderer command.\n"); Con_Printf("^1Video mode switch failed. Old mode wasn't supported either. Console forced.\nChange vid_width, vid_height, vid_bpp, vid_displayfrequency to a compatable mode, and then use the setrenderer command.\n");
Con_Printf("================================\n\n"); Con_Printf("================================\n\n");
} }
else else
@ -1854,103 +1753,58 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
void R_SetRenderer_f (void) void R_SetRenderer_f (void)
{ {
if (!strcmp(Cmd_Argv(1), "help")) int i, j;
int best;
char *param = Cmd_Argv(1);
if (Cmd_Argc() == 1 || !stricmp(param, "help"))
{ {
Con_Printf ("\nValid commands are:\n" Con_Printf ("\nValid setrenderer parameters are:\n");
#ifdef SWQUAKE for (i = 0; i < sizeof(rendererinfo)/sizeof(rendererinfo[0]); i++)
"%s SW 8 will set 8bit software rendering\n" {
"%s SW 32 will set 32 bit software rendering\n" if ((*rendererinfo[i]))
#endif //SWQUAKE Con_Printf("%s: %s\n", (*rendererinfo[i])->name[0], (*rendererinfo[i])->description);
#ifdef RGLQUAKE }
"%s GL will use the default OpenGL on your pc\n"
"%s GL 3dfxgl will use a 3dfx minidriver (not supplied)\n"
#ifdef AVAIL_DX7
"%s D3D will use direct3d rendering\n"
#endif
#endif
"\n"
#ifdef SWQUAKE
,Cmd_Argv(0),Cmd_Argv(0)
#endif
#ifdef RGLQUAKE
,Cmd_Argv(0),Cmd_Argv(0)
#ifdef AVAIL_DX7
,Cmd_Argv(0)
#endif
#endif
);
return; return;
} }
else if (!stricmp(Cmd_Argv(1), "dedicated"))
best = -1;
for (i = 0; i < sizeof(rendererinfo)/sizeof(rendererinfo[0]); i++)
{ {
Cvar_Set(&vid_renderer, "dedicated"); if (!*rendererinfo[i])
R_RestartRenderer_f(); continue; //not valid in this build. :(
} for (j = 4-1; j >= 0; j--)
else if (!stricmp(Cmd_Argv(1), "SW") || !stricmp(Cmd_Argv(1), "Software"))
{ {
#ifndef SWQUAKE if (!(*rendererinfo[i])->name[j])
Con_Printf("Software rendering is not supported in this binary\n"); continue;
#else if (!stricmp((*rendererinfo[i])->name[j], param))
if (Cmd_Argc() >= 3) //set vid_use32bit accordingly.
{ {
switch(atoi(Cmd_Argv(2))) best = i;
{
default:
Con_Printf ("The parameter you specified is not linked to the software renderer.");
return;
case 32:
Cvar_Set(&vid_bpp, "32");
break;
case 8:
Cvar_Set(&vid_bpp, "8");
break; break;
} }
} }
Cvar_Set(&vid_renderer, "sw");
R_RestartRenderer_f();
#endif
} }
else if (!stricmp(Cmd_Argv(1), "GL") || !stricmp(Cmd_Argv(1), "OpenGL"))
#ifdef CLIENTONLY
if (best == 0)
{ {
#ifndef RGLQUAKE Con_Printf("Client-only builds cannot use dedicated modes.\n");
Con_Printf("OpenGL rendering is not supported in this binary\n"); return;
#else
if (Cmd_Argc() == 3) //set gl_driver accordingly.
Cvar_Set(&gl_driver, Cmd_Argv(2));
Cvar_ForceSet(&vid_renderer, "gl");
if (vid_bpp.value == 8)
Cvar_Set(&vid_bpp, "16");
R_RestartRenderer_f();
#endif
} }
else if (!stricmp(Cmd_Argv(1), "D3D") || !stricmp(Cmd_Argv(1), "DX"))
{
#if defined(RGLQUAKE) && defined(AVAIL_DX7)
Cvar_Set(&vid_renderer, "d3d");
if (vid_bpp.value == 8)
Cvar_Set(&vid_bpp, "16");
R_RestartRenderer_f();
#else
Con_Printf("Direct3D rendering is not supported in this binary\n");
#endif #endif
}
else if (Cmd_Argc() < 2) if (best == -1)
{ {
Con_Printf ("%s: Switch to a different renderer\n\ttype %s help for more info.\n", Cmd_Argv(0), Cmd_Argv(0)); Con_Printf("setrenderer: parameter not supported (%s)\n", param);
return; return;
} }
else else
{ {
Con_Printf ("%s: Parameters are bad.\n\ttype %s help for more info.\n", Cmd_Argv(0), Cmd_Argv(0)); if (Cmd_Argc() == 3)
return; Cvar_Set(&vid_bpp, Cmd_Argv(2));
} }
Cvar_Set(&vid_renderer, param);
R_RestartRenderer_f();
} }

View file

@ -61,9 +61,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef NO_OGG #ifdef NO_OGG
#undef AVAIL_OGGVORBIS #undef AVAIL_OGGVORBIS
#endif #endif
#if defined(NO_D3D) || !defined(_WIN32)
#undef AVAIL_DX7
#endif
#if defined(NO_MASM) || !defined(_WIN32) #if defined(NO_MASM) || !defined(_WIN32)
#undef AVAIL_MASM #undef AVAIL_MASM
#endif #endif
@ -88,7 +85,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef AVAIL_JPEGLIB //no jpeg support #undef AVAIL_JPEGLIB //no jpeg support
#undef AVAIL_PNGLIB //no png support #undef AVAIL_PNGLIB //no png support
#undef USE_MADLIB //no internal mp3 playing #undef USE_MADLIB //no internal mp3 playing
#undef AVAIL_DX7 //no d3d support #undef USE_D3D //no d3d support
#define NOMEDIA //NO playing of avis/cins/roqs #define NOMEDIA //NO playing of avis/cins/roqs
#define MD3MODELS //we DO want to use quake3 alias models. This might be a minimal build, but we still want this. #define MD3MODELS //we DO want to use quake3 alias models. This might be a minimal build, but we still want this.
@ -172,8 +169,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif #endif
#endif #endif
#ifdef NODIRECTX #if defined(NODIRECTX) || (!defined(GLQUAKE) && !defined(RGLQUAKE))
#undef AVAIL_DX7 #undef USE_D3D
#endif #endif

View file

@ -63,7 +63,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"../../fteswqw.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"../../fteswqw.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug" !ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
@ -89,7 +89,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteswqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteswqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug" !ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
@ -117,7 +117,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteglqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteglqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease" !ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
@ -145,7 +145,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib ..\dxsdk\sdk\lib\dxguid.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteqw.exe" # ADD BASE LINK32 comctl32.lib ..\dxsdk\sdk\lib\dxguid.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteqw.exe"
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /out:"../../fteglqw.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /out:"../../fteglqw.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /debug # SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug" !ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
@ -163,7 +163,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /ML /W3 /GX /ZI /Od /I "..\client\gltod3d\sdk7\include" /I "..\client\gltod3d\D3DFrame" /I "..\dxsdk\sdk\inc" /I "..\scitech\include" /I "..\client" /D "NQPROT" /D "_DEBUG" /D "GLQUAKE" /D "SERVERDLL" /D "WIN32" /D "_WINDOWS" /FR".\GLDebug/" /Fp".\GLDebug/qwcl.pch" /YX /Fo".\GLDebug/" /Fd".\GLDebug/" /FD /c # ADD BASE CPP /nologo /G5 /ML /W3 /GX /ZI /Od /I "..\client\gltod3d\sdk7\include" /I "..\client\gltod3d\D3DFrame" /I "..\dxsdk\sdk\inc" /I "..\scitech\include" /I "..\client" /D "NQPROT" /D "_DEBUG" /D "GLQUAKE" /D "SERVERDLL" /D "WIN32" /D "_WINDOWS" /FR".\GLDebug/" /Fp".\GLDebug/qwcl.pch" /YX /Fo".\GLDebug/" /Fd".\GLDebug/" /FD /c
# ADD CPP /nologo /G5 /W3 /Gi /GX /ZI /Od /I "..\client" /I "../libs/dxsdk7/include" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "GLQUAKE" /D "SWQUAKE" /D "AVAIL_DX7" /Fr /Fp".\MDebug/qwcl.pch" /Yu"quakedef.h" /FD /c # ADD CPP /nologo /G5 /W3 /Gi /GX /ZI /Od /I "..\client" /I "../libs/dxsdk7/include" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "GLQUAKE" /D "SWQUAKE" /D "USE_D3D" /Fr /Fp".\MDebug/qwcl.pch" /Yu"quakedef.h" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD BASE RSC /l 0x809 /d "_DEBUG"
@ -174,7 +174,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteglqw.exe"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../../fteqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"../../fteqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /profile /pdb:none # SUBTRACT LINK32 /profile /pdb:none
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease" !ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
@ -192,7 +192,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\client\gltod3d\sdk7\include" /I "..\client\gltod3d\D3DFrame" /I "..\dxsdk\sdk\inc" /I "..\scitech\include" /I "..\client" /D "NOSOUNDASM" /D "NDEBUG" /D "_MBCS" /D "GLQUAKE" /D "SERVERDLL" /D "NQPROT" /D "WIN32" /D "_WINDOWS" /FR /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /I "..\client\gltod3d\sdk7\include" /I "..\client\gltod3d\D3DFrame" /I "..\dxsdk\sdk\inc" /I "..\scitech\include" /I "..\client" /D "NOSOUNDASM" /D "NDEBUG" /D "_MBCS" /D "GLQUAKE" /D "SERVERDLL" /D "NQPROT" /D "WIN32" /D "_WINDOWS" /FR /YX /FD /c
# ADD CPP /nologo /G6 /GX /O2 /I "..\client" /I "../libs/dxsdk7/include" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "GLQUAKE" /D "SWQUAKE" /D "AVAIL_DX7" /Fr /Yu"quakedef.h" /FD /c # ADD CPP /nologo /G6 /GX /O2 /I "..\client" /I "../libs/dxsdk7/include" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "GLQUAKE" /D "SWQUAKE" /D "USE_D3D" /Fr /Yu"quakedef.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD BASE RSC /l 0x809 /d "NDEBUG"
@ -202,7 +202,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteglqw.exe"
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /out:"../../fteqw.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /map /machine:I386 /out:"../../fteqw.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug" !ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
@ -230,7 +230,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteglqw.exe"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"../../fteminglqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"../../fteminglqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease" !ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
@ -257,7 +257,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /out:"../../../fteglqw.exe"
# ADD LINK32 wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"../../fteminglqw.exe" # ADD LINK32 wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"../../fteminglqw.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server" !ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
@ -286,7 +286,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteminglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteminglqw.exe"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../../fteqwsv.exe" # ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../../fteqwsv.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server" !ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
@ -314,7 +314,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteminglqw.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../../fteminglqw.exe"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 winmm.lib wsock32.lib user32.lib shell32.lib Advapi32.lib /nologo /subsystem:console /pdb:none /map /machine:I386 /out:"../../fteqwsv.exe" # ADD LINK32 winmm.lib wsock32.lib user32.lib shell32.lib Advapi32.lib /nologo /subsystem:console /pdb:none /map /machine:I386 /out:"../../fteqwsv.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /debug # SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW" !ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
@ -342,7 +342,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteswqw_dbg.exe" /pdbtype:sept # ADD BASE LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteswqw_dbg.exe" /pdbtype:sept
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"../../fteswqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"../../fteswqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3" !ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
@ -371,7 +371,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../fteglqw_dbg.exe" # ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../fteglqw_dbg.exe"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteglqw_dbg.exe" # ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteglqw_dbg.exe" /libpath:"../libs/dxsdk7/lib"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ENDIF !ENDIF
@ -2099,6 +2099,37 @@ SOURCE=..\client\skin.c
# Begin Source File # Begin Source File
SOURCE=..\client\snd_directx.c SOURCE=..\client\snd_directx.c
!IF "$(CFG)" == "ftequake - Win32 Release"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -5006,449 +5037,45 @@ SOURCE=..\common\zone.c
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\Comprout.c SOURCE=..\QCLIB\Comprout.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\qclib\execloop.h SOURCE=..\qclib\execloop.h
!IF "$(CFG)" == "ftequake - Win32 Release"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\hash.c SOURCE=..\QCLIB\hash.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\initlib.c SOURCE=..\QCLIB\initlib.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\pr_edict.c SOURCE=..\QCLIB\pr_edict.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\Pr_exec.c SOURCE=..\QCLIB\Pr_exec.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /WX /YX /Yc /Yu # SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /WX /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\pr_multi.c SOURCE=..\QCLIB\pr_multi.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\progtype.h SOURCE=..\QCLIB\progtype.h
!IF "$(CFG)" == "ftequake - Win32 Release"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\qcc_cmdlib.c SOURCE=..\QCLIB\qcc_cmdlib.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -5621,57 +5248,7 @@ SOURCE=..\QCLIB\QccMain.c
# Begin Source File # Begin Source File
SOURCE=..\QCLIB\qcd_main.c SOURCE=..\QCLIB\qcd_main.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# SUBTRACT CPP /YX /Yc /Yu # SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File

View file

@ -33,12 +33,22 @@ R_AnimateLight
*/ */
void GLR_AnimateLight (void) void GLR_AnimateLight (void)
{ {
int i,j,k; int i,j;
int v1, v2;
float f;
// //
// light animations // light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright // 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int)(cl.time*10); f = (cl.time*r_lightstylespeed.value);
if (f < 0)
f = 0;
i = (int)f;
if (r_lightstylesmooth.value)
f -= i; //this can require updates at 1000 times a second.. Depends on your framerate of course
else
f = 0; //only update them 10 times a second
for (j=0 ; j<MAX_LIGHTSTYLES ; j++) for (j=0 ; j<MAX_LIGHTSTYLES ; j++)
{ {
if (!cl_lightstyle[j].length) if (!cl_lightstyle[j].length)
@ -47,10 +57,13 @@ void GLR_AnimateLight (void)
cl_lightstyle[j].colour = 7; cl_lightstyle[j].colour = 7;
continue; continue;
} }
k = i % cl_lightstyle[j].length; v1 = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a'; v1 = cl_lightstyle[j].map[v1] - 'a';
k = k*22;
d_lightstylevalue[j] = k; v2 = (i+1) % cl_lightstyle[j].length;
v2 = cl_lightstyle[j].map[v2] - 'a';
d_lightstylevalue[j] = (v1*(1-f) + v2*(f))*22;
} }
} }

View file

@ -63,7 +63,7 @@ extern cvar_t vid_conwidth;
typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t; typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t;
#ifdef AVAIL_DX7 #ifdef USE_D3D
void D3DInitialize(void); void D3DInitialize(void);
void d3dSetMode(int fullscreen, int width, int height, int bpp, int zbpp); void d3dSetMode(int fullscreen, int width, int height, int bpp, int zbpp);
#endif #endif
@ -713,7 +713,7 @@ qboolean VID_AttachGL (rendererstate_t *info)
{ //make sure we can get a valid renderer. { //make sure we can get a valid renderer.
do do
{ {
#ifdef AVAIL_DX7 #ifdef USE_D3D
if (!Q_strcasecmp(info->glrenderer, "D3D")) if (!Q_strcasecmp(info->glrenderer, "D3D"))
{ {
extern cvar_t gl_ztrick; extern cvar_t gl_ztrick;

View file

@ -26,7 +26,7 @@ the fact that it uses wrapper functions to call methods in a class could be a re
#include "bothdefs.h" //our always-present config file #include "bothdefs.h" //our always-present config file
#ifdef AVAIL_DX7 #ifdef USE_D3D
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@ -56,9 +56,9 @@ the fact that it uses wrapper functions to call methods in a class could be a re
#define D3D_OVERLOADS #define D3D_OVERLOADS
#define RELEASENULL(object) if (object) {object->Release();} #define RELEASENULL(object) if (object) {object->Release();}
#include "dxsdk7/include/ddraw.h" #include "ddraw.h"
#include "dxsdk7/include/d3d.h" #include "d3d.h"
#include "dxsdk7/include/d3dx.h" #include "d3dx.h"
typedef HRESULT (WINAPI *qD3DXInitialize_t)(); typedef HRESULT (WINAPI *qD3DXInitialize_t)();
qD3DXInitialize_t qD3DXInitialize; qD3DXInitialize_t qD3DXInitialize;
@ -83,11 +83,11 @@ qD3DXMakeDDPixelFormat_t qD3DXMakeDDPixelFormat;
typedef D3DXMATRIX* (WINAPI *qD3DXMatrixTranslation_t) ( D3DXMATRIX *pOut, float x, float y, float z ); typedef D3DXMATRIX* (WINAPI *qD3DXMatrixTranslation_t) ( D3DXMATRIX *pOut, float x, float y, float z );
qD3DXMatrixTranslation_t qD3DXMatrixTranslation; qD3DXMatrixTranslation_t qD3DXMatrixTranslation;
#include "quakedef.h"
extern "C" { extern "C" {
#include "quakedef.h"
#include "glquake.h" #include "glquake.h"
} }
#ifdef AVAIL_DX7 #ifdef USE_D3D
// Choose one of the following. D3DXContext is new in DX7, and // Choose one of the following. D3DXContext is new in DX7, and
// provides a standard way of managing DX. D3DFrame is from // provides a standard way of managing DX. D3DFrame is from
@ -109,9 +109,9 @@ extern "C" {
// #define USE_D3DFRAME // #define USE_D3DFRAME
#ifdef USE_D3DFRAME #ifdef USE_D3DFRAME
#include "sdk7/include/d3denum.h" #include "d3denum.h"
#include "sdk7/include/d3dframe.h" #include "d3dframe.h"
#include "sdk7/include/d3dutil.h" #include "d3dutil.h"
#endif #endif
#if 0 #if 0
@ -3554,6 +3554,12 @@ void APIENTRY D3DViewport (GLint x, GLint y, GLsizei width, GLsizei height){
gFakeGL->cglViewport(x, y, width, height); gFakeGL->cglViewport(x, y, width, height);
} }
int APIENTRY D3DGetError (void)
{
return 0;
}
HDC gHDC; HDC gHDC;
HGLRC gHGLRC; HGLRC gHGLRC;
@ -4039,6 +4045,8 @@ d3dglfunc_t glfuncs[] = {
{"glColorPointer", (PROC)D3DColorPointer}, {"glColorPointer", (PROC)D3DColorPointer},
{"glEnableClientState", (PROC)D3DEnableClientState}, {"glEnableClientState", (PROC)D3DEnableClientState},
{"glDisableClientState", (PROC)D3DDisableClientState}, {"glDisableClientState", (PROC)D3DDisableClientState},
{"glGetError", (PROC)D3DGetError},
/* /*
qwglCreateContext = D3DwglCreateContext; qwglCreateContext = D3DwglCreateContext;
qwglDeleteContext = D3DwglDeleteContext; qwglDeleteContext = D3DwglDeleteContext;
@ -4051,6 +4059,115 @@ d3dglfunc_t glfuncs[] = {
}; };
qboolean D3DVID_Init(rendererstate_t *info, unsigned char *palette)
{
strcpy(info->glrenderer, "D3D");
return GLVID_Init(info, palette);
}
extern "C" {
#include "gl_draw.h"
}
rendererinfo_t d3drendererinfo = {
"Direct3D",
{
"d3d",
"crap"
},
QR_OPENGL,
GLDraw_PicFromWad,
GLDraw_SafePicFromWad,
GLDraw_CachePic,
GLDraw_SafeCachePic,
GLDraw_Init,
GLDraw_ReInit,
GLDraw_Character,
GLDraw_ColouredCharacter,
GLDraw_String,
GLDraw_Alt_String,
GLDraw_Crosshair,
GLDraw_DebugChar,
GLDraw_Pic,
GLDraw_ScalePic,
GLDraw_SubPic,
GLDraw_TransPic,
GLDraw_TransPicTranslate,
GLDraw_ConsoleBackground,
GLDraw_EditorBackground,
GLDraw_TileClear,
GLDraw_Fill,
GLDraw_FadeScreen,
GLDraw_BeginDisc,
GLDraw_EndDisc,
GLDraw_Image,
GLDraw_ImageColours,
GLR_Init,
GLR_DeInit,
GLR_ReInit,
GLR_RenderView,
GLR_InitSky,
GLR_CheckSky,
GLR_SetSky,
GLR_NewMap,
GLR_PreNewMap,
GLR_LightPoint,
GLR_PushDlights,
GLR_AddStain,
GLR_LessenStains,
MediaGL_ShowFrameBGR_24_Flip,
MediaGL_ShowFrameRGBA_32,
MediaGL_ShowFrame8bit,
GLMod_Init,
GLMod_ClearAll,
GLMod_ForName,
GLMod_FindName,
GLMod_Extradata,
GLMod_TouchModel,
GLMod_PointInLeaf,
GLMod_LeafPVS,
GLMod_NowLoadExternal,
GLMod_Think,
GLMod_GetTag,
GLMod_TagNumForName,
D3DVID_Init,
GLVID_DeInit,
GLVID_HandlePause,
GLVID_LockBuffer,
GLVID_UnlockBuffer,
GLD_BeginDirectRect,
GLD_EndDirectRect,
GLVID_ForceLockState,
GLVID_ForceUnlockedAndReturnState,
GLVID_SetPalette,
GLVID_ShiftPalette,
GLVID_GetRGBInfo,
NULL, //setcaption
GLSCR_UpdateScreen,
""
};
extern "C" {
rendererinfo_t *pd3drendererinfo = &d3drendererinfo;
}
#endif #endif

View file

@ -428,22 +428,6 @@ void PR_LoadGlabalStruct(void)
globalfloat (true, total_monsters); globalfloat (true, total_monsters);
globalfloat (true, found_secrets); globalfloat (true, found_secrets);
globalfloat (true, killed_monsters); globalfloat (true, killed_monsters);
globalfloat (true, parm1);
globalfloat (true, parm2);
globalfloat (true, parm3);
globalfloat (true, parm4);
globalfloat (true, parm5);
globalfloat (true, parm6);
globalfloat (true, parm7);
globalfloat (true, parm8);
globalfloat (true, parm9);
globalfloat (true, parm10);
globalfloat (true, parm11);
globalfloat (true, parm12);
globalfloat (true, parm13);
globalfloat (true, parm14);
globalfloat (true, parm15);
globalfloat (true, parm16);
globalvec (true, v_forward); globalvec (true, v_forward);
globalvec (true, v_up); globalvec (true, v_up);
globalvec (true, v_right); globalvec (true, v_right);
@ -474,6 +458,9 @@ void PR_LoadGlabalStruct(void)
memset(&evalc_idealpitch, 0, sizeof(evalc_idealpitch)); memset(&evalc_idealpitch, 0, sizeof(evalc_idealpitch));
memset(&evalc_pitch_speed, 0, sizeof(evalc_pitch_speed)); memset(&evalc_pitch_speed, 0, sizeof(evalc_pitch_speed));
for (i = 0; i < NUM_SPAWN_PARMS; i++)
spawnparamglobals[i] = (float *)PR_FindGlobal(svprogfuncs, va("parm%i", i+1), 0);
if (!((nqglobalvars_t*)pr_globals)->dimension_send) if (!((nqglobalvars_t*)pr_globals)->dimension_send)
{ //make sure dimension send is always a valid pointer. { //make sure dimension send is always a valid pointer.
((nqglobalvars_t*)pr_globals)->dimension_send = &dimension_send_default; ((nqglobalvars_t*)pr_globals)->dimension_send = &dimension_send_default;
@ -4918,7 +4905,7 @@ void PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals)
client = svs.clients + (i-1); client = svs.clients + (i-1);
for (i=0 ; i< NUM_SPAWN_PARMS ; i++) for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
(&pr_global_struct->parm1)[i] = client->spawn_parms[i]; *spawnparamglobals[i] = client->spawn_parms[i];
} }
/* /*

View file

@ -36,7 +36,7 @@ typedef struct globalvars_s
} globalvars_t; } globalvars_t;
typedef struct nqglobalvars_s typedef struct nqglobalvars_s
{ int *pad[28]; {
int *self; int *self;
int *other; int *other;
int *world; int *world;
@ -53,22 +53,6 @@ typedef struct nqglobalvars_s
float *total_monsters; float *total_monsters;
float *found_secrets; float *found_secrets;
float *killed_monsters; float *killed_monsters;
float *parm1;
float *parm2;
float *parm3;
float *parm4;
float *parm5;
float *parm6;
float *parm7;
float *parm8;
float *parm9;
float *parm10;
float *parm11;
float *parm12;
float *parm13;
float *parm14;
float *parm15;
float *parm16;
vec3_t *V_v_forward; vec3_t *V_v_forward;
vec3_t *V_v_up; vec3_t *V_v_up;
vec3_t *V_v_right; vec3_t *V_v_right;

View file

@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_PROGS 64 #define MAX_PROGS 64
#define MAXADDONS 16 #define MAXADDONS 16
#define NUM_SPAWN_PARMS 32 //moved from server.h because of include ordering :(.
#define NewGetEdictFieldValue GetEdictFieldValue #define NewGetEdictFieldValue GetEdictFieldValue
void Q_SetProgsParms(qboolean forcompiler); void Q_SetProgsParms(qboolean forcompiler);
void PR_Deinit(void); void PR_Deinit(void);
@ -97,6 +99,8 @@ typedef struct edict_s
//#define pr_nqglobal_struct *((nqglobalvars_t*)pr_globals) //#define pr_nqglobal_struct *((nqglobalvars_t*)pr_globals)
#define pr_global_struct *pr_nqglobal_struct #define pr_global_struct *pr_nqglobal_struct
float *spawnparamglobals[NUM_SPAWN_PARMS];
extern nqglobalvars_t *pr_nqglobal_struct; extern nqglobalvars_t *pr_nqglobal_struct;
extern progfuncs_t *svprogfuncs; //instance extern progfuncs_t *svprogfuncs; //instance

View file

@ -637,7 +637,7 @@ qboolean SV_LoadLevelCache(char *level, char *startspot, qboolean ignoreplayers)
if (e2) if (e2)
e2->_float = 1; e2->_float = 1;
for (j=0 ; j< NUM_SPAWN_PARMS ; j++) for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
(&pr_global_struct->parm1)[j] = host_client->spawn_parms[j]; *spawnparamglobals[j] = host_client->spawn_parms[j];
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
ent->area.next = ent->area.prev = NULL; ent->area.next = ent->area.prev = NULL;

View file

@ -271,9 +271,6 @@ typedef struct
int csqcentversion[MAX_EDICTS];//prevents ent versions from going backwards int csqcentversion[MAX_EDICTS];//prevents ent versions from going backwards
} server_t; } server_t;
#define NUM_SPAWN_PARMS 16
typedef enum typedef enum
{ {
cs_free, // can be reused for a new connection cs_free, // can be reused for a new connection
@ -465,6 +462,7 @@ typedef struct client_s
int delta_sequence; // -1 = no compression int delta_sequence; // -1 = no compression
int last_sequence; int last_sequence;
netchan_t netchan; netchan_t netchan;
qboolean isindependant;
int lastsequence_acknoledged; int lastsequence_acknoledged;

View file

@ -968,7 +968,7 @@ void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t
MSG_WriteByte(msg, svcdp_entities); MSG_WriteByte(msg, svcdp_entities);
MSG_WriteLong(msg, 0); MSG_WriteLong(msg, 0);
if (client->protocol == SCP_DARKPLACES7) if (client->protocol == SCP_DARKPLACES7)
MSG_WriteLong(msg, 0); MSG_WriteLong(msg, client->last_sequence);
for (newindex = 0; newindex < to->num_entities; newindex++) for (newindex = 0; newindex < to->num_entities; newindex++)
to->entities[newindex].bitmask = 0; to->entities[newindex].bitmask = 0;
@ -2344,8 +2344,8 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
continue; continue;
if (e >= 1024 && !(client->fteprotocolextensions & PEXT_ENTITYDBL2)) if (e >= 1024 && !(client->fteprotocolextensions & PEXT_ENTITYDBL2))
continue; continue;
if (/*dement->modelindex >= 256 &&*/ !(client->fteprotocolextensions & PEXT_MODELDBL)) // if (dement->modelindex >= 256 && !(client->fteprotocolextensions & PEXT_MODELDBL))
continue; // continue;
state = &pack->entities[pack->num_entities]; state = &pack->entities[pack->num_entities];
pack->num_entities++; pack->num_entities++;

View file

@ -304,7 +304,12 @@ void SV_SaveSpawnparms (qboolean dontsave)
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, host_client->edict); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, host_client->edict);
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms);
for (j=0 ; j<NUM_SPAWN_PARMS ; j++) for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
host_client->spawn_parms[j] = (&pr_global_struct->parm1)[j]; {
if (spawnparamglobals[j])
host_client->spawn_parms[j] = *spawnparamglobals[j];
else
host_client->spawn_parms[j] = 0;
}
} }
#ifdef SVRANKING #ifdef SVRANKING
@ -320,7 +325,12 @@ void SV_SaveSpawnparms (qboolean dontsave)
host_client->kills=0; host_client->kills=0;
host_client->deaths=0; host_client->deaths=0;
for (j=0 ; j<NUM_SPAWN_PARMS ; j++) for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
rs.parm[j] = (&pr_global_struct->parm1)[j]; {
if (spawnparamglobals[j])
rs.parm[j] = *spawnparamglobals[j];
else
rs.parm[j] = 0;
}
Rank_SetPlayerStats(host_client->rankid, &rs); Rank_SetPlayerStats(host_client->rankid, &rs);
} }
} }

View file

@ -376,7 +376,7 @@ void SV_DropClient (client_t *drop)
if (pr_nqglobal_struct->SetChangeParms) if (pr_nqglobal_struct->SetChangeParms)
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms);
for (j=0 ; j<NUM_SPAWN_PARMS ; j++) for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
rs.parm[j] = (&pr_global_struct->parm1)[j]; rs.parm[j] = *spawnparamglobals[j];
Rank_SetPlayerStats(drop->rankid, &rs); Rank_SetPlayerStats(drop->rankid, &rs);
} }
} }
@ -1029,7 +1029,12 @@ void SV_GetNewSpawnParms(client_t *cl)
if (pr_nqglobal_struct->SetNewParms) if (pr_nqglobal_struct->SetNewParms)
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
for (i=0 ; i<NUM_SPAWN_PARMS ; i++) for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
cl->spawn_parms[i] = (&pr_global_struct->parm1)[i]; {
if (spawnparamglobals[i])
cl->spawn_parms[i] = *spawnparamglobals[i];
else
cl->spawn_parms[i] = 0;
}
} }
} }
@ -3297,7 +3302,7 @@ qboolean ReloadRanking(client_t *cl, char *newname)
if (pr_nqglobal_struct->SetChangeParms) if (pr_nqglobal_struct->SetChangeParms)
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms);
for (j=0 ; j<NUM_SPAWN_PARMS ; j++) for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
rs.parm[j] = (&pr_global_struct->parm1)[j]; rs.parm[j] = *spawnparamglobals[j];
Rank_SetPlayerStats(cl->rankid, &rs); Rank_SetPlayerStats(cl->rankid, &rs);
} }
if (!Rank_GetPlayerStats(newid, &rs)) if (!Rank_GetPlayerStats(newid, &rs))

View file

@ -868,20 +868,6 @@ if (l > 1.0/64)
} }
/*
=============
SV_Physics_None
Non moving objects can only think
=============
*/
void SV_Physics_None (edict_t *ent)
{
// regular thinking
SV_RunThink (ent);
}
/* /*
============= =============
SV_Physics_Follow SV_Physics_Follow
@ -1660,30 +1646,35 @@ void SV_WalkMove (edict_t *ent)
#endif #endif
#define FL_JUMPRELEASED 4096
/* /*
================ ================
SV_Physics_Client SV_RunEntity
Player character actions
From normal Quake in an attempt to fix physics in QuakeRally
================ ================
*/ */
#define FL_JUMPRELEASED 4096 void SV_RunEntity (edict_t *ent)
void SV_Physics_Client (edict_t *ent, int num)
{ {
qboolean readyforjump; edict_t *movechain;
float oldvel; vec3_t initial_origin,initial_angle;
if ( svs.clients[num-1].state < cs_spawned ) if (ent->entnum > 0 && ent->entnum <= sv.allocated_client_slots)
{ //a client woo.
qboolean readyforjump = false;
if ( svs.clients[ent->entnum-1].state < cs_spawned )
return; // unconnected slot return; // unconnected slot
readyforjump = false;
if (progstype == PROG_QW) host_client = &svs.clients[ent->entnum-1];
SV_ClientThink();
if (progstype == PROG_QW) //detect if the mod should do a jump
if (ent->v->button2) if (ent->v->button2)
if ((int)ent->v->flags & FL_JUMPRELEASED) if ((int)ent->v->flags & FL_JUMPRELEASED)
readyforjump = true; readyforjump = true;
// //
// call standard client pre-think // call standard client pre-think
// //
@ -1693,94 +1684,24 @@ void SV_Physics_Client (edict_t *ent, int num)
if (readyforjump) //qw progs can't jump for themselves... if (readyforjump) //qw progs can't jump for themselves...
{ {
if (!ent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED)) if (!ent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED) && ent->v->velocity[2] <= 0)
ent->v->velocity[2] += 270; ent->v->velocity[2] += 270;
} }
//
// do a move
//
SV_CheckVelocity (ent);
//
// decide which move function to call
//
switch ((int)ent->v->movetype)
{
case MOVETYPE_NONE:
if (!SV_RunThink (ent))
return;
break;
case MOVETYPE_WALK:
oldvel = ent->v->velocity[0];
if (!SV_RunThink (ent))
return;
if (!SV_CheckWater (ent) && ! ((int)ent->v->flags & FL_WATERJUMP) )
SV_AddGravity (ent, ent->v->gravity);
SV_CheckStuck (ent);
SV_WalkMove (ent);
break;
case MOVETYPE_FOLLOW:
SV_Physics_Follow (ent);
break;
case MOVETYPE_TOSS:
case MOVETYPE_BOUNCE:
SV_Physics_Toss (ent);
break;
case MOVETYPE_FLY:
case MOVETYPE_SWIM:
if (!SV_RunThink (ent))
return;
SV_FlyMove (ent, host_frametime, NULL);
break;
case MOVETYPE_NOCLIP:
if (!SV_RunThink (ent))
return;
VectorMA (ent->v->origin, host_frametime, ent->v->velocity, ent->v->origin);
VectorMA (ent->v->angles, host_frametime, ent->v->avelocity, ent->v->angles);
break;
default:
Sys_Error ("SV_Physics_client: bad movetype %i", (int)ent->v->movetype);
} }
else
//
// call standard player post-think
//
SV_LinkEdict (ent, true);
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPostThink);
}
/*
================
SV_RunEntity
================
*/
void SV_RunEntity (edict_t *ent)
{ {
int c,originMoved;
edict_t *ent2;
vec3_t oldOrigin,oldAngle;
if (ent->v->lastruntime == (float)realtime) if (ent->v->lastruntime == (float)realtime)
return; return;
ent->v->lastruntime = (float)realtime; ent->v->lastruntime = (float)realtime;
}
ent2 = PROG_TO_EDICT(svprogfuncs, ent->v->movechain);
if (ent2 != sv.edicts)
movechain = PROG_TO_EDICT(svprogfuncs, ent->v->movechain);
if (movechain != sv.edicts)
{ {
VectorCopy(ent->v->origin,oldOrigin); VectorCopy(ent->v->origin,initial_origin);
VectorCopy(ent->v->angles,oldAngle); VectorCopy(ent->v->angles,initial_angle);
} }
switch ( (int)ent->v->movetype) switch ( (int)ent->v->movetype)
@ -1789,7 +1710,8 @@ void SV_RunEntity (edict_t *ent)
SV_Physics_Pusher (ent); SV_Physics_Pusher (ent);
break; break;
case MOVETYPE_NONE: case MOVETYPE_NONE:
SV_Physics_None (ent); if (!SV_RunThink (ent))
return;
break; break;
case MOVETYPE_NOCLIP: case MOVETYPE_NOCLIP:
SV_Physics_Noclip (ent); SV_Physics_Noclip (ent);
@ -1826,36 +1748,39 @@ void SV_RunEntity (edict_t *ent)
SV_Error ("SV_Physics: bad movetype %i on %s", (int)ent->v->movetype, svprogfuncs->stringtable + ent->v->classname); SV_Error ("SV_Physics: bad movetype %i on %s", (int)ent->v->movetype, svprogfuncs->stringtable + ent->v->classname);
} }
if (ent2 != sv.edicts) if (movechain != sv.edicts)
{ {
originMoved = !VectorCompare(ent->v->origin,oldOrigin); qboolean callfunc;
if (originMoved || !VectorCompare(ent->v->angles,oldAngle)) if ((callfunc=DotProduct(ent->v->origin, initial_origin)) || DotProduct(ent->v->angles, initial_angle))
{ {
VectorSubtract(ent->v->origin,oldOrigin,oldOrigin); vec3_t moveang, moveorg;
VectorSubtract(ent->v->angles,oldAngle,oldAngle); int i;
VectorSubtract(ent->v->angles, initial_angle, moveang)
VectorSubtract(ent->v->origin, initial_origin, moveorg)
for(c=0;c<10;c++) for(i=16;i && movechain != sv.edicts && !movechain->isfree;i--, movechain = PROG_TO_EDICT(svprogfuncs, movechain->v->movechain))
{ // chain a max of 10 objects
if (ent2->isfree) break;
VectorAdd(oldOrigin,ent2->v->origin,ent2->v->origin);
if ((int)ent2->v->flags & FL_MOVECHAIN_ANGLE)
{ {
VectorAdd(oldAngle,ent2->v->angles,ent2->v->angles); if ((int)movechain->v->flags & FL_MOVECHAIN_ANGLE)
} VectorAdd(movechain->v->angles, moveang, movechain->v->angles);
VectorAdd(movechain->v->origin, moveorg, movechain->v->origin);
if (originMoved && ent2->v->chainmoved) if (movechain->v->chainmoved && callfunc)
{ // callback function {
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent2); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, movechain);
pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, ent); pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, ent);
PR_ExecuteProgram(svprogfuncs, ent2->v->chainmoved); PR_ExecuteProgram(svprogfuncs, movechain->v->chainmoved);
}
}
}
} }
ent2 = PROG_TO_EDICT(svprogfuncs, ent2->v->movechain); if (ent->entnum > 0 && ent->entnum <= sv.allocated_client_slots)
if (ent2 == sv.edicts) break; {
SV_LinkEdict (ent, true);
} pr_global_struct->time = sv.time;
} pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPostThink);
} }
} }
@ -1990,14 +1915,6 @@ qboolean SV_Physics (void)
pr_global_struct->frametime = host_frametime; pr_global_struct->frametime = host_frametime;
for (i = 0; i < sv.allocated_client_slots; i++)
{
host_client = &svs.clients[i];
if (host_client->state == cs_spawned)
if (sv_nomsec.value || SV_PlayerPhysicsQC || !ISQWCLIENT(host_client))
SV_ClientThink();
}
SV_ProgStartFrame (); SV_ProgStartFrame ();
PR_RunThreads(); PR_RunThreads();
@ -2025,9 +1942,9 @@ qboolean SV_Physics (void)
if (i > 0 && i <= sv.allocated_client_slots) if (i > 0 && i <= sv.allocated_client_slots)
{ {
if (sv_nomsec.value || SV_PlayerPhysicsQC || !ISQWCLIENT(&svs.clients[i-1])) if (!svs.clients[i-1].isindependant)
{ {
SV_Physics_Client(ent, i); SV_RunEntity(ent);
SV_RunNewmis (); SV_RunNewmis ();
} }
else else

View file

@ -9,6 +9,8 @@
#ifdef SVRANKING #ifdef SVRANKING
typedef struct { typedef struct {
int ident;
int version;
int usedslots; int usedslots;
int leader; int leader;
int freeslot; int freeslot;
@ -26,6 +28,9 @@ cvar_t rank_needlogin = {"rank_needlogin", "0"};
cvar_t rank_filename = {"rank_filename", ""}; cvar_t rank_filename = {"rank_filename", ""};
char rank_cvargroup[] = "server rankings"; char rank_cvargroup[] = "server rankings";
#define RANKFILE_VERSION 0x00000000
#define RANKFILE_IDENT *(int*)"RANK"
void inline READ_PLAYERSTATS(int x, rankstats_t *os) void inline READ_PLAYERSTATS(int x, rankstats_t *os)
{ {
int i; int i;
@ -102,6 +107,8 @@ void inline WRITEHEADER(void)
{ {
rankfileheader_t nh; rankfileheader_t nh;
nh.ident = RANKFILE_IDENT;
nh.version = swaplong(RANKFILE_VERSION);
nh.usedslots = swaplong(rankfileheader.usedslots); nh.usedslots = swaplong(rankfileheader.usedslots);
nh.leader = swaplong(rankfileheader.leader); nh.leader = swaplong(rankfileheader.leader);
nh.freeslot = swaplong(rankfileheader.freeslot); nh.freeslot = swaplong(rankfileheader.freeslot);
@ -115,6 +122,7 @@ void inline WRITEHEADER(void)
qboolean Rank_OpenRankings(void) qboolean Rank_OpenRankings(void)
{ {
qboolean created;
if (!rankfile) if (!rankfile)
{ {
if (!*rank_filename.string) if (!*rank_filename.string)
@ -127,7 +135,12 @@ qboolean Rank_OpenRankings(void)
rankfile = fopen(va("%s/%s", com_gamedir, rank_filename.string), "r+b"); rankfile = fopen(va("%s/%s", com_gamedir, rank_filename.string), "r+b");
if (!rankfile) //hmm... try creating if (!rankfile) //hmm... try creating
{
rankfile = fopen(va("%s/%s", com_gamedir, rank_filename.string), "w+b"); rankfile = fopen(va("%s/%s", com_gamedir, rank_filename.string), "w+b");
created = true;
}
else
created = false;
if (!rankfile) if (!rankfile)
return false; //couldn't open file. return false; //couldn't open file.
@ -136,10 +149,20 @@ qboolean Rank_OpenRankings(void)
fseek(rankfile, 0, SEEK_SET); fseek(rankfile, 0, SEEK_SET);
fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile); fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile);
rankfileheader.version = swaplong(rankfileheader.version);
rankfileheader.usedslots = swaplong(rankfileheader.usedslots); rankfileheader.usedslots = swaplong(rankfileheader.usedslots);
rankfileheader.leader = swaplong(rankfileheader.leader); rankfileheader.leader = swaplong(rankfileheader.leader);
rankfileheader.freeslot = swaplong(rankfileheader.freeslot); rankfileheader.freeslot = swaplong(rankfileheader.freeslot);
if (!created && (rankfileheader.version != RANKFILE_VERSION || rankfileheader.ident != RANKFILE_IDENT))
{
Con_Printf("Rank file is version %i not %i\nEither delete the file or use an equivelent version of " DISTRIBUTION "\n");
fclose(rankfile);
rankfile = NULL;
return false;
}
return true; //success. return true; //success.
} }
return true; //already open return true; //already open

View file

@ -136,13 +136,13 @@ void SV_New_f (void)
//NOTE: This doesn't go through ClientReliableWrite since it's before the user //NOTE: This doesn't go through ClientReliableWrite since it's before the user
//spawns. These functions are written to not overflow //spawns. These functions are written to not overflow
if (host_client->num_backbuf) /* if (host_client->num_backbuf)
{ {
Con_TPrintf(STL_BACKBUFSET, host_client->name, host_client->netchan.message.cursize); Con_TPrintf(STL_BACKBUFSET, host_client->name, host_client->netchan.message.cursize);
host_client->num_backbuf = 0; host_client->num_backbuf = 0;
SZ_Clear(&host_client->netchan.message); SZ_Clear(&host_client->netchan.message);
} }
*/
if (sizeofcoord > 2 && !(host_client->fteprotocolextensions & PEXT_FLOATCOORDS)) if (sizeofcoord > 2 && !(host_client->fteprotocolextensions & PEXT_FLOATCOORDS))
{ {
SV_ClientPrintf(host_client, 2, "\n\n\n\nSorry, but your client does not appear to support FTE's bigcoords\nFTE users will need to set cl_nopext to 0 and then reconnect, or to upgrade\n"); SV_ClientPrintf(host_client, 2, "\n\n\n\nSorry, but your client does not appear to support FTE's bigcoords\nFTE users will need to set cl_nopext to 0 and then reconnect, or to upgrade\n");
@ -150,9 +150,10 @@ void SV_New_f (void)
return; return;
} }
ClientReliableCheckBlock(host_client, 800); //okay, so it might be longer, but I'm too lazy to work out the real size.
// send the serverdata // send the serverdata
MSG_WriteByte (&host_client->netchan.message, ISQ2CLIENT(host_client)?svcq2_serverdata:svc_serverdata); ClientReliableWrite_Byte (host_client, ISQ2CLIENT(host_client)?svcq2_serverdata:svc_serverdata);
#ifdef PROTOCOL_VERSION_FTE #ifdef PROTOCOL_VERSION_FTE
if (host_client->fteprotocolextensions)//let the client know if (host_client->fteprotocolextensions)//let the client know
{ {
@ -163,11 +164,11 @@ void SV_New_f (void)
MSG_WriteLong (&host_client->netchan.message, host_client->fteprotocolextensions); MSG_WriteLong (&host_client->netchan.message, host_client->fteprotocolextensions);
} }
#endif #endif
MSG_WriteLong (&host_client->netchan.message, ISQ2CLIENT(host_client)?PROTOCOL_VERSION_Q2:PROTOCOL_VERSION); ClientReliableWrite_Long (host_client, ISQ2CLIENT(host_client)?PROTOCOL_VERSION_Q2:PROTOCOL_VERSION);
MSG_WriteLong (&host_client->netchan.message, svs.spawncount); ClientReliableWrite_Long (host_client, svs.spawncount);
if (ISQ2CLIENT(host_client)) if (ISQ2CLIENT(host_client))
MSG_WriteByte (&host_client->netchan.message, 0); ClientReliableWrite_Byte (host_client, 0);
MSG_WriteString (&host_client->netchan.message, gamedir); ClientReliableWrite_String (host_client, gamedir);
splitnum = 0; splitnum = 0;
for (split = host_client; split; split = split->controlled) for (split = host_client; split; split = split->controlled)
@ -189,9 +190,9 @@ void SV_New_f (void)
playernum = -1; playernum = -1;
if (ISQ2CLIENT(host_client)) if (ISQ2CLIENT(host_client))
MSG_WriteShort (&host_client->netchan.message, playernum); ClientReliableWrite_Short (host_client, playernum);
else else
MSG_WriteByte (&host_client->netchan.message, playernum); ClientReliableWrite_Byte (host_client, playernum);
split->state = cs_connected; split->state = cs_connected;
split->connection_started = realtime; split->connection_started = realtime;
@ -201,13 +202,13 @@ void SV_New_f (void)
splitnum++; splitnum++;
} }
if (host_client->fteprotocolextensions & PEXT_SPLITSCREEN) if (host_client->fteprotocolextensions & PEXT_SPLITSCREEN)
MSG_WriteByte (&host_client->netchan.message, 128); ClientReliableWrite_Byte (host_client, 128);
// send full levelname // send full levelname
if (sv.demostatevalid) if (sv.demostatevalid)
MSG_WriteString (&host_client->netchan.message, sv.demfullmapname); ClientReliableWrite_String (host_client, sv.demfullmapname);
else else
MSG_WriteString (&host_client->netchan.message, sv.mapname); ClientReliableWrite_String (host_client, sv.mapname);
// //
// game server // game server
@ -221,39 +222,48 @@ void SV_New_f (void)
memset (&host_client->lastcmd, 0, sizeof(host_client->lastcmd)); memset (&host_client->lastcmd, 0, sizeof(host_client->lastcmd));
// begin fetching configstrings // begin fetching configstrings
MSG_WriteByte (&host_client->netchan.message, svcq2_stufftext); ClientReliableWrite_Byte (host_client, svcq2_stufftext);
MSG_WriteString (&host_client->netchan.message, va("cmd configstrings %i 0\n",svs.spawncount) ); ClientReliableWrite_String (host_client, va("cmd configstrings %i 0\n",svs.spawncount) );
} }
return; return;
} }
#endif #endif
// send the movevars // send the movevars
MSG_WriteFloat(&host_client->netchan.message, movevars.gravity); ClientReliableWrite_Float(host_client, movevars.gravity);
MSG_WriteFloat(&host_client->netchan.message, movevars.stopspeed); ClientReliableWrite_Float(host_client, movevars.stopspeed);
MSG_WriteFloat(&host_client->netchan.message, movevars.maxspeed); ClientReliableWrite_Float(host_client, movevars.maxspeed);
MSG_WriteFloat(&host_client->netchan.message, movevars.spectatormaxspeed); ClientReliableWrite_Float(host_client, movevars.spectatormaxspeed);
MSG_WriteFloat(&host_client->netchan.message, movevars.accelerate); ClientReliableWrite_Float(host_client, movevars.accelerate);
MSG_WriteFloat(&host_client->netchan.message, movevars.airaccelerate); ClientReliableWrite_Float(host_client, movevars.airaccelerate);
MSG_WriteFloat(&host_client->netchan.message, movevars.wateraccelerate); ClientReliableWrite_Float(host_client, movevars.wateraccelerate);
MSG_WriteFloat(&host_client->netchan.message, movevars.friction); ClientReliableWrite_Float(host_client, movevars.friction);
MSG_WriteFloat(&host_client->netchan.message, movevars.waterfriction); ClientReliableWrite_Float(host_client, movevars.waterfriction);
MSG_WriteFloat(&host_client->netchan.message, movevars.entgravity); ClientReliableWrite_Float(host_client, movevars.entgravity);
// send server info string // send server info string
MSG_WriteByte (&host_client->netchan.message, svc_stufftext);
if (sv.demostatevalid) if (sv.demostatevalid)
MSG_WriteString (&host_client->netchan.message, va("fullserverinfo \"%s\"\n", sv.demoinfo)); {
ClientReliableCheckBlock(host_client, 20 + strlen(sv.demoinfo));
ClientReliableWrite_Byte (host_client, svc_stufftext);
ClientReliableWrite_String (host_client, va("fullserverinfo \"%s\"\n", sv.demoinfo) );
}
else else
MSG_WriteString (&host_client->netchan.message, va("fullserverinfo \"%s\"\n", svs.info) ); {
ClientReliableCheckBlock(host_client, 20 + strlen(svs.info));
ClientReliableWrite_Byte (host_client, svc_stufftext);
ClientReliableWrite_String (host_client, va("fullserverinfo \"%s\"\n", svs.info) );
}
host_client->csqcactive = false; host_client->csqcactive = false;
// send music // send music
MSG_WriteByte (&host_client->netchan.message, svc_cdtrack); ClientReliableCheckBlock(host_client, 2);
ClientReliableWrite_Byte (host_client, svc_cdtrack);
if (svprogfuncs) if (svprogfuncs)
MSG_WriteByte (&host_client->netchan.message, sv.edicts->v->sounds); ClientReliableWrite_Byte (host_client, sv.edicts->v->sounds);
else else
MSG_WriteByte (&host_client->netchan.message, 0); ClientReliableWrite_Byte (host_client, 0);
} }
#define GAME_DEATHMATCH 0 #define GAME_DEATHMATCH 0
#define GAME_COOP 1 #define GAME_COOP 1
@ -1245,7 +1255,10 @@ void SV_Begin_f (void)
{ {
// copy spawn parms out of the client_t // copy spawn parms out of the client_t
for (i=0 ; i< NUM_SPAWN_PARMS ; i++) for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
(&pr_global_struct->parm1)[i] = split->spawn_parms[i]; {
if (spawnparamglobals[i])
*spawnparamglobals[i] = split->spawn_parms[i];
}
// call the spawn function // call the spawn function
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
@ -1273,7 +1286,10 @@ void SV_Begin_f (void)
if (eval2) if (eval2)
eval2->_float = 1; eval2->_float = 1;
for (j=0 ; j< NUM_SPAWN_PARMS ; j++) for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
(&pr_global_struct->parm1)[j] = split->spawn_parms[j]; {
if (spawnparamglobals[j])
*spawnparamglobals[j] = split->spawn_parms[j];
}
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
G_FLOAT(OFS_PARM0) = sv.time - split->spawninfotime; G_FLOAT(OFS_PARM0) = sv.time - split->spawninfotime;
@ -1283,7 +1299,10 @@ void SV_Begin_f (void)
{ {
// copy spawn parms out of the client_t // copy spawn parms out of the client_t
for (i=0 ; i< NUM_SPAWN_PARMS ; i++) for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
(&pr_global_struct->parm1)[i] = split->spawn_parms[i]; {
if (spawnparamglobals[i])
*spawnparamglobals[i] = split->spawn_parms[i];
}
// call the spawn function // call the spawn function
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
@ -2702,7 +2721,12 @@ void Cmd_Join_f (void)
// call the progs to get default spawn parms for the new client // call the progs to get default spawn parms for the new client
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
for (i=0 ; i<NUM_SPAWN_PARMS ; i++) for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
host_client->spawn_parms[i] = (&pr_global_struct->parm1)[i]; {
if (spawnparamglobals[i])
host_client->spawn_parms[i] = *spawnparamglobals[i];
else
host_client->spawn_parms[i] = 0;
}
// call the spawn function // call the spawn function
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
@ -2779,7 +2803,12 @@ void Cmd_Observe_f (void)
// call the progs to get default spawn parms for the new client // call the progs to get default spawn parms for the new client
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms); PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
for (i=0 ; i<NUM_SPAWN_PARMS ; i++) for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
host_client->spawn_parms[i] = (&pr_global_struct->parm1)[i]; {
if (spawnparamglobals[i])
host_client->spawn_parms[i] = *spawnparamglobals[i];
else
host_client->spawn_parms[i] = 0;
}
SV_SpawnSpectator (); SV_SpawnSpectator ();
@ -3119,7 +3148,10 @@ void SVNQ_Begin_f (void)
{ {
// copy spawn parms out of the client_t // copy spawn parms out of the client_t
for (i=0 ; i< NUM_SPAWN_PARMS ; i++) for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
(&pr_global_struct->parm1)[i] = host_client->spawn_parms[i]; {
if (spawnparamglobals[i])
*spawnparamglobals[i] = host_client->spawn_parms[i];
}
// call the spawn function // call the spawn function
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
@ -3131,7 +3163,10 @@ void SVNQ_Begin_f (void)
{ {
// copy spawn parms out of the client_t // copy spawn parms out of the client_t
for (i=0 ; i< NUM_SPAWN_PARMS ; i++) for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
(&pr_global_struct->parm1)[i] = host_client->spawn_parms[i]; {
if (spawnparamglobals[i])
*spawnparamglobals[i] = host_client->spawn_parms[i];
}
// call the spawn function // call the spawn function
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
@ -3742,6 +3777,10 @@ int SV_PMTypeForClient (client_t *cl)
return PM_NORMAL; return PM_NORMAL;
} }
//called for common csqc/server code (supposedly)
void SV_RunEntity (edict_t *ent);
/* /*
=========== ===========
SV_PreRunCmd SV_PreRunCmd
@ -3933,6 +3972,15 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
V_CalcRoll (sv_player->v->angles, sv_player->v->velocity)*4; V_CalcRoll (sv_player->v->angles, sv_player->v->velocity)*4;
} }
if (SV_PlayerPhysicsQC)
{ //csqc independant physics support
pr_global_struct->frametime = host_frametime;
pr_global_struct->time = sv.time;
SV_RunEntity(sv_player);
return;
}
if (!host_client->spectator) if (!host_client->spectator)
{ {
vec_t oldvz; vec_t oldvz;
@ -4306,8 +4354,9 @@ haveannothergo:
if (!sv.paused) if (!sv.paused)
{ {
if (sv_nomsec.value || SV_PlayerPhysicsQC) if (sv_nomsec.value)
{ {
cl->isindependant = false;
if (!sv_player->v->fixangle) if (!sv_player->v->fixangle)
{ {
sv_player->v->v_angle[0] = newcmd.angles[0]* (360.0/65536); sv_player->v->v_angle[0] = newcmd.angles[0]* (360.0/65536);
@ -4349,6 +4398,7 @@ haveannothergo:
} }
continue; continue;
} }
cl->isindependant = true;
SV_PreRunCmd(); SV_PreRunCmd();
if (net_drop < 20) if (net_drop < 20)
@ -4365,6 +4415,7 @@ haveannothergo:
} }
SV_RunCmd (&newcmd, false); SV_RunCmd (&newcmd, false);
if (!SV_PlayerPhysicsQC)
SV_PostRunCmd(); SV_PostRunCmd();
} }
@ -4589,7 +4640,9 @@ void SVNQ_ReadClientMove (usercmd_t *move)
frame = &host_client->frames[host_client->netchan.incoming_acknowledged & UPDATE_MASK]; frame = &host_client->frames[host_client->netchan.incoming_acknowledged & UPDATE_MASK];
if (host_client->protocol == SCP_DARKPLACES7) if (host_client->protocol == SCP_DARKPLACES7)
MSG_ReadLong (); host_client->last_sequence = MSG_ReadLong ();
else
host_client->last_sequence = 0;
frame->ping_time = sv.time - MSG_ReadFloat (); frame->ping_time = sv.time - MSG_ReadFloat ();
@ -4657,6 +4710,9 @@ void SVNQ_ReadClientMove (usercmd_t *move)
host_client->edict->v->button6 = ((bits >> 5) & 1); host_client->edict->v->button6 = ((bits >> 5) & 1);
host_client->edict->v->button7 = ((bits >> 6) & 1); host_client->edict->v->button7 = ((bits >> 6) & 1);
host_client->edict->v->button8 = ((bits >> 7) & 1); host_client->edict->v->button8 = ((bits >> 7) & 1);
if (host_client->last_sequence)
SV_RunEntity(host_client->edict);
} }
void SVNQ_ExecuteClientMessage (client_t *cl) void SVNQ_ExecuteClientMessage (client_t *cl)

View file

@ -32,23 +32,37 @@ R_AnimateLight
*/ */
void SWR_AnimateLight (void) void SWR_AnimateLight (void)
{ {
int i,j,k; int i,j;
int v1, v2;
float f;
// //
// light animations // light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright // 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int)(cl.time*10); f = (cl.time*r_lightstylespeed.value);
if (f < 0)
f = 0;
i = (int)f;
if (r_lightstylesmooth.value)
f -= i; //this can require updates at 1000 times a second.. Depends on your framerate of course
else
f = 0; //only update them 10 times a second
for (j=0 ; j<MAX_LIGHTSTYLES ; j++) for (j=0 ; j<MAX_LIGHTSTYLES ; j++)
{ {
if (!cl_lightstyle[j].length) if (!cl_lightstyle[j].length)
{ {
d_lightstylevalue[j] = 256; d_lightstylevalue[j] = 256;
cl_lightstyle[j].colour = 7;
continue; continue;
} }
k = i % cl_lightstyle[j].length; v1 = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a'; v1 = cl_lightstyle[j].map[v1] - 'a';
k = k*22;
d_lightstylevalue[j] = k; v2 = (i+1) % cl_lightstyle[j].length;
v2 = cl_lightstyle[j].map[v2] - 'a';
d_lightstylevalue[j] = (v1*(1-f) + v2*(f))*22;
} }
} }