-// This code written in 2010 by Forest Hale (darkplacesengine gmail com), and placed into public domain.
+// This code written in 2010 by Ashley Rose Hale (LadyHavoc) (darkplacesengine gmail com), and placed into public domain.
#include <stdlib.h>
#include <string.h>
-// This code written in 2010 by Forest Hale (darkplacesengine gmail com), and placed into public domain.
+// This code written in 2010 by Ashley Rose Hale (LadyHavoc) (darkplacesengine gmail com), and placed into public domain.
// Based on information in http://zach.in.tu-clausthal.de/papers/vrst02.html (in particular vrst02_boxtree.pdf)
/*
typedef struct dface_s
{
- // LordHavoc: changed from short to unsigned short for q2 support
+ // LadyHavoc: changed from short to unsigned short for q2 support
unsigned short planenum;
short side;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
Called when a demo file runs out, or the user starts a game
==============
*/
-// LordHavoc: now called only by CL_Disconnect
+// LadyHavoc: now called only by CL_Disconnect
void CL_StopPlayback (void)
{
#ifdef CONFIG_VIDEO_CAPTURE
int i;
float f;
- if (cls.demopaused) // LordHavoc: pausedemo
+ if (cls.demopaused) // LadyHavoc: pausedemo
return;
len = LittleLong (message->cursize);
if (!cls.demoplayback)
return;
- // LordHavoc: pausedemo
+ // LadyHavoc: pausedemo
if (cls.demopaused)
return;
}
// write a disconnect message to the demo file
- // LordHavoc: don't replace the cl_message when doing this
+ // LadyHavoc: don't replace the cl_message when doing this
buf.data = bufdata;
buf.maxsize = sizeof(bufdata);
SZ_Clear(&buf);
fpsmin = cls.td_onesecondminfps;
fpsavg = cls.td_onesecondavgcount ? cls.td_onesecondavgfps / cls.td_onesecondavgcount : 0;
fpsmax = cls.td_onesecondmaxfps;
- // LordHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max
+ // LadyHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max
Con_Printf("%i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, benchmark_runs + 1, frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
if (COM_CheckParm("-benchmark"))
kbutton_t in_lookup, in_lookdown, in_moveleft, in_moveright;
kbutton_t in_strafe, in_speed, in_jump, in_attack, in_use;
kbutton_t in_up, in_down;
-// LordHavoc: added 6 new buttons
+// LadyHavoc: added 6 new buttons
kbutton_t in_button3, in_button4, in_button5, in_button6, in_button7, in_button8;
//even more
kbutton_t in_button9, in_button10, in_button11, in_button12, in_button13, in_button14, in_button15, in_button16;
static void IN_UseDown(void) {KeyDown(&in_use);}
static void IN_UseUp(void) {KeyUp(&in_use);}
-// LordHavoc: added 6 new buttons
+// LadyHavoc: added 6 new buttons
static void IN_Button3Down(void) {KeyDown(&in_button3);}
static void IN_Button3Up(void) {KeyUp(&in_button3);}
static void IN_Button4Down(void) {KeyDown(&in_button4);}
break;
// this is only really needed for nogravityonground combined with gravityunaffectedbyticrate
- // <LordHavoc> I'm pretty sure I commented it out solely because it seemed redundant
+ // <LadyHavoc> I'm pretty sure I commented it out solely because it seemed redundant
// this got commented out in a change that supposedly makes the code match QW better
// so if this is broken, maybe put it in an if(cls.protocol != PROTOCOL_QUAKEWORLD) block
if (trace.plane.normal[2] > 0.7)
cl.cmd.sequence = cls.netcon->outgoing_unreliable_sequence;
// set button bits
- // LordHavoc: added 6 new buttons and use and chat buttons, and prydon cursor active button
+ // LadyHavoc: added 6 new buttons and use and chat buttons, and prydon cursor active button
bits = 0;
if (in_attack.state & 3) bits |= 1;
if (in_jump.state & 3) bits |= 2;
Cmd_AddCommand ("+mlook", IN_MLookDown, "activate mouse looking mode, do not recenter view");
Cmd_AddCommand ("-mlook", IN_MLookUp, "deactivate mouse looking mode");
- // LordHavoc: added use button
+ // LadyHavoc: added use button
Cmd_AddCommand ("+use", IN_UseDown, "use something (may be used by some mods)");
Cmd_AddCommand ("-use", IN_UseUp, "stop using something");
- // LordHavoc: added 6 new buttons
+ // LadyHavoc: added 6 new buttons
Cmd_AddCommand ("+button3", IN_Button3Down, "activate button3 (behavior depends on mod)");
Cmd_AddCommand ("-button3", IN_Button3Up, "deactivate button3");
Cmd_AddCommand ("+button4", IN_Button4Down, "activate button4 (behavior depends on mod)");
Cmd_AddCommand ("+button16", IN_Button16Down, "activate button16 (behavior depends on mod)");
Cmd_AddCommand ("-button16", IN_Button16Up, "deactivate button16");
- // LordHavoc: added bestweapon command
+ // LadyHavoc: added bestweapon command
Cmd_AddCommand ("bestweapon", IN_BestWeapon, "send an impulse number to server to select the first usable weapon out of several (example: 8 7 6 5 4 3 2 1)");
#if 0
Cmd_AddCommand ("cycleweapon", IN_CycleWeapon, "send an impulse number to server to select the next usable weapon out of several (example: 9 4 8) if you are holding one of these, and choose the first one if you are holding none of these");
cl.decals = (decal_t *) Mem_Alloc(cls.levelmempool, cl.max_decals * sizeof(decal_t));
cl.showlmps = NULL;
- // LordHavoc: have to set up the baseline info for alpha and other stuff
+ // LadyHavoc: have to set up the baseline info for alpha and other stuff
for (i = 0;i < cl.max_entities;i++)
{
cl.entities[i].state_baseline = defaultstate;
if (cl_nettimesyncboundmode.integer == 1)
cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
- // LordHavoc: lerp in listen games as the server is being capped below the client (usually)
+ // LadyHavoc: lerp in listen games as the server is being capped below the client (usually)
if (cl.mtime[0] <= cl.mtime[1])
{
cl.time = cl.mtime[0];
// handle particle trails and such effects now that we know where this
// entity is in the world...
trailtype = EFFECT_NONE;
- // LordHavoc: if the entity has no effects, don't check each
+ // LadyHavoc: if the entity has no effects, don't check each
if (e->render.effects & (EF_BRIGHTFIELD | EF_FLAME | EF_STARDUST))
{
if (e->render.effects & EF_BRIGHTFIELD)
// muzzleflash fades over time
if (e->persistent.muzzleflash > 0)
e->persistent.muzzleflash -= bound(0, cl.time - cl.oldtime, 0.1) * 20;
- // LordHavoc: if the entity has no effects, don't check each
+ // LadyHavoc: if the entity has no effects, don't check each
if (e->render.effects && !(e->render.flags & RENDER_VIEWMODEL))
{
if (e->render.effects & EF_GIB)
trailtype = EFFECT_TR_ROCKET;
else if (e->render.effects & EF_GRENADE)
{
- // LordHavoc: e->render.alpha == -1 is for Nehahra dem compatibility (cigar smoke)
+ // LadyHavoc: e->render.alpha == -1 is for Nehahra dem compatibility (cigar smoke)
trailtype = e->render.alpha == -1 ? EFFECT_TR_NEHAHRASMOKE : EFFECT_TR_GRENADE;
}
else if (e->render.effects & EF_TRACER3)
dlightcolor[0] = 0;
dlightcolor[1] = 0;
dlightcolor[2] = 0;
- // LordHavoc: if the entity has no effects, don't check each
+ // LadyHavoc: if the entity has no effects, don't check each
if (e->render.effects & (EF_BRIGHTFIELD | EF_DIMLIGHT | EF_BRIGHTLIGHT | EF_RED | EF_BLUE | EF_FLAME | EF_STARDUST))
{
if (e->render.effects & EF_BRIGHTFIELD)
dlightcolor[1] += 3.00f;
dlightcolor[2] += 3.00f;
}
- // LordHavoc: more effects
+ // LadyHavoc: more effects
if (e->render.effects & EF_RED) // red
{
dlightradius = max(dlightradius, 200);
R_RTLight_Update(&r_refdef.scene.templights[r_refdef.scene.numlights], false, &tempmatrix, color, -1, NULL, true, 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
r_refdef.scene.lights[r_refdef.scene.numlights] = &r_refdef.scene.templights[r_refdef.scene.numlights];r_refdef.scene.numlights++;
}
- // LordHavoc: if the model has no flags, don't check each
+ // LadyHavoc: if the model has no flags, don't check each
if (e->render.model && e->render.effects && !(e->render.flags & RENDER_VIEWMODEL))
{
if (e->render.effects & EF_GIB)
trailtype = EFFECT_TR_ROCKET;
else if (e->render.effects & EF_GRENADE)
{
- // LordHavoc: e->render.alpha == -1 is for Nehahra dem compatibility (cigar smoke)
+ // LadyHavoc: e->render.alpha == -1 is for Nehahra dem compatibility (cigar smoke)
trailtype = e->render.alpha == -1 ? EFFECT_TR_NEHAHRASMOKE : EFFECT_TR_GRENADE;
}
else if (e->render.effects & EF_TRACER3)
trailtype = EFFECT_TR_VORESPIKE;
}
- // LordHavoc: customizable glow
+ // LadyHavoc: customizable glow
if (e->state_current.glowsize)
{
// * 4 for the expansion from 0-255 to 0-1023 range,
{
if (cl_beams_quakepositionhack.integer && !chase_active.integer)
{
- // LordHavoc: this is a stupid hack from Quake that makes your
+ // LadyHavoc: this is a stupid hack from Quake that makes your
// lightning appear to come from your waist and cover less of your
// view
// in Quake this hack was applied to all players (causing the
{
vec3_t dir, localend;
vec_t len;
- // LordHavoc: this updates the beam direction to match your
+ // LadyHavoc: this updates the beam direction to match your
// viewangles
VectorSubtract(end, start, dir);
len = VectorLength(dir);
r_refdef.scene.time = cl.time;
}
-// LordHavoc: pausedemo command
+// LadyHavoc: pausedemo command
static void CL_PauseDemo_f (void)
{
cls.demopaused = !cls.demopaused;
CL_Locs_Clear_f();
- // try maps/something.loc first (LordHavoc: where I think they should be)
+ // try maps/something.loc first (LadyHavoc: where I think they should be)
dpsnprintf(locfilename, sizeof(locfilename), "%s.loc", cl.worldnamenoextension);
filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
if (!filedata)
{
- // try proquake name as well (LordHavoc: I hate path mangling)
+ // try proquake name as well (LadyHavoc: I hate path mangling)
dpsnprintf(locfilename, sizeof(locfilename), "locs/%s.loc", cl.worldbasename);
filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
if (!filedata)
Cmd_AddCommand ("fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
Cmd_AddCommand ("fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
- // LordHavoc: added pausedemo
+ // LadyHavoc: added pausedemo
Cmd_AddCommand ("pausedemo", CL_PauseDemo_f, "pause demo playback (can also safely pause demo recording if using QUAKE, QUAKEDP or NEHAHRAMOVIE protocol, useful for making movies)");
Cmd_AddCommand ("cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
unsigned char buf[4];
countdownmsg = 5;
// write out a nop
- // LordHavoc: must use unreliable because reliable could kill the sigon message!
+ // LadyHavoc: must use unreliable because reliable could kill the sigon message!
Con_Print("--> client to server keepalive\n");
memset(&msg, 0, sizeof(msg));
msg.data = buf;
qboolean loadedsky = false;
const char *data;
char key[128], value[MAX_INPUTLINE];
- FOG_clear(); // LordHavoc: no fog until set
- // LordHavoc: default to the map's sky (q3 shader parsing sets this)
+ FOG_clear(); // LadyHavoc: no fog until set
+ // LadyHavoc: default to the map's sky (q3 shader parsing sets this)
R_SetSkyBox(cl.worldmodel->brush.skybox);
data = entdata;
if (!data)
case 2:
if (cls.netcon)
{
- // LordHavoc: quake sent the player info here but due to downloads
+ // LadyHavoc: quake sent the player info here but due to downloads
// it is sent earlier instead
// CL_SendPlayerInfo();
- // LordHavoc: changed to begin a loading stage and issue this when done
+ // LadyHavoc: changed to begin a loading stage and issue this when done
MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
MSG_WriteString (&cls.netcon->message, "spawn");
}
}
}
- // LordHavoc: hipnotic demos don't have this bit set but should
+ // LadyHavoc: hipnotic demos don't have this bit set but should
if (bits & SU_ITEMS || cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5)
cl.stats[STAT_ITEMS] = MSG_ReadLong(&cl_message);
S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
}
break;
- // LordHavoc: added for improved blood splatters
+ // LadyHavoc: added for improved blood splatters
case TE_BLOOD:
// blood puff
MSG_ReadVector(&cl_message, pos, cls.protocol);
CL_FindNonSolidLocation(pos, pos, 4);
CL_ParticleEffect(EFFECT_TE_PLASMABURN, 1, pos, pos, vec3_origin, vec3_origin, NULL, 0);
break;
- // LordHavoc: added for improved gore
+ // LadyHavoc: added for improved gore
case TE_BLOODSHOWER:
// vaporized body
MSG_ReadVector(&cl_message, pos, cls.protocol); // mins
break;
// PGM 01/21/97
- // LordHavoc: for compatibility with the Nehahra movie...
+ // LadyHavoc: for compatibility with the Nehahra movie...
case TE_LIGHTNING4NEH:
CL_ParseBeam(Mod_ForName(MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), true, false, NULL), false);
break;
qboolean strip_pqc;
char vabuf[1024];
- // LordHavoc: moved demo message writing from before the packet parse to
+ // LadyHavoc: moved demo message writing from before the packet parse to
// after the packet parse so that CL_Stop_f can be called by cl_autodemo
// code in CL_ParseServerinfo
//if (cls.demorecording)
cmdlogname[cmdindex] = qw_svc_strings[cmd];
if (!cmdlogname[cmdindex])
{
- // LordHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
+ // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
const char *d = "<unknown>";
cmdlogname[cmdindex] = d;
}
// if the high bit of the command byte is set, it is a fast update
if (cmd & 128)
{
- // LordHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
+ // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
temp = "entity";
cmdlogname[cmdindex] = temp;
SHOWNET("fast update");
cmdlogname[cmdindex] = svc_strings[cmd];
if (!cmdlogname[cmdindex])
{
- // LordHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
+ // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
const char *d = "<unknown>";
cmdlogname[cmdindex] = d;
}
Host_Error("svc_setview >= MAX_EDICTS");
if (cl.viewentity >= cl.max_entities)
CL_ExpandEntities(cl.viewentity);
- // LordHavoc: assume first setview recieved is the real player entity
+ // LadyHavoc: assume first setview recieved is the real player entity
if (!cl.realplayerentity)
cl.realplayerentity = cl.viewentity;
// update cl.playerentity to this one if it is a valid player
case svc_signonnum:
i = MSG_ReadByte(&cl_message);
- // LordHavoc: it's rude to kick off the client if they missed the
+ // LadyHavoc: it's rude to kick off the client if they missed the
// reconnect somehow, so allow signon 1 even if at signon 1
if (i <= cls.signon && i != 1)
Host_Error ("Received signon %i when at %i", i, cls.signon);
parsingerror = false;
- // LordHavoc: this was at the start of the function before cl_autodemo was
+ // LadyHavoc: this was at the start of the function before cl_autodemo was
// implemented
if (cls.demorecording)
{
frametime = bound(0, cl.time - cl.decals_updatetime, 1);
cl.decals_updatetime = bound(cl.time - 1, cl.decals_updatetime + frametime, cl.time + 1);
- // LordHavoc: early out conditions
+ // LadyHavoc: early out conditions
if (!cl.num_decals)
return;
frametime = bound(0, cl.time - cl.particles_updatetime, 1);
cl.particles_updatetime = bound(cl.time - 1, cl.particles_updatetime + frametime, cl.time + 1);
- // LordHavoc: early out conditions
+ // LadyHavoc: early out conditions
if (!cl.num_particles)
return;
float x, y;
strlcpy (lmplabel,MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (lmplabel));
strlcpy (picname, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (picname));
- if (gamemode == GAME_NEHAHRA) // LordHavoc: nasty old legacy junk
+ if (gamemode == GAME_NEHAHRA) // LadyHavoc: nasty old legacy junk
{
x = MSG_ReadByte(&cl_message);
y = MSG_ReadByte(&cl_message);
r_refdef.view.z = 0;
}
- // LordHavoc: viewzoom (zoom in for sniper rifles, etc)
- // LordHavoc: this is designed to produce widescreen fov values
+ // LadyHavoc: viewzoom (zoom in for sniper rifles, etc)
+ // LadyHavoc: this is designed to produce widescreen fov values
// when the screen is wider than 4/3 width/height aspect, to do
// this it simply assumes the requested fov is the vertical fov
// for a 4x3 display, if the ratio is not 4x3 this makes the fov
*/
-// LordHavoc: for some reason this is being #include'd rather than treated as its own file...
-// LordHavoc: adapted to not require stdint.h as this is not available on MSVC++, using unsigned char instead of uint8_t and fs_offset_t instead of int64_t.
+// LadyHavoc: for some reason this is being #include'd rather than treated as its own file...
+// LadyHavoc: adapted to not require stdint.h as this is not available on MSVC++, using unsigned char instead of uint8_t and fs_offset_t instead of int64_t.
// scaler type
#define LIBAVW_SCALER_BILINEAR 0
}
frameblend_t;
-// LordHavoc: this struct is intended for the renderer but some fields are
+// LadyHavoc: this struct is intended for the renderer but some fields are
// used by the client.
//
// The renderer should not rely on any changes to this struct to be persistent
// -1 = use normal cd track
int forcetrack;
qfile_t *demofile;
- // realtime at second frame of timedemo (LordHavoc: changed to double)
+ // realtime at second frame of timedemo (LadyHavoc: changed to double)
double td_starttime;
int td_frames; // total frames parsed
double td_onesecondnexttime;
double td_onesecondmaxfps;
double td_onesecondavgfps;
int td_onesecondavgcount;
- // LordHavoc: pausedemo
+ // LadyHavoc: pausedemo
qboolean demopaused;
// sound mixer statistics for showsound display
if( mod ) {
// TODO: check if this breaks needed consistency and maybe add a cvar for it too?? [1/10/2008 Black]
- // LordHavoc: erm you broke it by commenting this out - setmodel must do setsize or else the qc can't find out the model size, and ssqc does this by necessity, consistency.
+ // LadyHavoc: erm you broke it by commenting this out - setmodel must do setsize or else the qc can't find out the model size, and ssqc does this by necessity, consistency.
SetMinMaxSize (prog, e, mod->normalmins, mod->normalmaxs);
}
else
flags = 0;
else
{
- // LordHavoc: we only let the qc set certain flags, others are off-limits
+ // LadyHavoc: we only let the qc set certain flags, others are off-limits
flags = (int)PRVM_G_FLOAT(OFS_PARM6) & (CHANNELFLAG_RELIABLE | CHANNELFLAG_FORCELOOP | CHANNELFLAG_PAUSED | CHANNELFLAG_FULLVOLUME);
}
tracebox (vector1, vector mins, vector maxs, vector2, tryents)
=================
*/
-// LordHavoc: added this for my own use, VERY useful, similar to traceline
+// LadyHavoc: added this for my own use, VERY useful, similar to traceline
static void VM_CL_tracebox (prvm_prog_t *prog)
{
vec3_t v1, v2, m1, m2;
gravity = 1.0f;
gravity *= cl.movevars_gravity * 0.05;
- for (i = 0;i < 200;i++) // LordHavoc: sanity check; never trace more than 10 seconds
+ for (i = 0;i < 200;i++) // LadyHavoc: sanity check; never trace more than 10 seconds
{
PRVM_clientedictvector(tossent, velocity)[2] -= gravity;
VectorMA (PRVM_clientedictvector(tossent, angles), 0.05, PRVM_clientedictvector(tossent, avelocity), PRVM_clientedictvector(tossent, angles));
// (note: this is the reason you can't blow up fallen zombies)
if (PRVM_clientedictfloat(ent, solid) == SOLID_NOT && !sv_gameplayfix_blowupfallenzombies.integer)
continue;
- // LordHavoc: compare against bounding box rather than center so it
+ // LadyHavoc: compare against bounding box rather than center so it
// doesn't miss large objects, and use DotProduct instead of Length
// for a major speedup
VectorSubtract(org, PRVM_clientedictvector(ent, origin), eorg);
if (PRVM_clientedictfloat(ent, health) > 0 && cl_bob.value && cl_bobcycle.value)
{
double bob, cycle;
- // LordHavoc: this code is *weird*, but not replacable (I think it
+ // LadyHavoc: this code is *weird*, but not replacable (I think it
// should be done in QC on the server, but oh well, quake is quake)
- // LordHavoc: figured out bobup: the time at which the sin is at 180
+ // LadyHavoc: figured out bobup: the time at which the sin is at 180
// degrees (which allows lengthening or squishing the peak or valley)
cycle = cl.time/cl_bobcycle.value;
cycle -= (int)cycle;
NULL, // #397
NULL, // #398
NULL, // #399
-// LordHavoc's range #400-#499
+// LadyHavoc's range #400-#499
VM_CL_copyentity, // #400 void(entity from, entity to) copyentity (DP_QC_COPYENTITY)
NULL, // #401 void(entity ent, float colors) setcolor (DP_QC_SETCOLOR)
VM_findchain, // #402 entity(.string fld, string match) findchain (DP_QC_FINDCHAIN)
qboolean quotes;
char *comment;
- // LordHavoc: making sure the tokenizebuffer doesn't get filled up by repeated crashes
+ // LadyHavoc: making sure the tokenizebuffer doesn't get filled up by repeated crashes
cmd_tokenizebufferpos = 0;
while (cmd_text.cursize)
return buf;
}
-// written by LordHavoc
+// written by LadyHavoc
void Cmd_CompleteCommandPrint (const char *partial)
{
cmd_function_t *cmd;
return NULL;
}
-// written by LordHavoc
+// written by LadyHavoc
void Cmd_CompleteAliasPrint (const char *partial)
{
cmdalias_t *alias;
if (!cls.netcon)
return;
- // LordHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
+ // LadyHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
// attention, it has been eradicated from here, its only (former) use in
// all of darkplaces.
if (cls.protocol == PROTOCOL_QUAKEWORLD)
//pseudocode for detecting line/sphere overlap without calculating an impact point
//linesphereorigin = sphereorigin - linestart;linediff = lineend - linestart;linespherefrac = DotProduct(linesphereorigin, linediff) / DotProduct(linediff, linediff);return VectorLength2(linesphereorigin - bound(0, linespherefrac, 1) * linediff) >= sphereradius*sphereradius;
-// LordHavoc: currently unused, but tested
+// LadyHavoc: currently unused, but tested
// note: this can be used for tracing a moving sphere vs a stationary sphere,
// by simply adding the moving sphere's radius to the sphereradius parameter,
// all the results are correct (impactpoint, impactnormal, and fraction)
MSG_WriteCoord (sb, v[2], protocol);
}
-// LordHavoc: round to nearest value, rather than rounding toward zero, fixes crosshair problem
+// LadyHavoc: round to nearest value, rather than rounding toward zero, fixes crosshair problem
void MSG_WriteAngle8i (sizebuf_t *sb, float f)
{
if (f >= 0)
v[2] = MSG_ReadCoord(sb, protocol);
}
-// LordHavoc: round to nearest value, rather than rounding toward zero, fixes crosshair problem
+// LadyHavoc: round to nearest value, rather than rounding toward zero, fixes crosshair problem
float MSG_ReadAngle8i (sizebuf_t *sb)
{
return (signed char) MSG_ReadByte (sb) * (360.0/256.0);
memcpy (SZ_GetSpace(buf,length),data,length);
}
-// LordHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
+// LadyHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
// attention, it has been eradicated from here, its only (former) use in
// all of darkplaces.
extern int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list args);
// A bunch of functions are forbidden for security reasons (and also to please MSVS 2005, for some of them)
-// LordHavoc: added #undef lines here to avoid warnings in Linux
+// LadyHavoc: added #undef lines here to avoid warnings in Linux
#undef strcat
#define strcat DO_NOT_USE_STRCAT__USE_STRLCAT_OR_MEMCPY
#undef strncat
}
//[515]: the simplest command ever
-//LordHavoc: not so simple after I made it print usage...
+//LadyHavoc: not so simple after I made it print usage...
static void Con_Maps_f (void)
{
if (Cmd_Argc() > 2)
char charbuf16[16];
cursor = u8_encodech(0xE00A + ((int)(realtime * con_cursorspeed)&1), NULL, charbuf16);
- // LordHavoc: speedup, and other improvements
+ // LadyHavoc: speedup, and other improvements
if (chat_mode < 0)
dpsnprintf(temptext, sizeof(temptext), "]%s%s", chat_buffer, cursor);
else if(chat_mode)
its format (q1/q2/q3/hl) and even its message
*/
//[515]: here is an ugly hack.. two gotos... oh my... *but it works*
-//LordHavoc: rewrote bsp type detection, rewrote message extraction to do proper worldspawn parsing
-//LordHavoc: added .ent file loading, and redesigned error handling to still try the .ent file even if the map format is not recognized, this also eliminated one goto
-//LordHavoc: FIXME: man this GetMapList is STILL ugly code even after my cleanups...
+//LadyHavoc: rewrote bsp type detection, rewrote message extraction to do proper worldspawn parsing
+//LadyHavoc: added .ent file loading, and redesigned error handling to still try the .ent file even if the map format is not recognized, this also eliminated one goto
+//LadyHavoc: FIXME: man this GetMapList is STILL ugly code even after my cleanups...
qboolean GetMapList (const char *s, char *completedname, int completednamebufferlength)
{
fssearch_t *t;
VectorCopy(cl.csqc_vieworiginfromengine, cl.csqc_vieworigin);
VectorCopy(cl.csqc_viewanglesfromengine, cl.csqc_viewangles);
- // LordHavoc: Spike says not to do this, but without pmove_org the
+ // LadyHavoc: Spike says not to do this, but without pmove_org the
// CSQC is useless as it can't alter the view origin without
// completely replacing it
Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, pmove_org);
}
else
{
- // LordHavoc: removing an entity that is already gone on
+ // LadyHavoc: removing an entity that is already gone on
// the csqc side is possible for legitimate reasons (such
// as a repeat of the remove message), so no warning is
// needed
#ifndef CSPROGS_H
#define CSPROGS_H
-// LordHavoc: changed to match MAX_EDICTS
+// LadyHavoc: changed to match MAX_EDICTS
#define CL_MAX_EDICTS MAX_EDICTS
#define ENTMASK_ENGINE 1
/*
-this code written by Forest Hale, on 2004-10-17, and placed into public domain
+this code written by Ashley Rose Hale (LadyHavoc), on 2004-10-17, and placed into public domain
this implements Quadratic BSpline surfaces as seen in Quake3 by id Software
a small rant on misuse of the name 'bezier': many people seem to think that
return buf;
}
-// written by LordHavoc
+// written by LadyHavoc
void Cvar_CompleteCvarPrint (const char *partial)
{
cvar_t *cvar;
char vabuf[1024];
changed = strcmp(var->string, value) != 0;
- // LordHavoc: don't reallocate when there is no change
+ // LadyHavoc: don't reallocate when there is no change
if (!changed)
return;
- // LordHavoc: don't reallocate when the buffer is the same size
+ // LadyHavoc: don't reallocate when the buffer is the same size
valuelen = strlen(value);
if (!var->string || strlen(var->string) != valuelen)
{
#include "quakedef.h"
-// LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such...
+// LadyHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such...
int matchpattern(const char *in, const char *pattern, int caseinsensitive)
{
float v[4];
static float noisetable[NOISE_SIZE];
static int r[NOISE_SIZE];
- // LordHavoc: this is inspired by code I saw in Quake3, however I think my
+ // LadyHavoc: this is inspired by code I saw in Quake3, however I think my
// version is much cleaner and substantially faster as well
//
// the following changes were made:
// 1st uint8 : general purpose bit flag
// Check bits 0 (encryption), 3 (data descriptor after the file), and 5 (compressed patched data (?))
//
- // LordHavoc: bit 3 would be a problem if we were scanning the archive
+ // LadyHavoc: bit 3 would be a problem if we were scanning the archive
// but is not a problem in the central directory where the values are
// always real.
//
// -game <gamedir>
// Adds basedir/gamedir as an override game
- // LordHavoc: now supports multiple -game directories
+ // LadyHavoc: now supports multiple -game directories
// set the com_modname (reported in server info)
*gamedirbuf = 0;
for (i = 0;i < fs_numgamedirs;i++)
// -game <gamedir>
// Adds basedir/gamedir as an override game
- // LordHavoc: now supports multiple -game directories
+ // LadyHavoc: now supports multiple -game directories
for (i = 1;i < com_argc && fs_numgamedirs < MAX_GAMEDIRS;i++)
{
if (!com_argv[i])
}
#endif
- // LordHavoc: FILEDESC_SEEK affects all duplicates of a handle so we do it before
+ // LadyHavoc: FILEDESC_SEEK affects all duplicates of a handle so we do it before
// the dup() call to avoid having to close the dup_handle on error here
if (FILEDESC_SEEK (pack->handle, pfile->offset, SEEK_SET) == -1)
{
FS_Purge (file);
// Write the buffer and update the position
- // LordHavoc: to hush a warning about passing size_t to an unsigned int parameter on Win64 we do this as multiple writes if the size would be too big for an integer (we never write that big in one go, but it's a theory)
+ // LadyHavoc: to hush a warning about passing size_t to an unsigned int parameter on Win64 we do this as multiple writes if the size would be too big for an integer (we never write that big in one go, but it's a theory)
while (written < (fs_offset_t)datasize)
{
// figure out how much to write in one chunk
Matrix4x4_Transform3x3(&v->viewmatrix, normal, clipPlane);
VectorScale(normal, -dist, v3);
Matrix4x4_Transform(&v->viewmatrix, v3, v4);
- // FIXME: LordHavoc: I think this can be done more efficiently somehow but I can't remember the technique
+ // FIXME: LadyHavoc: I think this can be done more efficiently somehow but I can't remember the technique
clipPlane[3] = -DotProduct(v4, clipPlane);
// Calculate the clip-space corner point opposite the clipping plane
gl_state.pointer_vertex_offset = bufferoffset;
CHECKGLERROR
GL_BindVBO(bufferobject);
- // LordHavoc: special flag added to gltype for unnormalized types
+ // LadyHavoc: special flag added to gltype for unnormalized types
qglVertexAttribPointer(GLSLATTRIB_POSITION, components, gltype & ~0x80000000, (gltype & 0x80000000) == 0, (GLsizei)stride, bufferobject ? (void *)bufferoffset : pointer);CHECKGLERROR
}
break;
gl_state.pointer_color_offset = bufferoffset;
CHECKGLERROR
GL_BindVBO(bufferobject);
- // LordHavoc: special flag added to gltype for unnormalized types
+ // LadyHavoc: special flag added to gltype for unnormalized types
qglVertexAttribPointer(GLSLATTRIB_COLOR, components, gltype & ~0x80000000, (gltype & 0x80000000) == 0, (GLsizei)stride, bufferobject ? (void *)bufferoffset : pointer);CHECKGLERROR
}
}
unit->pointer_texcoord_vertexbuffer = vertexbuffer;
unit->pointer_texcoord_offset = bufferoffset;
GL_BindVBO(bufferobject);
- // LordHavoc: special flag added to gltype for unnormalized types
+ // LadyHavoc: special flag added to gltype for unnormalized types
qglVertexAttribPointer(unitnum+GLSLATTRIB_TEXCOORD0, components, gltype & ~0x80000000, (gltype & 0x80000000) == 0, (GLsizei)stride, bufferobject ? (void *)bufferoffset : pointer);CHECKGLERROR
}
}
static const vec4_t string_colors[] =
{
// Quake3 colors
- // LordHavoc: why on earth is cyan before magenta in Quake3?
- // LordHavoc: note: Doom3 uses white for [0] and [7]
+ // LadyHavoc: why on earth is cyan before magenta in Quake3?
+ // LadyHavoc: note: Doom3 uses white for [0] and [7]
{0.0, 0.0, 0.0, 1.0}, // black
{1.0, 0.0, 0.0, 1.0}, // red
{0.0, 1.0, 0.0, 1.0}, // green
r_refdef.fog_height_table2d = (unsigned char *)Mem_Alloc(r_main_mempool, size * size * 4);
memcpy(r_refdef.fog_height_table1d, inpixels, size * 4);
Mem_Free(inpixels);
- // LordHavoc: now the magic - what is that table2d for? it is a cooked
+ // LadyHavoc: now the magic - what is that table2d for? it is a cooked
// average fog color table accounting for every fog layer between a point
// and the camera. (Note: attenuation is handled separately!)
for (y = 0;y < size;y++)
//==================================================================================
-// LordHavoc: this stores temporary data used within the same frame
+// LadyHavoc: this stores temporary data used within the same frame
typedef struct r_framedata_mem_s
{
//==================================================================================
-// LordHavoc: animcache originally written by Echon, rewritten since then
+// LadyHavoc: animcache originally written by Echon, rewritten since then
/**
* Animation cache prevents re-generating mesh data for an animated model
for (i = 0;i < r_refdef.view.numfrustumplanes;i++)
PlaneClassify(r_refdef.view.frustum + i);
- // LordHavoc: note to all quake engine coders, Quake had a special case
+ // LadyHavoc: note to all quake engine coders, Quake had a special case
// for 90 degrees which assumed a square view (wrong), so I removed it,
// Quake2 has it disabled as well.
t->currentmaterialflags |= MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
else if (t->currentalpha < 1)
t->currentmaterialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
- // LordHavoc: prevent bugs where code checks add or alpha at higher priority than customblend by clearing these flags
+ // LadyHavoc: prevent bugs where code checks add or alpha at higher priority than customblend by clearing these flags
if (t->currentmaterialflags & MATERIALFLAG_CUSTOMBLEND)
t->currentmaterialflags &= ~(MATERIALFLAG_ADD | MATERIALFLAG_ALPHA);
if (rsurface.ent_flags & RENDER_DOUBLESIDED)
R_Mesh_Draw(0, numpoints, 0, numpoints - 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
}
-// LordHavoc: this is just a nice debugging tool, very slow
+// LadyHavoc: this is just a nice debugging tool, very slow
void R_DrawPortals(void)
{
int i, leafnum;
{
case RENDERPATH_GL32:
case RENDERPATH_GLES2:
- // LordHavoc: allow any alignment
+ // LadyHavoc: allow any alignment
CHECKGLERROR
qglPixelStorei(GL_UNPACK_ALIGNMENT, 1);CHECKGLERROR
qglPixelStorei(GL_PACK_ALIGNMENT, 1);CHECKGLERROR
else if (!memcmp(dds+84, "DXT1", 4))
{
// we need to find out if this is DXT1 (opaque) or DXT1A (transparent)
- // LordHavoc: it is my belief that this does not infringe on the
+ // LadyHavoc: it is my belief that this does not infringe on the
// patent because it is not decoding pixels...
textype = TEXTYPE_DXT1;
bytesperblock = 8;
// how many frames have occurred
// (checked by Host_Error and Host_SaveConfig_f)
int host_framecount = 0;
-// LordHavoc: set when quit is executed
+// LadyHavoc: set when quit is executed
qboolean host_shuttingdown = false;
// the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
Con_Printf("Host_Error: %s\n", hosterrorstring1);
- // LordHavoc: if crashing very early, or currently shutting down, do
+ // LadyHavoc: if crashing very early, or currently shutting down, do
// Sys_Error instead
if (host_framecount < 3 || host_shuttingdown)
Sys_Error ("Host_Error: %s", hosterrorstring1);
// dedicated servers initialize the host but don't parse and set the
// config.cfg cvars
- // LordHavoc: don't save a config if it crashed in startup
+ // LadyHavoc: don't save a config if it crashed in startup
if (host_framecount >= 3 && cls.state != ca_dedicated && !COM_CheckParm("-benchmark") && !COM_CheckParm("-capturedemo"))
{
f = FS_OpenRealFile(file, "wb", false);
// tell the client to be gone
if (!crash)
{
- // LordHavoc: no opportunity for resending, so use unreliable 3 times
+ // LadyHavoc: no opportunity for resending, so use unreliable 3 times
unsigned char bufdata[8];
sizebuf_t buf;
memset(&buf, 0, sizeof(buf));
}
// call qc ClientDisconnect function
- // LordHavoc: don't call QC if server is dead (avoids recursive
+ // LadyHavoc: don't call QC if server is dead (avoids recursive
// Host_Error in some mods when they run out of edicts)
if (host_client->clientconnectcalled && sv.active && host_client->edict)
{
if (COM_CheckParm("-profilegameonly"))
Sys_AllowProfiling(false);
- // LordHavoc: quake never seeded the random number generator before... heh
+ // LadyHavoc: quake never seeded the random number generator before... heh
if (COM_CheckParm("-benchmark"))
srand(0); // predictable random sequence for -benchmark
else
srand((unsigned int)time(NULL));
// FIXME: this is evil, but possibly temporary
- // LordHavoc: doesn't seem very temporary...
- // LordHavoc: made this a saved cvar
+ // LadyHavoc: doesn't seem very temporary...
+ // LadyHavoc: made this a saved cvar
// COMMANDLINEOPTION: Console: -developer enables warnings and other notices (RECOMMENDED for mod developers)
if (COM_CheckParm("-developer"))
{
{
if (sv.protocol == PROTOCOL_QUAKE && svs.maxclients <= 99)
{
- // LordHavoc: this is very touchy because we must maintain ProQuake compatible status output
+ // LadyHavoc: this is very touchy because we must maintain ProQuake compatible status output
print ("#%-2u %-16.16s %3i %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
print (" %s\n", ip);
}
else
{
- // LordHavoc: no real restrictions here, not a ProQuake-compatible protocol anyway...
+ // LadyHavoc: no real restrictions here, not a ProQuake-compatible protocol anyway...
print ("#%-3u %-16.16s %4i %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
print (" %s\n", ip);
}
else
dpsnprintf(comment, sizeof(comment), "(crash dump of %s progs)", prog->name);
// convert space to _ to make stdio happy
- // LordHavoc: convert control characters to _ as well
+ // LadyHavoc: convert control characters to _ as well
for (i=0 ; i<SAVEGAME_COMMENT_LENGTH ; i++)
if (ISWHITESPACEORCONTROL(comment[i]))
comment[i] = '_';
int j, quoted;
const char *p1;
char *p2;
- // LordHavoc: long say messages
+ // LadyHavoc: long say messages
char text[1024];
qboolean fromServer = false;
client_t *save;
int j;
const char *p1, *p2;
- char text[MAX_INPUTLINE]; // LordHavoc: FIXME: temporary buffer overflow fix (was 64)
+ char text[MAX_INPUTLINE]; // LadyHavoc: FIXME: temporary buffer overflow fix (was 64)
qboolean fromServer = false;
if (cmd_source == src_command)
top &= 15;
bottom &= 15;
- // LordHavoc: allowing skin colormaps 14 and 15 by commenting this out
+ // LadyHavoc: allowing skin colormaps 14 and 15 by commenting this out
//if (top > 13)
// top = 13;
//if (bottom > 13)
/*
======================
Host_PModel_f
-LordHavoc: only supported for Nehahra, I personally think this is dumb, but Mindcrime won't listen.
-LordHavoc: correction, Mindcrime will be removing pmodel in the future, but it's still stuck here for compatibility.
+LadyHavoc: only supported for Nehahra, I personally think this is dumb, but Mindcrime won't listen.
+LadyHavoc: correction, Mindcrime will be removing pmodel in the future, but it's still stuck here for compatibility.
======================
*/
cvar_t cl_pmodel = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_pmodel", "0", "internal storage cvar for current player model number in nehahra (changed by pmodel command)"};
// again in the first 5 seconds after connecting
host_client->nametime = 0;
- // LordHavoc: moved this above the QC calls at FrikaC's request
- // LordHavoc: commented this out
+ // LadyHavoc: moved this above the QC calls at FrikaC's request
+ // LadyHavoc: commented this out
//if (host_client->netconnection)
// SZ_Clear (&host_client->netconnection->message);
}
host_client->begun = true;
- // LordHavoc: note: this code also exists in SV_DropClient
+ // LadyHavoc: note: this code also exists in SV_DropClient
if (sv.loadgame)
{
int i;
for (i=1 ; i<c+1 ; i++)
strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
- // LordHavoc: clear the remaining slots
+ // LadyHavoc: clear the remaining slots
for (;i <= MAX_DEMOS;i++)
cls.demos[i-1][0] = 0;
if (cls.state == ca_connected)
{
c = Cvar_FindVar(cvarname);
- // LordHavoc: if there is no such cvar or if it is private, send a
+ // LadyHavoc: if there is no such cvar or if it is private, send a
// reply indicating that it has no value
if(!c || (c->flags & CVAR_PRIVATE))
Cmd_ForwardStringToServer(va(vabuf, sizeof(vabuf), "sentcvar %s", cvarname));
}
#if 1
-// written by LordHavoc in a readable way, optimized by Vic, further optimized by LordHavoc (the non-special index case), readable version preserved below this
+// written by LadyHavoc in a readable way, optimized by Vic, further optimized by LadyHavoc (the non-special index case), readable version preserved below this
void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qboolean inputflipx, qboolean inputflipy, qboolean inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
{
int index, c, x, y;
memcpy(&pcx, fin, sizeof(pcx));
fin += sizeof(pcx);
- // LordHavoc: big-endian support ported from QF newtree
+ // LadyHavoc: big-endian support ported from QF newtree
pcx.xmax = LittleShort (pcx.xmax);
pcx.xmin = LittleShort (pcx.xmin);
pcx.ymax = LittleShort (pcx.ymax);
memcpy(&pcx, fin, sizeof(pcx));
fin += sizeof(pcx);
- // LordHavoc: big-endian support ported from QF newtree
+ // LadyHavoc: big-endian support ported from QF newtree
pcx.xmax = LittleShort (pcx.xmax);
pcx.xmin = LittleShort (pcx.xmin);
pcx.ymax = LittleShort (pcx.ymax);
/*
- Copyright (C) 2006 Serge "(515)" Ziryukin, Forest "LordHavoc" Hale
+ Copyright (C) 2006 Serge "(515)" Ziryukin, Ashley Rose Hale (LadyHavoc)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
//[515]: png implemented into DP ONLY FOR TESTING 2d stuff with csqc
// so delete this bullshit :D
//
-//LordHavoc: rewrote most of this.
+//LadyHavoc: rewrote most of this.
#include "quakedef.h"
#include "image.h"
qfile_t *outfile;
} my_png;
-//LordHavoc: removed __cdecl prefix, added overrun protection, and rewrote this to be more efficient
+//LadyHavoc: removed __cdecl prefix, added overrun protection, and rewrote this to be more efficient
static void PNG_fReadData(void *png, unsigned char *data, size_t length)
{
size_t l;
static void
Key_Console (int key, int unicode)
{
- // LordHavoc: copied most of this from Q2 to improve keyboard handling
+ // LadyHavoc: copied most of this from Q2 to improve keyboard handling
switch (key)
{
case K_KP_SLASH:
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
};
-extern long keysym2ucs(KeySym keysym); // LordHavoc: suppress warning just in this case, it's not worth having a header file for this...
+extern long keysym2ucs(KeySym keysym); // LadyHavoc: suppress warning just in this case, it's not worth having a header file for this...
long keysym2ucs(KeySym keysym)
{
int min = 0;
-// Written by Forest Hale 2003-06-15 and placed into public domain.
+// Written by Ashley Rose Hale (LadyHavoc) 2003-06-15 and placed into public domain.
#ifdef WIN32
#ifdef _MSC_VER
-// Written by Forest Hale 2003-06-15 and placed into public domain.
+// Written by Ashley Rose Hale (LadyHavoc) 2003-06-15 and placed into public domain.
#ifndef LHNET_H
#define LHNET_H
// assumes "src" is normalized
void PerpendicularVector( vec3_t dst, const vec3_t src )
{
- // LordHavoc: optimized to death and beyond
+ // LadyHavoc: optimized to death and beyond
int pos;
float minelem;
#endif
-// LordHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
+// LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up)
{
// NOTE: this is consistent to AngleVectors applied to AnglesFromVectors
}
}
-// LordHavoc: calculates pitch/yaw/roll angles from forward and up vectors
+// LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors
void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qboolean flippitch)
{
if (forward[0] == 0 && forward[1] == 0)
#endif
-// LordHavoc: renamed this to Length, and made the normal one a #define
+// LadyHavoc: renamed this to Length, and made the normal one a #define
float VectorNormalizeLength (vec3_t v)
{
float length, ilength;
{
int a;
- // LordHavoc: setup 1.0f / N table for quick recipricols of integers
+ // LadyHavoc: setup 1.0f / N table for quick recipricols of integers
ixtable[0] = 0;
for (a = 1;a < 4096;a++)
ixtable[a] = 1.0f / a;
}
}
-// LordHavoc: this has to be done right or you get severe precision breakdown
+// LadyHavoc: this has to be done right or you get severe precision breakdown
int LoopingFrameNumberFromDouble(double t, int loopframes)
{
if (loopframes)
#define max(A,B) ((A) > (B) ? (A) : (B))
#endif
-/// LordHavoc: this function never returns exactly MIN or exactly MAX, because
+/// LadyHavoc: this function never returns exactly MIN or exactly MAX, because
/// of a QuakeC bug in id1 where the line
/// self.nextthink = self.nexthink + random() * 0.5;
/// can result in 0 (self.nextthink is 0 at this point in the code to begin
#define VectorLehmerRandom(seed,v) do{(v)[0] = Math_crandomf(seed);(v)[1] = Math_crandomf(seed);(v)[2] = Math_crandomf(seed);}while(DotProduct(v, v) > 1)
/*
-// LordHavoc: quaternion math, untested, don't know if these are correct,
+// LadyHavoc: quaternion math, untested, don't know if these are correct,
// need to add conversion to/from matrices
-// LordHavoc: later note: the matrix faq is useful: http://skal.planet-d.net/demo/matrixfaq.htm
-// LordHavoc: these are probably very wrong and I'm not sure I care, not used by anything
+// LadyHavoc: later note: the matrix faq is useful: http://skal.planet-d.net/demo/matrixfaq.htm
+// LadyHavoc: these are probably very wrong and I'm not sure I care, not used by anything
// returns length of quaternion
#define qlen(a) ((float) sqrt((a)[0]*(a)[0]+(a)[1]*(a)[1]+(a)[2]*(a)[2]+(a)[3]*(a)[3]))
void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4]);
void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
-/// LordHavoc: proper matrix version of AngleVectors
+/// LadyHavoc: proper matrix version of AngleVectors
void AngleVectorsFLU (const vec3_t angles, vec3_t forward, vec3_t left, vec3_t up);
/// divVerent: improper matrix version of AngleVectors
void AngleVectorsDuke3DFLU (const vec3_t angles, vec3_t forward, vec3_t left, vec3_t up, double maxShearAngle);
-/// LordHavoc: builds a [3][4] matrix
+/// LadyHavoc: builds a [3][4] matrix
void AngleMatrix (const vec3_t angles, const vec3_t translate, vec_t matrix[][4]);
-/// LordHavoc: calculates pitch/yaw/roll angles from forward and up vectors
+/// LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors
void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qboolean flippitch);
-/// LordHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
+/// LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up);
void VectorVectorsDouble(const double *forward, double *right, double *up);
#define PlaneDist(point,plane) ((plane)->type < 3 ? (point)[(plane)->type] : DotProduct((point), (plane)->normal))
#define PlaneDiff(point,plane) (((plane)->type < 3 ? (point)[(plane)->type] : DotProduct((point), (plane)->normal)) - (plane)->dist)
-/// LordHavoc: minimal plane structure
+/// LadyHavoc: minimal plane structure
typedef struct tinyplane_s
{
float normal[3], dist;
#include "matrixlib.h"
#ifdef _MSC_VER
-#pragma warning(disable : 4244) // LordHavoc: MSVC++ 4 x86, double/float
-#pragma warning(disable : 4305) // LordHavoc: MSVC++ 6 x86, double/float
+#pragma warning(disable : 4244) // LadyHavoc: MSVC++ 4 x86, double/float
+#pragma warning(disable : 4305) // LadyHavoc: MSVC++ 6 x86, double/float
#endif
const matrix4x4_t identitymatrix =
#endif
}
-// LordHavoc: I got this code from:
+// LadyHavoc: I got this code from:
//http://www.doom3world.org/phpbb2/viewtopic.php?t=2884
void Matrix4x4_FromDoom3Joint(matrix4x4_t *m, double ox, double oy, double oz, double x, double y, double z)
{
{
uint32 M[16];
-// start of edit by Forest 'LordHavoc' Hale
+// start of edit by Ashley Rose Hale (LadyHavoc)
// commented out to prevent crashing when length is 0
// if (n == 0) mdfour_tail(in, n);
-// end of edit by Forest 'LordHavoc' Hale
+// end of edit by Ashley Rose Hale (LadyHavoc)
while (n >= 64) {
copy64(M, in);
if (!sv.active)
return;
#if 1
- // LordHavoc: allow saving multiplayer games
+ // LadyHavoc: allow saving multiplayer games
if (cl.islocalgame && cl.intermission)
return;
#else
M_DrawTextBox (64, 140-8, 14, 1);
M_Print(72, 140, "Accept Changes");
- // LordHavoc: rewrote this code greatly
+ // LadyHavoc: rewrote this code greatly
if (menuplyr_load)
{
unsigned char *f;
Key_FindKeysForCommand (bindnames[i][0], keys, NUMKEYS, 0);
- // LordHavoc: redesigned to print more than 2 keys, inspired by Tomaz's MiniRacer
+ // LadyHavoc: redesigned to print more than 2 keys, inspired by Tomaz's MiniRacer
if (keys[0] == -1)
strlcpy(keystring, "???", sizeof(keystring));
else
}
// model bbox
- // LordHavoc: actually we blow this away later with Mod_Alias_CalculateBoundingBox()
+ // LadyHavoc: actually we blow this away later with Mod_Alias_CalculateBoundingBox()
modelradius = pheader->radius;
for (i = 0;i < 3;i++)
{
loadmodel->AnimateVertices = Mod_Skeletal_AnimateVertices;
// model bbox
- // LordHavoc: actually we blow this away later with Mod_Alias_CalculateBoundingBox()
+ // LadyHavoc: actually we blow this away later with Mod_Alias_CalculateBoundingBox()
for (i = 0;i < 3;i++)
{
loadmodel->normalmins[i] = pheader->mins[i];
Host_Error ("Mod_INTERQUAKEMODEL_Load: %s is not an Inter-Quake Model %d", loadmodel->name, (int)(pend - pbase));
// copy struct (otherwise it may be misaligned)
- // LordHavoc: okay it's definitely not misaligned here, but for consistency...
+ // LadyHavoc: okay it's definitely not misaligned here, but for consistency...
memcpy(&header, pbase, sizeof(iqmheader_t));
if (memcmp(header.id, "INTERQUAKEMODEL", 16))
========================================================================
*/
-// LordHavoc: grabbed this from the Q2 utility source,
+// LadyHavoc: grabbed this from the Q2 utility source,
// renamed a things to avoid conflicts
#define MD2ALIAS_VERSION 8
if (model == NULL)
return NULL;
- // LordHavoc: modified to start at first clip node,
+ // LadyHavoc: modified to start at first clip node,
// in other words: first node of the (sub)model
node = model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode;
while (node->plane)
rhc.hull = &model->brushq1.hulls[0]; // 0x0x0
else if (model->brush.ishlbsp)
{
- // LordHavoc: this has to have a minor tolerance (the .1) because of
+ // LadyHavoc: this has to have a minor tolerance (the .1) because of
// minor float precision errors from the box being transformed around
if (boxsize[0] < 32.1)
{
}
else
{
- // LordHavoc: this has to have a minor tolerance (the .1) because of
+ // LadyHavoc: this has to have a minor tolerance (the .1) because of
// minor float precision errors from the box being transformed around
if (boxsize[0] < 32.1)
rhc.hull = &model->brushq1.hulls[1]; // 32x32x56
w11 = ( dsfrac) * ( dtfrac) * (1.0f / 128.0f);
// values for pointer math
- line3 = lmwidth * 3; // LordHavoc: *3 for colored lighting
- size3 = lmwidth * lmheight * 3; // LordHavoc: *3 for colored lighting
+ line3 = lmwidth * 3; // LadyHavoc: *3 for colored lighting
+ size3 = lmwidth * lmheight * 3; // LadyHavoc: *3 for colored lighting
// look up the pixel
- lightmap = surface->lightmapinfo->samples + dti * line3 + dsi*3; // LordHavoc: *3 for colored lighting
+ lightmap = surface->lightmapinfo->samples + dti * line3 + dsi*3; // LadyHavoc: *3 for colored lighting
// bilinear filter each lightmap style, and sum them
for (maps = 0;maps < MAXLIGHTMAPS && surface->lightmapinfo->styles[maps] != 255;maps++)
}
// the line intersects, find intersection point
- // LordHavoc: this uses the original trace for maximum accuracy
+ // LadyHavoc: this uses the original trace for maximum accuracy
if (plane->type < 3)
{
t1 = t->start[plane->type] - plane->dist;
s += 5;
FS_StripExtension(s, mapname, sizeof(mapname));
- // LordHavoc: mostly rewritten map texture loader
+ // LadyHavoc: mostly rewritten map texture loader
for (i = 0;i < nummiptex;i++)
{
doffset = MSG_ReadLittleLong(sb);
if ((mtwidth & 15) || (mtheight & 15))
Con_DPrintf("%s: warning: texture \"%s\" is not 16 aligned\n", loadmodel->name, name);
- // LordHavoc: force all names to lowercase
+ // LadyHavoc: force all names to lowercase
for (j = 0;name[j];j++)
if (name[j] >= 'A' && name[j] <= 'Z')
name[j] += 'a' - 'A';
- // LordHavoc: backup the texture_t because q3 shader loading overwrites it
+ // LadyHavoc: backup the texture_t because q3 shader loading overwrites it
backuptex = loadmodel->data_textures[i];
if (name[0] && Mod_LoadTextureFromQ3Shader(loadmodel->mempool, loadmodel->name, loadmodel->data_textures + i, name, false, false, 0, MATERIALFLAG_WALL))
continue;
if (cls.state != ca_dedicated)
{
- // LordHavoc: HL sky textures are entirely different than quake
+ // LadyHavoc: HL sky textures are entirely different than quake
if (!loadmodel->brush.ishlbsp && !strncmp(tx->name, "sky", 3) && mtwidth == mtheight * 2)
{
data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va(vabuf, sizeof(vabuf), "textures/%s/%s", mapname, tx->name), false, false, false, NULL);
if (skinframe)
tx->materialshaderpass->skinframes[0] = skinframe;
}
- // LordHavoc: some Tenebrae textures get replaced by black
+ // LadyHavoc: some Tenebrae textures get replaced by black
if (!strncmp(tx->name, "*glassmirror", 12)) // Tenebrae
tx->materialshaderpass->skinframes[0] = R_SkinFrame_LoadInternalBGRA(tx->name, TEXF_MIPMAP | TEXF_ALPHA, zerotrans, 1, 1, 0, 0, 0, false);
else if (!strncmp(tx->name, "mirror", 6)) // Tenebrae
tx->basematerialflags = MATERIALFLAG_WALL;
if (tx->name[0] == '*')
{
- // LordHavoc: some turbulent textures should not be affected by wateralpha
+ // LadyHavoc: some turbulent textures should not be affected by wateralpha
if (!strncmp(tx->name, "*glassmirror", 12)) // Tenebrae
tx->basematerialflags |= MATERIALFLAG_NOSHADOW | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_REFLECTION;
else if (!strncmp(tx->name,"*lava",5)
char litfilename[MAX_QPATH];
char dlitfilename[MAX_QPATH];
fs_offset_t filesize;
- if (loadmodel->brush.ishlbsp) // LordHavoc: load the colored lighting data straight
+ if (loadmodel->brush.ishlbsp) // LadyHavoc: load the colored lighting data straight
{
loadmodel->brushq1.lightdata = (unsigned char *)Mem_Alloc(loadmodel->mempool, sb->cursize);
for (i = 0;i < sb->cursize;i++)
loadmodel->brushq1.lightdata[i] = sb->data[i] >>= 1;
}
- else // LordHavoc: bsp version 29 (normal white lighting)
+ else // LadyHavoc: bsp version 29 (normal white lighting)
{
- // LordHavoc: hope is not lost yet, check for a .lit file to load
+ // LadyHavoc: hope is not lost yet, check for a .lit file to load
strlcpy (litfilename, loadmodel->name, sizeof (litfilename));
FS_StripExtension (litfilename, litfilename, sizeof (litfilename));
strlcpy (dlitfilename, litfilename, sizeof (dlitfilename));
data = NULL;
}
}
- // LordHavoc: oh well, expand the white lighting data
+ // LadyHavoc: oh well, expand the white lighting data
if (!sb->cursize)
return;
loadmodel->brushq1.lightdata = (unsigned char *)Mem_Alloc(loadmodel->mempool, sb->cursize*3);
}
#endif
}
- else if (loadmodel->brush.ishlbsp || loadmodel->brush.isq2bsp) // LordHavoc: HalfLife map (bsp version 30)
+ else if (loadmodel->brush.ishlbsp || loadmodel->brush.isq2bsp) // LadyHavoc: HalfLife map (bsp version 30)
surface->lightmapinfo->samples = loadmodel->brushq1.lightdata + lightmapoffset;
- else // LordHavoc: white lighting (bsp version 29)
+ else // LadyHavoc: white lighting (bsp version 29)
{
surface->lightmapinfo->samples = loadmodel->brushq1.lightdata + (lightmapoffset * 3);
if (loadmodel->brushq1.nmaplightdata)
v = ((DotProduct(((loadmodel->surfmesh.data_vertex3f + 3 * surface->num_firstvertex) + i * 3), surface->lightmapinfo->texinfo->vecs[1]) + surface->lightmapinfo->texinfo->vecs[1][3]) + 8 - surface->lightmapinfo->texturemins[1]) * (1.0 / 16.0);
(loadmodel->surfmesh.data_texcoordlightmap2f + 2 * surface->num_firstvertex)[i * 2 + 0] = u * uscale + ubase;
(loadmodel->surfmesh.data_texcoordlightmap2f + 2 * surface->num_firstvertex)[i * 2 + 1] = v * vscale + vbase;
- // LordHavoc: calc lightmap data offset for vertex lighting to use
+ // LadyHavoc: calc lightmap data offset for vertex lighting to use
iu = (int) u;
iv = (int) v;
(loadmodel->surfmesh.data_lightmapoffsets + surface->num_firstvertex)[i] = (bound(0, iv, tmax) * ssize + bound(0, iu, smax)) * 3;
for (j=0 ; j<2 ; j++)
{
- // LordHavoc: this code supports broken bsp files produced by
+ // LadyHavoc: this code supports broken bsp files produced by
// arguire qbsp which can produce more than 32768 nodes, any value
// below count is assumed to be a node number, any other value is
// assumed to be a leaf number
}
else
{
- // LordHavoc: this code supports arguire qbsp's broken clipnodes indices (more than 32768 clipnodes), values above count are assumed to be contents values
+ // LadyHavoc: this code supports arguire qbsp's broken clipnodes indices (more than 32768 clipnodes), values above count are assumed to be contents values
out->children[0] = (unsigned short)MSG_ReadLittleShort(sb);
out->children[1] = (unsigned short)MSG_ReadLittleShort(sb);
if (out->children[0] >= count)
if (loadmodel->brush.numsubmodels)
loadmodel->brush.submodels = (dp_model_t **)Mem_Alloc(loadmodel->mempool, loadmodel->brush.numsubmodels * sizeof(dp_model_t *));
- // LordHavoc: to clear the fog around the original quake submodel code, I
+ // LadyHavoc: to clear the fog around the original quake submodel code, I
// will explain:
// first of all, some background info on the submodels:
// model 0 is the map model (the world, named maps/e1m1.bsp for example)
// the number i), at the end of the loop it duplicates the model to become
// the next submodel, and loops back to set up the new submodel.
- // LordHavoc: now the explanation of my sane way (which works identically):
+ // LadyHavoc: now the explanation of my sane way (which works identically):
// set up the world model, then on each submodel copy from the world model
// and set up the submodel with the respective model info.
totalstylesurfaces = 0;
datapointer = (unsigned char *)Mem_Alloc(mod->mempool, mod->num_surfaces * sizeof(int) + totalstyles * sizeof(model_brush_lightstyleinfo_t) + totalstylesurfaces * sizeof(int *));
for (i = 0;i < mod->brush.numsubmodels;i++)
{
- // LordHavoc: this code was originally at the end of this loop, but
+ // LadyHavoc: this code was originally at the end of this loop, but
// has been transformed to something more readable at the start here.
if (i > 0)
}
else
{
- // LordHavoc: empty submodel(lacrima.bsp has such a glitch)
+ // LadyHavoc: empty submodel(lacrima.bsp has such a glitch)
Con_Printf("warning: empty submodel *%i in %s\n", i+1, loadmodel->name);
}
//mod->brushq1.num_visleafs = bm->visleafs;
static void Mod_Q2BSP_LoadLighting(sizebuf_t *sb)
{
- // LordHavoc: this fits exactly the same format that we use in .lit files
+ // LadyHavoc: this fits exactly the same format that we use in .lit files
loadmodel->brushq1.lightdata = (unsigned char *)Mem_Alloc(loadmodel->mempool, sb->cursize);
MSG_ReadBytes(sb, sb->cursize, loadmodel->brushq1.lightdata);
}
SCR_PushLoadingScreen(true, mod->name, 1);
- // LordHavoc: unload the existing model in this slot (if there is one)
+ // LadyHavoc: unload the existing model in this slot (if there is one)
if (mod->loaded || mod->mempool)
Mod_UnloadModel(mod);
}
else if (crash)
{
- // LordHavoc: Sys_Error was *ANNOYING*
+ // LadyHavoc: Sys_Error was *ANNOYING*
Con_Printf ("Mod_LoadModel: %s not found\n", mod->name);
}
if (loadmodel->numframes < 1)
Host_Error ("Mod_Sprite_SharedSetup: Invalid # of frames: %d", loadmodel->numframes);
- // LordHavoc: hack to allow sprites to be non-fullbright
+ // LadyHavoc: hack to allow sprites to be non-fullbright
fullbright = true;
for (i = 0;i < MAX_QPATH && loadmodel->name[i];i++)
if (loadmodel->name[i] == '!')
loadmodel->sprite.sprnum_type = SPR_VP_PARALLEL;
loadmodel->synctype = ST_SYNC;
- // LordHavoc: hack to allow sprites to be non-fullbright
+ // LadyHavoc: hack to allow sprites to be non-fullbright
fullbright = true;
for (i = 0;i < MAX_QPATH && loadmodel->name[i];i++)
if (loadmodel->name[i] == '!')
/*
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 2002 Mathieu Olivier
-Copyright (C) 2003 Forest Hale
+Copyright (C) 2003 Ashley Rose Hale (LadyHavoc)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
{CVAR_SAVE, "sv_master2", "", "user-chosen master server 2"},
{CVAR_SAVE, "sv_master3", "", "user-chosen master server 3"},
{CVAR_SAVE, "sv_master4", "", "user-chosen master server 4"},
- {0, "sv_masterextra1", "ghdigital.com", "ghdigital.com - default master server 1 (admin: LordHavoc)"}, // admin: LordHavoc
+ {0, "sv_masterextra1", "ghdigital.com", "ghdigital.com - default master server 1 (admin: LadyHavoc)"}, // admin: LadyHavoc
{0, "sv_masterextra2", "dpmaster.deathmask.net", "dpmaster.deathmask.net - default master server 2 (admin: Willis)"}, // admin: Willis
{0, "sv_masterextra3", "dpmaster.tchr.no", "dpmaster.tchr.no - default master server 3 (admin: tChr)"}, // admin: tChr
{0, NULL, NULL, NULL}
conn->message.data = conn->messagedata;
conn->message.maxsize = sizeof(conn->messagedata);
conn->message.cursize = 0;
- // LordHavoc: (inspired by ProQuake) use a short connect timeout to
+ // LadyHavoc: (inspired by ProQuake) use a short connect timeout to
// reduce effectiveness of connection request floods
conn->timeout = realtime + net_connecttimeout.value;
LHNETADDRESS_ToString(&conn->peeraddress, conn->address, sizeof(conn->address), true);
if (developer_extra.integer)
Con_DPrintf("Datagram_ParseConnectionless: received CCREP_SERVER_INFO from %s.\n", addressstring2);
#ifdef CONFIG_MENU
- // LordHavoc: because the quake server may report weird addresses
+ // LadyHavoc: because the quake server may report weird addresses
// we just ignore it and keep the real address
MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring));
// search the cache for this server and update it
/*
Copyright (C) 1996-1997 Id Software, Inc.
-Copyright (C) 2003 Forest Hale
+Copyright (C) 2003 Ashley Rose Hale (LadyHavoc)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
/*
-Polygon clipping routines written by Forest Hale and placed into public domain.
+Polygon clipping routines written by Ashley Rose Hale (LadyHavoc) and placed into public domain.
*/
#include <math.h>
#define POLYGON_H
/*
-Polygon clipping routines written by Forest Hale and placed into public domain.
+Polygon clipping routines written by Ashley Rose Hale (LadyHavoc) and placed into public domain.
*/
void PolygonF_QuadForPlane(float *outpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float quadsize);
// baseline values
entity_state_t baseline;
- // LordHavoc: gross hack to make floating items still work
+ // LadyHavoc: gross hack to make floating items still work
int suspendedinairflag;
// cached position to avoid redundant SV_CheckWaterTransition calls on monsters
ddef_t *globaldefs;
mstatement_t *statements;
int entityfields; // number of vec_t fields in progs (some variables are 3)
- int entityfieldsarea; // LordHavoc: equal to max_edicts * entityfields (for bounds checking)
+ int entityfieldsarea; // LadyHavoc: equal to max_edicts * entityfields (for bounds checking)
// loaded values from the disk format
int progs_version;
{32, 32, 32},//unsigned char glowmod[3];
};
-// LordHavoc: I own protocol ranges 96, 97, 3500-3599
+// LadyHavoc: I own protocol ranges 96, 97, 3500-3599
struct protocolversioninfo_s
{
if (bits & U_VIEWMODEL) s.flags |= RENDER_VIEWMODEL;
if (bits & U_EXTERIORMODEL) s.flags |= RENDER_EXTERIORMODEL;
- // LordHavoc: to allow playback of the Nehahra movie
+ // LadyHavoc: to allow playback of the Nehahra movie
if (cls.protocol == PROTOCOL_NEHAHRAMOVIE && (bits & U_EXTEND1))
{
- // LordHavoc: evil format
+ // LadyHavoc: evil format
int i = (int)MSG_ReadFloat(&cl_message);
int j = (int)(MSG_ReadFloat(&cl_message) * 255.0f);
if (i == 2)
if (s->flags & RENDER_EXTERIORMODEL)
bits |= U_EXTERIORMODEL;
- // LordHavoc: old stuff, but rewritten to have more exact tolerances
+ // LadyHavoc: old stuff, but rewritten to have more exact tolerances
baseline = prog->edicts[s->number].priv.server->baseline;
if (baseline.origin[0] != s->origin[0])
bits |= U_ORIGIN1;
}
else
{
- // LordHavoc: have to write flags first, as they can modify protocol
+ // LadyHavoc: have to write flags first, as they can modify protocol
if (bits & E_FLAGS)
MSG_WriteByte(msg, ent->flags);
if (ent->flags & RENDER_LOWPRECISION)
#define EF_ADDITIVE 32
#define EF_BLUE 64
#define EF_RED 128
-#define EF_NOGUNBOB 256 // LordHavoc: when used with .viewmodelforclient this makes the entity attach to the view without gun bobbing and such effects, it also works on the player entity to disable gun bobbing of the engine-managed .viewmodel (without affecting any .viewmodelforclient entities attached to the player)
-#define EF_FULLBRIGHT 512 // LordHavoc: fullbright
-#define EF_FLAME 1024 // LordHavoc: on fire
-#define EF_STARDUST 2048 // LordHavoc: showering sparks
-#define EF_NOSHADOW 4096 // LordHavoc: does not cast a shadow
-#define EF_NODEPTHTEST 8192 // LordHavoc: shows through walls
-#define EF_SELECTABLE 16384 // LordHavoc: highlights when PRYDON_CLIENTCURSOR mouse is over it
+#define EF_NOGUNBOB 256 // LadyHavoc: when used with .viewmodelforclient this makes the entity attach to the view without gun bobbing and such effects, it also works on the player entity to disable gun bobbing of the engine-managed .viewmodel (without affecting any .viewmodelforclient entities attached to the player)
+#define EF_FULLBRIGHT 512 // LadyHavoc: fullbright
+#define EF_FLAME 1024 // LadyHavoc: on fire
+#define EF_STARDUST 2048 // LadyHavoc: showering sparks
+#define EF_NOSHADOW 4096 // LadyHavoc: does not cast a shadow
+#define EF_NODEPTHTEST 8192 // LadyHavoc: shows through walls
+#define EF_SELECTABLE 16384 // LadyHavoc: highlights when PRYDON_CLIENTCURSOR mouse is over it
#define EF_DOUBLESIDED 32768 //[515]: disable cull face for this entity
-#define EF_NOSELFSHADOW 65536 // LordHavoc: does not cast a shadow on itself (or any other EF_NOSELFSHADOW entities)
+#define EF_NOSELFSHADOW 65536 // LadyHavoc: does not cast a shadow on itself (or any other EF_NOSELFSHADOW entities)
#define EF_DYNAMICMODELLIGHT 131072
#define EF_UNUSED18 262144
#define EF_UNUSED19 524288
#define EF_RESTARTANIM_BIT 1048576 // div0: restart animation bit (like teleport bit, but lerps between end and start of the anim, and doesn't stop player lerping)
#define EF_TELEPORT_BIT 2097152 // div0: teleport bit (toggled when teleporting, prevents lerping when the bit has changed)
-#define EF_LOWPRECISION 4194304 // LordHavoc: entity is low precision (integer coordinates) to save network bandwidth (serverside only)
+#define EF_LOWPRECISION 4194304 // LadyHavoc: entity is low precision (integer coordinates) to save network bandwidth (serverside only)
#define EF_NOMODELFLAGS 8388608 // indicates the model's .effects should be ignored (allows overriding them)
#define EF_ROCKET 16777216 // leave a trail
#define EF_GRENADE 33554432 // leave a trail
#define U_ORIGIN2 (1<<2)
#define U_ORIGIN3 (1<<3)
#define U_ANGLE2 (1<<4)
-// LordHavoc: U_NOLERP was only ever used for monsters, so I renamed it U_STEP
+// LadyHavoc: U_NOLERP was only ever used for monsters, so I renamed it U_STEP
#define U_STEP (1<<5)
#define U_FRAME (1<<6)
// just differentiates from other updates
#define U_EFFECTS (1<<13)
#define U_LONGENTITY (1<<14)
-// LordHavoc: protocol extension
+// LadyHavoc: protocol extension
#define U_EXTEND1 (1<<15)
-// LordHavoc: first extend byte
+// LadyHavoc: first extend byte
#define U_DELTA (1<<16) // no data, while this is set the entity is delta compressed (uses previous frame as a baseline, meaning only things that have changed from the previous frame are sent, except for the forced full update every half second)
#define U_ALPHA (1<<17) // 1 byte, 0.0-1.0 maps to 0-255, not sent if exactly 1, and the entity is not sent if <=0 unless it has effects (model effects are checked as well)
#define U_SCALE (1<<18) // 1 byte, scale / 16 positive, not sent if 1.0
#define U_GLOWCOLOR (1<<21) // 1 byte, palette index, default is 254 (white), this IS used for darklight (allowing colored darklight), however the particles from a darklight are always black, not sent if default value (even if glowsize or glowtrail is set)
#define U_COLORMOD (1<<22) // 1 byte, 3 bit red, 3 bit green, 2 bit blue, this lets you tint an object artifically, so you could make a red rocket, or a blue fiend...
#define U_EXTEND2 (1<<23) // another byte to follow
-// LordHavoc: second extend byte
+// LadyHavoc: second extend byte
#define U_GLOWTRAIL (1<<24) // leaves a trail of particles (of color .glowcolor, or black if it is a negative glowsize)
#define U_VIEWMODEL (1<<25) // attachs the model to the view (origin and angles become relative to it), only shown to owner, a more powerful alternative to .weaponmodel and such
#define U_FRAME2 (1<<26) // 1 byte, this is .frame & 0xFF00 (second byte)
#define svc_hidelmp 36 // [string] slotname
#define svc_skybox 37 // [string] skyname
-// LordHavoc: my svc_ range, 50-69
+// LadyHavoc: my svc_ range, 50-69
#define svc_downloaddata 50 // [int] start [short] size
#define svc_updatestatubyte 51 // [byte] stat [byte] value
#define svc_effect 52 // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
#define clc_move 3 // [usercmd_t]
#define clc_stringcmd 4 // [string] message
-// LordHavoc: my clc_ range, 50-59
+// LadyHavoc: my clc_ range, 50-59
#define clc_ackframe 50 // [int] framenumber
#define clc_ackdownloaddata 51 // [int] start [short] size (note: exact echo of latest values received in svc_downloaddata, packet-loss handling is in the server)
#define clc_unusedlh2 52
#define TE_EXPLOSION3 16 // [vector] origin [coord] red [coord] green [coord] blue
#define TE_LIGHTNING4NEH 17 // [string] model [entity] entity [vector] start [vector] end
-// LordHavoc: added some TE_ codes (block1 - 50-60)
+// LadyHavoc: added some TE_ codes (block1 - 50-60)
#define TE_BLOOD 50 // [vector] origin [byte] xvel [byte] yvel [byte] zvel [byte] count
#define TE_SPARK 51 // [vector] origin [byte] xvel [byte] yvel [byte] zvel [byte] count
#define TE_BLOODSHOWER 52 // [vector] min [vector] max [coord] explosionspeed [short] count
#define TE_GUNSHOTQUAD 57 // [vector] origin
#define TE_SPIKEQUAD 58 // [vector] origin
#define TE_SUPERSPIKEQUAD 59 // [vector] origin
-// LordHavoc: block2 - 70-80
+// LadyHavoc: block2 - 70-80
#define TE_EXPLOSIONQUAD 70 // [vector] origin
#define TE_UNUSED1 71 // unused
#define TE_SMALLFLASH 72 // [vector] origin
#define TE_CUSTOMFLASH 73 // [vector] origin [byte] radius / 8 - 1 [byte] lifetime / 256 - 1 [byte] red [byte] green [byte] blue
#define TE_FLAMEJET 74 // [vector] origin [vector] velocity [byte] count
#define TE_PLASMABURN 75 // [vector] origin
-// LordHavoc: Tei grabbed these codes
+// LadyHavoc: Tei grabbed these codes
#define TE_TEI_G3 76 // [vector] start [vector] end [vector] angles
#define TE_TEI_SMOKE 77 // [vector] origin [vector] dir [byte] count
#define TE_TEI_BIGEXPLOSION 78 // [vector] origin
unsigned char tagindex;
unsigned char colormod[3];
unsigned char glowmod[3];
- // LordHavoc: very big data here :(
+ // LadyHavoc: very big data here :(
framegroupblend_t framegroupblend[4];
skeleton_t skeletonobject;
}
}
entityframe_database_t;
-// LordHavoc: these are in approximately sorted order, according to cost and
+// LadyHavoc: these are in approximately sorted order, according to cost and
// likelyhood of being used for numerous objects in a frame
// note that the bytes are not written/read in this order, this is only the
extern dllhandle_t ode_dll;
#endif
-// LordHavoc: changed this to NOT use a return statement, so that it can be used in functions that must return a value
+// LadyHavoc: changed this to NOT use a return statement, so that it can be used in functions that must return a value
void VM_Warning(prvm_prog_t *prog, const char *fmt, ...)
{
va_list argptr;
// TODO DONE: move vm_files and vm_fssearchlist to prvm_prog_t struct
// TODO: move vm_files and vm_fssearchlist back [9/13/2006 Black]
-// TODO: (move vm_files and vm_fssearchlist to prvm_prog_t struct again) [2007-01-23 LordHavoc]
-// TODO: will this war ever end? [2007-01-23 LordHavoc]
+// TODO: (move vm_files and vm_fssearchlist to prvm_prog_t struct again) [2007-01-23 LadyHavoc]
+// TODO: will this war ever end? [2007-01-23 LadyHavoc]
void VM_CheckEmptyString(prvm_prog_t *prog, const char *s)
{
framegroupblend[0].lerp = 1 - framegroupblend[1].lerp - framegroupblend[2].lerp - framegroupblend[3].lerp;
}
-// LordHavoc: quite tempting to break apart this function to reuse the
+// LadyHavoc: quite tempting to break apart this function to reuse the
// duplicated code, but I suspect it is better for performance
// this way
void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const dp_model_t *model, double curtime)
f = PRVM_G_INT(OFS_PARM1);
s = PRVM_G_STRING(OFS_PARM2);
- // LordHavoc: apparently BloodMage does a find(world, weaponmodel, "") and
+ // LadyHavoc: apparently BloodMage does a find(world, weaponmodel, "") and
// expects it to find all the monsters, so we must be careful to support
// searching for ""
entity findentity(entity start, .entity field, entity match)
=========
*/
-// LordHavoc: added this for searching float, int, and entity reference fields
+// LadyHavoc: added this for searching float, int, and entity reference fields
void VM_findfloat(prvm_prog_t *prog)
{
int e;
f = PRVM_G_INT(OFS_PARM0);
s = PRVM_G_STRING(OFS_PARM1);
- // LordHavoc: apparently BloodMage does a find(world, weaponmodel, "") and
+ // LadyHavoc: apparently BloodMage does a find(world, weaponmodel, "") and
// expects it to find all the monsters, so we must be careful to support
// searching for ""
entity findchainentity(.string field, entity match)
=========
*/
-// LordHavoc: chained search for float, int, and entity reference fields
+// LadyHavoc: chained search for float, int, and entity reference fields
// entity(.string field, float match) findchainfloat = #403;
void VM_findchainfloat(prvm_prog_t *prog)
{
entity findflags(entity start, .float field, float match)
========================
*/
-// LordHavoc: search for flags in float fields
+// LadyHavoc: search for flags in float fields
void VM_findflags(prvm_prog_t *prog)
{
prvm_int_t e;
entity findchainflags(.float field, float match)
========================
*/
-// LordHavoc: chained search for flags in float fields
+// LadyHavoc: chained search for flags in float fields
void VM_findchainflags(prvm_prog_t *prog)
{
prvm_int_t i;
void VM_min(prvm_prog_t *prog)
{
VM_SAFEPARMCOUNTRANGE(2, 8, VM_min);
- // LordHavoc: 3+ argument enhancement suggested by FrikaC
+ // LadyHavoc: 3+ argument enhancement suggested by FrikaC
if (prog->argc >= 3)
{
int i;
void VM_max(prvm_prog_t *prog)
{
VM_SAFEPARMCOUNTRANGE(2, 8, VM_max);
- // LordHavoc: 3+ argument enhancement suggested by FrikaC
+ // LadyHavoc: 3+ argument enhancement suggested by FrikaC
if (prog->argc >= 3)
{
int i;
=========
*/
//void(entity e, string s) clientcommand = #440; // executes a command string as if it came from the specified client
-//this function originally written by KrimZon, made shorter by LordHavoc
+//this function originally written by KrimZon, made shorter by LadyHavoc
void VM_clcommand (prvm_prog_t *prog)
{
client_t *temp_client;
=========
*/
//float(string s) tokenize = #441; // takes apart a string into individal words (access them with argv), returns how many
-//this function originally written by KrimZon, made shorter by LordHavoc
-//20040203: rewritten by LordHavoc (no longer uses allocations)
+//this function originally written by KrimZon, made shorter by LadyHavoc
+//20040203: rewritten by LadyHavoc (no longer uses allocations)
static int num_tokens = 0;
static int tokens[VM_STRINGTEMP_LENGTH / 2];
static int tokens_startpos[VM_STRINGTEMP_LENGTH / 2];
}
//string(float n) argv = #442; // returns a word from the tokenized string (returns nothing for an invalid index)
-//this function originally written by KrimZon, made shorter by LordHavoc
+//this function originally written by KrimZon, made shorter by LadyHavoc
void VM_argv (prvm_prog_t *prog)
{
int token_num;
prvm_eval_t prvm_badvalue; // used only for error returns
cvar_t prvm_language = {CVAR_SAVE, "prvm_language", "", "when set, loads PROGSFILE.LANGUAGENAME.po and common.LANGUAGENAME.po for string translations; when set to dump, PROGSFILE.pot is written from the strings in the progs"};
-// LordHavoc: prints every opcode as it executes - warning: this is significant spew
+// LadyHavoc: prints every opcode as it executes - warning: this is significant spew
cvar_t prvm_traceqc = {0, "prvm_traceqc", "0", "prints every QuakeC statement as it is executed (only for really thorough debugging!)"};
-// LordHavoc: counts usage of each QuakeC statement
+// LadyHavoc: counts usage of each QuakeC statement
cvar_t prvm_statementprofiling = {0, "prvm_statementprofiling", "0", "counts how many times each QuakeC statement has been executed, these counts are displayed in prvm_printfunction output (if enabled)"};
cvar_t prvm_timeprofiling = {0, "prvm_timeprofiling", "0", "counts how long each function has been executed, these counts are displayed in prvm_profile output (if enabled)"};
cvar_t prvm_coverage = {0, "prvm_coverage", "0", "report and count coverage events (1: per-function, 2: coverage() builtin, 4: per-statement)"};
dpsnprintf (line, linelength, "void");
break;
case ev_float:
- // LordHavoc: changed from %5.1f to %10.4f
+ // LadyHavoc: changed from %5.1f to %10.4f
dpsnprintf (line, linelength, FLOAT_LOSSLESS_FORMAT, val->_float);
break;
case ev_vector:
- // LordHavoc: changed from %5.1f to %10.4f
+ // LadyHavoc: changed from %5.1f to %10.4f
dpsnprintf (line, linelength, "'" VECTOR_LOSSLESS_FORMAT "'", val->vector[0], val->vector[1], val->vector[2]);
break;
case ev_pointer:
For debugging
=============
*/
-// LordHavoc: optimized this to print out much more quickly (tempstring)
-// LordHavoc: changed to print out every 4096 characters (incase there are a lot of fields to print)
+// LadyHavoc: optimized this to print out much more quickly (tempstring)
+// LadyHavoc: changed to print out every 4096 characters (incase there are a lot of fields to print)
void PRVM_ED_Print(prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname)
{
size_t l;
prog->numfielddefs++;
}
- // LordHavoc: TODO: reorder globals to match engine struct
- // LordHavoc: TODO: reorder fields to match engine struct
+ // LadyHavoc: TODO: reorder globals to match engine struct
+ // LadyHavoc: TODO: reorder fields to match engine struct
#define remapglobal(index) (index)
#define remapfield(index) (index)
// copy globals
- // FIXME: LordHavoc: this uses a crude way to identify integer constants, rather than checking for matching globaldefs and checking their type
+ // FIXME: LadyHavoc: this uses a crude way to identify integer constants, rather than checking for matching globaldefs and checking their type
for (i = 0;i < prog->progs_numglobals;i++)
{
u.i = LittleLong(inglobals[i]);
}
}
- // LordHavoc: TODO: support 32bit progs statement formats
+ // LadyHavoc: TODO: support 32bit progs statement formats
// copy, remap globals in statements, bounds check
for (i = 0;i < prog->progs_numstatements;i++)
{
prog->leaktest_active = prvm_leaktest.integer != 0;
}
-// LordHavoc: turned PRVM_EDICT_NUM into a #define for speed reasons
+// LadyHavoc: turned PRVM_EDICT_NUM into a #define for speed reasons
unsigned int PRVM_EDICT_NUM_ERROR(prvm_prog_t *prog, unsigned int n, const char *filename, int fileline)
{
prog->error_cmd("PRVM_EDICT_NUM: %s: bad number %i (called at %s:%i)", prog->name, n, filename, fileline);
}
DISPATCH_OPCODE();
-// LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
+// LadyHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
/*
HANDLE_OPCODE(OP_ADD_I):
OPC->_int = OPA->_int + OPB->_int;
typedef long long dpint64;
typedef unsigned long long dpuint64;
-// LordHavoc: upgrade the prvm to double precision for better time values
-// LordHavoc: to be enabled when bugs are worked out...
+// LadyHavoc: upgrade the prvm to double precision for better time values
+// LadyHavoc: to be enabled when bugs are worked out...
#define PRVM_64
#ifdef PRVM_64
typedef double prvm_vec_t;
return R_LoadSkyBox();
}
-// LordHavoc: added LoadSky console command
+// LadyHavoc: added LoadSky console command
static void LoadSky_f (void)
{
switch (Cmd_Argc())
break;
}
- // LordHavoc: interpolated sprite rendering
+ // LadyHavoc: interpolated sprite rendering
for (i = 0;i < MAX_FRAMEBLENDS;i++)
{
if (ent->frameblend[i].lerp >= 0.01f)
static void Sbar_DrawScoreboard (void)
{
Sbar_SoloScoreboard ();
- // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ // LadyHavoc: changed to draw the deathmatch overlays in any multiplayer mode
//if (cl.gametype == GAME_DEATHMATCH)
if (!cl.islocalgame)
Sbar_DeathmatchOverlay ();
{
sbar_x = (vid_conwidth.integer - 320)/2;
sbar_y = vid_conheight.integer - SBAR_HEIGHT;
- // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ // LadyHavoc: changed to draw the deathmatch overlays in any multiplayer mode
//if (cl.gametype == GAME_DEATHMATCH && gamemode != GAME_TRANSFUSION)
if (sb_lines > 24)
Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
- // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ // LadyHavoc: changed to draw the deathmatch overlays in any multiplayer mode
if ((!cl.islocalgame || cl.gametype != GAME_COOP))
{
if (gamemode == GAME_TRANSFUSION)
char worldnamenoextension[MAX_QPATH]; // maps/%s
struct model_s *worldmodel;
// NULL terminated
- // LordHavoc: precaches are now MAX_QPATH rather than a pointer
+ // LadyHavoc: precaches are now MAX_QPATH rather than a pointer
// updated by SV_ModelIndex
char model_precache[MAX_MODELS][MAX_QPATH];
struct model_s *models[MAX_MODELS];
// NULL terminated
- // LordHavoc: precaches are now MAX_QPATH rather than a pointer
+ // LadyHavoc: precaches are now MAX_QPATH rather than a pointer
// updated by SV_SoundIndex
char sound_precache[MAX_SOUNDS][MAX_QPATH];
char lightstyles[MAX_LIGHTSTYLES][64];
unsigned char reliable_datagram_buf[NET_MAXMESSAGE];
sizebuf_t signon;
- /// LordHavoc: increased signon message buffer from 8192
+ /// LadyHavoc: increased signon message buffer from 8192
unsigned char signon_buf[NET_MAXMESSAGE];
/// connection flood blocking
/// ping_times[num_pings%NUM_PING_TIMES]
int num_pings;
#endif
- /// LordHavoc: can be used for prediction or whatever...
+ /// LadyHavoc: can be used for prediction or whatever...
float ping;
/// this is used by sv_clmovement_minping code
#define SOLID_BBOX 2 ///< touch on edge, block
#define SOLID_SLIDEBOX 3 ///< touch on edge, but not an onground
#define SOLID_BSP 4 ///< bsp clip, touch on edge, block
-// LordHavoc: corpse code
+// LadyHavoc: corpse code
#define SOLID_CORPSE 5 ///< same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
-// LordHavoc: physics
+// LadyHavoc: physics
// VorteX: now these fields are deprecated, as geomtype is more flexible
#define SOLID_PHYSICS_BOX 32 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
#define SOLID_PHYSICS_SPHERE 33 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
"// ambient+diffuse+specular+normalmap+attenuation+cubemap+fog shader\n",
-"// written by Forest 'LordHavoc' Hale\n",
+"// written by Ashley Rose Hale (LadyHavoc)\n",
"// shadowmapping enhancements by Lee 'eihrul' Salzman\n",
"\n",
"#if defined(USESKELETAL) || defined(USEOCCLUDE)\n",
"\n",
"#ifdef VERTEX_SHADER\n",
"#ifdef USETRIPPY\n",
-"// LordHavoc: based on shader code linked at: http://www.youtube.com/watch?v=JpksyojwqzE\n",
+"// LadyHavoc: based on shader code linked at: http://www.youtube.com/watch?v=JpksyojwqzE\n",
"// tweaked scale\n",
"uniform highp float ClientTime;\n",
"vec4 TrippyVertex(vec4 position)\n",
}
#if 0
- // LordHavoc: now you can with the resampler...
+ // LadyHavoc: now you can with the resampler...
// You can't change sound speed after start time (not yet supported)
if (prev_render_format.speed != 0)
{
ch->mixspeed = mixspeed;
// anything coming from the view entity will always be full volume
- // LordHavoc: make sounds with ATTN_NONE have no spatialization
+ // LadyHavoc: make sounds with ATTN_NONE have no spatialization
if (ch->entnum == cl.viewentity || ch->entnum == CL_VM_GetViewEntity() || ch->distfade == 0)
{
ch->prologic_invert = 1;
SCR_PushLoadingScreen(true, sfx->name, 1);
- // LordHavoc: if the sound filename does not begin with sound/, try adding it
+ // LadyHavoc: if the sound filename does not begin with sound/, try adding it
if (strncasecmp(sfx->name, "sound/", 6))
{
dpsnprintf (namebuffer, sizeof(namebuffer), "sound/%s", sfx->name);
}
}
- // LordHavoc: then try without the added sound/ as wav and ogg
+ // LadyHavoc: then try without the added sound/ as wav and ogg
dpsnprintf (namebuffer, sizeof(namebuffer), "%s", sfx->name);
len = strlen(namebuffer);
// request foo.wav: tries foo.wav, then foo.ogg
ret = qov_pcm_seek(&per_ch->vf, (ogg_int64_t)firstsampleframe);
if (ret != 0)
{
- // LordHavoc: we can't Con_Printf here, not thread safe...
+ // LadyHavoc: we can't Con_Printf here, not thread safe...
//Con_Printf("OGG_FetchSound: qov_pcm_seek(..., %d) returned %d\n", firstsampleframe, ret);
return;
}
Cvar_RegisterVariable (&scratch4);
Cvar_RegisterVariable (&temp1);
- // LordHavoc: Nehahra uses these to pass data around cutscene demos
+ // LadyHavoc: Nehahra uses these to pass data around cutscene demos
Cvar_RegisterVariable (&nehx00);
Cvar_RegisterVariable (&nehx01);
Cvar_RegisterVariable (&nehx02);
client->weaponmodel[0] = 0;
client->weaponmodelindex = 0;
- // LordHavoc: clear entityframe tracking
+ // LadyHavoc: clear entityframe tracking
client->latestframenum = 0;
// initialize the movetime, so a speedhack can't make use of the time before this client joined
effects = (unsigned)PRVM_serveredictfloat(ent, effects);
// we can omit invisible entities with no effects that are not clients
- // LordHavoc: this could kill tags attached to an invisible entity, I
+ // LadyHavoc: this could kill tags attached to an invisible entity, I
// just hope we never have to support that case
i = (int)PRVM_serveredictfloat(ent, modelindex);
modelindex = (i >= 1 && i < MAX_MODELS && PRVM_serveredictstring(ent, model) && *PRVM_GetString(prog, PRVM_serveredictstring(ent, model)) && sv.models[i]) ? i : 0;
return;
if (s->effects & EF_NODRAW)
return;
- // LordHavoc: only send entities with a model or important effects
+ // LadyHavoc: only send entities with a model or important effects
if (!s->modelindex && s->specialvisibilityradius == 0)
return;
sv.writeentitiestoclient_numeyes = 0;
// get eye location
- sv.writeentitiestoclient_cliententitynumber = PRVM_EDICT_TO_PROG(clent); // LordHavoc: for comparison purposes
+ sv.writeentitiestoclient_cliententitynumber = PRVM_EDICT_TO_PROG(clent); // LadyHavoc: for comparison purposes
camera = PRVM_EDICT_NUM( client->clientcamera );
VectorAdd(PRVM_serveredictvector(camera, origin), PRVM_serveredictvector(clent, view_ofs), eye);
sv.writeentitiestoclient_pvsbytes = 0;
int i, entnum, large;
prvm_edict_t *svent;
- // LordHavoc: clear *all* baselines (not just active ones)
+ // LadyHavoc: clear *all* baselines (not just active ones)
for (entnum = 0;entnum < prog->max_edicts;entnum++)
{
// get the current server version
svent = PRVM_EDICT_NUM(entnum);
- // LordHavoc: always clear state values, whether the entity is in use or not
+ // LadyHavoc: always clear state values, whether the entity is in use or not
svent->priv.server->baseline = defaultstate;
if (svent->priv.server->free)
//
if (coop.integer)
Cvar_SetValue ("deathmatch", 0);
- // LordHavoc: it can be useful to have skills outside the range 0-3...
+ // LadyHavoc: it can be useful to have skills outside the range 0-3...
//current_skill = bound(0, (int)(skill.value + 0.5), 3);
//Cvar_SetValue ("skill", (float)current_skill);
current_skill = (int)(skill.value + 0.5);
PRVM_ED_LoadFromFile(prog, sv.worldmodel->brush.entities);
- // LordHavoc: clear world angles (to fix e3m3.bsp)
+ // LadyHavoc: clear world angles (to fix e3m3.bsp)
VectorClear(PRVM_serveredictvector(prog->edicts, angles));
// all setup is completed, any further precache statements are errors
-// sv.state = ss_active; // LordHavoc: workaround for svc_precache bug
+// sv.state = ss_active; // LadyHavoc: workaround for svc_precache bug
prog->allowworldwrites = false;
// run two frames to allow everything to settle
if (sv.protocol == PROTOCOL_QUAKE || sv.protocol == PROTOCOL_QUAKEDP || sv.protocol == PROTOCOL_NEHAHRAMOVIE || sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3)
SV_CreateBaseline ();
- sv.state = ss_active; // LordHavoc: workaround for svc_precache bug
+ sv.state = ss_active; // LadyHavoc: workaround for svc_precache bug
// send serverinfo to all connected clients, and set up botclients coming back from a level change
for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
static void SVVM_init_edict(prvm_prog_t *prog, prvm_edict_t *e)
{
- // LordHavoc: for consistency set these here
+ // LadyHavoc: for consistency set these here
int num = PRVM_NUM_FOR_EDICT(e) - 1;
e->priv.server->move = false; // don't move on first frame
if(advancetime > 0)
{
- offset = sv_timer + (Sys_DirtyTime() - sv_realtime); // LordHavoc: FIXME: I don't understand this line
+ offset = sv_timer + (Sys_DirtyTime() - sv_realtime); // LadyHavoc: FIXME: I don't understand this line
++svs.perf_acc_offset_samples;
svs.perf_acc_offset += offset;
svs.perf_acc_offset_squared += offset * offset;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
if (type == MOVE_MISSILE)
{
- // LordHavoc: modified this, was = -15, now -= 15
+ // LadyHavoc: modified this, was = -15, now -= 15
for (i = 0;i < 3;i++)
{
clipmins2[i] -= 15;
vec3_t paddedmins, paddedmaxs;
if (maxedicts < 1 || resultedicts == NULL)
return 0;
- // LordHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
+ // LadyHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
//VectorSet(paddedmins, mins[0] - 10, mins[1] - 10, mins[2] - 1);
//VectorSet(paddedmaxs, maxs[0] + 10, maxs[1] + 10, maxs[2] + 1);
VectorCopy(mins, paddedmins);
}
}
- // LordHavoc: a hack to ensure that the (rather silly) id1 quakec
+ // LadyHavoc: a hack to ensure that the (rather silly) id1 quakec
// player_run/player_stand1 does not horribly malfunction if the
// velocity becomes a denormalized float
if (VectorLength2(PRVM_serveredictvector(ent, velocity)) < 0.0000001)
VectorClear(PRVM_serveredictvector(ent, velocity));
- // LordHavoc: max velocity fix, inspired by Maddes's source fixes, but this is faster
+ // LadyHavoc: max velocity fix, inspired by Maddes's source fixes, but this is faster
wishspeed = DotProduct(PRVM_serveredictvector(ent, velocity), PRVM_serveredictvector(ent, velocity));
if (wishspeed > sv_maxvelocity.value * sv_maxvelocity.value)
{
break;
}
CrossProduct(planes[0], planes[1], dir);
- // LordHavoc: thanks to taniwha of QuakeForge for pointing out this fix for slowed falling in corners
+ // LadyHavoc: thanks to taniwha of QuakeForge for pointing out this fix for slowed falling in corners
VectorNormalize(dir);
d = DotProduct(dir, PRVM_serveredictvector(ent, velocity));
VectorScale(dir, d, PRVM_serveredictvector(ent, velocity));
/*
if ((blocked & 1) == 0 && bumpcount > 1)
{
- // LordHavoc: fix the 'fall to your death in a wedge corner' glitch
+ // LadyHavoc: fix the 'fall to your death in a wedge corner' glitch
// flag ONGROUND if there's ground under it
trace = SV_TraceBox(PRVM_serveredictvector(ent, origin), PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), end, MOVE_NORMAL, ent, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask);
}
*/
- // LordHavoc: this came from QW and allows you to get out of water more easily
+ // LadyHavoc: this came from QW and allows you to get out of water more easily
if (sv_gameplayfix_easierwaterjump.integer && ((int)PRVM_serveredictfloat(ent, flags) & FL_WATERJUMP) && !(blocked & 8))
VectorCopy(primal_velocity, PRVM_serveredictvector(ent, velocity));
switch ((int) PRVM_serveredictfloat(pusher, solid))
{
- // LordHavoc: valid pusher types
+ // LadyHavoc: valid pusher types
case SOLID_BSP:
case SOLID_BBOX:
case SOLID_SLIDEBOX:
- case SOLID_CORPSE: // LordHavoc: this would be weird...
+ case SOLID_CORPSE: // LadyHavoc: this would be weird...
break;
- // LordHavoc: no collisions
+ // LadyHavoc: no collisions
case SOLID_NOT:
case SOLID_TRIGGER:
VectorMA (PRVM_serveredictvector(pusher, origin), movetime, PRVM_serveredictvector(pusher, velocity), PRVM_serveredictvector(pusher, origin));
// this has been disabled so that you can't jump when you are stepping
// up while already jumping (also known as the Quake2 double jump bug)
#if 0
- // LordHavoc: disabled this check so you can walk on monsters/players
+ // LadyHavoc: disabled this check so you can walk on monsters/players
//if (PRVM_serveredictfloat(ent, solid) == SOLID_BSP)
{
//Con_Printf("onground\n");
vec3_t vf, vr, vu, angles, v;
prvm_edict_t *e;
- // LordHavoc: implemented rotation on MOVETYPE_FOLLOW objects
+ // LadyHavoc: implemented rotation on MOVETYPE_FOLLOW objects
e = PRVM_PROG_TO_EDICT(PRVM_serveredictedict(ent, aiment));
if (PRVM_serveredictvector(e, angles)[0] == PRVM_serveredictvector(ent, punchangle)[0] && PRVM_serveredictvector(e, angles)[1] == PRVM_serveredictvector(ent, punchangle)[1] && PRVM_serveredictvector(e, angles)[2] == PRVM_serveredictvector(ent, punchangle)[2])
{
{
vec3_t entorigin;
prvm_prog_t *prog = SVVM_prog;
- // LordHavoc: bugfixes in this function are keyed to the sv_gameplayfix_bugfixedcheckwatertransition cvar - if this cvar is 0 then all the original bugs should be reenabled for compatibility
+ // LadyHavoc: bugfixes in this function are keyed to the sv_gameplayfix_bugfixedcheckwatertransition cvar - if this cvar is 0 then all the original bugs should be reenabled for compatibility
int cont;
VectorCopy(PRVM_serveredictvector(ent, origin), entorigin);
cont = Mod_Q1BSP_NativeContentsFromSuperContents(SV_PointSuperContents(entorigin));
ent_gravity = PRVM_serveredictfloat(ent, gravity);
if (!ent_gravity)
ent_gravity = 1.0f;
- // LordHavoc: fixed grenades not bouncing when fired down a slope
+ // LadyHavoc: fixed grenades not bouncing when fired down a slope
if (sv_gameplayfix_grenadebouncedownslopes.integer)
d = fabs(DotProduct(trace.plane.normal, PRVM_serveredictvector(ent, velocity)));
else
SV_Physics_Pusher (ent);
break;
case MOVETYPE_NONE:
- // LordHavoc: manually inlined the thinktime check here because MOVETYPE_NONE is used on so many objects
+ // LadyHavoc: manually inlined the thinktime check here because MOVETYPE_NONE is used on so many objects
if (PRVM_serveredictfloat(ent, nextthink) > 0 && PRVM_serveredictfloat(ent, nextthink) <= sv.time + sv.frametime)
SV_RunThink (ent);
break;
SV_Physics_Pusher (ent);
break;
case MOVETYPE_NONE:
- // LordHavoc: manually inlined the thinktime check here because MOVETYPE_NONE is used on so many objects
+ // LadyHavoc: manually inlined the thinktime check here because MOVETYPE_NONE is used on so many objects
if (PRVM_serveredictfloat(ent, nextthink) > 0 && PRVM_serveredictfloat(ent, nextthink) <= sv.time + sv.frametime)
SV_RunThink (ent);
break;
if (PRVM_serverglobalfloat(force_retouch) > 0)
PRVM_serverglobalfloat(force_retouch) = max(0, PRVM_serverglobalfloat(force_retouch) - 1);
- // LordHavoc: endframe support
+ // LadyHavoc: endframe support
if (PRVM_serverfunction(EndFrame))
{
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(prog->edicts);
vec3_t wishvel;
float fmove, smove, temp;
- // LordHavoc: correct quake movement speed bug when looking up/down
+ // LadyHavoc: correct quake movement speed bug when looking up/down
wishvel[0] = wishvel[2] = 0;
wishvel[1] = PRVM_serveredictvector(host_client->edict, angles)[1];
AngleVectors (wishvel, forward, right, up);
// make sure the velocity is sane (not a NaN)
SV_CheckVelocity(host_client->edict);
- // LordHavoc: QuakeC replacement for SV_ClientThink (player movement)
+ // LadyHavoc: QuakeC replacement for SV_ClientThink (player movement)
if (PRVM_serverfunction(SV_PlayerPhysics) && sv_playerphysicsqc.integer)
{
PRVM_serverglobalfloat(time) = sv.time;
-// Shadow Volume BSP code written by Forest "LordHavoc" Hale on 2003-11-06 and placed into public domain.
-// Modified by LordHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25
-// Optimized by LordHavoc on 2009-12-24 and 2009-12-25
+// Shadow Volume BSP code written by Ashley Rose Hale (LadyHavoc) on 2003-11-06 and placed into public domain.
+// Modified by LadyHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25
+// Optimized by LadyHavoc on 2009-12-24 and 2009-12-25
#include <math.h>
#include <string.h>
-// Shadow Volume BSP code written by Forest "LordHavoc" Hale on 2003-11-06 and placed into public domain.
-// Modified by LordHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25
+// Shadow Volume BSP code written by Ashley Rose Hale (LadyHavoc) on 2003-11-06 and placed into public domain.
+// Modified by LadyHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25
#ifndef SVBSP_H
#define SVBSP_H
VM_SV_setsize
the size box is rotated by the current angle
-LordHavoc: no it isn't...
+LadyHavoc: no it isn't...
setsize (entity, minvector, maxvector)
=================
VM_VarString(prog, 1, string, sizeof(string));
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
- // LordHavoc: div0 requested that sprintto world operate like print
+ // LadyHavoc: div0 requested that sprintto world operate like print
if (entnum == 0)
{
Con_Print(string);
}
else
{
- // LordHavoc: we only let the qc set certain flags, others are off-limits
+ // LadyHavoc: we only let the qc set certain flags, others are off-limits
flags = (int)PRVM_G_FLOAT(OFS_PARM6) & (CHANNELFLAG_RELIABLE | CHANNELFLAG_FORCELOOP | CHANNELFLAG_PAUSED | CHANNELFLAG_FULLVOLUME);
}
tracebox (vector1, vector mins, vector maxs, vector2, tryents)
=================
*/
-// LordHavoc: added this for my own use, VERY useful, similar to traceline
+// LadyHavoc: added this for my own use, VERY useful, similar to traceline
static void VM_SV_tracebox(prvm_prog_t *prog)
{
vec3_t v1, v2, m1, m2;
gravity = 1.0f;
gravity *= sv_gravity.value * 0.025;
- for (i = 0;i < 200;i++) // LordHavoc: sanity check; never trace more than 10 seconds
+ for (i = 0;i < 200;i++) // LadyHavoc: sanity check; never trace more than 10 seconds
{
SV_CheckVelocity (tossent);
PRVM_serveredictvector(tossent, velocity)[2] -= gravity;
// (note: this is the reason you can't blow up fallen zombies)
if (PRVM_serveredictfloat(ent, solid) == SOLID_NOT && !sv_gameplayfix_blowupfallenzombies.integer)
continue;
- // LordHavoc: compare against bounding box rather than center so it
+ // LadyHavoc: compare against bounding box rather than center so it
// doesn't miss large objects, and use DotProduct instead of Length
// for a major speedup
VectorSubtract(org, PRVM_serveredictvector(ent, origin), eorg);
}
//void(entity e, string s) clientcommand = #440; // executes a command string as if it came from the specified client
-//this function originally written by KrimZon, made shorter by LordHavoc
+//this function originally written by KrimZon, made shorter by LadyHavoc
static void VM_SV_clientcommand(prvm_prog_t *prog)
{
client_t *temp_client;
if (PRVM_serveredictfloat(ent, health) > 0 && cl_bob.value && cl_bobcycle.value)
{
double bob, cycle;
- // LordHavoc: this code is *weird*, but not replacable (I think it
+ // LadyHavoc: this code is *weird*, but not replacable (I think it
// should be done in QC on the server, but oh well, quake is quake)
- // LordHavoc: figured out bobup: the time at which the sin is at 180
+ // LadyHavoc: figured out bobup: the time at which the sin is at 180
// degrees (which allows lengthening or squishing the peak or valley)
cycle = sv.time/cl_bobcycle.value;
cycle -= (int)cycle;
NULL, // #397
NULL, // #398
NULL, // #399
-// LordHavoc's range #400-#499
+// LadyHavoc's range #400-#499
VM_SV_copyentity, // #400 void(entity from, entity to) copyentity (DP_QC_COPYENTITY)
VM_SV_setcolor, // #401 void(entity ent, float colors) setcolor (DP_QC_SETCOLOR)
VM_findchain, // #402 entity(.string fld, string match) findchain (DP_QC_FINDCHAIN)
#if HAVE_QUERYPERFORMANCECOUNTER
if (sys_usequeryperformancecounter.integer)
{
- // LordHavoc: note to people modifying this code, DWORD is specifically defined as an unsigned 32bit number, therefore the 65536.0 * 65536.0 is fine.
+ // LadyHavoc: note to people modifying this code, DWORD is specifically defined as an unsigned 32bit number, therefore the 65536.0 * 65536.0 is fine.
// QueryPerformanceCounter
// platform:
// Windows 95/98/ME/NT/2000/XP
houtput = GetStdHandle (STD_OUTPUT_HANDLE);
hinput = GetStdHandle (STD_INPUT_HANDLE);
- // LordHavoc: can't check cls.state because it hasn't been initialized yet
+ // LadyHavoc: can't check cls.state because it hasn't been initialized yet
// if (cls.state == ca_dedicated)
if (COM_CheckParm("-dedicated"))
{
- //if ((houtput == 0) || (houtput == INVALID_HANDLE_VALUE)) // LordHavoc: on Windows XP this is never 0 or invalid, but hinput is invalid
+ //if ((houtput == 0) || (houtput == INVALID_HANDLE_VALUE)) // LadyHavoc: on Windows XP this is never 0 or invalid, but hinput is invalid
{
if (!AllocConsole ())
Sys_Error ("Couldn't create dedicated server console (error code %x)", (unsigned int)GetLastError());
Cvar_SetQuick(&gl_info_platform, gl_platform ? gl_platform : "");
Cvar_SetQuick(&gl_info_driver, gl_driver);
- // LordHavoc: report supported extensions
+ // LadyHavoc: report supported extensions
#ifdef CONFIG_MENU
Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions);
#else
float in_mouse_x, in_mouse_y;
float in_windowmouse_x, in_windowmouse_y;
-// LordHavoc: if window is hidden, don't update screen
+// LadyHavoc: if window is hidden, don't update screen
qboolean vid_hidden = true;
-// LordHavoc: if window is not the active window, don't hog as much CPU time,
+// LadyHavoc: if window is not the active window, don't hog as much CPU time,
// let go of the mouse, turn off sound, and restore system gamma ramps...
qboolean vid_activewindow = true;
ramps[i] = (int)floor(bound(0.0f, Image_sRGBFloatFromLinearFloat(ramps[i] / 65535.0f), 1.0f) * 65535.0f + 0.5f);
}
- // LordHavoc: this code came from Ben Winslow and Zinx Verituse, I have
+ // LadyHavoc: this code came from Ben Winslow and Zinx Verituse, I have
// immensely butchered it to work with variable framerates and fit in with
// the rest of darkplaces.
//
bob_limit *= min(trace1fraction, trace2fraction);
}
- // LordHavoc: this code is *weird*, but not replacable (I think it
+ // LadyHavoc: this code is *weird*, but not replacable (I think it
// should be done in QC on the server, but oh well, quake is quake)
- // LordHavoc: figured out bobup: the time at which the sin is at 180
+ // LadyHavoc: figured out bobup: the time at which the sin is at 180
// degrees (which allows lengthening or squishing the peak or valley)
cycle = cl.time / cl_bobcycle.value;
cycle -= (int) cycle;
cl.cshifts[CSHIFT_VCSHIFT].destcolor[2] = v_cshift.destcolor[2];
cl.cshifts[CSHIFT_VCSHIFT].percent = v_cshift.percent;
- // LordHavoc: fixed V_CalcBlend
+ // LadyHavoc: fixed V_CalcBlend
for (j = 0;j < NUM_CSHIFTS;j++)
{
a2 = bound(0.0f, cl.cshifts[j].percent * (1.0f / 255.0f), 1.0f);
if (prog == NULL || prog->num_edicts < 1)
return 0;
- // LordHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
+ // LadyHavoc: discovered this actually causes its own bugs (dm6 teleporters being too close to info_teleport_destination)
//VectorSet(paddedmins, requestmins[0] - 1.0f, requestmins[1] - 1.0f, requestmins[2] - 1.0f);
//VectorSet(paddedmaxs, requestmaxs[0] + 1.0f, requestmaxs[1] + 1.0f, requestmaxs[2] + 1.0f);
VectorCopy(requestmins, paddedmins);
cvar_t physics_ode = {0, "physics_ode", "0", "run ODE physics (VERY experimental and potentially buggy)"};
-// LordHavoc: this large chunk of definitions comes from the ODE library
+// LadyHavoc: this large chunk of definitions comes from the ODE library
// include files.
#ifdef LINK_TO_LIBODE
# define FILE_BACKED_MALLOC 0
#endif
-// LordHavoc: enables our own low-level allocator (instead of malloc)
+// LadyHavoc: enables our own low-level allocator (instead of malloc)
#ifndef MEMCLUMPING
# define MEMCLUMPING 0
#endif