Changeset 217 for trunk/src/lua/lua_state.cc
- Timestamp:
- 09/10/13 18:11:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r216 r217 8 8 9 9 #include "nv/lua/lua_raw.hh" 10 #include "nv/lua/lua_nova.hh" 10 11 #include "nv/logging.hh" 11 12 #include "nv/string.hh" … … 235 236 lib->func( m_state ); 236 237 } 238 register_nova( this ); 237 239 } 238 240 … … 337 339 } 338 340 deep_pointer_copy( -1, o ); 341 return luaL_ref( m_state, LUA_REGISTRYINDEX ); 342 } 343 344 lua::reference lua::state::register_proto( object * o, const char* storage ) 345 { 346 stack_guard guard( this ); 347 lua_getglobal( m_state, storage ); 348 if ( lua_isnil( m_state, -1 ) ) 349 { 350 NV_THROW( runtime_error, std::string( storage ) + " storage not registered!" ); 351 } 352 lua_getfield( m_state, -1, o->get_id().c_str() ); 353 if ( lua_isnil( m_state, -1 ) ) 354 { 355 NV_THROW( runtime_error, std::string( o->get_id() ) + " not found in " + std::string( storage ) + " storage!" ); 356 } 339 357 return luaL_ref( m_state, LUA_REGISTRYINDEX ); 340 358 }
Note: See TracChangeset
for help on using the changeset viewer.