From 2d6513af0b8278b722dde1ed5c2ecf0baa1ee61a Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sun, 10 Feb 2002 16:26:55 +0000 Subject: [PATCH] Attempting to intergrate zcam better into rq3 and a fix for lights.wav --- reaction/cgame/cg_event.c | 7 ++++++- reaction/game/g_client.c | 7 +++++++ reaction/game/zcam.c | 38 +++----------------------------------- reaction/game/zcam.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 36 deletions(-) diff --git a/reaction/cgame/cg_event.c b/reaction/cgame/cg_event.c index 9a928308..0c18c38b 100644 --- a/reaction/cgame/cg_event.c +++ b/reaction/cgame/cg_event.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.36 2002/02/10 16:26:55 jbravo +// Attempting to intergrate zcam better into rq3 and a fix for lights.wav +// // Revision 1.35 2002/01/24 14:20:53 jbravo // Adding func_explosive and a few new surfaceparms // @@ -2215,7 +2218,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { // JBravo: LCA soundevents. case RQ3_SOUND_LIGHTS: if ( es->number == cg.snap->ps.clientNum ) - CG_AddBufferedSound(cgs.media.lightsSound); +// CG_AddBufferedSound(cgs.media.lightsSound); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.lightsSound); +// trap_S_StartLocalSound( cgs.media.lightsSound, CHAN_ANNOUNCER ); break; case RQ3_SOUND_CAMERA: if ( es->number == cg.snap->ps.clientNum ) diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index a7ecdf90..ecb30653 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.36 2002/02/10 16:26:55 jbravo +// Attempting to intergrate zcam better into rq3 and a fix for lights.wav +// // Revision 1.35 2002/02/07 23:01:07 slicer // Small fix.. // @@ -1180,6 +1183,10 @@ void ClientBegin( int clientNum ) { // JBravo: if teamplay and the client has not been on teams, make them a spectator. if ( g_gametype.integer == GT_TEAMPLAY && client->sess.savedTeam != TEAM_RED && client->sess.savedTeam != TEAM_BLUE ) { client->sess.sessionTeam = TEAM_SPECTATOR; + client->sess.spectatorState = SPECTATOR_FREE; +#ifdef __ZCAM__ + client->camera->mode = CAMERA_MODE_FLIC; +#endif } if ( client->sess.sessionTeam != TEAM_SPECTATOR ) { diff --git a/reaction/game/zcam.c b/reaction/game/zcam.c index ae721bea..5f942b7d 100644 --- a/reaction/game/zcam.c +++ b/reaction/game/zcam.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.5 2002/02/10 16:26:55 jbravo +// Attempting to intergrate zcam better into rq3 and a fix for lights.wav +// // Revision 1.4 2002/02/09 01:06:36 jbravo // Added zcam files // @@ -50,41 +53,6 @@ gentity_t *PlayerToTrack (gentity_t *ent, gentity_t *target1st); #define SWING_FOV_FACTOR 1.25F #define SWING_MSG_TIME 1000 -/* camera mode */ -typedef enum camera_mode_e { - CAMERA_MODE_FLIC, - CAMERA_MODE_SWING -} camera_mode_t; - -/* camera data */ -typedef struct camera_s -{ - camera_mode_t mode; // camera mode - - // swing mode - float swing_distance; // distance behind player - float swing_height; // height of camera - float swing_angle; // angle of camera - float swing_yaw; // yaw of camera - float swing_pitch; // pitch of camera - gentity_t *swing_target; - gentity_t *swing_secondry_target; - vec3_t swing_last_viewangles; - float swing_msg_time; - - // flic mode - gentity_t *flic_target; - qboolean flic_watching_the_dead; - qboolean flic_watching_the_wall; - vec3_t flic_dead_origin; - float flic_xy_lag; - float flic_z_lag; - float flic_angle_lag; - float flic_last_move_time; - float flic_last_switch_time; - qboolean flic_override; // signal that player must be followed -} camera_t; - #ifndef min #define min(a, b) ((a) < (b) ? (a) : (b)) #endif diff --git a/reaction/game/zcam.h b/reaction/game/zcam.h index f9cfdf51..47de05ce 100644 --- a/reaction/game/zcam.h +++ b/reaction/game/zcam.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.5 2002/02/10 16:26:55 jbravo +// Attempting to intergrate zcam better into rq3 and a fix for lights.wav +// // Revision 1.4 2002/02/09 01:07:14 jbravo // Added zcam files // @@ -38,5 +41,41 @@ void camera_disconnect (gentity_t *ent); void camera_think (gentity_t *ent); void camera_cmd (gentity_t *ent); +// JBravo: moved from zcam.c to here: +/* camera mode */ +typedef enum camera_mode_e { + CAMERA_MODE_FLIC, + CAMERA_MODE_SWING +} camera_mode_t; + +/* camera data */ +typedef struct camera_s +{ + camera_mode_t mode; // camera mode + + // swing mode + float swing_distance; // distance behind player + float swing_height; // height of camera + float swing_angle; // angle of camera + float swing_yaw; // yaw of camera + float swing_pitch; // pitch of camera + gentity_t *swing_target; + gentity_t *swing_secondry_target; + vec3_t swing_last_viewangles; + float swing_msg_time; + + // flic mode + gentity_t *flic_target; + qboolean flic_watching_the_dead; + qboolean flic_watching_the_wall; + vec3_t flic_dead_origin; + float flic_xy_lag; + float flic_z_lag; + float flic_angle_lag; + float flic_last_move_time; + float flic_last_switch_time; + qboolean flic_override; // signal that player must be followed +} camera_t; + #endif /* __ZCAM_H__ */