mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Lunatic: on the Lua side, rename gv.g_RETURN to the prettier gv.RETURN.
On the C side, keep the name g_RETURN. I'm still superstitious about dropping the "g_". git-svn-id: https://svn.eduke32.com/eduke32@4031 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
55a3cda9e1
commit
15bcfe3f34
3 changed files with 18 additions and 14 deletions
|
@ -581,7 +581,6 @@ ffi.cdef[[
|
|||
const int32_t screenpeek;
|
||||
hudweapon_t hudweap;
|
||||
int32_t g_logoFlags;
|
||||
int32_t g_RETURN;
|
||||
]]
|
||||
|
||||
-- INTERNAL VARIABLES/FUNCTIONS
|
||||
|
@ -589,6 +588,7 @@ decl("map_t MapInfo[$*$];", con_lang.MAXVOLUMES+1, con_lang.MAXLEVELS)
|
|||
decl("char EpisodeNames[$][33];", con_lang.MAXVOLUMES)
|
||||
|
||||
decl[[
|
||||
int32_t g_RETURN;
|
||||
int32_t g_elCONSize;
|
||||
char *g_elCON;
|
||||
void El_SetCON(const char *conluacode);
|
||||
|
@ -2342,9 +2342,11 @@ end
|
|||
-- Map of 'gv' variable names to C ones.
|
||||
local varnameMap = {
|
||||
gametic = "g_moveThingsCount",
|
||||
RETURN = "g_RETURN",
|
||||
}
|
||||
|
||||
gv_access.gametic = true
|
||||
gv_access.RETURN = true
|
||||
|
||||
local tmpmt = {
|
||||
__index = function(_, key)
|
||||
|
@ -2365,6 +2367,8 @@ local tmpmt = {
|
|||
if (gv_access[key] == nil) then
|
||||
-- Variables declared 'const' are handled by LuaJIT.
|
||||
ffiC[key] = val
|
||||
elseif (varnameMap[key]) then
|
||||
ffiC[varnameMap[key]] = val
|
||||
else
|
||||
error("write access forbidden", 2)
|
||||
end
|
||||
|
|
|
@ -347,7 +347,7 @@ local function new_initial_gvartab()
|
|||
-- NOTE: THISACTOR can mean different things in some contexts.
|
||||
THISACTOR = RO "_aci",
|
||||
|
||||
RETURN = RW "_gv.g_RETURN",
|
||||
RETURN = RW "_gv.RETURN",
|
||||
HITAG = RW(CSV".HITAG"),
|
||||
LOTAG = RW(CSV".LOTAG"),
|
||||
TEXTURE = RW(CSV".TEXTURE"),
|
||||
|
@ -2277,7 +2277,7 @@ local Cinner = {
|
|||
operatemasterswitches = cmd(R)
|
||||
/ "_con._G_OperateMasterSwitches(%1)",
|
||||
checkactivatormotion = cmd(R)
|
||||
/ "_gv.g_RETURN=_con._checkactivatormotion(%1)",
|
||||
/ "_gv.RETURN=_con._checkactivatormotion(%1)",
|
||||
time = cmd(R) -- no-op
|
||||
/ "",
|
||||
inittimer = cmd(R)
|
||||
|
@ -2350,17 +2350,17 @@ local Cinner = {
|
|||
spawn = cmd(D)
|
||||
/ "_con.spawn(%1,_aci)",
|
||||
espawn = cmd(D)
|
||||
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
|
||||
/ "_gv.RETURN=_con.spawn(%1,_aci)",
|
||||
espawnvar = cmd(R)
|
||||
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
|
||||
/ "_gv.RETURN=_con.spawn(%1,_aci)",
|
||||
qspawn = cmd(D)
|
||||
/ "_con.spawn(%1,_aci,true)",
|
||||
qspawnvar = cmd(R)
|
||||
/ "_con.spawn(%1,_aci,true)",
|
||||
eqspawn = cmd(D)
|
||||
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
|
||||
/ "_gv.RETURN=_con.spawn(%1,_aci,true)",
|
||||
eqspawnvar = cmd(R)
|
||||
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
|
||||
/ "_gv.RETURN=_con.spawn(%1,_aci,true)",
|
||||
|
||||
angoff = cmd(D)
|
||||
/ "spriteext[_aci].angoff=%1",
|
||||
|
@ -2390,13 +2390,13 @@ local Cinner = {
|
|||
/ ACS".timetosleep=%1",
|
||||
|
||||
eshoot = cmd(D)
|
||||
/ "_gv.g_RETURN=_con._shoot(_aci,%1)",
|
||||
/ "_gv.RETURN=_con._shoot(_aci,%1)",
|
||||
eshootvar = cmd(R)
|
||||
/ "_gv.g_RETURN=_con._shoot(_aci,%1)",
|
||||
/ "_gv.RETURN=_con._shoot(_aci,%1)",
|
||||
ezshoot = cmd(R,D)
|
||||
/ "_gv.g_RETURN=_con._shoot(_aci,%2,%1)",
|
||||
/ "_gv.RETURN=_con._shoot(_aci,%2,%1)",
|
||||
ezshootvar = cmd(R,R)
|
||||
/ "_gv.g_RETURN=_con._shoot(_aci,%2,%1)",
|
||||
/ "_gv.RETURN=_con._shoot(_aci,%2,%1)",
|
||||
shoot = cmd(D)
|
||||
/ "_con._shoot(_aci,%1)",
|
||||
shootvar = cmd(R)
|
||||
|
@ -2439,9 +2439,9 @@ local Cinner = {
|
|||
|
||||
-- player/sprite searching
|
||||
findplayer = cmd(W)
|
||||
/ "_gv.g_RETURN,%1=_con._findplayer(_pli,_aci)", -- player index, distance
|
||||
/ "_gv.RETURN,%1=_con._findplayer(_pli,_aci)", -- player index, distance
|
||||
findotherplayer = cmd(W)
|
||||
/ "_gv.g_RETURN,%1=0,0x7fffffff", -- TODO_MP
|
||||
/ "_gv.RETURN,%1=0,0x7fffffff", -- TODO_MP
|
||||
findnearspritezvar = cmd(D,R,R,W)
|
||||
/ "%4=_con._findnear(_aci,true,'z',%1,%2,%3)",
|
||||
findnearspritez = cmd(D,D,D,W)
|
||||
|
|
|
@ -628,7 +628,7 @@ gameevent
|
|||
|
||||
function (aci, pli)
|
||||
local ps = player[pli]
|
||||
local neww, curw = gv.g_RETURN, ps.curr_weapon
|
||||
local neww, curw = gv.RETURN, ps.curr_weapon
|
||||
|
||||
local r, g, b = testbit(neww, 1), testbit(neww, 2), testbit(neww, 4)
|
||||
local speed = FADE_SPEED[neww] or 1
|
||||
|
|
Loading…
Reference in a new issue