From d356761b9305cb29649d94a7325c0e744cb5cd4d Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Sun, 20 Feb 2000 20:46:13 +0000 Subject: [PATCH] Fix for the QW protocol problem by Dabb.. Some profiling changes as well.. Code now compiles with profiling support, will disable later.. --- AUTHORS | 6 +++ common/cl_tent.c | 12 ++++- common/common.h | 2 +- configure.in | 4 +- qw_client/gl_rpart.c | 3 +- qw_client/r_part.c | 126 +++++++++++++++++++++---------------------- 6 files changed, 83 insertions(+), 70 deletions(-) diff --git a/AUTHORS b/AUTHORS index 38a07e7..a231e05 100644 --- a/AUTHORS +++ b/AUTHORS @@ -177,3 +177,9 @@ D: Q1/QW tree merging N: Jason Nelson E: jason_nelson@email.msn.com D: VC win32 support. + +N: Jukka Sorjonen +E: jukka.sorjonen@asikkala.fi +D: Bug squasher (see below). +D: QW network protocol fixes. +D: Found out why our VERSION was messing things up.. diff --git a/common/cl_tent.c b/common/cl_tent.c index cbcbc5a..d68232f 100644 --- a/common/cl_tent.c +++ b/common/cl_tent.c @@ -315,14 +315,15 @@ CL_ParseTEnt (void) R_TeleportSplash (pos); break; +#ifdef QUAKEWORLD case TE_GUNSHOT: // bullet hitting wall + cnt = MSG_ReadByte (); pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); - R_RunParticleEffect (pos, vec3_origin, 0, 20); + R_RunParticleEffect (pos, vec3_origin, 0, 20 * cnt); break; -#ifdef QUAKEWORLD case TE_BLOOD: // bullets hitting body cnt = MSG_ReadByte (); pos[0] = MSG_ReadCoord (); @@ -340,6 +341,13 @@ CL_ParseTEnt (void) #endif // QUAKEWORLD #ifdef UQUAKE + case TE_GUNSHOT: // bullet hitting wall + pos[0] = MSG_ReadCoord (); + pos[1] = MSG_ReadCoord (); + pos[2] = MSG_ReadCoord (); + R_RunParticleEffect (pos, vec3_origin, 0, 20); + break; + // PGM 01/21/97 case TE_BEAM: // grappling hook beam CL_ParseBeam (Mod_ForName("progs/beam.mdl", true)); diff --git a/common/common.h b/common/common.h index e5c782e..4a9a98a 100644 --- a/common/common.h +++ b/common/common.h @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#define MAX_INFO_STRING 196 +#define MAX_INFO_STRING 512 #define MAX_SERVERINFO_STRING 512 #define MAX_LOCALINFO_STRING 32768 diff --git a/configure.in b/configure.in index dce6af4..e145c4d 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ AC_PREREQ(2.13) AC_INIT(common/crc.h) dnl Version of this release -QF_VERSION=0.2-devel +QF_VERSION=0.2-d VERSION=2.40 AC_DEFINE_UNQUOTED(QF_VERSION,"$QF_VERSION") AC_DEFINE_UNQUOTED(VERSION,"$VERSION") @@ -522,7 +522,7 @@ fi dnl We want warnings, lots of warnings... if test "x$GCC" = xyes; then - CFLAGS="$CFLAGS -Wall -Werror" + CFLAGS="$CFLAGS -Wall -Werror -pg" fi # CFLAGS="$CFLAGS -Wall -pedantic" diff --git a/qw_client/gl_rpart.c b/qw_client/gl_rpart.c index e87603e..a2a5bba 100644 --- a/qw_client/gl_rpart.c +++ b/qw_client/gl_rpart.c @@ -99,7 +99,8 @@ void R_DrawParticles (void) } // hack a scale up to keep particles from disapearing - scale = (p->org[0] - r_origin[0])*vpn[0] + (p->org[1] - r_origin[1])*vpn[1] + scale = (p->org[0] - r_origin[0])*vpn[0] + + (p->org[1] - r_origin[1])*vpn[1] + (p->org[2] - r_origin[2])*vpn[2]; if (scale < 20) scale = 1; diff --git a/qw_client/r_part.c b/qw_client/r_part.c index d3469b3..dd0c7f1 100644 --- a/qw_client/r_part.c +++ b/qw_client/r_part.c @@ -378,73 +378,71 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type) VectorCopy (vec3_origin, p->vel); p->die = cl.time + 2; - if (type == 4) - { // slight blood - p->type = pt_slowgrav; - p->color = 67 + (rand()&3); - for (j=0 ; j<3 ; j++) - p->org[j] = start[j] + ((rand()%6)-3); - len -= 3; - } - else if (type == 2) - { // blood - p->type = pt_slowgrav; - p->color = 67 + (rand()&3); - for (j=0 ; j<3 ; j++) - p->org[j] = start[j] + ((rand()%6)-3); - } - else if (type == 6) - { // voor trail - p->color = 9*16 + 8 + (rand()&3); - p->type = pt_static; - p->die = cl.time + 0.3; - for (j=0 ; j<3 ; j++) - p->org[j] = start[j] + ((rand()&15)-8); - } - else if (type == 1) - { // smoke smoke - p->ramp = (rand()&3) + 2; - p->color = ramp3[(int)p->ramp]; - p->type = pt_fire; - for (j=0 ; j<3 ; j++) - p->org[j] = start[j] + ((rand()%6)-3); - } - else if (type == 0) - { // rocket trail - p->ramp = (rand()&3); - p->color = ramp3[(int)p->ramp]; - p->type = pt_fire; - for (j=0 ; j<3 ; j++) - p->org[j] = start[j] + ((rand()%6)-3); - } - else if (type == 3 || type == 5) - { // tracer - static int tracercount; + switch (type) { + case 4: + // slight blood + p->type = pt_slowgrav; + p->color = 67 + (rand()&3); + for (j=0 ; j<3 ; j++) + p->org[j] = start[j] + ((rand()%6)-3); + len -= 3; + break; + case 2: + // blood + p->type = pt_slowgrav; + p->color = 67 + (rand()&3); + for (j=0 ; j<3 ; j++) + p->org[j] = start[j] + ((rand()%6)-3); + break; + case 6: + // voor trail + p->color = 9*16 + 8 + (rand()&3); + p->type = pt_static; + p->die = cl.time + 0.3; + for (j=0 ; j<3 ; j++) + p->org[j] = start[j] + ((rand()&15)-8); + break; + case 1: + // smoke smoke + p->ramp = (rand()&3) + 2; + p->color = ramp3[(int)p->ramp]; + p->type = pt_fire; + for (j=0 ; j<3 ; j++) + p->org[j] = start[j] + ((rand()%6)-3); + break; + case 0: + // rocket trail + p->ramp = (rand()&3); + p->color = ramp3[(int)p->ramp]; + p->type = pt_fire; + for (j=0 ; j<3 ; j++) + p->org[j] = start[j] + ((rand()%6)-3); + break; + case 3: + case 5: + // tracer + static int tracercount; - p->die = cl.time + 0.5; - p->type = pt_static; - if (type == 3) - p->color = 52 + ((tracercount&4)<<1); - else - p->color = 230 + ((tracercount&4)<<1); - - tracercount++; + p->die = cl.time + 0.5; + p->type = pt_static; + if (type == 3) + p->color = 52 + ((tracercount&4)<<1); + else + p->color = 230 + ((tracercount&4)<<1); + + tracercount++; + + VectorCopy (start, p->org); + if (tracercount & 1) { + p->vel[0] = 30*vec[1]; + p->vel[1] = 30*-vec[0]; + } else { + p->vel[0] = 30*-vec[1]; + p->vel[1] = 30*vec[0]; + } + break; - VectorCopy (start, p->org); - if (tracercount & 1) - { - p->vel[0] = 30*vec[1]; - p->vel[1] = 30*-vec[0]; - } - else - { - p->vel[0] = 30*-vec[1]; - p->vel[1] = 30*vec[0]; - } - } - - VectorAdd (start, vec, start); } }