/*QUAKED props_skyportal (.6 .7 .7) (-8 -8 0) (8 8 16) "fov" for the skybox default is 90 To have the portal sky fogged, enter any of the following values: "fogcolor" (r g b) (values 0.0-1.0) "fognear" distance from entity to start fogging (FIXME? Supported by RTCW, but not Spearmint) "fogfar" distance from entity that fog is opaque */ void SP_skyportal( void ) { int fogn; int isfog; cg.hasSkyPortal = qtrue; CG_SpawnVector( "origin", "0 0 0", cg.skyPortalOrigin ); isfog = CG_SpawnVector( "fogcolor", "0 0 0", cg.skyPortalFogColor ); isfog += CG_SpawnInt( "fognear", "0", &fogn ); isfog += CG_SpawnInt( "fogfar", "300", &cg.skyPortalFogDepthForOpaque ); if ( !isfog ) { cg.skyPortalFogDepthForOpaque = 0; } }
/* =================== CG_ParseEntityFromSpawnVars Spawn an entity and fill in all of the level fields from cg.spawnVars[], then call the class specfic spawn function =================== */ void CG_ParseEntityFromSpawnVars( void ) { spawn_t *s; int i; char *classname; char *p, *value, *gametypeName; static char *gametypeNames [] = { "ffa", "duel", "powerduel", "single", "team", "ctf", "cty" }; // check for "notsingle" flag if( cgs.gametype == GT_SINGLE_PLAYER ) { CG_SpawnInt( "notsingle", "0", &i ); if( i ) { return; } } // check for "notteam" flag (GT_FFA, GT_DUEL, GT_SINGLE_PLAYER) if( cgs.gametype >= GT_TEAM ) { CG_SpawnInt( "notteam", "0", &i ); if( i ) { return; } } else { CG_SpawnInt( "notfree", "0", &i ); if( i ) { return; } } if( CG_SpawnString( "gametype", NULL, &value ) ) { if( cgs.gametype >= GT_FFA && cgs.gametype < GT_MAX_GAME_TYPE ) { gametypeName = gametypeNames[cgs.gametype]; p = strstr( value, gametypeName ); if( !p ) { return; } } } if( CG_SpawnString( "classname", "", &classname ) ) { for( s = spawns; s->name; s++ ) { if( !Q_stricmp( s->name, classname ) ) { s->spawn(); break; } } } }
/* =================== CG_ParseEntityFromSpawnVars Spawn an entity and fill in all of the level fields from cg.spawnVars[], then call the class specfic spawn function =================== */ void CG_ParseEntityFromSpawnVars(void) { int i; char *classname; // check for "notteam" / "notfree" flags CG_SpawnInt("notteam", "0", &i); if (i) { return; } if (CG_SpawnString("classname", "", &classname)) { for (i = 0; i < NUMSPAWNS; i++) { if (!Q_stricmp(spawns[i].name, classname)) { spawns[i].spawn(); break; } } } }