Things should compile again now.

Reverted clipping change, its not stable enough.
Optimised player prediction/tracing.
Framerates are a little more competitive now.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3549 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2010-07-13 09:49:38 +00:00
parent e7ec40d0c8
commit 83ec5e427f
14 changed files with 58 additions and 114 deletions

View file

@ -3145,20 +3145,6 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
pplayer->active = true;
pplayer->flags = state->flags;
/*
if (pplayer->frame != state->frame)
{
state->oldframe = pplayer->oldframe = pplayer->frame;
state->lerpstarttime = pplayer->lerptime = realtime;
pplayer->frame = state->frame;
}
else
{
state->lerpstarttime = pplayer->lerptime;
state->oldframe = pplayer->oldframe;
}
*/
// note that the local player is special, since he moves locally
// we use his last predicted postition
for (s = 0; s < cl.splitclients; s++)

View file

@ -726,6 +726,7 @@ extern float server_version; // version of server we connected to
// cl_main
//
void CL_InitDlights(void);
void CL_FreeDlights(void);
dlight_t *CL_AllocDlight (int key);
dlight_t *CL_AllocSlight (void); //allocates a static light
dlight_t *CL_NewDlight (int key, const vec3_t origin, float radius, float time, int type);

View file

@ -679,6 +679,7 @@ void VARGS Con_Printf (const char *fmt, ...)
#endif
// also echo to debugging console
// OutputDebugString(msg); //msvc debug output
Sys_Printf ("%s", msg); // also echo to debugging console
// log all messages to file

View file

@ -2105,7 +2105,7 @@ texid_t R_LoadHiResTexture(char *name, char *subpath, unsigned int flags)
data = W_GetTexture(name, &image_width, &image_height, &alphaed);
if (data)
{
tex = R_LoadTexture32 (name, image_width, image_height, (unsigned*)data, flags)
tex = R_LoadTexture32 (name, image_width, image_height, (unsigned*)data, flags);
BZ_Free(data);
return tex;
}

View file

@ -869,7 +869,6 @@ void M_Reinit(void)
M_Init_Internal();
}
}
#warning ----------- move menu reload here --------------
void FPS_Preset_f(void);

View file

@ -102,6 +102,8 @@ void M_SomeInitialisationFunctionCalledAtStartup(void)
// menus
//
void M_Init (void);
void M_Reinit(void);
void M_Shutdown(void);
void M_Keydown (int key, int unicode);
void M_Keyup (int key, int unicode);
void M_Draw (int uimenu);
@ -390,6 +392,7 @@ void M_FindKeysForCommand (char *command, int *twokeys);
void M_UnbindCommand (char *command);
qboolean MP_Init (void);
void MP_Shutdown (void);
qboolean MP_Toggle(void);
void MP_Draw(void);
void MP_RegisterCvarsAndCmds(void);

View file

@ -31,9 +31,10 @@ static void PNULL_RunParticleEffect4 (vec3_t org, float radius, int color, int e
static void PNULL_ParticleTrailIndex (vec3_t start, vec3_t end, int color, int crnd, trailstate_t **tsk){}
static void PNULL_EmitSkyEffectTris(model_t *mod, msurface_t *fa){}
static void PNULL_InitParticles (void)
static int PNULL_InitParticles (void)
{
CL_RegisterParticles();
return true;
}
static void PNULL_ShutdownParticles(void)

View file

@ -1897,6 +1897,7 @@ qboolean MP_Init (void)
Con_DPrintf("Initialized menu.dat\n");
return true;
}
return false;
}
void MP_CoreDump_f(void)

View file

@ -79,10 +79,15 @@ void R_ParticleSystem_Callback(struct cvar_s *var, char *oldvalue)
{
int i;
if (pe)
{
OutputDebugString("foo\n");
pe->ShutdownParticles();
}
if (!qrenderer)
{
pe = &pe_null;
}
else
{
pe = NULL;

View file

@ -173,6 +173,7 @@ void Surf_AddStain(vec3_t org, float red, float green, float blue, float radius)
void Surf_LessenStains(void);
void Surf_WipeStains(void);
void Surf_DeInit(void);
void Surf_Clear(struct model_s *mod);
void Surf_BuildLightmaps(void);
void Surf_BuildSurfaceDisplayList (struct model_s *mod, struct msurface_s *fa);
void Surf_RenderDynamicLightmaps (struct msurface_s *fa, int shift);
@ -309,6 +310,7 @@ enum uploadfmt
texid_t GL_AllocNewTexture(void);
void GL_UploadFmt(texid_t tex, char *name, enum uploadfmt fmt, void *data, void *palette, int width, int height, unsigned int flags);
texid_t GL_LoadTextureFmt (char *identifier, int width, int height, enum uploadfmt fmt, void *data, unsigned int flags);
void GL_DestroyTexture(texid_t tex);
#endif
#ifdef D3DQUAKE
texid_t D3D_AllocNewTexture(int width, int height);

View file

@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trace_t *trace, vec3_t origin, vec3_t angles);
static qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trace_t *trace, vec3_t origin, vec3_t angles);
int Q1BSP_HullPointContents(hull_t *hull, vec3_t p);
static hull_t box_hull;
static dclipnode_t box_clipnodes[6];
@ -174,7 +174,8 @@ int PM_ExtraBoxContents (vec3_t p)
{
if (pe->forcecontentsmask)
{
PM_TransformedHullCheck(pm, p, p, &tr, pe->origin, pe->angles);
if (!PM_TransformedHullCheck(pm, p, p, &tr, pe->origin, pe->angles))
continue;
if (tr.startsolid)
pc |= pe->forcecontentsmask;
}
@ -199,20 +200,17 @@ LINE TESTING IN HULLS
===============================================================================
*/
// 1/32 epsilon to keep floating point happy
#define DIST_EPSILON (0.03125)
static vec3_t trace_extents;
vec3_t trace_extents;
qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trace_t *trace, vec3_t origin, vec3_t angles)
/*returns if it actually did a trace*/
static qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trace_t *trace, vec3_t origin, vec3_t angles)
{
vec3_t start_l, end_l;
vec3_t a;
vec3_t forward, right, up;
vec3_t temp;
qboolean rotated;
qboolean result;
int i;
// subtract origin offset
VectorSubtract (start, origin, start_l);
@ -241,11 +239,29 @@ qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trac
}
// sweep the box through the model
if (model && model->funcs.Trace)
result = model->funcs.Trace(model, 0, 0, start_l, end_l, player_mins, player_maxs, trace);
if (model)
{
for (i = 0; i < 3; i++)
{
if (start_l[i]+player_mins[i] > model->maxs[i] && end_l[i] + player_mins[i] > model->maxs[i])
return false;
if (start_l[i]+player_maxs[i] < model->mins[i] && end_l[i] + player_maxs[i] < model->mins[i])
return false;
}
model->funcs.Trace(model, 0, 0, start_l, end_l, player_mins, player_maxs, trace);
}
else
{
result = Q1BSP_RecursiveHullCheck (&box_hull, box_hull.firstclipnode, 0, 1, start_l, end_l, trace);
for (i = 0; i < 3; i++)
{
if (start_l[i]+player_mins[i] > box_planes[0+i*2].dist && end_l[i] + player_mins[i] > box_planes[0+i*2].dist)
return false;
if (start_l[i]+player_maxs[i] < box_planes[1+i*2].dist && end_l[i] + player_maxs[i] < box_planes[1+i*2].dist)
return false;
}
Q1BSP_RecursiveHullCheck (&box_hull, box_hull.firstclipnode, 0, 1, start_l, end_l, trace);
}
if (rotated)
@ -275,8 +291,7 @@ qboolean PM_TransformedHullCheck (model_t *model, vec3_t start, vec3_t end, trac
trace->endpos[1] += origin[1];
trace->endpos[2] += origin[2];
}
return result;
return true;
}
/*
@ -304,18 +319,8 @@ qboolean PM_TestPlayerPosition (vec3_t pos)
// get the clipping hull
if (pe->model)
{
/*
#ifdef Q2BSPS
if (pe->model->fromgame == fg_quake2 || pe->model->fromgame == fg_quake3)
{
trace_t trace = CM_TransformedBoxTrace(pe->model, pos, pos, player_mins, player_maxs, MASK_PLAYERSOLID, pe->origin, pe->angles);
if (trace.fraction == 0)
return false;
if (!PM_TransformedHullCheck (pe->model, pos, pos, &trace, pe->origin, pe->angles))
continue;
}
#endif*/
PM_TransformedHullCheck (pe->model, pos, pos, &trace, pe->origin, pe->angles);
if (trace.allsolid)
return false; //solid
}
@ -328,9 +333,6 @@ qboolean PM_TestPlayerPosition (vec3_t pos)
if (Q1BSP_HullPointContents(hull, mins) & FTECONTENTS_SOLID)
return false;
// if (Q1BSP_Trace(&box_hull, 0, 0, pe->origin, pe->origin, pe->mins, pe->maxs, pos, pe->origin, pe->angles) & FTECONTENTS_SOLID)
// return false;
}
}
@ -364,13 +366,15 @@ trace_t PM_PlayerTrace (vec3_t start, vec3_t end)
if (!pe->model)
{
vec3_t mins, maxs;
VectorSubtract (pe->mins, player_maxs, mins);
VectorSubtract (pe->maxs, player_mins, maxs);
PM_HullForBox (mins, maxs);
}
// trace a line through the apropriate clipping hull
PM_TransformedHullCheck (pe->model, start, end, &trace, pe->origin, pe->angles);
if (!PM_TransformedHullCheck (pe->model, start, end, &trace, pe->origin, pe->angles))
continue;
if (trace.allsolid)
trace.startsolid = true;

View file

@ -61,7 +61,7 @@ int VARGS Q1_HullPointContents (hull_t *hull, int num, vec3_t p);
#define DIST_EPSILON (0.03125)
#if 1
#if 0
enum
{
rht_solid,

View file

@ -2084,8 +2084,6 @@ SOURCE=..\client\p_null.c
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
@ -4404,65 +4402,7 @@ SOURCE=..\common\translate.c
# Begin Source File
SOURCE=..\server\world.c
!IF "$(CFG)" == "ftequake - Win32 Release"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
# ADD CPP /Yu"quakedef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated ServerQ3"
# ADD CPP /Yu"quekdef.h"
!ELSEIF "$(CFG)" == "ftequake - Win32 D3DDebug"
# ADD CPP /Yu"quekdef.h"
!ENDIF
# End Source File
# Begin Source File

View file

@ -1553,14 +1553,15 @@ static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis)
return;
}
if (l->worldshadowmesh)
if (l->worldshadowmesh)
{
lvis = l->worldshadowmesh->litleaves;
//fixme: check head node first?
if (!Sh_LeafInView(l->worldshadowmesh->litleaves, vvis))
{
//fixme: check head node first?
if (!Sh_LeafInView(l->worldshadowmesh->litleaves, vvis))
{
bench.numpvsculled++;
return;
}
bench.numpvsculled++;
return;
}
}
else
{