Play correct team sounds when in spectator mode and following a player.

git-svn-id: svn://svn.icculus.org/quake3/trunk@2323 edf5b092-35ff-0310-97b2-ce42778d08ea
Don't include client.h in sdl_glimp.c as it is part of the external renderer lib.

git-svn-id: svn://svn.icculus.org/quake3/trunk@2324 edf5b092-35ff-0310-97b2-ce42778d08ea
Check last listener number instead of clc.clientNum in S_AL_HearingThroughEntity so sound work correctly when spectate following a client. (Related to bug 5741.)

git-svn-id: svn://svn.icculus.org/quake3/trunk@2325 edf5b092-35ff-0310-97b2-ce42778d08ea
When in third person, don't play player's sounds as full volume in Base sound system. OpenAL already does this. (Related to bug 5741.)

git-svn-id: svn://svn.icculus.org/quake3/trunk@2326 edf5b092-35ff-0310-97b2-ce42778d08ea
From /dev/humancontroller:
really fix the confusion with game entity and refentity numbers

for any natural number M, the following is logical as a whole:
- the array size for refentities is M;
- the refentity number limit is M-1, ie., each refentity number is in [0..M-1];
- the special number for the world is M.

before r1429, the code was roughly the following:

// constants related to the game, should not be used by the renderer

// renderer stuff
refEntity_t refEntities[MAX_ENTITIES];
int numRefEntities = 0;

void addRefEntity(refEntity_t re)
{
	if (numRefEntities >= ENTITYNUM_WORLD)
		return; // full
	refEntities[numRefEntities++] = re;
}

void render(int num)
{
	if (num == ENTITYNUM_WORLD)
		renderWorld();
	else
		renderRefEntity(refEntities[num]);
}

so before r1429,
- the array size for refentities was 1023;
- the refentity number limit was 1021, ie., each refentity number was in [0..1021]; and
- the special number for the world entity was 1022.
this was a small waste of memory, as the last array element wasn't used.

r1429 changed
	if (numRefEntities >= ENTITYNUM_WORLD)
to
	if (numRefEntities >= MAX_ENTITIES).

this creates the following configuration:
- the array size for refentities is 1023;
- the refentity number limit is 1022, ie., each refentity number is in [0..1022]; and
- the special number for the world entity is 1022.

r1429 just makes things worse: it allows 1 more refentity to be added, but that entity doesn't get drawn anyway, as its number will be equal to the special number for the world. this is a small waste of not only memory, but also processing time.

perhaps in XreaL,

ENTITYNUM_WORLD is a game entity constant, and has nothing to do with refentities. a new REFENTITYNUM_WORLD constant should be added to denote the special number for the world, and that constant should be used in the renderer code in place of ENTITYNUM_WORLD. so define such a constant, and let it be equal to MAX_ENTITIES, which is 1023.

git-svn-id: svn://svn.icculus.org/quake3/trunk@2327 edf5b092-35ff-0310-97b2-ce42778d08ea
From /dev/humancontroller:
to further reduce confusion, rename constants like MAX_ENTITIES to MAX_REFENTITIES

git-svn-id: svn://svn.icculus.org/quake3/trunk@2328 edf5b092-35ff-0310-97b2-ce42778d08ea
Merge remote-tracking branch 'upstream/master'

Conflicts:
	code/sdl/sdl_glimp.c
Sync with code/renderer changes
Merge branch 'master' into vbo_renderer
Sync with code/renderer changes from upstream/master