Ignore:
Timestamp:
06/02/13 18:25:29 (12 years ago)
Author:
epyon
Message:
  • lua_raw - several utility functions added
  • lua_aux - aux implementations use lua_raw functions
  • lua_glm, lua_aux - registration through nlua_register
File:
1 edited

Legend:

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

    r75 r85  
    66
    77#include "nv/lua/lua_glm.hh"
     8
     9#include "nv/lua/lua_raw.hh"
    810#include "nv/string.hh"
    911
     
    203205        size_t idx = 255;
    204206
    205         if( len == 1 )
     207        if ( len == 1 )
    206208        {
    207209                idx = nlua_swizzel_lookup[ key[ 0 ] ];
     
    222224        }
    223225
    224         lua_getmetatable( L, 1 );
    225         lua_getfield( L, -1, "__base" );
     226        luaL_getmetafield( L, 1, "__base" );
    226227        lua_pushvalue( L, 2 );
    227228        lua_rawget( L, -2 );
     
    305306
    306307        luaL_newmetatable( L, nlua_metatable_name<T>() );
    307         luaL_setfuncs( L, nlua_vec_m, 0 );
    308         luaL_newlib(L, nlua_vec_f);
     308        nlua_register( L, nlua_vec_m, -1 );
     309        lua_createtable( L, 0, 0 );
     310        nlua_register( L, nlua_vec_f, -1 );
    309311        lua_pushvalue(L, -1);
    310312        lua_setfield(L, -3, "__base" );
    311313        lua_replace(L, -2);
    312     lua_newtable( L );
    313         luaL_setfuncs( L, nlua_vec_fm, 0 );
     314        lua_createtable( L, 0, 0 );
     315        nlua_register( L, nlua_vec_fm, -1 );
    314316        lua_setmetatable( L, -2 );
    315317        return 1;
Note: See TracChangeset for help on using the changeset viewer.