Changeset 335
- Timestamp:
- 09/17/14 14:58:46 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_state.hh
r334 r335 24 24 25 25 #ifdef NV_DEBUG 26 #define NV_LUA_STACK ASSERT( state, value ) nv::lua::stack_assert __lua_stack_assert( state, value );26 #define NV_LUA_STACK_ASSERT( state, value ) nv::lua::stack_assert __lua_stack_assert( state, value ); 27 27 #else 28 #define NV_LUA_STACK ASSERT( state, value )28 #define NV_LUA_STACK_ASSERT( state, value ) 29 29 #endif 30 30 -
trunk/src/gl/gl_context.cc
r331 r335 63 63 glDeleteRenderbuffers( 1, &info->depth_rb_glid ); 64 64 glDeleteFramebuffers( 1, &info->glid ); 65 m_framebuffers.destroy( f ); 65 66 } 66 67 } -
trunk/src/lua/lua_area.cc
r334 r335 403 403 static int luaopen_area( lua_State * L ) 404 404 { 405 NV_LUA_STACK ASSERT( L, 0);405 NV_LUA_STACK_ASSERT( L, 1 ); 406 406 static const struct luaL_Reg nlua_area_sf [] = { 407 407 { "new", nlua_area_new }, -
trunk/src/lua/lua_handle.cc
r333 r335 7 7 #include "nv/lua/lua_handle.hh" 8 8 9 #include "nv/lua/lua_state.hh" 9 10 #include "nv/lua/lua_raw.hh" 10 11 … … 12 13 void nv::lua::detail::push_handle_impl( lua_State* L, int pseudoindex, uint32 index ) 13 14 { 14 int stack = lua_gettop(L);15 NV_LUA_STACK_ASSERT( L, +1 ); 15 16 lua_rawgeti( L, LUA_REGISTRYINDEX, pseudoindex ); // table 16 17 lua_rawgeti( L, -1, index ); // table, entry 17 if ( lua_isnil( L, -1 ) )18 if ( !lua_istable( L, -1 ) ) 18 19 { 19 20 NV_LOG( nv::LOG_ERROR, "NIL" ); 21 lua_pop( L, 2 ); 22 lua_pushnil( L ); 23 return; 20 24 } 21 lua_replace( L, stack + 1 ); 22 lua_settop( L, stack + 1 ); 25 lua_replace( L, -2 ); 23 26 } 24 27 25 28 nv::lua::detail::handle_struct nv::lua::detail::to_handle_impl( lua_State* L, int i, uint32 dindex, uint32 dcounter ) 26 29 { 30 NV_LUA_STACK_ASSERT( L, 0 ); 27 31 handle_conversion hc; 28 32 hc.h.index = dindex; … … 59 63 void nv::lua::detail::unregister_handle_impl( lua_State* L, int pseudoindex, uint32 index ) 60 64 { 61 int stack = lua_gettop(L);65 NV_LUA_STACK_ASSERT( L, 0 ); 62 66 lua_rawgeti( L, LUA_REGISTRYINDEX, pseudoindex ); // table 63 67 lua_pushinteger( L, 0 ); 64 68 lua_rawseti( L, -2, index ); 65 lua_ settop( L, stack);69 lua_pop( L, 1 ); 66 70 }
Note: See TracChangeset
for help on using the changeset viewer.