From 1486a2937b4f6f5d89a91f8317965f258c68e587 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 2 Aug 2014 17:24:39 +0000 Subject: [PATCH] A couple of Lunatic updates. DONT_BUILD. - LunaCON: support for setting userdef[].m_volume_number, getting .last_level - bump con_lang.MAXEVENTS - fix compilation of astub.c git-svn-id: https://svn.eduke32.com/eduke32@4567 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 4 ++-- polymer/eduke32/source/lunatic/con_lang.lua | 6 ++++-- polymer/eduke32/source/lunatic/defs.ilua | 8 ++++++++ polymer/eduke32/source/lunatic/lunacon.lua | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index f7cd50103..cfbac3a73 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9860,8 +9860,8 @@ int32_t ExtPostStartupWindow(void) { extern const char luaJIT_BC_defs_m32[]; - i = L_RunString(&g_EmState, (char *)luaJIT_BC_defs_m32, 0, - LUNATIC_DEFS_M32_BC_SIZE, "defs_m32.ilua"); + int32_t i = L_RunString(&g_EmState, (char *)luaJIT_BC_defs_m32, 0, + LUNATIC_DEFS_M32_BC_SIZE, "defs_m32.ilua"); if (i != 0) { Em_DestroyState(&g_EmState); diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index 874d1f4cf..0ee301691 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -17,7 +17,6 @@ MAXGAMETYPES = 16 MAXSKILLS = 7 -MAXEVENTS = 96 -- KEEPINSYNC with EVENT_* list MAXSOUNDS = 4096 MAXSESSIONVARS = 8 -- KEEPINSYNC lunatic_game.c @@ -174,6 +173,8 @@ EVENT = { -- EVENT_ANIMATEALLSPRITES = 97, -- internal } +MAXEVENTS = 97 -- KEEPINSYNC with above EVENT_* list + -- NOTE: negated values are not exported to the ffi.C namespace or CON. -- See TWEAK_SFLAG below. SFLAG = { @@ -852,11 +853,12 @@ local UserdefLabels = { fta_on = UD".fta_on", god = UDRO".god", idplayers = UDRO".idplayers", + last_level = UDRO".lastlevel", level_number = { UD".level_number", UD":set_level_number(%%s)", {0, MAXLEVELS-1} }, levelstats = UD".levelstats", lockout = UDRO".lockout", m_player_skill = UDRO".m_player_skill", - m_volume_number = UDRO".m_volume_number", + m_volume_number = { UD".m_volume_number", UD":set_m_volume_number(%%s)", {0, MAXVOLUMES} }, mouseaiming = UD".mouseaiming", pause_on = UDRO".pause_on", player_skill = UD".player_skill", diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 98b292e95..9cf4b5deb 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -1486,6 +1486,14 @@ local user_defs_mt = { ud.volume_number = volume_number end, + set_m_volume_number = function(ud, volume_number) + -- NOTE: allow volume_number==MAXVOLUMES. + if (not (volume_number==con_lang.MAXVOLUMES)) then + bcheck.volume_idx(volume_number) + end + ud.m_volume_number = volume_number + end, + set_level_number = function(ud, level_number) bcheck.level_idx(level_number) ud.level_number = level_number diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index f72352e15..a3a70b51e 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -444,7 +444,7 @@ local function new_initial_gvartab() } -- Reserved bits - gamevar.LOGO_FLAGS.rbits = bit.bnot(2097151) + gamevar.LOGO_FLAGS.rbits = bit.bnot(0x001fffff) for w=0,C.MAX_WEAPONS-1 do for i=1,#wmembers do