mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Lunatic translator: music 0, add two userdefs members.
git-svn-id: https://svn.eduke32.com/eduke32@3567 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4601b2d203
commit
92e85fa0d3
3 changed files with 26 additions and 16 deletions
|
@ -2138,6 +2138,15 @@ void C_DefineSound(int32_t sndidx, const char *fn, int32_t args[5])
|
|||
|
||||
void C_DefineMusic(int32_t vol, int32_t lev, const char *fn)
|
||||
{
|
||||
if (vol==-1)
|
||||
{
|
||||
Bassert((unsigned)lev < MAXVOLUMES);
|
||||
|
||||
Bstrncpyz(EnvMusicFilename[lev], fn, BMAX_PATH);
|
||||
check_filename_case(EnvMusicFilename[lev]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Bassert((unsigned)vol < MAXVOLUMES+1);
|
||||
Bassert((unsigned)lev < MAXLEVELS);
|
||||
|
||||
|
@ -2148,6 +2157,7 @@ void C_DefineMusic(int32_t vol, int32_t lev, const char *fn)
|
|||
map->musicfn = dup_filename(fn);
|
||||
check_filename_case(map->musicfn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void C_DefineQuote(int32_t qnum, const char *qstr)
|
||||
|
|
|
@ -821,7 +821,9 @@ local UserdefLabels = {
|
|||
screen_tilting = UD".screen_tilting",
|
||||
showallmap = UDRO".showallmap",
|
||||
showweapons = UDRO".showweapons",
|
||||
statusbarscale = UDRO".statusbarscale",
|
||||
volume_number = { UD".volume_number", UD":set_volume_number(%%s)" },
|
||||
weaponscale = UDRO".weaponscale",
|
||||
weaponswitch = UD".weaponswitch",
|
||||
}
|
||||
|
||||
|
|
|
@ -955,22 +955,20 @@ function Cmd.definesound(sndnum, fn, ...)
|
|||
end
|
||||
|
||||
function Cmd.music(volnum, ...)
|
||||
if (volnum==0) then
|
||||
warnprintf("`music' for volume 0 not yet implemented")
|
||||
return
|
||||
end
|
||||
local envmusicp = (volnum==0)
|
||||
|
||||
if (not (volnum >= 1 and volnum <= conl.MAXVOLUMES)) then
|
||||
if (not (volnum >= 0 and volnum <= conl.MAXVOLUMES)) then
|
||||
-- NOTE: Don't allow MAXVOLUMES+1 for now.
|
||||
errprintf("volume number must be between 1 and MAXVOLUMES=%d", conl.MAXVOLUMES)
|
||||
errprintf("volume number must be between 0 and MAXVOLUMES=%d", conl.MAXVOLUMES)
|
||||
return
|
||||
end
|
||||
|
||||
local filenames = {...}
|
||||
local MAXFNS = envmusicp and conl.MAXVOLUMES or conl.MAXLEVELS
|
||||
|
||||
if (#filenames > conl.MAXLEVELS) then
|
||||
warnprintf("ignoring extraneous %d music file names", #filenames-conl.MAXLEVELS)
|
||||
for i=conl.MAXLEVELS+1,#filenames do
|
||||
if (#filenames > MAXFNS) then
|
||||
warnprintf("ignoring extraneous %d music file names", #filenames-MAXFNS)
|
||||
for i=MAXFNS+1,#filenames do
|
||||
filenames[i] = nil
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue