Lua support for sprite2.

This commit is contained in:
toasterbabe 2016-11-11 21:37:28 +00:00
parent d8096d237a
commit 9aa41582c3

View file

@ -34,6 +34,7 @@ enum mobj_e {
mobj_angle, mobj_angle,
mobj_sprite, mobj_sprite,
mobj_frame, mobj_frame,
mobj_sprite2,
mobj_anim_duration, mobj_anim_duration,
mobj_touching_sectorlist, mobj_touching_sectorlist,
mobj_subsector, mobj_subsector,
@ -93,6 +94,7 @@ static const char *const mobj_opt[] = {
"angle", "angle",
"sprite", "sprite",
"frame", "frame",
"sprite2",
"anim_duration", "anim_duration",
"touching_sectorlist", "touching_sectorlist",
"subsector", "subsector",
@ -189,6 +191,9 @@ static int mobj_get(lua_State *L)
case mobj_frame: case mobj_frame:
lua_pushinteger(L, mo->frame); lua_pushinteger(L, mo->frame);
break; break;
case mobj_sprite2:
lua_pushinteger(L, mo->sprite2);
break;
case mobj_anim_duration: case mobj_anim_duration:
lua_pushinteger(L, mo->anim_duration); lua_pushinteger(L, mo->anim_duration);
break; break;
@ -411,6 +416,9 @@ static int mobj_set(lua_State *L)
case mobj_frame: case mobj_frame:
mo->frame = (UINT32)luaL_checkinteger(L, 3); mo->frame = (UINT32)luaL_checkinteger(L, 3);
break; break;
case mobj_sprite2:
mo->sprite2 = (UINT8)luaL_checkinteger(L, 3);
break;
case mobj_anim_duration: case mobj_anim_duration:
mo->anim_duration = (UINT16)luaL_checkinteger(L, 3); mo->anim_duration = (UINT16)luaL_checkinteger(L, 3);
break; break;