Beispiel #1
0
    }                                    // hide default constructor

    // create a new T object and
    // push onto the Lua stack a userdata containing a pointer to T object
    private static int new_T(Lua.lua_State L)
    {
        Lua.lua_remove(L, 1);                                         // use classname:new(), instead of classname.new()
        LWF.BitmapClip obj = LunaTraits_LWF_BitmapClip._bind_ctor(L); // call constructor for T objects
        push(L, obj, true);
        return(1);                                                    // userdata containing pointer to T object
    }
Beispiel #2
0
    // garbage collection metamethod
    private static int gc_T(Lua.lua_State L)
    {
        byte[] d = (byte[])Lua.lua_touserdata(L, 1);
        if (d == null)
        {
            Luna.print("checkRaw: ud==nil\n"); Lua.luaL_typerror(L, 1, LunaTraits_LWF_BitmapClip.className);
        }
        Luna.userdataType ud = new Luna.userdataType(d);

        LWF.BitmapClip obj = null;
        if (!objects[L].TryGetValue(ud.ObjectId, out obj))
        {
            return(0);
        }

        if (ud.Gc)
        {
            LunaTraits_LWF_BitmapClip._bind_dtor(obj);              // call constructor for T objects
            Destroy(L, obj);
        }

        return(0);
    }