Beispiel #1
0
qboolean CG_IsEnemyTeam (int team)
{
    int ourClientNum;
    const clientInfo_t *us;

    if (wolfcam_following) {
        ourClientNum = wcg.clientNum;
    } else {
        ourClientNum = cg.snap->ps.clientNum;
    }

    us = &cgs.clientinfo[ourClientNum];

    //if (us == ci) {
    //    return qfalse;
    //}

	if (CG_IsTeamGame(cgs.gametype)  &&  team != us->team) {
        return qtrue;
	} else if (!CG_IsTeamGame(cgs.gametype)) {
        return qtrue;
    }

    return qfalse;
}
Beispiel #2
0
/*
====================
CG_ParseSpawnVars

Parses a brace bounded set of key / value pairs out of the
level's entity strings into cg.spawnVars[]

This does not actually spawn an entity.
====================
*/
qboolean CG_ParseSpawnVars( void ) {
    char            keyname[MAX_TOKEN_CHARS];
    char            com_token[MAX_TOKEN_CHARS];
    char    token[MAX_TOKEN_CHARS];
    //char buf[MAX_TOKEN_CHARS];
    const char *line;
    qboolean newLine;
    vec3_t origin;
    int wait;
    titem_t ti;
    int val;
    int skipItem;
    int i;
    //char *gametypeName;
    //char *value;
    int angle;
    int spawnflags;
    qboolean spawnPoint;
    qboolean redSpawn;
    qboolean blueSpawn;
    qboolean initial;
    qboolean deathmatch;
    qboolean portal;
    qboolean portalHasTarget;
    qboolean startTimer;
    qboolean stopTimer;
    qboolean gotOrigin;
    int pointContents;
    static char *gametypeNames[] = { "ffa", "tournament", "single", "team", /*FIXME clanarena*/ "ca",  "ctf", "oneflag", "obelisk", "harvester", "ft", "dom", "ad", "rr", "race" };

    //Com_Printf("cgs.gametype : %d\n", cgs.gametype);
    cg.numSpawnVars = 0;
    cg.numSpawnVarChars = 0;

    // parse the opening brace
    if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) {
        // end of spawn string
        return qfalse;
    }
    if ( com_token[0] != '{' ) {
        CG_Error( "CG_ParseSpawnVars: found %s when expecting {",com_token );
    }

    // go through all the key / value pairs
    while ( 1 ) {
        // parse key
        if ( !trap_GetEntityToken( keyname, sizeof( keyname ) ) ) {
            CG_Error( "CG_ParseSpawnVars: EOF without closing brace" );
        }

        if ( keyname[0] == '}' ) {
            break;
        }

        // parse value
        if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) {
            CG_Error( "CG_ParseSpawnVars: EOF without closing brace" );
        }

        if ( com_token[0] == '}' ) {
            CG_Error( "CG_ParseSpawnVars: closing brace without data" );
        }
        if ( cg.numSpawnVars == MAX_SPAWN_VARS ) {
            CG_Error( "CG_ParseSpawnVars: MAX_SPAWN_VARS" );
        }
        cg.spawnVars[ cg.numSpawnVars ][0] = CG_AddSpawnVarToken( keyname );
        cg.spawnVars[ cg.numSpawnVars ][1] = CG_AddSpawnVarToken( com_token );
        cg.numSpawnVars++;

        if (!Q_stricmp(keyname, "enableDust")) {
            cg.mapEnableDust = atoi(com_token);
        } else if (!Q_stricmp(keyname, "enableBreath")) {
            cg.mapEnableBreath = atoi(com_token);
        }
        //CG_Printf("spawnvars  %s : %s\n", cg.spawnVars[ cg.numSpawnVars - 1 ][0], cg.spawnVars[ cg.numSpawnVars - 1 ][1]);
    }

    if (cgs.gametype == GT_CA) {
        //return qtrue;
    }

    ti = noitem;
    wait = 0;
    skipItem = 0;
    angle = 0;
    spawnflags = 0;
    spawnPoint = qfalse;
    redSpawn = qfalse;
    blueSpawn = qfalse;
    initial = qfalse;
    deathmatch = qfalse;
    portal = qfalse;
    portalHasTarget = qfalse;
    startTimer = qfalse;
    stopTimer = qfalse;
    gotOrigin = qfalse;

    // get the rest
    while (1) {
        // parse key
        if ( !trap_GetEntityToken( keyname, sizeof( keyname ) ) ) {
            //CG_Printf("all done parsing ents\n");
            break;
        }

        //Com_Printf("'%s'\n", keyname);

        if (keyname[0] == '{') {
            //CG_Printf("{\n");
            // clear values
            ti = noitem;
            wait = 0;
            skipItem = 0;
            angle = 0;
            spawnflags = 0;
            spawnPoint = qfalse;
            redSpawn = qfalse;
            blueSpawn = qfalse;
            initial = qfalse;
            deathmatch = qfalse;
            portal = qfalse;
            portalHasTarget = qfalse;
            startTimer = qfalse;
            stopTimer = qfalse;
            gotOrigin = qfalse;
            continue;
        }
        if ( keyname[0] == '}' ) {
            //CG_Printf("}\n");
            if (spawnPoint) {
                //Com_Printf("spawn: %f %f %f   angle:%d  spawnflags:%d  r:%d b:%d\n", origin[0], origin[1], origin[2], angle, spawnflags, redSpawn, blueSpawn);
                i = cg.numSpawnPoints;
                if (i >= MAX_SPAWN_POINTS) {
                    continue;
                }

                VectorCopy(origin, cg.spawnPoints[i].origin);
                cg.spawnPoints[i].angle = angle;
                cg.spawnPoints[i].spawnflags = spawnflags;
                cg.spawnPoints[i].redSpawn = redSpawn;
                cg.spawnPoints[i].blueSpawn = blueSpawn;
                cg.spawnPoints[i].initial = initial;
                cg.spawnPoints[i].deathmatch = deathmatch;
                cg.numSpawnPoints++;
                continue;
            }
            if (portal) {
                if (!portalHasTarget) {
                    if (cg.numMirrorSurfaces > MAX_MIRROR_SURFACES) {
                        Com_Printf("^3max mirror surfaces (%d)\n", MAX_MIRROR_SURFACES);
                        continue;
                    }
                    VectorCopy(origin, cg.mirrorSurfaces[cg.numMirrorSurfaces]);
                    cg.numMirrorSurfaces++;
                    //Com_Printf("origin: %f %f %f\n", origin[0], origin[1], origin[2]);
                }
                //Com_Printf("^1origin: %f %f %f  (hasTarget %d)\n", origin[0], origin[1], origin[2], portalHasTarget);
                continue;
            }
            if (startTimer) {
                cg.hasStartTimer = qtrue;
                VectorCopy(origin, cg.startTimerOrigin);
                Com_Printf("^5start timer %f %f %f\n", origin[0], origin[1], origin[2]);
                continue;
            }
            if (stopTimer) {
                cg.hasStopTimer = qtrue;
                VectorCopy(origin, cg.stopTimerOrigin);
                Com_Printf("^5stop timer %f %f %f\n", origin[0], origin[1], origin[2]);
                continue;
            }

            if (gotOrigin) {
                pointContents = CG_PointContents(origin, 0);
            } else {
                pointContents = 0;
            }

            if (skipItem) {
                continue;
            } else if (pointContents & 0x1) {
                // it's in an invalid place, some maps have this  qzdm20 has 2 megas
                continue;
            } else if (ti == redArmor) {
                if (!wait)
                    wait = 25;
                AddTimedItem(&cg.numRedArmors, cg.redArmors, origin, wait);
            } else if (ti == yellowArmor) {
                if (!wait)
                    wait = 25;
                AddTimedItem(&cg.numYellowArmors, cg.yellowArmors, origin, wait);
            } else if (ti == greenArmor) {
                if (!wait)
                    wait = 25;
                AddTimedItem(&cg.numGreenArmors, cg.greenArmors, origin, wait);
            } else if (ti == megaHealth) {
                if (!wait)
                    wait = 35;
                AddTimedItem(&cg.numMegaHealths, cg.megaHealths, origin, wait);
            } else if (ti == quad) {
                if (!wait)
                    wait = 120;
                AddTimedItem(&cg.numQuads, cg.quads, origin, wait);
            } else if (ti == battleSuit) {
                if (!wait)
                    wait = 120;
                AddTimedItem(&cg.numBattleSuits, cg.battleSuits, origin, wait);
            }

            continue;
        }

        // parse value
        if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) {
            CG_Error( "CG_ParseSpawnVars: EOF without closing brace" );
        }

        if ( com_token[0] == '}' ) {
            CG_Error( "CG_ParseSpawnVars: closing brace without data" );
        }

        //CG_Printf("^3ent  %s : %s\n", keyname, com_token);

        if (!Q_stricmp(keyname, "classname")) {
            if (!Q_stricmp(com_token, "info_player_deathmatch")  ||  !Q_stricmp(com_token, "info_player_start")) {
                //FIXME spawnflags 4
                spawnPoint = qtrue;
                deathmatch = qtrue;
                blueSpawn = qtrue;
                redSpawn = qtrue;
                //Com_Printf("deathmatch spawn %d\n", cg.numSpawnPoints);
            } else if (!Q_stricmp(com_token, "team_CTF_redspawn")) {
                spawnPoint = qtrue;
                redSpawn = qtrue;
            } else if (!Q_stricmp(com_token, "team_CTF_bluespawn")) {
                spawnPoint = qtrue;
                blueSpawn = qtrue;
            } else if (!Q_stricmp(com_token, "team_CTF_redplayer")) {
                spawnPoint = qtrue;
                redSpawn = qtrue;
                initial = qtrue;
            } else if (!Q_stricmp(com_token, "team_CTF_blueplayer")) {
                spawnPoint = qtrue;
                blueSpawn = qtrue;
                initial = qtrue;
            } else if (!Q_stricmp(com_token, "item_armor_body")) {
                // red armor
                //Com_Printf("red armor\n");
                ti = redArmor;
            } else if (!Q_stricmp(com_token, "item_armor_combat")) {
                // yellow armor
                //Com_Printf("yellow armor\n");
                ti = yellowArmor;
            } else if (!Q_stricmp(com_token, "item_armor_jacket")) {
                ti = greenArmor;
            } else if (!Q_stricmp(com_token, "item_health_mega")) {
                //Com_Printf("mega health\n");
                ti = megaHealth;
            } else if (!Q_stricmp(com_token, "item_quad")) {
                //Com_Printf("quad\n");
                ti = quad;
            } else if (!Q_stricmp(com_token, "item_enviro")) {
                // battlesuit
                //Com_Printf("battlesuit?\n");
                ti = battleSuit;
                // count ??
            } else if (!Q_stricmp(com_token, "misc_portal_surface")) {
                //Com_Printf("^3portal surface\n");
                portal = qtrue;
            } else if (!Q_stricmp(com_token, "target_starttimer")) {
                startTimer = qtrue;
            } else if (!Q_stricmp(com_token, "target_stoptimer")) {
                stopTimer = qtrue;
            } else {
                //FIXME other?  regen?
            }


        } else if (!Q_stricmp(keyname, "origin")) {
            if (SC_ParseVec3FromStr(com_token, origin) == -1) {
                //Com_Printf("FIXME getting origin for entitytoken %s", com_token);
                origin[0] = 0.0;
                origin[1] = 0.0;
                origin[2] = 0.0;
            }
            gotOrigin = qtrue;
            //Com_Printf("*** origin: %f %f %f\n", origin[0], origin[1], origin[2]);
        } else if (!Q_stricmp(keyname, "target")) {
            portalHasTarget = qtrue;
            //Q_strncpyz(buf, com_token, sizeof(buf));
            //Com_Printf("^5target == '%s'\n", buf);
        } else if (!Q_stricmp(keyname, "wait")) {
            wait = atoi(com_token);
        } else if (!Q_stricmp(keyname, "notteam")) {
            val = atoi(com_token);
            //if (val  &&  cgs.gametype >= GT_TEAM) {
            if (val  &&  CG_IsTeamGame(cgs.gametype)) {
                skipItem = 1;
            }
        } else if (!Q_stricmp(keyname, "not_gametype")) {
            const char *value = com_token;
            const char *gametypeName;
            const char *s;

            //FIXME could be more than one digit in the list ??

            if (isdigit(com_token[0])) {
                val = atoi(com_token);
                if (cgs.protocol == PROTOCOL_QL) {
                    if (cgs.gametype == GT_RACE) {
                        if (val == 2) {
                            skipItem = 1;
                        }
                    } else {
                        if (cgs.gametype == val) {
                            skipItem = 1;
                        }
                    }
                } else {
                    if (cgs.gametype == val) {
                        skipItem = 1;
                    }
                }
            } else {  // string value
                s = NULL;
                if (cgs.gametype < ARRAY_LEN(gametypeNames)) {
                    gametypeName = gametypeNames[cgs.gametype];
                    s = strstr(value, gametypeName);
                }
                if (!s) {
                    // try alternate quake live gametype names
                    if (cgs.gametype == GT_TEAM) {
                        s = strstr(value, "tdm");
                    } else if (cgs.gametype == GT_TOURNAMENT) {
                        s = strstr(value, "duel");
                    } else if (cgs.gametype == GT_HARVESTER) {
                        s = strstr(value, "har");
                    } else if (cgs.gametype == GT_1FCTF) {
                        s = strstr(value, "1f");
                    } else if (cgs.gametype == GT_OBELISK) {
                        s = strstr(value, "obj");
                    }
                }
                if (s) {
                    skipItem = 1;
                }
            }
        } else if (!Q_stricmp(keyname, "gametype")) {
            //FIXME this is wrong, see g_spawn.c
            //val = atoi(com_token);
            //if (val != cgs.gametype) {
            //    skipItem = 1;
            //}
            qboolean found = qfalse;

            skipItem = 1;
            line = com_token;
            newLine = qfalse;
            while (*line  &&  newLine == qfalse) {
                int ln;
                //Com_Printf("line1: '%s'\n", line);
                //FIXME const
                line = (char *)CG_GetTokenGameType(line, token, qfalse, &newLine);
                //Com_Printf("newline: %d\n", newLine);
                //Com_Printf("line2: '%s'\n", line);
                //Com_Printf("    token: '%s'\n", token);
                ln = strlen(token);
                if (ln  &&  *token) {
                    if (token[ln - 1] == ',') {
                        token[ln - 1] = '\0';
                    }
                }
                for (i = 0;  i < (sizeof(gametypeNames) / sizeof(char *));  i++) {
                    if (!Q_stricmp(token, gametypeNames[i])) {
                        found = qtrue;
                        break;
                    }
                }
                if (!found) {
                    // try alternate quakelive name for 'team'
                    if (!Q_stricmp(token, "tdm")) {
                        if (cgs.gametype == GT_TEAM) {
                            skipItem = 0;
                        }
                    } else if (!Q_stricmp(token, "duel")) {
                        if (cgs.gametype == GT_TOURNAMENT) {
                            skipItem = 0;
                        }
                    } else if (!Q_stricmp(token, "har")) {
                        if (cgs.gametype == GT_HARVESTER) {
                            skipItem = 0;
                        }
                    } else if (!Q_stricmp(token, "1f")) {
                        if (cgs.gametype == GT_1FCTF) {
                            skipItem = 0;
                        }
                    } else if (!Q_stricmp(token, "ob")) {
                        if (cgs.gametype == GT_OBELISK) {
                            skipItem = 0;
                        }
                    } else {
                        Com_Printf("FIXME gametype : '%s'  '%s'\n", com_token, token);
                    }
                } else if (cgs.gametype < ARRAY_LEN(gametypeNames)  &&  !Q_stricmp(token, gametypeNames[cgs.gametype])) {
                    skipItem = 0;
                }
            }
#if 0
            if (!found) {
                Com_Printf("FIXME gametype : %s\n", com_token);
            }

            if (cgs.gametype >= ARRAY_LEN(gametypeNames)  ||  Q_stricmp(com_token, gametypeNames[cgs.gametype])) {
                skipItem = 1;
            }
#endif
        } else if (!Q_stricmp(keyname, "notfree")) {
            val = atoi(com_token);
            if (val  &&  (cgs.gametype == GT_FFA ||  cgs.gametype == GT_TOURNAMENT)) {
                skipItem = 1;
            }
        } else if (!Q_stricmp(keyname, "notsingle")) {
            val = atoi(com_token);
            if (val  &&  cgs.gametype == GT_SINGLE_PLAYER) {
                skipItem = 1;
            }
        } else if (!Q_stricmp(keyname, "angle")) {
            angle = atoi(com_token);
        } else if (!Q_stricmp(keyname, "spawnflags")) {
            spawnflags = atoi(com_token);
        }

            //  count
    }

    return qtrue;
}
Beispiel #3
0
/*
=================
CG_RegisterSounds

called during a precache command
=================
*/
static void CG_RegisterSounds( void ) {
	int		i;
	char	items[MAX_ITEMS+1];
	char	name[MAX_QPATH];
	const char	*soundName;

	// voice commands
	cgs.media.oneMinuteSound = trap_S_RegisterSound( "sound/feedback/1_minute.wav", qtrue );
	cgs.media.fiveMinuteSound = trap_S_RegisterSound( "sound/feedback/5_minute.wav", qtrue );
	cgs.media.suddenDeathSound = trap_S_RegisterSound( "sound/feedback/sudden_death.wav", qtrue );
	cgs.media.oneFragSound = trap_S_RegisterSound( "sound/feedback/1_frag.wav", qtrue );
	cgs.media.twoFragSound = trap_S_RegisterSound( "sound/feedback/2_frags.wav", qtrue );
	cgs.media.threeFragSound = trap_S_RegisterSound( "sound/feedback/3_frags.wav", qtrue );
	cgs.media.count3Sound = trap_S_RegisterSound( "sound/feedback/three.wav", qtrue );
	cgs.media.count2Sound = trap_S_RegisterSound( "sound/feedback/two.wav", qtrue );
	cgs.media.count1Sound = trap_S_RegisterSound( "sound/feedback/one.wav", qtrue );
	cgs.media.countFightSound = trap_S_RegisterSound( "sound/feedback/fight.wav", qtrue );
	cgs.media.countPrepareSound = trap_S_RegisterSound( "sound/feedback/prepare.wav", qtrue );

	if ( CG_IsTeamGame() || cg_buildScript.integer ) {

		cgs.media.captureAwardSound = trap_S_RegisterSound( "sound/teamplay/flagcapture_yourteam.wav", qtrue );
		cgs.media.redLeadsSound = trap_S_RegisterSound( "sound/feedback/redleads.wav", qtrue );
		cgs.media.blueLeadsSound = trap_S_RegisterSound( "sound/feedback/blueleads.wav", qtrue );
		cgs.media.teamsTiedSound = trap_S_RegisterSound( "sound/feedback/teamstied.wav", qtrue );
		cgs.media.hitTeamSound = trap_S_RegisterSound( "sound/feedback/hit_teammate.wav", qtrue );

		cgs.media.redScoredSound = trap_S_RegisterSound( "sound/teamplay/voc_red_scores.wav", qtrue );
		cgs.media.blueScoredSound = trap_S_RegisterSound( "sound/teamplay/voc_blue_scores.wav", qtrue );

		cgs.media.captureYourTeamSound = trap_S_RegisterSound( "sound/teamplay/flagcapture_yourteam.wav", qtrue );
		cgs.media.captureOpponentSound = trap_S_RegisterSound( "sound/teamplay/flagcapture_opponent.wav", qtrue );

		cgs.media.returnYourTeamSound = trap_S_RegisterSound( "sound/teamplay/flagreturn_yourteam.wav", qtrue );
		cgs.media.returnOpponentSound = trap_S_RegisterSound( "sound/teamplay/flagreturn_opponent.wav", qtrue );

		cgs.media.takenYourTeamSound = trap_S_RegisterSound( "sound/teamplay/flagtaken_yourteam.wav", qtrue );
		cgs.media.takenOpponentSound = trap_S_RegisterSound( "sound/teamplay/flagtaken_opponent.wav", qtrue );

		if ( cg_buildScript.integer ) {
			cgs.media.redFlagReturnedSound = trap_S_RegisterSound( "sound/teamplay/voc_red_returned.wav", qtrue );
			cgs.media.blueFlagReturnedSound = trap_S_RegisterSound( "sound/teamplay/voc_blue_returned.wav", qtrue );
			cgs.media.enemyTookYourFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_enemy_flag.wav", qtrue );
			cgs.media.yourTeamTookEnemyFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_team_flag.wav", qtrue );
		}

		cgs.media.youHaveFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_you_flag.wav", qtrue );
		cgs.media.holyShitSound = trap_S_RegisterSound("sound/feedback/voc_holyshit.wav", qtrue);
		cgs.media.neutralFlagReturnedSound = trap_S_RegisterSound( "sound/teamplay/flagreturn_opponent.wav", qtrue );
		cgs.media.yourTeamTookTheFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_team_1flag.wav", qtrue );
		cgs.media.enemyTookTheFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_enemy_1flag.wav", qtrue );
	}

	cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/machinegun/buletby1.wav", qfalse );
	cgs.media.selectSound = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse );
	cgs.media.wearOffSound = trap_S_RegisterSound( "sound/items/wearoff.wav", qfalse );
	cgs.media.useNothingSound = trap_S_RegisterSound( "sound/items/use_nothing.wav", qfalse );
	cgs.media.gibSound = trap_S_RegisterSound( "sound/player/gibsplt1.wav", qfalse );
	cgs.media.gibBounce1Sound = trap_S_RegisterSound( "sound/player/gibimp1.wav", qfalse );
	cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse );
	cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse );

	cgs.media.teleInSound = trap_S_RegisterSound( "sound/world/telein.wav", qfalse );
	cgs.media.teleOutSound = trap_S_RegisterSound( "sound/world/teleout.wav", qfalse );
	cgs.media.respawnSound = trap_S_RegisterSound( "sound/items/respawn1.wav", qfalse );

	cgs.media.noAmmoSound = trap_S_RegisterSound( "sound/weapons/noammo.wav", qfalse );

	cgs.media.talkSound = trap_S_RegisterSound( "sound/player/talk.wav", qfalse );
	cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav", qfalse);

	cgs.media.hitSound = trap_S_RegisterSound( "sound/feedback/hit.wav", qfalse );

	cgs.media.impressiveSound = trap_S_RegisterSound( "sound/feedback/impressive.wav", qtrue );
	cgs.media.excellentSound = trap_S_RegisterSound( "sound/feedback/excellent.wav", qtrue );
	cgs.media.deniedSound = trap_S_RegisterSound( "sound/feedback/denied.wav", qtrue );
	cgs.media.humiliationSound = trap_S_RegisterSound( "sound/feedback/humiliation.wav", qtrue );
	cgs.media.assistSound = trap_S_RegisterSound( "sound/feedback/assist.wav", qtrue );
	cgs.media.defendSound = trap_S_RegisterSound( "sound/feedback/defense.wav", qtrue );

	cgs.media.takenLeadSound = trap_S_RegisterSound( "sound/feedback/takenlead.wav", qtrue);
	cgs.media.tiedLeadSound = trap_S_RegisterSound( "sound/feedback/tiedlead.wav", qtrue);
	cgs.media.lostLeadSound = trap_S_RegisterSound( "sound/feedback/lostlead.wav", qtrue);

	cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav", qfalse);
	cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav", qfalse);
	cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav", qfalse);

	cgs.media.jumpPadSound = trap_S_RegisterSound ("sound/world/jumppad.wav", qfalse );

	for (i=0 ; i<4 ; i++) {
		Com_sprintf (name, sizeof(name), "sound/player/footsteps/step%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_NORMAL][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/boot%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_BOOT][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/flesh%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_FLESH][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/mech%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_MECH][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/energy%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_ENERGY][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/splash%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_SPLASH][i] = trap_S_RegisterSound (name, qfalse);

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/clank%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_METAL][i] = trap_S_RegisterSound (name, qfalse);
	}

	// only register the items that the server says we need
	strcpy( items, CG_ConfigString( CS_ITEMS ) );

	for ( i = 1 ; i < bg_numItems ; i++ ) {
//		if ( items[ i ] == '1' || cg_buildScript.integer ) {
			CG_RegisterItemSounds( i );
//		}
	}

	for ( i = 1 ; i < MAX_SOUNDS ; i++ ) {
		soundName = CG_ConfigString( CS_SOUNDS+i );
		if ( !soundName[0] ) {
			break;
		}
		if ( soundName[0] == '*' ) {
			continue;	// custom sound
		}
		cgs.gameSounds[i] = trap_S_RegisterSound( soundName, qfalse );
	}

	// FIXME: only needed with item
	cgs.media.flightSound = trap_S_RegisterSound( "sound/items/flight.wav", qfalse );
	cgs.media.medkitSound = trap_S_RegisterSound ("sound/items/use_medkit.wav", qfalse);
	cgs.media.quadSound = trap_S_RegisterSound("sound/items/damage3.wav", qfalse);
	cgs.media.sfx_ric1 = trap_S_RegisterSound ("sound/weapons/machinegun/ric1.wav", qfalse);
	cgs.media.sfx_ric2 = trap_S_RegisterSound ("sound/weapons/machinegun/ric2.wav", qfalse);
	cgs.media.sfx_ric3 = trap_S_RegisterSound ("sound/weapons/machinegun/ric3.wav", qfalse);
	cgs.media.sfx_railg = trap_S_RegisterSound ("sound/weapons/railgun/railgf1a.wav", qfalse);
	cgs.media.sfx_rockexp = trap_S_RegisterSound ("sound/weapons/rocket/rocklx1a.wav", qfalse);
	cgs.media.sfx_plasmaexp = trap_S_RegisterSound ("sound/weapons/plasma/plasmx1a.wav", qfalse);

	cgs.media.regenSound = trap_S_RegisterSound("sound/items/regen.wav", qfalse);
	cgs.media.protectSound = trap_S_RegisterSound("sound/items/protect3.wav", qfalse);
	cgs.media.n_healthSound = trap_S_RegisterSound("sound/items/n_health.wav", qfalse );
	cgs.media.hgrenb1aSound = trap_S_RegisterSound("sound/weapons/grenade/hgrenb1a.wav", qfalse);
	cgs.media.hgrenb2aSound = trap_S_RegisterSound("sound/weapons/grenade/hgrenb2a.wav", qfalse);
}
Beispiel #4
0
/*
=================
CG_RegisterGraphics

This function may execute for a couple of minutes with a slow disk.
=================
*/
static void CG_RegisterGraphics( void ) {
	gitem_t		*backpack;
	int			i;
	char		items[MAX_ITEMS+1];
	static char		*sb_nums[11] = {
		"gfx/2d/numbers/zero_32b",
		"gfx/2d/numbers/one_32b",
		"gfx/2d/numbers/two_32b",
		"gfx/2d/numbers/three_32b",
		"gfx/2d/numbers/four_32b",
		"gfx/2d/numbers/five_32b",
		"gfx/2d/numbers/six_32b",
		"gfx/2d/numbers/seven_32b",
		"gfx/2d/numbers/eight_32b",
		"gfx/2d/numbers/nine_32b",
		"gfx/2d/numbers/minus_32b",
	};

	// clear any references to old media
	memset( &cg.refdef, 0, sizeof( cg.refdef ) );
	trap_R_ClearScene();

	CG_LoadingString( cgs.mapname );

	trap_R_LoadWorldMap( cgs.mapname );

	// precache status bar pics
	CG_LoadingString( "game media" );

	for ( i=0 ; i<11 ; i++) {
		cgs.media.numberShaders[i] = trap_R_RegisterShader( sb_nums[i] );
	}

	cgs.media.botSkillShaders[0] = trap_R_RegisterShader( "menu/art/skill1.tga" );
	cgs.media.botSkillShaders[1] = trap_R_RegisterShader( "menu/art/skill2.tga" );
	cgs.media.botSkillShaders[2] = trap_R_RegisterShader( "menu/art/skill3.tga" );
	cgs.media.botSkillShaders[3] = trap_R_RegisterShader( "menu/art/skill4.tga" );
	cgs.media.botSkillShaders[4] = trap_R_RegisterShader( "menu/art/skill5.tga" );

	cgs.media.viewBloodShader = trap_R_RegisterShader( "viewBloodBlend" );

	cgs.media.deferShader = trap_R_RegisterShaderNoMip( "gfx/2d/defer.tga" );

	cgs.media.scoreboardName = trap_R_RegisterShaderNoMip( "menu/tab/name.tga" );
	cgs.media.scoreboardPing = trap_R_RegisterShaderNoMip( "menu/tab/ping.tga" );
	cgs.media.scoreboardScore = trap_R_RegisterShaderNoMip( "menu/tab/score.tga" );
	cgs.media.scoreboardTime = trap_R_RegisterShaderNoMip( "menu/tab/time.tga" );

	cgs.media.objectivesOverlay = trap_R_RegisterShaderNoMip( CG_ConfigString(CS_OBJECTIVESOVERLAY) );
	cgs.media.objectivesUpdated = trap_R_RegisterShaderNoMip( "menu/objectives/updated.tga" );
	cgs.media.objectivesUpdatedSound = trap_S_RegisterSound( "sound/misc/objective_update_01.wav", qfalse );

	cgs.media.deathImage = trap_R_RegisterShaderNoMip( "menu/art/level_complete5" );

	cgs.media.scoreShow = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse );
	cgs.media.finalScoreShow = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse );

	cgs.media.smokePuffShader = trap_R_RegisterShader( "smokePuff" );
	cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" );
	cgs.media.shotgunSmokePuffShader = trap_R_RegisterShader( "shotgunSmokePuff" );
	cgs.media.plasmaBallShader = trap_R_RegisterShader( "sprites/plasma1" );
	cgs.media.bloodTrailShader = trap_R_RegisterShader( "bloodTrail" );
	cgs.media.lagometerShader = trap_R_RegisterShader("lagometer" );
	cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" );

	cgs.media.waterBubbleShader = trap_R_RegisterShader( "waterBubble" );

	cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" );
	cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" );

	for ( i = 0 ; i < NUM_CROSSHAIRS ; i++ ) {
		cgs.media.crosshairShader[i] = trap_R_RegisterShader( va("gfx/2d/crosshair%c", 'a'+i) );
	}

	cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" );
	cgs.media.noammoShader = trap_R_RegisterShader( "icons/noammo" );

	// powerup shaders
	cgs.media.quadShader = trap_R_RegisterShader("powerups/quad" );
	cgs.media.quadWeaponShader = trap_R_RegisterShader("powerups/quadWeapon" );
	cgs.media.battleSuitShader = trap_R_RegisterShader("powerups/battleSuit" );
	cgs.media.battleWeaponShader = trap_R_RegisterShader("powerups/battleWeapon" );
	cgs.media.invisShader = trap_R_RegisterShader("powerups/invisibility" );
	cgs.media.regenShader = trap_R_RegisterShader("powerups/regen" );
	cgs.media.hastePuffShader = trap_R_RegisterShader("hasteSmokePuff" );

	if ( cg_buildScript.integer ) {
		cgs.media.redCubeModel = trap_R_RegisterModel( "models/powerups/orb/r_orb.md3" );
		cgs.media.blueCubeModel = trap_R_RegisterModel( "models/powerups/orb/b_orb.md3" );
		cgs.media.redCubeIcon = trap_R_RegisterShader( "icons/skull_red" );
		cgs.media.blueCubeIcon = trap_R_RegisterShader( "icons/skull_blue" );
	}

	if ( cg_buildScript.integer ) {
		cgs.media.redFlagModel = trap_R_RegisterModel( "models/flags/r_flag.md3" );
		cgs.media.blueFlagModel = trap_R_RegisterModel( "models/flags/b_flag.md3" );
		cgs.media.redFlagShader[0] = trap_R_RegisterShaderNoMip( "icons/iconf_red1" );
		cgs.media.redFlagShader[1] = trap_R_RegisterShaderNoMip( "icons/iconf_red2" );
		cgs.media.redFlagShader[2] = trap_R_RegisterShaderNoMip( "icons/iconf_red3" );
		cgs.media.blueFlagShader[0] = trap_R_RegisterShaderNoMip( "icons/iconf_blu1" );
		cgs.media.blueFlagShader[1] = trap_R_RegisterShaderNoMip( "icons/iconf_blu2" );
		cgs.media.blueFlagShader[2] = trap_R_RegisterShaderNoMip( "icons/iconf_blu3" );

	}

	cgs.media.dustPuffShader = trap_R_RegisterShader("hasteSmokePuff" );

	if ( CG_IsTeamGame() || cg_buildScript.integer ) {
		cgs.media.friendShader = trap_R_RegisterShader( "sprites/foe" );
		cgs.media.redQuadShader = trap_R_RegisterShader("powerups/blueflag" );
		cgs.media.teamStatusBar = trap_R_RegisterShader( "gfx/2d/colorbar.tga" );
	}

	cgs.media.armorModel = trap_R_RegisterModel( "models/powerups/armor/armor_yel.md3" );
	cgs.media.armorIcon  = trap_R_RegisterShaderNoMip( "icons/iconr_yellow" );

	cgs.media.machinegunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/m_shell.md3" );
	cgs.media.shotgunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" );

	cgs.media.gibAbdomen = trap_R_RegisterModel( "models/gibs/abdomen.md3" );
	cgs.media.gibArm = trap_R_RegisterModel( "models/gibs/arm.md3" );
	cgs.media.gibChest = trap_R_RegisterModel( "models/gibs/chest.md3" );
	cgs.media.gibFist = trap_R_RegisterModel( "models/gibs/fist.md3" );
	cgs.media.gibFoot = trap_R_RegisterModel( "models/gibs/foot.md3" );
	cgs.media.gibForearm = trap_R_RegisterModel( "models/gibs/forearm.md3" );
	cgs.media.gibIntestine = trap_R_RegisterModel( "models/gibs/intestine.md3" );
	cgs.media.gibLeg = trap_R_RegisterModel( "models/gibs/leg.md3" );
	cgs.media.gibSkull = trap_R_RegisterModel( "models/gibs/skull.md3" );
	cgs.media.gibBrain = trap_R_RegisterModel( "models/gibs/brain.md3" );

	cgs.media.debrislight1 = trap_R_RegisterModel( "models/debris/concrete_b1.md3" );
	cgs.media.debrislight2 = trap_R_RegisterModel( "models/debris/concrete_b2.md3" );
	cgs.media.debrislight3 = trap_R_RegisterModel( "models/debris/concrete_b3.md3" );
	cgs.media.debrislight4 = trap_R_RegisterModel( "models/debris/concrete_b4.md3" );
	cgs.media.debrislight5 = trap_R_RegisterModel( "models/debris/concrete_b5.md3" );
	cgs.media.debrislight6 = trap_R_RegisterModel( "models/debris/concrete_b6.md3" );
	cgs.media.debrislight7 = trap_R_RegisterModel( "models/debris/concrete_b7.md3" );
	cgs.media.debrislight8 = trap_R_RegisterModel( "models/debris/concrete_b8.md3" );

	cgs.media.debrisdark1 = trap_R_RegisterModel( "models/debris/concrete_d1.md3" );
	cgs.media.debrisdark2 = trap_R_RegisterModel( "models/debris/concrete_d2.md3" );
	cgs.media.debrisdark3 = trap_R_RegisterModel( "models/debris/concrete_d3.md3" );
	cgs.media.debrisdark4 = trap_R_RegisterModel( "models/debris/concrete_d4.md3" );
	cgs.media.debrisdark5 = trap_R_RegisterModel( "models/debris/concrete_d5.md3" );
	cgs.media.debrisdark6 = trap_R_RegisterModel( "models/debris/concrete_d6.md3" );
	cgs.media.debrisdark7 = trap_R_RegisterModel( "models/debris/concrete_d7.md3" );
	cgs.media.debrisdark8 = trap_R_RegisterModel( "models/debris/concrete_d8.md3" );

	cgs.media.debrislightlarge1 = trap_R_RegisterModel( "models/debris/concrete_b1_large.md3" );
	cgs.media.debrislightlarge2 = trap_R_RegisterModel( "models/debris/concrete_b2_large.md3" );
	cgs.media.debrislightlarge3 = trap_R_RegisterModel( "models/debris/concrete_b3_large.md3" );

	cgs.media.debrisdarklarge1 = trap_R_RegisterModel( "models/debris/wood_b1.md3" );
	cgs.media.debrisdarklarge2 = trap_R_RegisterModel( "models/debris/wood_b1.md3" );
	cgs.media.debrisdarklarge3 = trap_R_RegisterModel( "models/debris/wood_b1.md3" );

	cgs.media.debriswood1 = trap_R_RegisterModel( "models/debris/wood_b1.md3" );
	cgs.media.debriswood2 = trap_R_RegisterModel( "models/debris/wood_b2.md3" );
	cgs.media.debriswood3 = trap_R_RegisterModel( "models/debris/wood_b3.md3" );
	cgs.media.debriswood4 = trap_R_RegisterModel( "models/debris/wood_b4.md3" );
	cgs.media.debriswood5 = trap_R_RegisterModel( "models/debris/wood_b5.md3" );

	cgs.media.debrisglass1 = trap_R_RegisterModel( "models/debris/glass_1.md3" );
	cgs.media.debrisglass2 = trap_R_RegisterModel( "models/debris/glass_2.md3" );
	cgs.media.debrisglass3 = trap_R_RegisterModel( "models/debris/glass_3.md3" );
	cgs.media.debrisglass4 = trap_R_RegisterModel( "models/debris/glass_4.md3" );
	cgs.media.debrisglass5 = trap_R_RegisterModel( "models/debris/glass_5.md3" );

	cgs.media.debrisglasslarge1 = trap_R_RegisterModel( "models/debris/glass_1_large.md3" );
	cgs.media.debrisglasslarge2 = trap_R_RegisterModel( "models/debris/glass_2_large.md3" );
	cgs.media.debrisglasslarge3 = trap_R_RegisterModel( "models/debris/glass_3_large.md3" );
	cgs.media.debrisglasslarge4 = trap_R_RegisterModel( "models/debris/glass_4_large.md3" );
	cgs.media.debrisglasslarge5 = trap_R_RegisterModel( "models/debris/glass_5_large.md3" );
	
	cgs.media.debrisstone1 = trap_R_RegisterModel( "models/debris/stone_1.md3" );
	cgs.media.debrisstone2 = trap_R_RegisterModel( "models/debris/stone_2.md3" );
	cgs.media.debrisstone3 = trap_R_RegisterModel( "models/debris/stone_3.md3" );
	cgs.media.debrisstone4 = trap_R_RegisterModel( "models/debris/stone_4.md3" );
	cgs.media.debrisstone5 = trap_R_RegisterModel( "models/debris/stone_5.md3" );

	cgs.media.sparkShader = trap_R_RegisterShaderNoMip("spark");
	
	cgs.media.smoke2 = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" );

	cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" );

	cgs.media.bloodExplosionShader = trap_R_RegisterShader( "bloodExplosion" );

	cgs.media.bulletFlashModel = trap_R_RegisterModel("models/weaphits/bullet.md3");
	cgs.media.ringFlashModel = trap_R_RegisterModel("models/weaphits/ring02.md3");
	cgs.media.dishFlashModel = trap_R_RegisterModel("models/weaphits/boom01.md3");
	cgs.media.teleportEffectModel = trap_R_RegisterModel( "models/misc/telep.md3" );
	cgs.media.teleportEffectShader = trap_R_RegisterShader( "teleportEffect" );

	cgs.media.invulnerabilityPowerupModel = trap_R_RegisterModel( "models/powerups/shield/shield.md3" );
	cgs.media.medalImpressive = trap_R_RegisterShaderNoMip( "medal_impressive" );
	cgs.media.medalExcellent = trap_R_RegisterShaderNoMip( "medal_excellent" );
	cgs.media.medalGauntlet = trap_R_RegisterShaderNoMip( "medal_gauntlet" );
	cgs.media.medalDefend = trap_R_RegisterShaderNoMip( "medal_defend" );
	cgs.media.medalAssist = trap_R_RegisterShaderNoMip( "medal_assist" );
	cgs.media.medalCapture = trap_R_RegisterShaderNoMip( "medal_capture" );


	memset( cg_items, 0, sizeof( cg_items ) );
	memset( cg_weapons, 0, sizeof( cg_weapons ) );

	// only register the items that the server says we need
	strcpy( items, CG_ConfigString( CS_ITEMS) );

	for ( i = 1 ; i < bg_numItems ; i++ ) {
		if ( items[ i ] == '1' || cg_buildScript.integer ) {
			CG_LoadingItem( i );
			CG_RegisterItemVisuals( i );
		}
	}

	// wall marks
	cgs.media.bulletMarkShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk" );
	cgs.media.burnMarkShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk" );
	cgs.media.holeMarkShader = trap_R_RegisterShader( "gfx/damage/hole_lg_mrk" );
	cgs.media.energyMarkShader = trap_R_RegisterShader( "gfx/damage/plasma_mrk" );
	cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" );
	cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" );
	cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" );

	// paintball mode marks
	cgs.media.bulletMarkPaintShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk_paint" );
	cgs.media.burnMarkPaintShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk_paint" );
	cgs.media.holeMarkPaintShader = trap_R_RegisterShader( "gfx/damage/hole_lg_mrk_paint" );
	cgs.media.energyMarkPaintShader = trap_R_RegisterShader( "gfx/damage/plasma_mrk_paint" );

	// register the inline models
	cgs.numInlineModels = trap_CM_NumInlineModels();
	for ( i = 1 ; i < cgs.numInlineModels ; i++ ) {
		char	name[10];
		vec3_t			mins, maxs;
		int				j;

		Com_sprintf( name, sizeof(name), "*%i", i );
		cgs.inlineDrawModel[i] = trap_R_RegisterModel( name );
		trap_R_ModelBounds( cgs.inlineDrawModel[i], mins, maxs );
		for ( j = 0 ; j < 3 ; j++ ) {
			cgs.inlineModelMidpoints[i][j] = mins[j] + 0.5 * ( maxs[j] - mins[j] );
		}
	}

	// register all the server specified models
	for (i=1 ; i<MAX_MODELS ; i++) {
		const char		*modelName;

		modelName = CG_ConfigString( CS_MODELS+i );
		if ( !modelName[0] ) {
			break;
		}
		cgs.gameModels[i] = trap_R_RegisterModel( modelName );
	}

	CG_ClearParticles ();
/*
	for (i=1; i<MAX_PARTICLES_AREAS; i++)
	{
		{
			int rval;

			rval = CG_NewParticleArea ( CS_PARTICLES + i);
			if (!rval)
				break;
		}
	}
*/
}
Beispiel #5
0
/*
=================
CG_DrawOldScoreboard

Draw the normal in-game scoreboard
=================
*/
qboolean CG_DrawOldScoreboard( void ) {
	int		x, y, w, i, n1, n2;
	float	fade;
	const float	*fadeColor;
	const char	*s;
	int maxClients;
	int lineHeight;
	int topBorderSize, bottomBorderSize;

	QLWideScreen = WIDESCREEN_CENTER;

	// don't draw amuthing if the menu or console is up
	if ( cg_paused.integer ) {
		cg.deferredPlayerLoading = 0;
		return qfalse;
	}

	if ( cgs.gametype == GT_SINGLE_PLAYER && cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
		cg.deferredPlayerLoading = 0;
		return qfalse;
	}

	// don't draw scoreboard during death while warmup up
	if ( cg.warmup && !cg.showScores ) {
		return qfalse;
	}

	if ( cg.showScores || cg.predictedPlayerState.pm_type == PM_DEAD ||
		 cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
		fade = 1.0;
		fadeColor = colorWhite;
	} else {
		fadeColor = CG_FadeColor( cg.scoreFadeTime, FADE_TIME );

		if ( !fadeColor ) {
			// next time scoreboard comes up, don't print killer
			cg.deferredPlayerLoading = 0;
			cg.killerName[0] = 0;
			return qfalse;
		}
		fade = *fadeColor;
	}


	// fragged by ... line
	if ( cg.killerName[0] ) {
		s = va("Fragged by %s", cg.killerName );
		w = CG_DrawStrlen( s, &cgs.media.bigchar );
		x = ( SCREEN_WIDTH - w ) / 2;
		y = 40;
		CG_DrawBigString( x, y, s, fade );
	}

	// current rank
	if (!CG_IsTeamGame(cgs.gametype)) {
		if (!wolfcam_following  ||  (wolfcam_following  &&  wcg.clientNum == cg.snap->ps.clientNum)) {
			if (cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) {
				s = va("%s place with %i",
					   CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
					   cg.snap->ps.persistant[PERS_SCORE] );
				w = CG_DrawStrlen( s, &cgs.media.bigchar );
				x = ( SCREEN_WIDTH - w ) / 2;
				y = 60;
				CG_DrawBigString( x, y, s, fade );
			}
		} else {  // wolfcam_following
			if (cgs.clientinfo[wcg.clientNum].team != TEAM_SPECTATOR) {
				if (CG_IsCpmaMvd()) {
					int rank;
					int i;

					rank = 1;
					for (i = 0;  i < MAX_CLIENTS;  i++) {
						if (!cgs.clientinfo[i].infoValid) {
							continue;
						}
						if (cgs.clientinfo[i].team == TEAM_SPECTATOR) {
							continue;
						}
						if (cgs.clientinfo[i].score > cgs.clientinfo[wcg.clientNum].score) {
							rank++;
						}
					}

					s = va("%s ^7place with %i", CG_PlaceString(rank), cgs.clientinfo[wcg.clientNum].score);

					w = CG_DrawStrlen( s, &cgs.media.bigchar );
					x = ( SCREEN_WIDTH - w ) / 2;
					y = 60;
					CG_DrawBigString( x, y, s, fade );
				} else {  // not cpma mvd
					// following someone who is ingame but not the main demo view

					if (CG_IsDuelGame(cgs.gametype)) {
						// we are following the other dueler
						if (cgs.scores1 == cgs.scores2) {
							s = va("%s ^7place with %i", CG_PlaceString(1), cgs.scores1);
						} else {
							if (cg.snap->ps.persistant[PERS_RANK] == 0) {
								// we are second
								s = va("%s ^7place with %i", CG_PlaceString(2), cgs.scores2);
							} else {
								// we are first
								s = va("%s ^7place with %i", CG_PlaceString(1), cgs.scores1);
							}
						}
						w = CG_DrawStrlen( s, &cgs.media.bigchar );
						x = ( SCREEN_WIDTH - w ) / 2;
						y = 60;
						CG_DrawBigString( x, y, s, fade );
					} else {
						// we don't have enough information
						// pass, don't draw ranking
					}
				}
			}
		}
	} else {
		if ( cg.teamScores[0] == cg.teamScores[1] ) {
			s = va("Teams are tied at %i", cg.teamScores[0] );
		} else if ( cg.teamScores[0] >= cg.teamScores[1] ) {
			s = va("Red leads %i to %i",cg.teamScores[0], cg.teamScores[1] );
		} else {
			s = va("Blue leads %i to %i",cg.teamScores[1], cg.teamScores[0] );
		}

		w = CG_DrawStrlen( s, &cgs.media.bigchar );
		x = ( SCREEN_WIDTH - w ) / 2;
		y = 60;
		CG_DrawBigString( x, y, s, fade );
	}

	// scoreboard
	y = SB_HEADER;

	CG_DrawPic( SB_SCORE_X + (SB_RATING_WIDTH / 2), y, 64, 32, cgs.media.scoreboardScore );
	CG_DrawPic( SB_PING_X - (SB_RATING_WIDTH / 2), y, 64, 32, cgs.media.scoreboardPing );
	CG_DrawPic( SB_TIME_X - (SB_RATING_WIDTH / 2), y, 64, 32, cgs.media.scoreboardTime );
	CG_DrawPic( SB_NAME_X - (SB_RATING_WIDTH / 2), y, 64, 32, cgs.media.scoreboardName );

	y = SB_TOP;

	// If there are more than SB_MAXCLIENTS_NORMAL, use the interleaved scores
	if (1) {  //( cg.numScores > SB_MAXCLIENTS_NORMAL ) {
		maxClients = SB_MAXCLIENTS_INTER;
		lineHeight = SB_INTER_HEIGHT;
		topBorderSize = 8;
		bottomBorderSize = 16;
	} else {
		maxClients = SB_MAXCLIENTS_NORMAL;
		lineHeight = SB_NORMAL_HEIGHT;
		topBorderSize = 16;
		bottomBorderSize = 16;
	}

	localClient = qfalse;

	if ( cgs.gametype >= GT_TEAM ) {
		//
		// teamplay scoreboard
		//
		y += lineHeight/2;

		if ( cg.teamScores[0] >= cg.teamScores[1] ) {
			n1 = CG_TeamScoreboard( y, TEAM_RED, fade, maxClients, lineHeight );
			CG_DrawTeamBackground( 0, y - topBorderSize, 640, n1 * lineHeight + bottomBorderSize, 0.33f, TEAM_RED );
			y += (n1 * lineHeight) + BIGCHAR_HEIGHT;
			maxClients -= n1;
			n2 = CG_TeamScoreboard( y, TEAM_BLUE, fade, maxClients, lineHeight );
			CG_DrawTeamBackground( 0, y - topBorderSize, 640, n2 * lineHeight + bottomBorderSize, 0.33f, TEAM_BLUE );
			y += (n2 * lineHeight) + BIGCHAR_HEIGHT;
			maxClients -= n2;
		} else {
			n1 = CG_TeamScoreboard( y, TEAM_BLUE, fade, maxClients, lineHeight );
			CG_DrawTeamBackground( 0, y - topBorderSize, 640, n1 * lineHeight + bottomBorderSize, 0.33f, TEAM_BLUE );
			y += (n1 * lineHeight) + BIGCHAR_HEIGHT;
			maxClients -= n1;
			n2 = CG_TeamScoreboard( y, TEAM_RED, fade, maxClients, lineHeight );
			CG_DrawTeamBackground( 0, y - topBorderSize, 640, n2 * lineHeight + bottomBorderSize, 0.33f, TEAM_RED );
			y += (n2 * lineHeight) + BIGCHAR_HEIGHT;
			maxClients -= n2;
		}
		n1 = CG_TeamScoreboard( y, TEAM_SPECTATOR, fade, maxClients, lineHeight );
		y += (n1 * lineHeight) + BIGCHAR_HEIGHT;

	} else {
		//
		// free for all scoreboard
		//
		n1 = CG_TeamScoreboard( y, TEAM_FREE, fade, maxClients, lineHeight );
		y += (n1 * lineHeight) + BIGCHAR_HEIGHT;
		n2 = CG_TeamScoreboard( y, TEAM_SPECTATOR, fade, maxClients - n1, lineHeight );
		y += (n2 * lineHeight) + BIGCHAR_HEIGHT;
	}

	if (!localClient) {
		// draw local client at the bottom
		for ( i = 0 ; i < cg.numScores ; i++ ) {
			if ( cg.scores[i].client == cg.snap->ps.clientNum ) {
				CG_DrawClientScore( y, &cg.scores[i], fadeColor, fade, lineHeight == SB_NORMAL_HEIGHT );
				break;
			}
		}
	}

	// load any models that have been deferred
	if ( ++cg.deferredPlayerLoading > 10 ) {
		CG_LoadDeferredPlayers();
	}

	return qtrue;
}