mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fixed love.audio.newSource(SoundData) variant.
This commit is contained in:
@@ -48,7 +48,9 @@ int w_newSource(lua_State *L)
|
|||||||
{
|
{
|
||||||
Source::Type stype = Source::TYPE_STREAM;
|
Source::Type stype = Source::TYPE_STREAM;
|
||||||
|
|
||||||
if (!luax_istype(L, 1, love::sound::SoundData::type) && !luax_istype(L, 1, love::sound::Decoder::type))
|
if (!luax_istype(L, 1, love::sound::SoundData::type))
|
||||||
|
{
|
||||||
|
if (!luax_istype(L, 1, love::sound::Decoder::type))
|
||||||
{
|
{
|
||||||
const char *stypestr = luaL_checkstring(L, 2);
|
const char *stypestr = luaL_checkstring(L, 2);
|
||||||
if (stypestr && !Source::getConstant(stypestr, stype))
|
if (stypestr && !Source::getConstant(stypestr, stype))
|
||||||
@@ -75,6 +77,7 @@ int w_newSource(lua_State *L)
|
|||||||
int idxs[] = { 1, lua_gettop(L), lua_gettop(L) - 1 };
|
int idxs[] = { 1, lua_gettop(L), lua_gettop(L) - 1 };
|
||||||
luax_convobj(L, idxs, 3, "sound", "newDecoder");
|
luax_convobj(L, idxs, 3, "sound", "newDecoder");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stype == Source::TYPE_STATIC && luax_istype(L, 1, love::sound::Decoder::type))
|
if (stype == Source::TYPE_STATIC && luax_istype(L, 1, love::sound::Decoder::type))
|
||||||
luax_convobj(L, 1, "sound", "newSoundData");
|
luax_convobj(L, 1, "sound", "newSoundData");
|
||||||
|
|||||||
Reference in New Issue
Block a user