mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Lunatic: make gv.current{Level,Episode} one-based and document them.
Also, in LunaCON, make player .palette member read-only. BUILD_LUNATIC. git-svn-id: https://svn.eduke32.com/eduke32@4260 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b79ee42553
commit
14db86ebb5
5 changed files with 10 additions and 11 deletions
|
@ -649,7 +649,7 @@ local PlayerLabels = {
|
|||
|
||||
curr_weapon = PL".curr_weapon",
|
||||
|
||||
palette = PL".palette",
|
||||
palette = { PL".palette" },
|
||||
|
||||
-- NOTE the special case:
|
||||
pals = PL"._pals[%s]",
|
||||
|
|
|
@ -314,7 +314,7 @@ __attribute__((packed)) struct {
|
|||
const<W-> int8_t wantweaponfire;
|
||||
const<W> int8_t curr_weapon;
|
||||
|
||||
uint8_t palette;
|
||||
const uint8_t palette;
|
||||
palette_t _pals;
|
||||
int8_t _palsfadespeed, _palsfadenext, _palsfadeprio, _padding2;
|
||||
|
||||
|
@ -1542,11 +1542,11 @@ end
|
|||
|
||||
-- TODO: make return 1-based index?
|
||||
function gv_access.currentEpisode()
|
||||
return ffiC.ud.volume_number
|
||||
return ffiC.ud.volume_number + 1
|
||||
end
|
||||
|
||||
function gv_access.currentLevel()
|
||||
return ffiC.ud.level_number
|
||||
return ffiC.ud.level_number + 1
|
||||
end
|
||||
|
||||
function gv_access.doQuake(gametics, snd)
|
||||
|
|
|
@ -419,12 +419,11 @@ etc. for the next `gametics` game tics. If a sound index `snd` is passed, also
|
|||
start playing that sound.
|
||||
// TODO: Play sound how? ("globalsound")
|
||||
|
||||
//////////
|
||||
`gv.currentEpisode()`::
|
||||
TODO
|
||||
Returns the one-based number of the episode currently being played.
|
||||
|
||||
`gv.currentLevel()`::
|
||||
TODO
|
||||
//////////
|
||||
Returns the one-based number of the level currently being played.
|
||||
|
||||
[[Lunatic_structures]]
|
||||
Lunatic structures
|
||||
|
|
|
@ -427,8 +427,8 @@ local function new_initial_gvartab()
|
|||
WEAPON = PRO(PLSX".curr_weapon"),
|
||||
WORKSLIKE = PRO(format(PLSX".weapon[%s].workslike", PLSX".curr_weapon")),
|
||||
|
||||
VOLUME = RO "_gv.currentEpisode()",
|
||||
LEVEL = RO "_gv.currentLevel()",
|
||||
VOLUME = RO "_gv._ud.volume_number",
|
||||
LEVEL = RO "_gv._ud.level_number",
|
||||
}
|
||||
|
||||
-- Reserved bits
|
||||
|
|
|
@ -50,7 +50,7 @@ gameevent
|
|||
"ENTERLEVEL",
|
||||
|
||||
function()
|
||||
local vol, lev = gv.currentEpisode()+1, gv.currentLevel()+1
|
||||
local vol, lev = gv.currentEpisode(), gv.currentLevel()
|
||||
printf('volume=%d, level=%d', vol, lev)
|
||||
|
||||
if (vol ~= 4) then
|
||||
|
|
Loading…
Reference in a new issue