mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Add basic lua 5.3 support
This commit is contained in:
@@ -38,10 +38,10 @@ int w_newSoundData(lua_State *L)
|
||||
|
||||
if (lua_isnumber(L, 1))
|
||||
{
|
||||
int samples = luaL_checkint(L, 1);
|
||||
int sampleRate = luaL_optint(L, 2, Decoder::DEFAULT_SAMPLE_RATE);
|
||||
int bitDepth = luaL_optint(L, 3, Decoder::DEFAULT_BIT_DEPTH);
|
||||
int channels = luaL_optint(L, 4, Decoder::DEFAULT_CHANNELS);
|
||||
int samples = (int) luaL_checknumber(L, 1);
|
||||
int sampleRate = (int) luaL_optnumber(L, 2, Decoder::DEFAULT_SAMPLE_RATE);
|
||||
int bitDepth = (int) luaL_optnumber(L, 3, Decoder::DEFAULT_BIT_DEPTH);
|
||||
int channels = (int) luaL_optnumber(L, 4, Decoder::DEFAULT_CHANNELS);
|
||||
|
||||
luax_catchexcept(L, [&](){ t = instance()->newSoundData(samples, sampleRate, bitDepth, channels); });
|
||||
}
|
||||
@@ -66,7 +66,7 @@ int w_newSoundData(lua_State *L)
|
||||
int w_newDecoder(lua_State *L)
|
||||
{
|
||||
love::filesystem::FileData *data = love::filesystem::luax_getfiledata(L, 1);
|
||||
int bufferSize = luaL_optint(L, 2, Decoder::DEFAULT_BUFFER_SIZE);
|
||||
int bufferSize = (int) luaL_optnumber(L, 2, Decoder::DEFAULT_BUFFER_SIZE);
|
||||
|
||||
Decoder *t = nullptr;
|
||||
luax_catchexcept(L,
|
||||
|
||||
Reference in New Issue
Block a user