diff --git a/reaction/cgame/cg_ents.c b/reaction/cgame/cg_ents.c index 484065d9..43a180cc 100644 --- a/reaction/cgame/cg_ents.c +++ b/reaction/cgame/cg_ents.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.44 2003/08/10 20:13:26 makro +// no message +// // Revision 1.43 2003/04/19 15:27:30 jbravo // Backing out of most of unlagged. Only optimized prediction and smooth clients // remains. @@ -1081,7 +1084,7 @@ void CG_AddPacketEntities(int mode) centity_t *cent; int num; - //Makro - if we're rendering the entities in a sky portals, we don't need this stuff + //Makro - if we're rendering the entities in a sky portal, we don't need this stuff if (mode != 1) { playerState_t *ps; diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index 889e1f86..6a3fb2cb 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.149 2003/08/10 20:13:26 makro +// no message +// // Revision 1.148 2003/07/30 16:05:46 makro // no message // @@ -358,6 +361,7 @@ #include "tr_types.h" #include "../game/bg_public.h" #include "cg_public.h" +#include "..\GAME\q_shared.h" // Added by ClassView // The entire cgame module is unloaded and reloaded on each level change, // so there is NO persistant data between levels on the client side. @@ -1674,6 +1678,12 @@ typedef struct { cgMedia_t media; // JBravo: unlagged int delagHitscan; + //Makro - sky portals + vec3_t skyPortalOrigin; + qboolean skyPortalSet; + //Makro - "clear" color + vec3_t clearColor; + qboolean clearColorSet; } cgs_t; //============================================================================== diff --git a/reaction/cgame/cg_main.c b/reaction/cgame/cg_main.c index 12f70fe3..d9e7cdff 100644 --- a/reaction/cgame/cg_main.c +++ b/reaction/cgame/cg_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.138 2003/08/10 20:13:26 makro +// no message +// // Revision 1.137 2003/07/30 16:05:46 makro // no message // @@ -1852,8 +1855,10 @@ static void CG_RegisterBreakables(void) continue; } - id = atoi(Info_ValueForKey(breakInfo, "id")); - if (id >= 0 && id < RQ3_MAX_BREAKABLES) { + //Makro - not needed + //id = atoi(Info_ValueForKey(breakInfo, "id")); + id = i; + //if (id >= 0 && id < RQ3_MAX_BREAKABLES) { name = Info_ValueForKey(breakInfo, "type"); Com_Printf("Registering breakable %s ID=%d\n", name, id); //Blaze: Breakable stuff - register the models, sounds, and explosion shader @@ -1907,9 +1912,9 @@ static void CG_RegisterBreakables(void) cgs.media.breakables[id].shader = trap_R_RegisterShader(va("breakable_%s_explosion", name)); cgs.media.breakables[id].velocity = atoi(Info_ValueForKey(breakInfo, "velocity")); cgs.media.breakables[id].jump = atoi(Info_ValueForKey(breakInfo, "jump")); - } else { - CG_Printf("ID was %d\n", id); - } + //} else { + // CG_Printf("ID was %d\n", id); + //} } } diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index 65ce3a3f..266eb6fb 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.73 2003/08/10 20:13:26 makro +// no message +// // Revision 1.72 2003/04/19 17:41:26 jbravo // Applied changes that where in 1.29h -> 1.32b gamecode. // @@ -433,6 +436,31 @@ static void CG_ParseWarmup(void) cg.warmup = warmup; } +//Makro - added +void CG_ParseSkyPortal(const char *str) +{ + if (str && str[0] && Q_stricmp(str, "none")) { + cgs.skyPortalOrigin[0] = atof(Info_ValueForKey(str, "x")); + cgs.skyPortalOrigin[1] = atof(Info_ValueForKey(str, "y")); + cgs.skyPortalOrigin[2] = atof(Info_ValueForKey(str, "z")); + cgs.skyPortalSet = qtrue; + } else { + cgs.skyPortalSet = qfalse; + } +} + +//Makro - added +void CG_ParseFogHull(const char *str) +{ + if (str && str[0]) { + cgs.clearColor[0] = atof(Info_ValueForKey(str, "r")); + cgs.clearColor[1] = atof(Info_ValueForKey(str, "g")); + cgs.clearColor[2] = atof(Info_ValueForKey(str, "b")); + cgs.clearColorSet = qtrue; + } else { + cgs.clearColorSet = qfalse; + } +} /* ================ CG_SetConfigValues @@ -456,6 +484,10 @@ void CG_SetConfigValues(void) // q3f atmospheric stuff: if ( cg_atmosphericEffects.integer ) CG_EffectParse( CG_ConfigString( CS_ATMOSEFFECT ) ); + //Makro - "clear" color + CG_ParseFogHull( CG_ConfigString(CS_FOGHULL) ); + //Makro - sky portal + CG_ParseSkyPortal( CG_ConfigString(CS_SKYPORTAL) ); } /* @@ -575,7 +607,13 @@ static void CG_ConfigStringModified(void) CG_ShaderStateChanged(); } else if( num == CS_ATMOSEFFECT ) { CG_EffectParse( str ); - } + //Makro - sky portals + } else if (num == CS_SKYPORTAL) { + CG_ParseSkyPortal(str); + //Makro - "clear" color + } else if (num == CS_FOGHULL) { + CG_ParseFogHull(str); + } } diff --git a/reaction/cgame/cg_view.c b/reaction/cgame/cg_view.c index 0bd73ebb..ea62408d 100644 --- a/reaction/cgame/cg_view.c +++ b/reaction/cgame/cg_view.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.35 2003/08/10 20:13:26 makro +// no message +// // Revision 1.34 2003/04/23 17:49:38 slicer // Added new cvar cg_RQ3_ssgZoomSensLock // @@ -1004,8 +1007,6 @@ Generates and draws a game scene and status information at the given time. void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoPlayback) { int inwater; - //Makro - added for sky portals - const char *info; int skyPortalMode = -1; //Blaze: for cheat detection @@ -1068,36 +1069,24 @@ void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoP memcpy(cg.refdef.areamask, cg.snap->areamask, sizeof(cg.refdef.areamask)); //Makro - fog hull - info = CG_ConfigString(CS_FOGHULL); - if (info) { - if (info[0]) { - vec4_t fogcolor; - fogcolor[0] = atof(Info_ValueForKey(info, "r")); - fogcolor[1] = atof(Info_ValueForKey(info, "g")); - fogcolor[2] = atof(Info_ValueForKey(info, "b")); - fogcolor[3] = 1; - CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, fogcolor); - //Com_Printf("Fog color: %f %f %f\n", fogcolor[0], fogcolor[1], fogcolor[2]); - } + if (cgs.clearColorSet) { + float fogcolor[4]; + fogcolor[0] = cgs.clearColor[0]; + fogcolor[1] = cgs.clearColor[1]; + fogcolor[2] = cgs.clearColor[2]; + fogcolor[3] = 1.0f; + CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, fogcolor); } //CG_DrawBigPolygon(); //Makro - draw sky portal first - //Note - doing it here means that sky portal entities won't get drawn. but at least the rest of the map looks ok :/ - info = CG_ConfigString(CS_SKYPORTAL); - if (info[0] && Q_stricmp(info, "none")) { + if (cgs.skyPortalSet) { vec3_t oldOrigin; - skyPortalMode = 0; - CG_AddPacketEntities(qtrue); + CG_AddPacketEntities(1); VectorCopy(cg.refdef.vieworg, oldOrigin); - cg.refdef.vieworg[0] = atof(Info_ValueForKey(info, "x")); - cg.refdef.vieworg[1] = atof(Info_ValueForKey(info, "y")); - cg.refdef.vieworg[2] = atof(Info_ValueForKey(info, "z")); - //memset(skyRef.areamask, 0, sizeof(skyRef.areamask)); - //Com_Printf("View axis is: %f %f %f\n", cg.refdef.viewaxis[0], cg.refdef.viewaxis[1], cg.refdef.viewaxis[2]); + VectorCopy(cgs.skyPortalOrigin, cg.refdef.vieworg); trap_R_RenderScene(&cg.refdef); - //trap_R_ClearScene(); VectorCopy(oldOrigin, cg.refdef.vieworg); } diff --git a/reaction/cgame/cgame.plg b/reaction/cgame/cgame.plg index 2068eb59..fa60d579 100644 --- a/reaction/cgame/cgame.plg +++ b/reaction/cgame/cgame.plg @@ -6,29 +6,54 @@ --------------------Configuration: cgame - Win32 Release--------------------