A_PlaySound is an action that plays a sound effect. Var1 determines the sound ID. If the lower 16 bits of Var2 are set to 0, the sound is played without an origin, if set to 1, the actor is used as the sound's origin. The upper 16 bits of Var2 determine if the sound should play during the preticker; if set to 1, the sound will not play during the preticker.
Attributes |
Use
|
Var1 |
Sound name
|
Var2 |
Upper 16 bits: 0 – Play sound during preticker; 1 – Don't play sound during preticker
Lower 16 bits: 0 – play sound without an origin; 1 – use actor as sound origin
|
Code – A_PlaySound
|
|
// Function: A_PlaySound
//
// Description: Plays a sound
//
// var1 = sound # to play
// var2:
// lower 16 bits = If 1, play sound using calling object as origin. If 0, play sound without an origin
// upper 16 bits = If 1, do not play sound during preticker.
//
void A_PlaySound(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_PlaySound", actor))
return;
#endif
if (leveltime < 2 && (locvar2 >> 16))
return;
S_StartSound((locvar2 & 65535) ? actor : NULL, locvar1);
}
|
|