#include "quakedef.h"
-char *svc_strings[] =
+char *svc_strings[128] =
{
"svc_bad",
"svc_nop",
// parse protocol version number
i = MSG_ReadLong ();
- if (i != PROTOCOL_VERSION && i != 250)
+ if (i != PROTOCOL_VERSION && i != DPPROTOCOL_VERSION && i != 250)
{
- Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION);
+ Con_Printf ("Server returned version %i, not %i or %i", i, DPPROTOCOL_VERSION, PROTOCOL_VERSION);
return;
}
Nehahrademcompatibility = false;
{
int cmd;
int i;
+ byte cmdlog[32];
+ char *cmdlogname[32];
+ int cmdindex, cmdcount = 0;
//
// if recording demos, copy the message out
return; // end of message
}
- // if the high bit of the command byte is set, it is a fast update
+ cmdindex = cmdcount & 31;
+ cmdcount++;
+ cmdlog[cmdindex] = cmd;
+
+ // if the high bit of the command byte is set, it is a fast update
if (cmd & 128)
{
+ cmdlogname[cmdindex] = &("svc_entity");
SHOWNET("fast update");
CL_ParseUpdate (cmd&127);
continue;
}
SHOWNET(svc_strings[cmd]);
+ cmdlogname[cmdindex] = svc_strings[cmd];
+ if (!cmdlogname[cmdindex])
+ cmdlogname[cmdindex] = &("<unknown>");
- // other commands
+ // other commands
switch (cmd)
{
default:
- Host_Error ("CL_ParseServerMessage: Illegible server message\n");
+ {
+ char description[32*64], temp[64];
+ int count;
+ strcpy(description, "packet dump: ");
+ i = cmdcount - 32;
+ if (i < 0)
+ i = 0;
+ count = cmdcount - i;
+ i &= 31;
+ while(count > 0)
+ {
+ sprintf(temp, "%3i:%s ", cmdlog[i], cmdlogname[i]);
+ strcat(description, temp);
+ count--;
+ i++;
+ i &= 31;
+ }
+ description[strlen(description)-1] = '\n'; // replace the last space with a newline
+ Con_Printf(description);
+ Host_Error ("CL_ParseServerMessage: Illegible server message\n");
+ }
break;
case svc_nop:
break;
case svc_setpause:
- {
- cl.paused = MSG_ReadByte ();
-
- if (cl.paused)
- CDAudio_Pause ();
- else
- CDAudio_Resume ();
- }
+ cl.paused = MSG_ReadByte ();
+ if (cl.paused)
+ CDAudio_Pause ();
+ else
+ CDAudio_Resume ();
break;
case svc_signonnum:
#include "quakedef.h"
+#define MSG_ReadVector(v) {(v)[0] = MSG_ReadCoord();(v)[1] = MSG_ReadCoord();(v)[2] = MSG_ReadCoord();}
+
cvar_t r_glowinglightning = {"r_glowinglightning", "1", true};
int num_temp_entities;
int i;
ent = MSG_ReadShort ();
-
- start[0] = MSG_ReadCoord ();
- start[1] = MSG_ReadCoord ();
- start[2] = MSG_ReadCoord ();
-
- end[0] = MSG_ReadCoord ();
- end[1] = MSG_ReadCoord ();
- end[2] = MSG_ReadCoord ();
+ MSG_ReadVector(start);
+ MSG_ReadVector(end);
// override any beam with the same entity
for (i=0, b=cl_beams ; i< MAX_BEAMS ; i++, b++)
switch (type)
{
case TE_WIZSPIKE: // spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
R_RunParticleEffect (pos, vec3_origin, 20, 30);
S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
break;
case TE_KNIGHTSPIKE: // spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
R_RunParticleEffect (pos, vec3_origin, 226, 20);
S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
break;
case TE_SPIKE: // spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
// LordHavoc: changed to spark shower
R_SparkShower(pos, vec3_origin, 15);
//R_RunParticleEffect (pos, vec3_origin, 0, 10);
}
break;
case TE_SPIKEQUAD: // quad spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
// LordHavoc: changed to spark shower
R_SparkShower(pos, vec3_origin, 15);
//R_RunParticleEffect (pos, vec3_origin, 0, 10);
}
break;
case TE_SUPERSPIKE: // super spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
// LordHavoc: changed to dust shower
R_SparkShower(pos, vec3_origin, 30);
//R_RunParticleEffect (pos, vec3_origin, 0, 20);
}
break;
case TE_SUPERSPIKEQUAD: // quad super spike hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
// LordHavoc: changed to dust shower
R_SparkShower(pos, vec3_origin, 30);
//R_RunParticleEffect (pos, vec3_origin, 0, 20);
break;
// LordHavoc: added for improved blood splatters
case TE_BLOOD: // blood puff
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
dir[0] = MSG_ReadChar ();
dir[1] = MSG_ReadChar ();
dir[2] = MSG_ReadChar ();
R_BloodPuff(pos);
break;
case TE_BLOOD2: // blood puff
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
R_BloodPuff(pos);
break;
case TE_SPARK: // spark shower
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
dir[0] = MSG_ReadChar ();
dir[1] = MSG_ReadChar ();
dir[2] = MSG_ReadChar ();
break;
// LordHavoc: added for improved gore
case TE_BLOODSHOWER: // vaporized body
- pos[0] = MSG_ReadCoord (); // mins
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- dir[0] = MSG_ReadCoord (); // maxs
- dir[1] = MSG_ReadCoord ();
- dir[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos); // mins
+ MSG_ReadVector(pos2); // maxs
velspeed = MSG_ReadCoord (); // speed
count = MSG_ReadShort (); // number of particles
- R_BloodShower(pos, dir, velspeed, count);
+ R_BloodShower(pos, pos2, velspeed, count);
break;
case TE_PARTICLECUBE: // general purpose particle effect
- pos[0] = MSG_ReadCoord (); // mins
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- pos2[0] = MSG_ReadCoord (); // maxs
- pos2[1] = MSG_ReadCoord ();
- pos2[2] = MSG_ReadCoord ();
- dir[0] = MSG_ReadCoord (); // dir
- dir[1] = MSG_ReadCoord ();
- dir[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos); // mins
+ MSG_ReadVector(pos2); // maxs
+ MSG_ReadVector(dir); // dir
count = MSG_ReadShort (); // number of particles
colorStart = MSG_ReadByte (); // color
colorLength = MSG_ReadByte (); // gravity (1 or 0)
break;
case TE_PARTICLERAIN: // general purpose particle effect
- pos[0] = MSG_ReadCoord (); // mins
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- pos2[0] = MSG_ReadCoord (); // maxs
- pos2[1] = MSG_ReadCoord ();
- pos2[2] = MSG_ReadCoord ();
- dir[0] = MSG_ReadCoord (); // dir
- dir[1] = MSG_ReadCoord ();
- dir[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos); // mins
+ MSG_ReadVector(pos2); // maxs
+ MSG_ReadVector(dir); // dir
count = MSG_ReadShort (); // number of particles
colorStart = MSG_ReadByte (); // color
R_ParticleRain(pos, pos2, dir, count, colorStart, 0);
break;
case TE_PARTICLESNOW: // general purpose particle effect
- pos[0] = MSG_ReadCoord (); // mins
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- pos2[0] = MSG_ReadCoord (); // maxs
- pos2[1] = MSG_ReadCoord ();
- pos2[2] = MSG_ReadCoord ();
- dir[0] = MSG_ReadCoord (); // dir
- dir[1] = MSG_ReadCoord ();
- dir[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos); // mins
+ MSG_ReadVector(pos2); // maxs
+ MSG_ReadVector(dir); // dir
count = MSG_ReadShort (); // number of particles
colorStart = MSG_ReadByte (); // color
R_ParticleRain(pos, pos2, dir, count, colorStart, 1);
break;
case TE_GUNSHOT: // bullet hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
// LordHavoc: changed to dust shower
R_SparkShower(pos, vec3_origin, 15);
//R_RunParticleEffect (pos, vec3_origin, 0, 20);
break;
case TE_GUNSHOTQUAD: // quad bullet hitting wall
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
R_SparkShower(pos, vec3_origin, 15);
dl = CL_AllocDlight (0);
VectorCopy (pos, dl->origin);
break;
case TE_EXPLOSION: // rocket explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
break;
case TE_EXPLOSIONQUAD: // quad rocket explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 480);
/*
case TE_SMOKEEXPLOSION: // rocket explosion with a cloud of smoke
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_ParticleExplosion (pos, true);
dl = CL_AllocDlight (0);
*/
case TE_EXPLOSION3: // Nehahra movie colored lighting explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
break;
case TE_EXPLOSIONRGB: // colored lighting explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
break;
case TE_TAREXPLOSION: // tarbaby explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
R_BlobExplosion (pos);
// R_BlastParticles (pos, 120, 120);
break;
case TE_EXPLOSION2: // color mapped explosion
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
FindNonSolidLocation(pos);
colorStart = MSG_ReadByte ();
colorLength = MSG_ReadByte ();
SZ_Write (sb, s, strlen(s)+1);
}
+// used by server (always dpprotocol)
+// moved to common.h as #define
+/*
+void MSG_WriteFloatCoord (sizebuf_t *sb, float f)
+{
+ MSG_WriteFloat(sb, f);
+}
+*/
+
+// used by client
void MSG_WriteCoord (sizebuf_t *sb, float f)
{
if (dpprotocol)
return string;
}
+// used by server (always dpprotocol)
+// moved to common.h as #define
+/*
+float MSG_ReadFloatCoord (void)
+{
+ return MSG_ReadFloat();
+}
+*/
+
+// used by client
float MSG_ReadCoord (void)
{
if (dpprotocol)
*/
void COM_FileBase (char *in, char *out)
{
- char *s, *s2;
-
- s = in + strlen(in) - 1;
-
- while (s != in && *s != '.')
- s--;
-
- // LordHavoc: EWW bug bug bug bug bug... added previously missing s2 != in (yes, could go hunting through mem for /)
- for (s2 = s ; s2 != in && *s2 && *s2 != '/' ; s2--)
- ;
-
- if (s-s2 < 2)
+ char *slash, *dot;
+ char *s;
+
+ slash = in;
+ dot = NULL;
+ s = in;
+ while(*s)
+ {
+ if (*s == '/')
+ slash = s + 1;
+ if (*s == '.')
+ dot = s;
+ s++;
+ }
+ if (dot == NULL)
+ dot = s;
+ if (dot - slash < 2)
strcpy (out,"?model?");
else
{
- // LordHavoc: FIXME: examine this
- s--;
- strncpy (out,s2+1, s-s2);
- out[s-s2] = 0;
+ while (slash < dot)
+ *out++ = *slash++;
+ *out++ = 0;
}
}
void MSG_WriteAngle (sizebuf_t *sb, float f);
void MSG_WritePreciseAngle (sizebuf_t *sb, float f);
+#define MSG_WriteFloatCoord MSG_WriteFloat
+
extern int msg_readcount;
extern qboolean msg_badread; // set if a read goes beyond end of message
float MSG_ReadCoord (void);
//float MSG_ReadAngle (void);
+#define MSG_ReadFloatCoord MSG_ReadFloat
+
#define MSG_ReadAngle() (MSG_ReadByte() * (360.0f / 256.0f))
#define MSG_ReadPreciseAngle() (MSG_ReadShort() * (360.0f / 65536.0f))
glDepthMask(1);
}
- if (colormap >= 0)
+ if (skin[0] || skin[1] || skin[2] || skin[3] || skin[4])
{
- if (!skin[0] && !skin[1] && !skin[2] && !skin[3])
- GL_DrawModelMesh(0, NULL, maliashdr);
- else
+ if (colormap >= 0 && (skin[0] || skin[1] || skin[2]))
{
int c;
if (skin[0])
R_TintModel(aliasvertcolor, aliasvertcolor2, maliashdr->numverts, (byte *) (&d_8to24table[c]));
GL_DrawModelMesh(skin[2], aliasvertcolor2, maliashdr);
}
- if (skin[3]) GL_DrawModelMesh(skin[3], NULL, maliashdr);
}
- }
- else
- {
- if (!skin[3] && !skin[4])
- GL_DrawModelMesh(0, NULL, maliashdr);
else
{
if (skin[4]) GL_DrawModelMesh(skin[4], aliasvertcolor, maliashdr);
- if (skin[3]) GL_DrawModelMesh(skin[3], NULL, maliashdr);
+ else
+ {
+ if (skin[0]) GL_DrawModelMesh(skin[0], aliasvertcolor, maliashdr);
+ if (skin[1]) GL_DrawModelMesh(skin[1], aliasvertcolor, maliashdr);
+ if (skin[2]) GL_DrawModelMesh(skin[2], aliasvertcolor, maliashdr);
+ }
}
+ if (skin[3]) GL_DrawModelMesh(skin[3], NULL, maliashdr);
}
+ else
+ GL_DrawModelMesh(0, NULL, maliashdr);
if (fogenabled)
{
int lightmapalign, lightmapalignmask; // LordHavoc: NVIDIA's broken subimage fix, see BuildLightmaps for notes
cvar_t gl_lightmapalign = {"gl_lightmapalign", "4"};
-cvar_t gl_lightmaprgba = {"gl_lightmaprgba", "0"};
+cvar_t gl_lightmaprgba = {"gl_lightmaprgba", "1"};
cvar_t gl_nosubimagefragments = {"gl_nosubimagefragments", "0"};
cvar_t gl_nosubimage = {"gl_nosubimage", "0"};
cvar_t r_ambient = {"r_ambient", "0"};
cvar_t gl_vertex = {"gl_vertex", "0"};
cvar_t gl_texsort = {"gl_texsort", "1"};
-//cvar_t gl_funnywalls = {"gl_funnywalls", "0"}; // LordHavoc: see BuildSurfaceDisplayList
cvar_t r_newworldnode = {"r_newworldnode", "0"};
cvar_t r_oldclip = {"r_oldclip", "1"};
cvar_t r_dlightmap = {"r_dlightmap", "1"};
Cvar_RegisterVariable(&gl_nosubimagefragments);
Cvar_RegisterVariable(&gl_nosubimage);
Cvar_RegisterVariable(&r_ambient);
-// Cvar_RegisterVariable(&gl_funnywalls);
Cvar_RegisterVariable(&gl_vertex);
Cvar_RegisterVariable(&gl_texsort);
Cvar_RegisterVariable(&r_newworldnode);
}
}
#else
- skintexnum[0] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FBD, va("&%s_normal", basename)); // normal (no special colors)
- skintexnum[1] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0040, va("&%s_pants", basename)); // pants
- skintexnum[2] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0002, va("&%s_shirt", basename)); // shirt
- skintexnum[3] = GL_SkinSplit(skindata, skintemp, width, height, 0xC000, va("%s_glow", basename)); // glow
- skintexnum[4] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FFF, va("%s_body", basename)); // body (normal + pants + shirt, but not glow)
+ skintexnum[0] = loadtextureimage(va("%s_normal", basename), 0, 0, false, true);
+ skintexnum[1] = 0;
+ skintexnum[2] = 0;
+ skintexnum[3] = loadtextureimage(va("%s_glow" , basename), 0, 0, false, true);
+ skintexnum[4] = 0;
+ if (skintexnum[0])
+ {
+ skintexnum[1] = loadtextureimage(va("%s_pants" , basename), 0, 0, false, true);
+ skintexnum[2] = loadtextureimage(va("%s_shirt" , basename), 0, 0, false, true);
+ }
+ else
+ {
+ skintexnum[0] = loadtextureimage(basename, 0, 0, false, true);
+ if (!skintexnum[0])
+ {
+ skintexnum[0] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FBD, va("&%s_normal", basename)); // normal (no special colors)
+ skintexnum[1] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0040, va("&%s_pants", basename)); // pants
+ skintexnum[2] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0002, va("&%s_shirt", basename)); // shirt
+ skintexnum[3] = GL_SkinSplit(skindata, skintemp, width, height, 0xC000, va("%s_glow", basename)); // glow
+ skintexnum[4] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FFF, va("%s_body", basename)); // body (normal + pants + shirt, but not glow)
+ }
+ }
#endif
}
freeimage = FALSE;
transparent = FALSE;
bytesperpixel = 1;
- if (!hlbsp && mt->offsets[0]) // texture included
+ if (mt->offsets[0]) // texture included
{
data = (byte *)((int) mt + mt->offsets[0]);
- if (r_fullbrights.value && tx->name[0] != '*')
+ if (hlbsp)
+ {
+ byte *in, *out, *pal;
+ int palsize, d, p;
+ bytesperpixel = 4;
+ freeimage = TRUE;
+ in = data;
+ data = out = qmalloc(mt->width * mt->height * 4);
+ pal = in + (((mt->width * mt->height) * 85) >> 6);
+ palsize = pal[1] * 0x100 + pal[0];
+ if (palsize >= 256)
+ palsize = 255;
+ pal += 2;
+ for (d = 0;d < mt->width * mt->height;d++)
+ {
+ p = (*in++) * 3;
+ out[0] = pal[p];
+ out[1] = pal[p+1];
+ out[2] = pal[p+2];
+ out[3] = 255;
+ if (out[0] == 255 && out[1] == 0 && out[2] == 0) // HL transparent color (pure blue)
+ out[0] = out[1] = out[2] = out[3] = 0;
+ out += 4;
+ }
+ }
+ else if (r_fullbrights.value && tx->name[0] != '*')
{
for (j = 0;j < tx->width*tx->height;j++)
+ {
if (data[j] >= 224) // fullbright
{
fullbrights = TRUE;
break;
}
+ }
}
}
else // no texture, and no external replacement texture was found
}
else
{
- tx->transparent = transparent;
if (fullbrights)
{
char name[64];
byte *data2;
+ tx->transparent = false;
data2 = qmalloc(tx->width*tx->height);
for (j = 0;j < tx->width*tx->height;j++)
data2[j] = data[j] >= 224 ? 0 : data[j]; // no fullbrights
- tx->gl_texturenum = GL_LoadTexture (tx->name, tx->width, tx->height, data2, true, transparent, 1);
+ tx->gl_texturenum = GL_LoadTexture (tx->name, tx->width, tx->height, data2, true, false, 1);
strcpy(name, tx->name);
strcat(name, "_glow");
for (j = 0;j < tx->width*tx->height;j++)
data2[j] = data[j] >= 224 ? data[j] : 0; // only fullbrights
- tx->gl_glowtexturenum = GL_LoadTexture (name, tx->width, tx->height, data2, true, transparent, 1);
+ tx->gl_glowtexturenum = GL_LoadTexture (name, tx->width, tx->height, data2, true, false, 1);
qfree(data2);
}
else
{
+ tx->transparent = transparent;
tx->gl_texturenum = GL_LoadTexture (tx->name, tx->width, tx->height, data, true, transparent, bytesperpixel);
tx->gl_glowtexturenum = 0;
}
}
// allocate a new model
- COM_FileBase (mod->name, loadname);
+// COM_FileBase (mod->name, loadname);
+ strcpy(loadname, mod->name);
loadmodel = mod;
MSG_WriteByte (&sv.signon,svc_spawnstaticsound);
for (i=0 ; i<3 ; i++)
- MSG_WriteCoord(&sv.signon, pos[i]);
+ MSG_WriteFloatCoord(&sv.signon, pos[i]);
MSG_WriteByte (&sv.signon, soundnum);
void PF_WriteCoord (void)
{
- MSG_WriteCoord (WriteDest(), G_FLOAT(OFS_PARM1));
+ MSG_WriteFloatCoord (WriteDest(), G_FLOAT(OFS_PARM1));
}
void PF_WriteString (void)
MSG_WriteByte (&sv.signon, ent->v.skin);
for (i=0 ; i<3 ; i++)
{
- MSG_WriteCoord(&sv.signon, ent->v.origin[i]);
+ MSG_WriteFloatCoord(&sv.signon, ent->v.origin[i]);
MSG_WriteAngle(&sv.signon, ent->v.angles[i]);
}
cvar_t r_particles = {"r_particles", "1"};
cvar_t r_drawparticles = {"r_drawparticles", "1"};
-cvar_t r_dynamicparticles = {"r_dynamicparticles", "0", TRUE};
+cvar_t r_dynamicparticles = {"r_dynamicparticles", "1", TRUE};
byte shadebubble(float dx, float dy, vec3_t light)
{
if (sv.datagram.cursize > MAX_DATAGRAM-16)
return;
MSG_WriteByte (&sv.datagram, svc_particle);
- MSG_WriteCoord (&sv.datagram, org[0]);
- MSG_WriteCoord (&sv.datagram, org[1]);
- MSG_WriteCoord (&sv.datagram, org[2]);
+ MSG_WriteFloatCoord (&sv.datagram, org[0]);
+ MSG_WriteFloatCoord (&sv.datagram, org[1]);
+ MSG_WriteFloatCoord (&sv.datagram, org[2]);
for (i=0 ; i<3 ; i++)
{
v = dir[i]*16;
MSG_WriteShort (&sv.datagram, channel);
MSG_WriteByte (&sv.datagram, sound_num);
for (i=0 ; i<3 ; i++)
- MSG_WriteCoord (&sv.datagram, entity->v.origin[i]+0.5*(entity->v.mins[i]+entity->v.maxs[i]));
+ MSG_WriteFloatCoord (&sv.datagram, entity->v.origin[i]+0.5*(entity->v.mins[i]+entity->v.maxs[i]));
}
/*
MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo);
- MSG_WriteLong (&client->message, PROTOCOL_VERSION);
+ MSG_WriteLong (&client->message, DPPROTOCOL_VERSION);
MSG_WriteByte (&client->message, svs.maxclients);
if (!coop.value && deathmatch.value)
if (bits & U_COLORMAP) MSG_WriteByte (msg, ent->v.colormap);
if (bits & U_SKIN) MSG_WriteByte (msg, ent->v.skin);
if (bits & U_EFFECTS) MSG_WriteByte (msg, ent->v.effects);
- if (bits & U_ORIGIN1) MSG_WriteCoord (msg, origin[0]);
+ if (bits & U_ORIGIN1) MSG_WriteFloatCoord (msg, origin[0]);
if (bits & U_ANGLE1) MSG_WriteAngle(msg, angles[0]);
- if (bits & U_ORIGIN2) MSG_WriteCoord (msg, origin[1]);
+ if (bits & U_ORIGIN2) MSG_WriteFloatCoord (msg, origin[1]);
if (bits & U_ANGLE2) MSG_WriteAngle(msg, angles[1]);
- if (bits & U_ORIGIN3) MSG_WriteCoord (msg, origin[2]);
+ if (bits & U_ORIGIN3) MSG_WriteFloatCoord (msg, origin[2]);
if (bits & U_ANGLE3) MSG_WriteAngle(msg, angles[2]);
// LordHavoc: new stuff
MSG_WriteByte (msg, ent->v.dmg_save);
MSG_WriteByte (msg, ent->v.dmg_take);
for (i=0 ; i<3 ; i++)
- MSG_WriteCoord (msg, other->v.origin[i] + 0.5*(other->v.mins[i] + other->v.maxs[i]));
+ MSG_WriteFloatCoord (msg, other->v.origin[i] + 0.5*(other->v.mins[i] + other->v.maxs[i]));
ent->v.dmg_take = 0;
ent->v.dmg_save = 0;
MSG_WriteByte (&sv.signon, svent->baseline.skin);
for (i=0 ; i<3 ; i++)
{
- MSG_WriteCoord(&sv.signon, svent->baseline.origin[i]);
+ MSG_WriteFloatCoord(&sv.signon, svent->baseline.origin[i]);
MSG_WriteAngle(&sv.signon, svent->baseline.angles[i]);
}
}
If steptrace is not NULL, the trace of any vertical wall hit will be stored
============
*/
-#define MAX_CLIP_PLANES 5
+// LordHavoc: increased from 5 to 20, to partially fix angled corner sticking
+// (example - start.bsp hall to e1m4, leading to the pool there are two
+// angled corners, which you could get stuck on, now they are just a one
+// frame hiccup)
+#define MAX_CLIP_PLANES 20
int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
{
int bumpcount, numbumps;
*/
void SV_Physics_Follow (edict_t *ent)
{
- vec3_t vf, vr, vu, angles;
+ vec3_t vf, vr, vu, angles, v;
edict_t *e;
// regular thinking
if (!SV_RunThink (ent))
}
else
{
- angles[0] = -(e->v.angles[0] - ent->v.punchangle[0]);
- angles[1] = e->v.angles[1] - ent->v.punchangle[1];
- angles[2] = e->v.angles[2] - ent->v.punchangle[2];
+ angles[0] = -ent->v.punchangle[0];
+ angles[1] = ent->v.punchangle[1];
+ angles[2] = ent->v.punchangle[2];
AngleVectors (angles, vf, vr, vu);
- ent->v.origin[0] = ent->v.view_ofs[0] * vf[0] + ent->v.view_ofs[1] * vr[0] + ent->v.view_ofs[2] * vu[0] + e->v.origin[0];
- ent->v.origin[1] = ent->v.view_ofs[0] * vf[1] + ent->v.view_ofs[1] * vr[1] + ent->v.view_ofs[2] * vu[1] + e->v.origin[1];
- ent->v.origin[2] = ent->v.view_ofs[0] * vf[2] + ent->v.view_ofs[1] * vr[2] + ent->v.view_ofs[2] * vu[2] + e->v.origin[2];
+ v[0] = ent->v.view_ofs[0] * vf[0] + ent->v.view_ofs[1] * vr[0] + ent->v.view_ofs[2] * vu[0];
+ v[1] = ent->v.view_ofs[0] * vf[1] + ent->v.view_ofs[1] * vr[1] + ent->v.view_ofs[2] * vu[1];
+ v[2] = ent->v.view_ofs[0] * vf[2] + ent->v.view_ofs[1] * vr[2] + ent->v.view_ofs[2] * vu[2];
+ angles[0] = -e->v.angles[0];
+ angles[1] = e->v.angles[1];
+ angles[2] = e->v.angles[2];
+ AngleVectors (angles, vf, vr, vu);
+ ent->v.origin[0] = v[0] * vf[0] + v[1] * vf[1] + v[2] * vf[2] + e->v.origin[0];
+ ent->v.origin[1] = v[0] * vr[0] + v[1] * vr[1] + v[2] * vr[2] + e->v.origin[1];
+ ent->v.origin[2] = v[0] * vu[0] + v[1] * vu[1] + v[2] * vu[2] + e->v.origin[2];
/*
ent->v.origin[0] = ent->v.view_ofs[0] * vf[0] + ent->v.view_ofs[0] * vf[1] + ent->v.view_ofs[0] * vf[2] + e->v.origin[0];
ent->v.origin[1] = ent->v.view_ofs[1] * vr[0] + ent->v.view_ofs[1] * vr[1] + ent->v.view_ofs[1] * vr[2] + e->v.origin[1];
}
// LordHavoc: added alternate WAD2/WAD3 system for HalfLife texture wads
-#define TEXWAD_MAXIMAGES 8192
+#define TEXWAD_MAXIMAGES 16384
typedef struct
{
char name[16];
for (i = 0;i < image_width*image_height;i++)
{
c = *indata++;
- if (c == 255) // transparent color
- {
- *outdata++ = 0;
- *outdata++ = 0;
- *outdata++ = 0;
- *outdata++ = 0;
- }
+ if (pal[c][0] == 255 && pal[c][1] == 0 && pal[c][2] == 0) // HL transparent color (pure blue)
+ outdata[0] = outdata[1] = outdata[2] = outdata[3] = 0;
else
{
- *outdata++ = pal[c][0];
- *outdata++ = pal[c][1];
- *outdata++ = pal[c][2];
- *outdata++ = 255;
+ outdata[0] = pal[c][0];
+ outdata[1] = pal[c][1];
+ outdata[2] = pal[c][2];
+ outdata[3] = 255;
}
+ outdata += 4;
}
return data;
}
trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end);
else
trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins, clip->maxs, clip->end);
- if (trace.allsolid || trace.startsolid ||
- trace.fraction < clip->trace.fraction)
+ if (trace.allsolid || trace.startsolid || trace.fraction < clip->trace.fraction)
{
trace.ent = touch;
if (clip->trace.startsolid)
{
int sentinal;
int size; // including sizeof(hunk_t), -1 = not allocated
- char name[24];
+ char name[56];
} hunk_t;
byte *hunk_base;
hunk_t *h, *next, *endlow, *starthigh, *endhigh;
int count, sum, i;
int totalblocks;
- char name[25];
+ char name[51];
- name[24] = 0;
+ name[50] = 0;
count = 0;
sum = 0;
totalblocks = 0;
// print the single block
//
// LordHavoc: pad name to full length
- for (i = 0;i < 24;i++)
+ for (i = 0;i < 50;i++)
{
if (!h->name[i])
break;
name[i] = h->name[i];
}
- for (;i < 24;i++)
+ for (;i < 50;i++)
name[i] = ' ';
- //memcpy (name, h->name, 24);
+ //memcpy (name, h->name, 51);
if (all)
Con_Printf ("%8p :%8i %s\n",h, h->size, name);
//
// print the total
//
- if (next == endlow || next == endhigh || strncmp(h->name, next->name, 24))
+ if (next == endlow || next == endhigh || strncmp(h->name, next->name, 50))
{
if (!all)
- Con_Printf (" :%8i %s (TOTAL)\n",sum, name);
+ Con_Printf (" :%8i %s (TOTAL)\n",sum, name);
count = 0;
sum = 0;
}
h->size = size;
h->sentinal = HUNK_SENTINAL;
- strncpy (h->name, name, 24);
+ strncpy (h->name, name, 50);
+ h->name[50] = 0;
return (void *)(h+1);
}