Changeset 209


Ignore:
Timestamp:
08/19/13 11:40:56 (12 years ago)
Author:
epyon
Message:
  • lua_flags - dedicated flags module and lua type passing support
  • minor cleanups
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/lua/lua_area.hh

    r208 r209  
    3838                {
    3939                        static void push( lua_State *L, const rectangle& p ) { detail::push_area( L, p ); }
    40                         static void pop( lua_State *L, rectangle& p ) { p = detail::to_area( L, -1 ); detail::pop_and_discard( L, 1 ); }
    4140                        static rectangle to( lua_State *L, int index ) { return detail::to_area( L, index ); }
    4241                };
  • trunk/nv/lua/lua_state.hh

    r207 r209  
    203203                        bool get_boolean( const std::string& element, bool defval = false );
    204204
    205                         template< uint32 SIZE, typename T >
    206                         flags< SIZE, T > get_flags( const std::string& element )
    207                         {
    208                                 flags< SIZE, T > result;
    209                                 get_raw_flags( element, result.data(), result.size() );
    210                                 return result;
    211                         }
    212 
    213                         template< uint32 SIZE, typename T >
    214                         void load_flags( const std::string& element, flags< SIZE, T >& flags )
    215                         {
    216                                 get_raw_flags( element, flags.data(), flags.size() );
    217                         }
    218 
    219                 private:
    220                         void get_raw_flags( const std::string& element, uint8* data, uint32 count );
    221 
     205                private:
    222206                        int m_level;
    223207                };
  • trunk/src/lua/lua_state.cc

    r207 r209  
    251251}
    252252
    253 void lua::table_guard::get_raw_flags( const std::string& element, uint8* data, uint32 count )
    254 {
    255         lua_getfield( m_state, -1, element.c_str() );
    256         if ( lua_type( m_state, -1 ) != LUA_TTABLE )
    257         {
    258                 lua_pop( m_state, 1 );
    259                 return;
    260         }
    261         nlua_toflags( m_state, -1, data, count );
    262         lua_pop( m_state, 1 );
    263 }
    264 
    265 
    266253void lua::state::log_stack()
    267254{
Note: See TracChangeset for help on using the changeset viewer.