Esempio n. 1
0
static int l_anims_set_alt_pal(lua_State *L)
{
    THAnimationManager* pAnims = luaT_testuserdata<THAnimationManager>(L);
    unsigned int iAnimation = luaL_checkint(L, 2);
    size_t iPalLen;
    const unsigned char *pPal = luaT_checkfile(L, 3, &iPalLen);
    if(iPalLen != 256)
        return luaL_typerror(L, 3, "GhostPalette string");

    pAnims->setAnimationAltPaletteMap(iAnimation, pPal);

    lua_getfenv(L, 1);
    lua_insert(L, 2);
    lua_settop(L, 4);
    lua_settable(L, 2);
    lua_settop(L, 1);
    return 1;
}
Esempio n. 2
0
static int l_anims_set_alt_pal(lua_State *L)
{
    THAnimationManager* pAnims = luaT_testuserdata<THAnimationManager>(L);
    size_t iAnimation = luaL_checkinteger(L, 2);
    size_t iPalLen;
    const uint8_t *pPal = luaT_checkfile(L, 3, &iPalLen);
    if(iPalLen != 256)
    {
        return luaL_argerror(L, 3, "GhostPalette string is not a valid palette");
    }
    uint32_t iAlt32 = static_cast<uint32_t>(luaL_checkinteger(L, 4));

    pAnims->setAnimationAltPaletteMap(iAnimation, pPal, iAlt32);

    lua_getfenv(L, 1);
    lua_insert(L, 2);
    lua_settop(L, 4);
    lua_settable(L, 2);
    lua_settop(L, 1);
    return 1;
}