Lunatic: cancel logo on EVENT_LOGO error, fix CON mulscale and writable gv.

git-svn-id: https://svn.eduke32.com/eduke32@3593 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-03-24 18:52:41 +00:00
parent 95b1a2a791
commit 3e4a0dadf5
6 changed files with 24 additions and 3 deletions

View file

@ -9512,8 +9512,10 @@ static void G_DisplayLogo(void)
} }
} }
#ifdef LUNATIC
g_elEventError = 0;
#endif
VM_OnEvent(EVENT_LOGO, -1, screenpeek, -1, 0); VM_OnEvent(EVENT_LOGO, -1, screenpeek, -1, 0);
G_HandleAsync(); G_HandleAsync();
if (g_restorePalette) if (g_restorePalette)
@ -9521,6 +9523,10 @@ static void G_DisplayLogo(void)
P_SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); P_SetGamePalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0);
g_restorePalette = 0; g_restorePalette = 0;
} }
#ifdef LUNATIC
if (g_elEventError)
break;
#endif
nextpage(); nextpage();
} }
} }

View file

@ -1596,6 +1596,13 @@ function _startlevel(volume, level)
end end
function _setaspect(viewingrange, yxaspect) function _setaspect(viewingrange, yxaspect)
if (viewingrange==0) then
error('invalid argument #1: must be nonzero', 2)
end
if (yxaspect==0) then
error('invalid argument #2: must be nonzero', 2)
end
-- XXX: surely not all values are sane -- XXX: surely not all values are sane
ffiC.setaspect(viewingrange, yxaspect) ffiC.setaspect(viewingrange, yxaspect)
end end

View file

@ -949,6 +949,7 @@ local weaponaccess_mt = {
return ffiC.g_playerWeapon[wa._p][key] return ffiC.g_playerWeapon[wa._p][key]
end end
-- TODO: use bcarray?
return ffiC.g_playerWeapon[wa._p][ffiC[key.."_WEAPON"]] return ffiC.g_playerWeapon[wa._p][ffiC[key.."_WEAPON"]]
end, end,
} }
@ -1576,7 +1577,8 @@ local tmpmt = {
end, end,
__newindex = function(gv, key, val) __newindex = function(gv, key, val)
if (key=="g_logoFlags") then if (gv_access[key] == nil) then
-- Read-only vars handled by LuaJIT.
ffiC[key] = val ffiC[key] = val
else else
error("write access forbidden", 2) error("write access forbidden", 2)

View file

@ -1846,7 +1846,7 @@ local Cinner = {
cos = cmd(W,R) cos = cmd(W,R)
/ "%1=_xmath.kcos(%2)", / "%1=_xmath.kcos(%2)",
mulscale = cmd(W,R,R,R) mulscale = cmd(W,R,R,R)
/ "%1=_gv.Mulscale(%1,%2,%3)", / "%1=_gv.Mulscale(%2,%3,%4)",
getangle = cmd(W,R,R) getangle = cmd(W,R,R)
/ "%1=_gv.getangle(%2,%3)", / "%1=_gv.getangle(%2,%3)",
getincangle = cmd(W,R,R) getincangle = cmd(W,R,R)

View file

@ -23,6 +23,9 @@ uint8_t g_elEvents[MAXEVENTS];
// same thing for actors: // same thing for actors:
el_actor_t g_elActors[MAXTILES]; el_actor_t g_elActors[MAXTILES];
// Set to 1 on error in event.
int32_t g_elEventError;
int32_t g_elCallDepth = 0; int32_t g_elCallDepth = 0;
int32_t g_elEventRETURN; int32_t g_elEventRETURN;
@ -496,6 +499,7 @@ int32_t El_CallEvent(L_State *estate, int32_t eventidx, int32_t iActor, int32_t
if (i != 0) if (i != 0)
{ {
g_elEventError = 1;
g_eventIdx = eventidx; g_eventIdx = eventidx;
return L_HandleError(L, i, &El_EventErrorPrint); return L_HandleError(L, i, &El_EventErrorPrint);
} }

View file

@ -22,6 +22,8 @@ typedef struct
extern uint8_t g_elEvents[MAXEVENTS]; // shouldn't be used directly extern uint8_t g_elEvents[MAXEVENTS]; // shouldn't be used directly
extern el_actor_t g_elActors[MAXTILES]; extern el_actor_t g_elActors[MAXTILES];
extern int32_t g_elEventError;
extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES]; extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES];
extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES], g_actorMinMs[MAXTILES], g_actorMaxMs[MAXTILES]; extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES], g_actorMinMs[MAXTILES], g_actorMaxMs[MAXTILES];