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

View file

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

View file

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

View file

@ -1667,6 +1667,12 @@ function _globalsound(pli, sndidx)
end end
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) -- This is a macro for EDuke32 (game.h)
local function S_StopSound(sndidx) local function S_StopSound(sndidx)
ffiC.S_StopEnvSound(sndidx, -1) ffiC.S_StopEnvSound(sndidx, -1)

View file

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