Implement pm_edgefriction cvar.

fteextensions generation now has an option to skip some defs incompatible with id1/dp.
Misc minor tweaks.




git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5367 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-12-11 00:20:59 +00:00
parent 0884126e56
commit 8fde77593c
20 changed files with 119 additions and 57 deletions

View File

@ -52,9 +52,6 @@ cvar_t in_xflip = {"in_xflip", "0"};
cvar_t prox_inmenu = CVAR("prox_inmenu", "0");
static int preselectedweapons[MAX_SPLITS];
static int preselectedweapon[MAX_SPLITS][32];
usercmd_t cl_pendingcmd[MAX_SPLITS];
/*kinda a hack...*/
@ -270,6 +267,9 @@ static cvar_t cl_weaponhide_preference = CVARAD("cl_weaponhide_preference", "2 1
static cvar_t cl_weaponpreselect = CVARD("cl_weaponpreselect", "0", "HACK: Controls the interaction between the ^aweapon^a and ^a+attack^a commands (does not affect ^aimpulse^a).\n0: weapon switch happens instantly\n1: weapon switch happens on next attack\n2: instant only when already firing, otherwise delayed\n3: delay until new attack only in deathmatch 1\n4: delay until any attack only in deathmatch 1");
static cvar_t cl_weaponforgetorder = CVARD("cl_weaponforgetorder", "0", "The 'weapon' command will lock in its weapon choice, instead of choosing a different weapon between select+fire.");
cvar_t r_viewpreselgun = CVARD("r_viewpreselgun", "0", "HACK: Display the preselected weaponmodel, instead of the current weaponmodel.");
static int preselectedweapons[MAX_SPLITS];
static int preselectedweapon[MAX_SPLITS][32];
//hacks, because we have to guess what the mod is doing. we'll probably get it wrong, which sucks.
static qboolean IN_HaveWeapon(int pnum, int imp)
{

View File

@ -2258,6 +2258,8 @@ void CL_CheckServerInfo(void)
movevars.watersinkspeed = *s?Q_atof(s):60;
s = InfoBuf_ValueForKey(&cl.serverinfo, "pm_flyfriction");
movevars.flyfriction = *s?Q_atof(s):4;
s = InfoBuf_ValueForKey(&cl.serverinfo, "pm_edgefriction");
movevars.edgefriction = *s?Q_atof(s):2;
}
movevars.coordsize = cls.netchan.netprim.coordsize;

View File

@ -2263,7 +2263,7 @@ const char *Key_KeynumToString (int keynum, int modifier)
Key_SetBinding
===================
*/
void Key_SetBinding (int keynum, int modifier, char *binding, int level)
void Key_SetBinding (int keynum, int modifier, const char *binding, int level)
{
char *newc;
int l;

View File

@ -303,7 +303,7 @@ void Key_Event (unsigned int devid, int key, unsigned int unicode, qboolean down
void Key_Init (void);
void IN_WriteButtons(vfsfile_t *f, qboolean all);
void Key_WriteBindings (struct vfsfile_s *f);
void Key_SetBinding (int keynum, int modifier, char *binding, int cmdlevel);
void Key_SetBinding (int keynum, int modifier, const char *binding, int cmdlevel);
void Key_ClearStates (void);
qboolean Key_Centerprint(int key, int unicode, unsigned int devid);
void Key_Unbindall_f (void); //aka: Key_Shutdown

View File

@ -6785,7 +6785,7 @@ static struct {
{"getsurfacenumtriangles", PF_getsurfacenumtriangles,628},
{"getsurfacetriangle", PF_getsurfacetriangle, 629},
// {"setkeybind", PF_Fixme, 630},
{"setkeybind", PF_cl_setkeybind, 630},
{"getbindmaps", PF_cl_GetBindMap, 631},
{"setbindmaps", PF_cl_SetBindMap, 632},
@ -7404,6 +7404,7 @@ qboolean CSQC_Init (qboolean anycsqc, const char *csprogsname, unsigned int chec
movevars.slidyslopes = false;//(pm_slidyslopes.value!=0);
movevars.watersinkspeed = 60;//*pm_watersinkspeed.string?pm_watersinkspeed.value:60;
movevars.flyfriction = 4;//*pm_flyfriction.string?pm_flyfriction.value:4;
movevars.edgefriction = 2;//*pm_edgefriction.string?pm_edgefriction.value:2;
movevars.stepheight = PM_DEFAULTSTEPHEIGHT;
movevars.coordsize = 4;
}

View File

@ -113,7 +113,7 @@ cvar_t snd_leftisright = CVARAF( "s_swapstereo", "0",
cvar_t snd_eax = CVARAF( "s_eax", "0",
"snd_eax", 0);
cvar_t snd_speakers = CVARAFD( "s_numspeakers", "2",
"snd_numspeakers", CVAR_ARCHIVE, "Number of hardware audio channels to use. "DISTRIBUTION" supports up to 6.");
"snd_numspeakers", CVAR_ARCHIVE, "Number of hardware audio channels to use. "FULLENGINENAME" supports up to 6.");
cvar_t snd_buffersize = CVARAF( "s_buffersize", "0",
"snd_buffersize", 0);
cvar_t snd_samplebits = CVARAF( "s_bits", "16",

View File

@ -230,6 +230,7 @@ void Sys_Printf (char *fmt, ...)
}
ApplyColour(CON_WHITEMASK);
fflush(stdout);
}
#else
void Sys_Printf (char *fmt, ...)

View File

@ -5,7 +5,7 @@
// Later code will disable any features if they're not supported on the current platform, so don't worry about win/lin/mac/android/web/etc here - any such issues should be fixed elsewhere.
//general rebranding
//#define DISTRIBUTION "FTE" //should be kept short. 3 or 4 letters is good, with no spaces.
//#define DISTRIBUTION "FTE" //should be kept short. 8 or less letters is good, with no spaces.
//#define DISTRIBUTIONLONG "Forethought Entertainment" //think of this as your company name. It isn't shown too often, so can be quite long.
//#define FULLENGINENAME "FTE Quake" //nominally user-visible name.
//#define ENGINEWEBSITE "http://fte.triptohell.info" //for shameless self-promotion purposes.

View File

@ -24,7 +24,6 @@ movevars_t movevars;
playermove_t pmove;
#define movevars_dpflags MOVEFLAG_QWCOMPAT
#define movevars_edgefriction 2
#define movevars_maxairspeed 30
#define movevars_jumpspeed 270
@ -521,7 +520,7 @@ void PM_Friction (void)
else if (pmove.onground) {
// apply ground friction
friction = movevars.friction;
if (movevars_edgefriction != 1.0)
if (movevars.edgefriction != 1.0)
{
// if the leading edge is over a dropoff, increase friction
start[0] = stop[0] = pmove.origin[0] + pmove.velocity[0]/speed*16;
@ -544,7 +543,7 @@ void PM_Friction (void)
VectorCopy(max, pmove.player_maxs);
}
if (trace.fraction == 1 && !trace.startsolid)
friction *= movevars_edgefriction;
friction *= movevars.edgefriction;
}
control = speed < movevars.stopspeed ? movevars.stopspeed : speed;
drop = control*friction*frametime;

View File

@ -113,6 +113,7 @@ typedef struct {
float bunnyspeedcap;
float watersinkspeed;
float ktjump;
float edgefriction; //default 2
int walljump;
qboolean slidefix;
qboolean airstep;

View File

@ -438,6 +438,7 @@ void QCBUILTIN PF_cl_findkeysforcommand (pubprogfuncs_t *prinst, struct globalva
void QCBUILTIN PF_cl_findkeysforcommandex (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_stringtokeynum(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_getkeybind (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_setkeybind (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_setmousetarget (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_getmousetarget (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_cl_setcursormode (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);

View File

@ -1933,12 +1933,11 @@ static qbyte *Q1BSP_DecompressVis (qbyte *in, model_t *model, qbyte *decompresse
c = in[1];
in += 2;
if ((out - decompressed) + c > row) {
if ((out - decompressed) + c > row)
{
c = row - (out - decompressed);
Con_DPrintf ("warning: Vis decompression overrun\n");
}
while (c)
{
*out++ = 0;

View File

@ -6,7 +6,7 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
#ifdef GLQUAKE
{QR_OPENGL, 110, "fixedemu",
"!!ver 100-450\n"
"!!samps sourcetex:0\n"
"!!samps sourcetex=0\n"
//this shader is present for support for gles/gl3core contexts
//it is single-texture-with-vertex-colours, and doesn't do anything special.
@ -6636,7 +6636,7 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
"ts *= (texture2D(s_lightmap, lm0) * e_lmscale).rgb;\n"
"#endif\n"
"gl_FragColor = fog4(vec4(ts, USEALPHA));\n"
"gl_FragColor = fog4(vec4(ts, USEALPHA) * e_colourident);\n"
"}\n"
"#endif\n"
},
@ -7303,7 +7303,7 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
"!!cvard_srgb_b r_floorcolor\n"
"!!cvard_srgb_b r_wallcolor\n"
"!!permu FOG\n"
"!!samps lm:0\n"
"!!samps lm=0\n"
//this is for the '286' preset walls, and just draws lightmaps coloured based upon surface normals.

View File

@ -10761,8 +10761,8 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
"} skelblend_t;\n"
{"skel_create", PF_skel_create, 0, 0, 0, 263, D("float(float modlindex, optional float useabstransforms)", "Allocates a new uninitiaised skeletal object, with enough bone info to animate the given model.\neg: self.skeletonobject = skel_create(self.modelindex);")}, // (FTE_CSQC_SKELETONOBJECTS)
{"skel_build", PF_skel_build, 0, 0, 0, 264, D(qcskelblend"float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac)", "Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object.\nIf retainfrac is set to 0 on the first call and 1 on the others, you can blend multiple animations together according to the addfrac value. The final weight should be 1. Other values will result in scaling and/or other weirdness. You can use firstbone and lastbone to update only part of the skeletal object, to allow legs to animate separately from torso, use 0 for both arguments to specify all, as bones are 1-based.")}, // (FTE_CSQC_SKELETONOBJECTS)
{"skel_build_ptr", PF_skel_build_ptr, 0, 0, 0, 0, D("float(float skel, int numblends, skelblend_t *weights, int structsize)", "Like skel_build, but slightly simpler.")},
{"skel_build", PF_skel_build, 0, 0, 0, 264, D("float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac)", "Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object.\nIf retainfrac is set to 0 on the first call and 1 on the others, you can blend multiple animations together according to the addfrac value. The final weight should be 1. Other values will result in scaling and/or other weirdness. You can use firstbone and lastbone to update only part of the skeletal object, to allow legs to animate separately from torso, use 0 for both arguments to specify all, as bones are 1-based.")}, // (FTE_CSQC_SKELETONOBJECTS)
{"skel_build_ptr", PF_skel_build_ptr, 0, 0, 0, 0, D(qcskelblend"float(float skel, int numblends, skelblend_t *weights, int structsize)", "Like skel_build, but slightly simpler.")},
{"skel_get_numbones",PF_skel_get_numbones,0, 0, 0, 265, D("float(float skel)", "Retrives the number of bones in the model. The valid range is 1<=bone<=numbones.")}, // (FTE_CSQC_SKELETONOBJECTS)
{"skel_get_bonename",PF_skel_get_bonename,0, 0, 0, 266, D("string(float skel, float bonenum)", "Retrieves the name of the specified bone. Mostly only for debugging.")}, // (FTE_CSQC_SKELETONOBJECTS) (returns tempstring)
{"skel_get_boneparent",PF_skel_get_boneparent,0,0, 0, 267, D("float(float skel, float bonenum)", "Retrieves which bone this bone's position is relative to. Bone 0 refers to the entity's position rather than an actual bone")}, // (FTE_CSQC_SKELETONOBJECTS)
@ -10963,7 +10963,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"adddecal", PF_Fixme, 0, 0, 0, 375, D("void(string shadername, vector origin, vector up, vector side, vector rgb, float alpha)", "Adds a temporary clipped decal shader to the scene, centered at the given point with given orientation. Will be drawn by the next renderscene call, and freed by the next clearscene call.")},
{"setcustomskin", PF_Fixme, 0, 0, 0, 376, D("void(entity e, string skinfilename, optional string skindata)", "Sets an entity's skin overrides to a new skin object. Releases the entities old skin (refcounted).")},
{"loadcustomskin", PF_Fixme, 0, 0, 0, 377, D("float(string skinfilename, optional string skindata)", "Creates a new skin object and returns it. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format:\nsurfacename,shadername - makes the named surface use the named shader\nreplace \"surfacename\" \"shadername\" - same.\nqwskin \"foo\" - use an unmodified quakeworld player skin (including crop+repalette rules)\nq1lower 0xff0000 - specify an override for the entity's lower colour, in this case to red\nq1upper 0x0000ff - specify an override for the entity's lower colour, in this case to blue\ncompose \"surfacename\" \"shader\" \"imagename@x,y:w,h$s,t,s2,t2?r,g,b,a\" - compose a skin texture from multiple images.\n The texture is determined to be sufficient to hold the first named image, additional images can be named as extra tokens on the same line.\n Use a + at the end of the line to continue reading image tokens from the next line also, the named shader must use 'map $diffuse' to read the composed texture (compatible with the defaultskin shader). Must be matched with a releasecustomskin call later, and is pointless without applycustomskin.")},
{"loadcustomskin", PF_Fixme, 0, 0, 0, 377, D("float(string skinfilename, optional string skindata)", "Creates a new skin object and returns it. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format:\nsurfacename,shadername - makes the named surface use the named shader (legacy format for compat with q3)\nreplace \"surfacename\" \"shadername\" - non-legacy equivalent.\nqwskin \"foo\" - use an unmodified quakeworld player skin (including crop+repalette rules)\nq1lower 0xff0000 - specify an override for the entity's lower colour, in this case to red\nq1upper 0x0000ff - specify an override for the entity's lower colour, in this case to blue\ncompose \"surfacename\" \"shader\" \"imagename@x,y:w,h$s,t,s2,t2?r,g,b,a\" - compose a skin texture from multiple images.\n The texture is determined to be sufficient to hold the first named image, additional images can be named as extra tokens on the same line.\n Use a + at the end of the line to continue reading image tokens from the next line also, the named shader must use 'map $diffuse' to read the composed texture (compatible with the defaultskin shader). Must be matched with a releasecustomskin call later, and is pointless without applycustomskin.")},
{"applycustomskin", PF_Fixme, 0, 0, 0, 378, D("void(entity e, float skinobj)", "Updates the entity's custom skin (refcounted).")},
{"releasecustomskin",PF_Fixme, 0, 0, 0, 379, D("void(float skinobj)", "Lets the engine know that the skin will no longer be needed. Thanks to refcounting any ents with the skin already applied will retain their skin until later changed. It is valid to destroy a skin just after applying it to an ent in the same function that it was created in, as the skin will only be destroyed once its refcount rops to 0.")},
//END EXT_CSQC
@ -11247,7 +11247,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"sprintf", PF_sprintf, 0, 0, 0, 627, D("string(string fmt, ...)", "'prints' to a formatted temp-string. Mostly acts as in C, however %d assumes floats (fteqcc has arg checking. Use it.).\ntype conversions: l=arg is an int, h=arg is a float, and will work as a prefix for any float or int representation.\nfloat representations: d=decimal, e,E=exponent-notation, f,F=floating-point notation, g,G=terse float, c=char code, x,X=hex\nother representations: i=int, s=string, S=quoted and marked-up string, v=vector, p=pointer\nso %ld will accept an int arg, while %hi will expect a float arg.\nentities, fields, and functions will generally need to be printed as ints with %i.")},
{"getsurfacenumtriangles",PF_getsurfacenumtriangles,0,0,0, 628, "float(entity e, float s)"},
{"getsurfacetriangle",PF_getsurfacetriangle,0, 0, 0, 629, "vector(entity e, float s, float n)"},
// {"setkeybind", PF_Fixme, 0, 0, 0, 630, "float(float key, string bind, optional float bindmap)"},
{"setkeybind", PF_Fixme, 0, 0, 0, 630, "float(float key, string bind, optional float bindmap, optional float modifier)"},
{"getbindmaps", PF_Fixme, 0, 0, 0, 631, "vector()"},
{"setbindmaps", PF_Fixme, 0, 0, 0, 632, "float(vector bm)"},
{"crypto_getkeyfp", PF_Fixme, 0, 0, 0, 633, "string(string addr)" STUB},
@ -11703,13 +11703,15 @@ svextqcfields
}
//targets
#define QW 1
#define NQ 2
#define CS 4
#define MENU 8
#define H2 16
#define QW 1 //exists in qwssqc
#define NQ 2 //exists in nqssqc
#define CS 4 //exists in csqc
#define MENU 8 //exists in menuqc
#define H2 16 //exists in h2ssqc
//mere flags
#define FTE 32
#define FTE 32 //use fte opcodes
#define ID1 64 //symbol conflicts with vanilla defs.qc (so stripped, with exceptions)
#define DPX 128 //symbol conflicts with dpextensions.qc
#ifdef HEXEN2
#define ALL (QW|NQ|H2|CS|MENU)
#else
@ -11824,7 +11826,7 @@ void PR_DumpPlatform_f(void)
{"PlayerPreThink", "void()", QW|NQ, D("With Prediction(QW compat/FTE default): Called before the player's input commands are processed.\nNo Prediction(NQ compat): Called AFTER the player's movement intents have already been processed (ie: velocity will have already changed according to input_*, but before the actual position change.")},
{"PlayerPostThink", "void()", QW|NQ, D("Called after the player's input commands are processed.")},
{"ClientKill", "void()", QW|NQ, D("Called in response to 'cmd kill' (or just 'kill').")},
{"ClientConnect", "void(optional float csqcactive)", QW|NQ, D("Called after the connecting client has finished loading and is ready to receive active entities. Note that this is NOT the first place that a client might be referred to.")},
{"ClientConnect", "void(optional float csqcactive)", QW|NQ|ID1, D("Called after the connecting client has finished loading and is ready to receive active entities. Note that this is NOT the first place that a client might be referred to.")},
{"PutClientInServer", "void()", QW|NQ, D("Enginewise, this is only ever called immediately after ClientConnect and is thus a little redundant. Modwise, this is also called for respawning a player etc.")},
{"ClientDisconnect", "void()", QW|NQ, D("Called once a client disconnects or times out. Not guarenteed to be called on map changes.")},
{"SetNewParms", "void()", QW|NQ, D("Called without context when a new client initially connects (before ClientConnect is even called). This function is expected to only set the parm* globals so that they can be decoded properly later. You should not rely on 'self' being set.")},
@ -12176,13 +12178,13 @@ void PR_DumpPlatform_f(void)
{"CONTENTBITS_BOXSOLID", "const int", QW|NQ|CS, D("Bits that tracebox would normally consider solid"), 0,"CONTENTBIT_SOLID|"STRINGIFY(Q2CONTENTS_WINDOW)"i|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP"},
{"CONTENTBITS_FLUID", "const int", QW|NQ|CS, NULL, 0,"CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY"},
{"SPA_POSITION", "const int", QW|NQ|CS, D("These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin"), 0},
{"SPA_S_AXIS", "const int", QW|NQ|CS, NULL, 1},
{"SPA_T_AXIS", "const int", QW|NQ|CS, NULL, 2},
{"SPA_R_AXIS", "const int", QW|NQ|CS, D("aka: SPA_NORMAL"), 3},
{"SPA_TEXCOORDS0", "const int", QW|NQ|CS, NULL, 4},
{"SPA_LIGHTMAP0_TEXCOORDS", "const int", QW|NQ|CS, NULL, 5},
{"SPA_LIGHTMAP0_COLOR", "const int", QW|NQ|CS, NULL, 6},
{"SPA_POSITION", "const float", QW|NQ|CS, D("These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin"), 0},
{"SPA_S_AXIS", "const float", QW|NQ|CS, NULL, 1},
{"SPA_T_AXIS", "const float", QW|NQ|CS, NULL, 2},
{"SPA_R_AXIS", "const float", QW|NQ|CS, D("aka: SPA_NORMAL"), 3},
{"SPA_TEXCOORDS0", "const float", QW|NQ|CS, NULL, 4},
{"SPA_LIGHTMAP0_TEXCOORDS", "const float", QW|NQ|CS, NULL, 5},
{"SPA_LIGHTMAP0_COLOR", "const float", QW|NQ|CS, NULL, 6},
{"CHAN_AUTO", "const float", QW|NQ|CS, D("The automatic channel, play as many sounds on this channel as you want, and they'll all play, however the other channels will replace each other."), CHAN_AUTO},
{"CHAN_WEAPON", "const float", QW|NQ|CS, NULL, CHAN_WEAPON},
@ -12592,6 +12594,8 @@ void PR_DumpPlatform_f(void)
"-Tqw - dump specifically QW fields\n" \
"-Tcs - dump specifically CSQC fields\n" \
"-Tmenu - dump specifically menuqc fields\n" \
"-Tid1 - omits any symbols that conflict with vanilla defs.qc\n" \
"-Tdp - omits any symbols that conflict with dpextensions.qc\n" \
"-Fdefines - generate #defines instead of constants\n" \
"-Faccessors - use accessors instead of basic types via defines\n" \
"-O - write to a different qc file\n"
@ -12611,6 +12615,10 @@ void PR_DumpPlatform_f(void)
targ |= MENU;
else if (!stricmp(arg, "-Th2"))
targ |= H2;
else if (!stricmp(arg, "-Tid1"))
targ |= ID1;
else if (!stricmp(arg, "-Tdp"))
targ |= DPX;
else if (!stricmp(arg, "-Fdefines"))
defines = true;
else if (!stricmp(arg, "-Fnodefines"))
@ -12666,9 +12674,9 @@ void PR_DumpPlatform_f(void)
VFS_PRINTF(f, "#pragma noref 1\n");
VFS_PRINTF(f, "//#pragma flag enable logicops\n");
VFS_PRINTF(f, "#pragma warning error Q101 /*too many parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/\n");
VFS_PRINTF(f, "#pragma warning error Q105 /*too few parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/\n");
VFS_PRINTF(f, "#pragma warning error Q106 /*assignment to constant/lvalue. Define them as var if you want to initialise something.*/\n");
VFS_PRINTF(f, "#pragma warning %s Q101 /*too many parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/\n", (targ & ID1)?"enable":"error");
VFS_PRINTF(f, "#pragma warning %s Q105 /*too few parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/\n", (targ & ID1)?"enable":"error");
VFS_PRINTF(f, "#pragma warning %s Q106 /*assignment to constant/lvalue. Define them as var if you want to initialise something.*/\n", (targ & ID1)?"enable":"error");
VFS_PRINTF(f, "#pragma warning error Q208 /*system crc unknown. Compatibility goes out of the window if you disable this.*/\n");
#ifdef NOLEGACY
VFS_PRINTF(f, "#pragma warning error F211 /*system crc outdated (eg: dp's csqc). Such mods will not run properly in FTE.*/\n");
@ -12677,6 +12685,7 @@ void PR_DumpPlatform_f(void)
#endif
VFS_PRINTF(f, "#pragma warning enable F301 /*non-utf-8 strings. Think of the foreigners! Also think of text editors that insist on screwing up your char encodings.*/\n");
VFS_PRINTF(f, "#pragma warning enable F302 /*uninitialised locals. They usually default to 0 in qc (except in recursive functions), but its still probably a bug*/\n");
// VFS_PRINTF(f, "#pragma warning %s F308 /*Optional arguments differ on redeclaration.*/\n", (targ & ID1)?"disable":"enable");
if ((targ&ALL) == H2)
{
@ -12783,9 +12792,17 @@ void PR_DumpPlatform_f(void)
d = ALL & ~targ;
for (i = 0; knowndefs[i].name; i++)
{
const char *type = knowndefs[i].type;
nd = (knowndefs[i].module & targ) | (~targ & ALL);
if (!(nd & targ))
continue;
if ((knowndefs[i].module & targ) & ID1)
{
if (!strcmp(knowndefs[i].name, "ClientConnect"))
type = "void()";
else
continue;
}
if ((nd&targ) != (d&targ))
{
if (d != (ALL & ~targ))
@ -12848,47 +12865,47 @@ void PR_DumpPlatform_f(void)
}
if (knowndefs[i].desc)
{
if (!strncmp(knowndefs[i].type, "//", 2))
if (!strncmp(type, "//", 2))
comment = va("\n/* %s */", knowndefs[i].desc);
else
comment = va("\t/* %s */", knowndefs[i].desc);
}
else
comment = "";
if (!strcmp(knowndefs[i].type, "const float"))
if (!strcmp(type, "const float"))
{
if (knowndefs[i].value >= (1<<23))
{
if (defines)
VFS_PRINTF(f, "#define %s %i%s\n", knowndefs[i].name, (int)knowndefs[i].value, comment);
else
VFS_PRINTF(f, "%s %s = %i;%s\n", knowndefs[i].type, knowndefs[i].name, (int)knowndefs[i].value, comment);
VFS_PRINTF(f, "%s %s = %i;%s\n", type, knowndefs[i].name, (int)knowndefs[i].value, comment);
}
else
{
if (defines)
VFS_PRINTF(f, "#define %s %g%s\n", knowndefs[i].name, knowndefs[i].value, comment);
else
VFS_PRINTF(f, "%s %s = %g;%s\n", knowndefs[i].type, knowndefs[i].name, knowndefs[i].value, comment);
VFS_PRINTF(f, "%s %s = %g;%s\n", type, knowndefs[i].name, knowndefs[i].value, comment);
}
}
else if (!strcmp(knowndefs[i].type, "const string"))
else if (!strcmp(type, "const string"))
{
if (defines)
VFS_PRINTF(f, "#define %s %s%s\n", knowndefs[i].name, knowndefs[i].valuestr, comment);
else
VFS_PRINTF(f, "%s %s = %s;%s\n", knowndefs[i].type, knowndefs[i].name, knowndefs[i].valuestr, comment);
VFS_PRINTF(f, "%s %s = %s;%s\n", type, knowndefs[i].name, knowndefs[i].valuestr, comment);
}
else if (knowndefs[i].valuestr)
{
VFS_PRINTF(f, "%s %s = %s;%s\n", knowndefs[i].type, knowndefs[i].name, knowndefs[i].valuestr, comment);
VFS_PRINTF(f, "%s %s = %s;%s\n", type, knowndefs[i].name, knowndefs[i].valuestr, comment);
}
else if (knowndefs[i].value)
{
VFS_PRINTF(f, "%s %s = %g;%s\n", knowndefs[i].type, knowndefs[i].name, knowndefs[i].value, comment);
VFS_PRINTF(f, "%s %s = %g;%s\n", type, knowndefs[i].name, knowndefs[i].value, comment);
}
else
VFS_PRINTF(f, "%s %s;%s\n", knowndefs[i].type, knowndefs[i].name, comment);
VFS_PRINTF(f, "%s %s;%s\n", type, knowndefs[i].name, comment);
}
for (i = 0; BuiltinList[i].name; i++)
{
@ -12928,6 +12945,36 @@ void PR_DumpPlatform_f(void)
if (MP_BuiltinValid(BuiltinList[i].name, idx))
nd |= MENU;
#endif
if (targ & ID1)
{
//both engines have these defs, but fte's version has extra args, or added non-void return types
//so to avoid compile errors/warnings, we omit our versions.
const char *buggyvanillabuiltins[] = {
"sound","vectoyaw","findradius","bprint","sprint",
"walkmove","droptofloor","lightstyle","vectoangles","changelevel","centerprint"
};
for (j = 0; j < countof(buggyvanillabuiltins) && nd; j++)
{
if (!strcmp(buggyvanillabuiltins[j], BuiltinList[i].name))
nd = 0;
}
}
if (targ & DPX)
{
//both engines have these defs, but fte's version has extra args, or added non-void return types
//so to avoid compile errors/warnings, we omit our versions.
const char *buggydpbuiltins[] = {
"copyentity","callfunction","parseentitydata","findfloat","trailparticles",
"findchain","findchainflags","findchainfloat","log","whichpack","uri_get","te_gunshot","fopen","fputs","skel_create","skel_build","skel_set_bone",
"infoadd","strcmp","strncmp","strncasecmp","strcat"
};
for (j = 0; j < countof(buggydpbuiltins) && nd; j++)
{
if (!strcmp(buggydpbuiltins[j], BuiltinList[i].name))
nd = 0;
}
}
if (!nd) /*no idea what its for*/
continue;

View File

@ -2015,8 +2015,16 @@ static void SV_Status_f (void)
if (svs.gametype == GT_PROGS)
{
int count = 0;
Con_Printf("entities : %i/%i (mem: %.1f%%)\n", sv.world.num_edicts, sv.world.max_edicts, 100*(float)(sv.world.progs->stringtablesize/(double)sv.world.progs->stringtablemaxsize));
int count = 0, i;
edict_t *e;
for (i = 0; i < sv.world.num_edicts; i++)
{
e = EDICT_NUM_PB(svprogfuncs, i);
if (e && e->ereftype == ER_FREE && sv.time - e->freetime > 0.5)
continue; //free, and older than the zombie time
count++;
}
Con_Printf("entities : %i/%i/%i (mem: %.1f%%)\n", count, sv.world.num_edicts, sv.world.max_edicts, 100*(float)(sv.world.progs->stringtablesize/(double)sv.world.progs->stringtablemaxsize));
for (count = 1; count < MAX_PRECACHE_MODELS; count++)
if (!sv.strings.model_precache[count])
break;

View File

@ -5116,6 +5116,7 @@ void SV_InitLocal (void)
extern cvar_t pm_slidyslopes;
extern cvar_t pm_watersinkspeed;
extern cvar_t pm_flyfriction;
extern cvar_t pm_edgefriction;
SV_InitOperatorCommands ();
SV_UserInit ();
@ -5173,6 +5174,7 @@ void SV_InitLocal (void)
Cvar_Register (&pm_airstep, cvargroup_serverphysics);
Cvar_Register (&pm_stepdown, cvargroup_serverphysics);
Cvar_Register (&pm_walljump, cvargroup_serverphysics);
Cvar_Register (&pm_edgefriction, cvargroup_serverphysics);
Cvar_Register (&sv_compatiblehulls, cvargroup_serverphysics);
Cvar_Register (&dpcompat_stats, "Darkplaces compatibility");

View File

@ -74,6 +74,7 @@ cvar_t pm_slidyslopes = CVARF("pm_slidyslopes", "", CVAR_SERVERINFO);
cvar_t pm_airstep = CVARAF("pm_airstep", "", "sv_jumpstep", CVAR_SERVERINFO);
cvar_t pm_stepdown = CVARF("pm_stepdown", "", CVAR_SERVERINFO);
cvar_t pm_walljump = CVARF("pm_walljump", "", CVAR_SERVERINFO);
cvar_t pm_edgefriction = CVARAFD("pm_edgefriction", "", "edgefriction", CVAR_SERVERINFO, "Default value of 2"); //alternative name (without prefix) for compat with dp
#define cvargroup_serverphysics "server physics variables"
void WPhys_Init(void)
@ -2683,5 +2684,6 @@ void SV_SetMoveVars(void)
movevars.stepheight = *sv_stepheight.string?sv_stepheight.value:PM_DEFAULTSTEPHEIGHT;
movevars.watersinkspeed = *pm_watersinkspeed.string?pm_watersinkspeed.value:60;
movevars.flyfriction = *pm_flyfriction.string?pm_flyfriction.value:4;
movevars.edgefriction = *pm_edgefriction.string?pm_edgefriction.value:2;
}
#endif

View File

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CHAN_ITEM 3
#define CHAN_BODY 4
extern cvar_t sv_gravity, sv_friction, sv_waterfriction, sv_gamespeed, sv_stopspeed, sv_spectatormaxspeed, sv_accelerate, sv_airaccelerate, sv_wateraccelerate, sv_edgefriction;
extern cvar_t sv_gravity, sv_friction, sv_waterfriction, sv_gamespeed, sv_stopspeed, sv_spectatormaxspeed, sv_accelerate, sv_airaccelerate, sv_wateraccelerate, pm_edgefriction;
extern cvar_t dpcompat_stats;
/*
@ -2406,7 +2406,7 @@ void SV_CalcClientStats(client_t *client, int statsi[MAX_CL_STATS], float statsf
statsfi[STAT_MOVEVARS_WATERACCELERATE] = sv_wateraccelerate.value;
statsfi[STAT_MOVEVARS_ENTGRAVITY] = client->entgravity/sv_gravity.value;
statsfi[STAT_MOVEVARS_JUMPVELOCITY] = 270;//sv_jumpvelocity.value; //bah
statsfi[STAT_MOVEVARS_EDGEFRICTION] = sv_edgefriction.value;
statsfi[STAT_MOVEVARS_EDGEFRICTION] = pm_edgefriction.value;
statsfi[STAT_MOVEVARS_MAXAIRSPEED] = 30; //max speed before airaccel cuts out. this is hardcoded in qw pmove
statsfi[STAT_MOVEVARS_STEPHEIGHT] = *sv_stepheight.string?sv_stepheight.value:PM_DEFAULTSTEPHEIGHT;
statsfi[STAT_MOVEVARS_AIRACCEL_QW] = 1; //we're a quakeworld engine...

View File

@ -77,8 +77,6 @@ cvar_t cmd_gamecodelevel = CVAR("cmd_gamecodelevel", STRINGIFY(RESTRICT_LOCAL));
cvar_t sv_pure = CVARFD("sv_pure", "", CVAR_SERVERINFO, "The most evil cvar in the world, many clients will ignore this.\n0=standard quake rules.\n1=clients should prefer files within packages present on the server.\n2=clients should use *only* files within packages present on the server.\nDue to quake 1.01/1.06 differences, a setting of 2 only works in total conversions.");
cvar_t sv_nqplayerphysics = CVARAFCD("sv_nqplayerphysics", "0", "sv_nomsec", 0, SV_NQPhysicsUpdate, "Disable player prediction and run NQ-style player physics instead. This can be used for compatibility with mods that expect exact behaviour.");
cvar_t sv_edgefriction = CVARAF("sv_edgefriction", "2",
"edgefriction", 0);
#ifndef NOLEGACY
cvar_t sv_brokenmovetypes = CVARD("sv_brokenmovetypes", "0", "Emulate vanilla quakeworld by forcing MOVETYPE_WALK on all players. Shouldn't be used for any games other than QuakeWorld.");
@ -112,6 +110,7 @@ extern cvar_t pm_stepdown;
extern cvar_t pm_walljump;
extern cvar_t pm_watersinkspeed;
extern cvar_t pm_flyfriction;
extern cvar_t pm_edgefriction;
cvar_t sv_pushplayers = CVAR("sv_pushplayers", "0");
//yes, realip cvars need to be fully initialised or realip will be disabled
@ -6979,6 +6978,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
movevars.slidyslopes = (pm_slidyslopes.value!=0);
movevars.watersinkspeed = *pm_watersinkspeed.string?pm_watersinkspeed.value:60;
movevars.flyfriction = *pm_flyfriction.string?pm_flyfriction.value:4;
movevars.edgefriction = *pm_edgefriction.string?pm_edgefriction.value:2;
movevars.coordsize = host_client->netchan.netprim.coordsize;
for (i=0 ; i<3 ; i++)
@ -7216,6 +7216,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
movevars.slidyslopes = (pm_slidyslopes.value!=0);
movevars.watersinkspeed = *pm_watersinkspeed.string?pm_watersinkspeed.value:60;
movevars.flyfriction = *pm_flyfriction.string?pm_flyfriction.value:4;
movevars.edgefriction = *pm_edgefriction.string?pm_edgefriction.value:2;
movevars.coordsize = host_client->netchan.netprim.coordsize;
// should already be folded into host_client->maxspeed
@ -8554,8 +8555,6 @@ void SV_UserInit (void)
#ifndef NOLEGACY
Cvar_Register (&sv_brokenmovetypes, "Backwards compatability");
#endif
Cvar_Register (&sv_edgefriction, "netquake compatability");
}
@ -8655,7 +8654,7 @@ static void SV_UserFriction (void)
trace = World_Move (&sv.world, start, vec3_origin, vec3_origin, stop, true, (wedict_t*)sv_player);
if (trace.fraction == 1.0)
friction = sv_friction.value*sv_edgefriction.value;
friction = sv_friction.value*pm_edgefriction.value;
else
friction = sv_friction.value;

View File

@ -43,6 +43,6 @@ void main ()
ts *= (texture2D(s_lightmap, lm0) * e_lmscale).rgb;
#endif
gl_FragColor = fog4(vec4(ts, USEALPHA));
gl_FragColor = fog4(vec4(ts, USEALPHA) * e_colourident);
}
#endif