mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Add Decoder:clone. Resolves issue #1479.
This commit is contained in:
@@ -34,6 +34,16 @@ Decoder *luax_checkdecoder(lua_State *L, int idx)
|
|||||||
return luax_checktype<Decoder>(L, idx);
|
return luax_checktype<Decoder>(L, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int w_Decoder_clone(lua_State *L)
|
||||||
|
{
|
||||||
|
Decoder *t = luax_checkdecoder(L, 1);
|
||||||
|
Decoder *c = nullptr;
|
||||||
|
luax_catchexcept(L, [&]() { c = t->clone(); });
|
||||||
|
luax_pushtype(L, c);
|
||||||
|
c->release();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int w_Decoder_getChannelCount(lua_State *L)
|
int w_Decoder_getChannelCount(lua_State *L)
|
||||||
{
|
{
|
||||||
Decoder *t = luax_checkdecoder(L, 1);
|
Decoder *t = luax_checkdecoder(L, 1);
|
||||||
@@ -104,6 +114,7 @@ int w_Decoder_getChannels(lua_State *L)
|
|||||||
|
|
||||||
static const luaL_Reg w_Decoder_functions[] =
|
static const luaL_Reg w_Decoder_functions[] =
|
||||||
{
|
{
|
||||||
|
{ "clone", w_Decoder_clone },
|
||||||
{ "getChannelCount", w_Decoder_getChannelCount },
|
{ "getChannelCount", w_Decoder_getChannelCount },
|
||||||
{ "getBitDepth", w_Decoder_getBitDepth },
|
{ "getBitDepth", w_Decoder_getBitDepth },
|
||||||
{ "getSampleRate", w_Decoder_getSampleRate },
|
{ "getSampleRate", w_Decoder_getSampleRate },
|
||||||
|
|||||||
Reference in New Issue
Block a user