mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
queueData now returns success state, couple bug fixes
success state return added to queueData functions queueable source is now seekable while stopped fixed bug with creating queueable source with invalid format silently crashing LOVE fixed bug with stopped queueable source reported as not queueable --HG-- branch : minor
This commit is contained in:
@@ -47,18 +47,20 @@ int w_newSource(lua_State *L)
|
||||
Source *t = 0;
|
||||
|
||||
if (lua_isnumber(L, 1) && lua_isnumber(L, 2) && lua_isnumber(L, 3))
|
||||
t = instance()->newSource((int)lua_tonumber(L, 1), (int)lua_tonumber(L, 2), (int)lua_tonumber(L, 3));
|
||||
luax_catchexcept(L, [&]() {
|
||||
t = instance()->newSource((int)lua_tonumber(L, 1), (int)lua_tonumber(L, 2), (int)lua_tonumber(L, 3));
|
||||
});
|
||||
else
|
||||
{
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_ID) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_ID))
|
||||
luax_convobj(L, 1, "sound", "newDecoder");
|
||||
|
||||
Source::Type stype = Source::TYPE_STREAM;
|
||||
|
||||
const char *stypestr = lua_isnoneornil(L, 2) ? 0 : lua_tostring(L, 2);
|
||||
if (stypestr && !Source::getConstant(stypestr, stype))
|
||||
return luaL_error(L, "Invalid source type: %s", stypestr);
|
||||
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_ID) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_ID))
|
||||
luax_convobj(L, 1, "sound", "newDecoder");
|
||||
|
||||
if (stype == Source::TYPE_STATIC && luax_istype(L, 1, SOUND_DECODER_ID))
|
||||
luax_convobj(L, 1, "sound", "newSoundData");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user