mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-05-08 05:50:38 +00:00
CON: Add commands "swaptrackslot" and "preloadtrackslotforswap"
git-svn-id: https://svn.eduke32.com/eduke32@6623 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0d1137be5d
commit
d41a013a57
3 changed files with 35 additions and 1 deletions
|
@ -380,6 +380,7 @@ static tokenmap_t const vm_keywords[] =
|
||||||
{ "precache", CON_PRECACHE },
|
{ "precache", CON_PRECACHE },
|
||||||
{ "prevspritesect", CON_PREVSPRITESECT },
|
{ "prevspritesect", CON_PREVSPRITESECT },
|
||||||
{ "prevspritestat", CON_PREVSPRITESTAT },
|
{ "prevspritestat", CON_PREVSPRITESTAT },
|
||||||
|
{ "preloadtrackslotforswap", CON_PRELOADTRACKSLOTFORSWAP },
|
||||||
{ "pstomp", CON_PSTOMP },
|
{ "pstomp", CON_PSTOMP },
|
||||||
{ "qgetsysstr", CON_QGETSYSSTR },
|
{ "qgetsysstr", CON_QGETSYSSTR },
|
||||||
{ "qspawnvar", CON_QSPAWNVAR },
|
{ "qspawnvar", CON_QSPAWNVAR },
|
||||||
|
@ -492,6 +493,7 @@ static tokenmap_t const vm_keywords[] =
|
||||||
{ "subvar", CON_SUBVAR },
|
{ "subvar", CON_SUBVAR },
|
||||||
{ "subvarvar", CON_SUBVARVAR },
|
{ "subvarvar", CON_SUBVARVAR },
|
||||||
{ "switch", CON_SWITCH },
|
{ "switch", CON_SWITCH },
|
||||||
|
{ "swaptrackslot", CON_SWAPTRACKSLOT },
|
||||||
{ "time", CON_TIME },
|
{ "time", CON_TIME },
|
||||||
{ "tip", CON_TIP },
|
{ "tip", CON_TIP },
|
||||||
{ "tossweapon", CON_TOSSWEAPON },
|
{ "tossweapon", CON_TOSSWEAPON },
|
||||||
|
@ -4205,6 +4207,8 @@ DO_DEFSTATE:
|
||||||
case CON_ACTORSOUND:
|
case CON_ACTORSOUND:
|
||||||
case CON_STOPACTORSOUND:
|
case CON_STOPACTORSOUND:
|
||||||
case CON_STARTTRACKSLOT:
|
case CON_STARTTRACKSLOT:
|
||||||
|
case CON_SWAPTRACKSLOT:
|
||||||
|
case CON_PRELOADTRACKSLOTFORSWAP:
|
||||||
C_GetManyVars(2);
|
C_GetManyVars(2);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -1208,6 +1208,8 @@ enum ScriptKeywords_t
|
||||||
CON_QSTRCMP, // 411
|
CON_QSTRCMP, // 411
|
||||||
CON_DIVR, // 412
|
CON_DIVR, // 412
|
||||||
CON_DIVRU, // 413
|
CON_DIVRU, // 413
|
||||||
|
CON_SWAPTRACKSLOT, // 414
|
||||||
|
CON_PRELOADTRACKSLOTFORSWAP, // 415
|
||||||
CON_END
|
CON_END
|
||||||
};
|
};
|
||||||
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua
|
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua
|
||||||
|
|
|
@ -1146,11 +1146,16 @@ static int G_StartTrackSlot(int const volumeNum, int const levelNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef LUNATIC
|
#ifndef LUNATIC
|
||||||
static void G_StartTrackSlotWrap(int const volumeNum, int const levelNum)
|
static int G_StartTrackSlotWrap(int const volumeNum, int const levelNum)
|
||||||
{
|
{
|
||||||
if (EDUKE32_PREDICT_FALSE(G_StartTrackSlot(volumeNum, levelNum)))
|
if (EDUKE32_PREDICT_FALSE(G_StartTrackSlot(volumeNum, levelNum)))
|
||||||
|
{
|
||||||
CON_ERRPRINTF("invalid level %d or null music for volume %d level %d\n",
|
CON_ERRPRINTF("invalid level %d or null music for volume %d level %d\n",
|
||||||
levelNum, volumeNum, levelNum);
|
levelNum, volumeNum, levelNum);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int G_StartTrack(int const levelNum)
|
int G_StartTrack(int const levelNum)
|
||||||
|
@ -5054,6 +5059,29 @@ finish_qsprintf:
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case CON_SWAPTRACKSLOT:
|
||||||
|
insptr++;
|
||||||
|
{
|
||||||
|
int const volumeNum = Gv_GetVarX(*(insptr++));
|
||||||
|
int const levelNum = Gv_GetVarX(*(insptr++));
|
||||||
|
|
||||||
|
if (volumeNum == ud.music_episode && levelNum == ud.music_level)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// This is the best ASS can do right now. Better implementation pending.
|
||||||
|
int32_t position = S_GetMusicPosition();
|
||||||
|
if (!G_StartTrackSlotWrap(volumeNum == -1 ? MAXVOLUMES : volumeNum, levelNum))
|
||||||
|
S_SetMusicPosition(position);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case CON_PRELOADTRACKSLOTFORSWAP:
|
||||||
|
// ASS can't even handle this command right now.
|
||||||
|
insptr++;
|
||||||
|
Gv_GetVarX(*(insptr++));
|
||||||
|
Gv_GetVarX(*(insptr++));
|
||||||
|
continue;
|
||||||
|
|
||||||
case CON_SETMUSICPOSITION:
|
case CON_SETMUSICPOSITION:
|
||||||
insptr++;
|
insptr++;
|
||||||
Gv_GetVarX(*(insptr++));
|
Gv_GetVarX(*(insptr++));
|
||||||
|
|
Loading…
Reference in a new issue