Changeset 449 for trunk/src/lua


Ignore:
Timestamp:
07/30/15 14:06:24 (10 years ago)
Author:
epyon
Message:
  • metatable types cleanup
  • fix for nlua_typecontent
Location:
trunk/src/lua
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_area.cc

    r395 r449  
    99#include "nv/lua/lua_raw.hh"
    1010#include "nv/core/random.hh"
    11 
    12 const char* nv::lua::detail::AREA_METATABLE = "area";
    1311
    1412using nv::lua::detail::is_coord;
     
    446444        };
    447445
    448         luaL_newmetatable( L, nv::lua::detail::AREA_METATABLE );
     446        luaL_newmetatable( L, nv::lua::pass_traits< nv::rectangle >::metatable() );
    449447        nlua_register( L, nlua_area_m, -1 );
    450448        lua_createtable( L, 0, 0 );
  • trunk/src/lua/lua_glm.cc

    r406 r449  
    339339        };
    340340
    341         luaL_newmetatable( L, nv::lua::detail::glm_metatable_name<T>() );
     341        luaL_newmetatable( L, nv::lua::pass_traits<T>::metatable() );
    342342        nlua_register( L, nlua_vec_m, -1 );
    343343        lua_createtable( L, 0, 0 );
  • trunk/src/lua/lua_raw.cc

    r441 r449  
    2424        {
    2525                nv::string64 buffer;
    26                 size_t l = nv::uint64_to_buffer( buffer, nv::uint64( lua_touserdata( L, idx ) ) );
     26                buffer.append( nv::uint64( lua_touserdata( L, idx ) ) );
    2727                return buffer;
    2828        }
     
    3030        {
    3131                nv::string64 buffer;
    32                 size_t l = nv::f64_to_buffer( buffer, lua_tonumber( L, idx ) );
     32                buffer.append( nv::uint64( lua_touserdata( L, idx ) ) );
    3333                return buffer;
    3434        }
  • trunk/src/lua/lua_values.cc

    r445 r449  
    2323}
    2424
    25 void* nv::lua::detail::check_userdata( lua_State *L, int index, const char* metatable )
     25void* nv::lua::detail::raw_check_userdata( lua_State *L, int index, const char* metatable )
    2626{
    2727        return luaL_checkudata( L, index, metatable );
    2828}
    2929
    30 void* nv::lua::detail::allocate_userdata( lua_State *L, size_t size, const char* metatable )
     30void* nv::lua::detail::raw_allocate_userdata( lua_State *L, size_t size, const char* metatable )
    3131{
    3232        void* result = lua_newuserdata(L, size);
     
    6363{
    6464        lua_pushboolean( L, v );
    65 }
    66 
    67 void nv::lua::detail::push_cstring ( lua_State *L, const char* s )
    68 {
    69         lua_pushstring( L, s );
    7065}
    7166
     
    105100        return lua_toboolean( L, index ) != 0;
    106101}
    107 
    108 // const char* nv::lua::detail::to_cstring ( lua_State *L, int index )
    109 // {
    110 //      return lua_tolstring( L, index, nullptr );
    111 // }
    112102
    113103nv::string_view nv::lua::detail::to_string_view( lua_State *L, int index )
     
    164154}
    165155
    166 // const char* nv::lua::detail::to_cstring ( lua_State *L, int index, const char* def )
    167 // {
    168 //      return ( lua_type( L, index ) == LUA_TSTRING ? lua_tostring( L, index ) : def );
    169 // }
    170 
    171156void*       nv::lua::detail::to_pointer ( lua_State *L, int index, void* def )
    172157{
Note: See TracChangeset for help on using the changeset viewer.