]>
git.r.bdr.sh - rbdr/pico-engine/blob - LuaRestoreStack.h
1 // ---------------------------------------------------------------------------
2 // FILE NAME : LuaRestoreStack.h
3 // ---------------------------------------------------------------------------
6 // Restores the Lua stack to the way we found it :)
8 // ---------------------------------------------------------------------------
11 // AUTHOR : Richard Shephard
12 // ---------------------------------------------------------------------------
13 // LIBRARY INCLUDE FILES
14 #ifndef __LUA_RESTORE_STACK_H__
15 #define __LUA_RESTORE_STACK_H__
19 class CLuaRestoreStack
22 CLuaRestoreStack (CLuaVirtualMachine
& vm
) : m_pState (NULL
)
24 m_pState
= (lua_State
*) vm
;
27 m_iTop
= lua_gettop (m_pState
);
31 virtual ~CLuaRestoreStack (void)
33 lua_settop (m_pState
, m_iTop
);
42 #endif // __LUA_RESTORE_STACK_H__