- Timestamp:
- 09/09/13 21:14:19 (12 years ago)
- Location:
- trunk/src/lua
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_flags.cc
r209 r215 20 20 // TODO : this can be optimized 21 21 lua_createtable( L, 0, 0 ); 22 for ( uint32 c = 0; c < count; ++c )22 for ( int c = 0; c < static_cast< int >( count ); ++c ) 23 23 { 24 uint32idx = c / 8;25 uint32pos = c % 8;24 int idx = c / 8; 25 int pos = c % 8; 26 26 if ( ( data[ idx ] & ( 1 << static_cast< uint8 >( pos ) ) ) != 0 ) 27 27 { -
trunk/src/lua/lua_state.cc
r213 r215 32 32 } 33 33 34 lua::state::state( lua_State* state ) : state_wrapper( state, false ) 35 { 36 37 } 38 39 lua::state::state( bool load_libs /*= false*/ ) : state_wrapper( nullptr, true ) 34 lua::state::state( lua_State* state ) : state_wrapper( state, false ), m_type_database( nullptr ) 35 { 36 37 } 38 39 lua::state::state( bool load_libs /*= false*/ ) : state_wrapper( nullptr, true ), m_type_database( nullptr ) 40 40 { 41 41 load_lua_library(); … … 49 49 if ( load_libs ) 50 50 { 51 m_type_database = new type_database(); 51 52 stack_guard guard( this ); 52 53 static const luaL_Reg lualibs[] = … … 290 291 lua::reference lua::state::register_object( object * o ) 291 292 { 292 if ( o == nullptr ) return ref_none; 293 type_database *db = o->get_root()->get_type_database(); 294 if ( db == nullptr ) return ref_none; 295 type_entry* t = db->get_type(typeid(*o)); 293 if ( o == nullptr || m_type_database == nullptr ) return ref_none; 294 type_entry* t = m_type_database->get_type(typeid(*o)); 296 295 if ( t == nullptr ) return ref_none; 297 296 return register_object( o, t->name.c_str() ); … … 359 358 } 360 359 361 void lua::state::register_enum ( type_database* db,const std::string& name, const std::string& prefix /*= std::string() */ )362 { 363 type_entry* et = db->get_type( name );360 void lua::state::register_enum_values( const std::string& name, const std::string& prefix /*= std::string() */ ) 361 { 362 type_entry* et = m_type_database->get_type( name ); 364 363 365 364 for ( const auto& entry : et->enum_list ) … … 388 387 } 389 388 389 nv::lua::state::~state() 390 { 391 if (m_type_database != nullptr ) 392 { 393 delete m_type_database; 394 } 395 } 396 390 397 bool nv::lua::state_wrapper::is_defined( const path& p, bool global ) 391 398 {
Note: See TracChangeset
for help on using the changeset viewer.