CON: New command 'screensound', unconditionally playing a session-wide sound.

git-svn-id: https://svn.eduke32.com/eduke32@3912 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-06-28 14:07:46 +00:00
parent b2c5e2d807
commit 6a33c2eec1
5 changed files with 16 additions and 0 deletions

View file

@ -94,6 +94,7 @@ static struct { uint32_t keyw; uint32_t date; } g_keywdate[] =
{ CON_ACTIVATE, 20130522 },
{ CON_SCREENTEXT, 20130529 },
{ CON_DYNAMICSOUNDREMAP, 20130530 },
{ CON_SCREENSOUND, 20130628 },
};
#endif
@ -591,6 +592,7 @@ const char *keyw[] =
"qstrdim", // 369
"screentext", // 370
"dynamicsoundremap", // 371
"screensound", // 372
"<null>"
};
#endif
@ -4101,6 +4103,7 @@ static int32_t C_ParseCommand(int32_t loop)
case CON_SOUNDVAR:
case CON_GLOBALSOUNDVAR:
case CON_STOPSOUNDVAR:
case CON_SCREENSOUND:
case CON_SOUNDONCEVAR:
case CON_ANGOFFVAR:
case CON_CHECKAVAILWEAPON:

View file

@ -945,6 +945,7 @@ enum ScriptKeywords_t
CON_QSTRDIM, // 369
CON_SCREENTEXT, // 370
CON_DYNAMICSOUNDREMAP, // 371
CON_SCREENSOUND, // 372
CON_END
};
#endif

View file

@ -2592,6 +2592,7 @@ nullquote:
case CON_STOPSOUNDVAR:
case CON_SOUNDONCEVAR:
case CON_GLOBALSOUNDVAR:
case CON_SCREENSOUND:
insptr++;
{
int32_t j=Gv_GetVarX(*insptr++);
@ -2618,6 +2619,9 @@ nullquote:
case CON_SOUNDVAR:
A_PlaySound((int16_t)j,vm.g_i);
continue;
case CON_SCREENSOUND:
A_PlaySound(j, -1);
continue;
}
}
continue;

View file

@ -1667,6 +1667,12 @@ function _globalsound(pli, sndidx)
end
end
-- This one unconditionally plays a session-wide sound.
function _screensound(sndidx)
check_sound_idx(sndidx)
CF.A_PlaySound(sndidx, -1)
end
-- This is a macro for EDuke32 (game.h)
local function S_StopSound(sndidx)
ffiC.S_StopEnvSound(sndidx, -1)

View file

@ -2171,6 +2171,8 @@ local Cinner = {
/ "_con._stopactorsound(%1,%2)",
stopallsounds = cmd()
/ "_con._stopallsounds()",
screensound = cmd(R)
/ "_con._screensound(%1)",
mikesnd = cmd()
/ format("_con._soundonce(_aci,%s)", SPS".yvel"),
setactorsoundpitch = cmd(R,R,R)