Automatically deduce the type in luax_checktype, luax_getmodule, luax_optmodule and luax_totype

--HG--
branch : dynamiccore2
This commit is contained in:
Bart van Strien
2016-11-13 17:13:40 +01:00
parent 4a0a90e511
commit 7dd960619d
61 changed files with 120 additions and 98 deletions
+2 -2
View File
@@ -63,9 +63,9 @@ int w_newSource(lua_State *L)
luax_catchexcept(L, [&]() {
if (luax_istype(L, 1, love::sound::SoundData::type))
t = instance()->newSource(luax_totype<love::sound::SoundData>(L, 1, love::sound::SoundData::type));
t = instance()->newSource(luax_totype<love::sound::SoundData>(L, 1));
else if (luax_istype(L, 1, love::sound::Decoder::type))
t = instance()->newSource(luax_totype<love::sound::Decoder>(L, 1, love::sound::Decoder::type));
t = instance()->newSource(luax_totype<love::sound::Decoder>(L, 1));
});
if (t != nullptr)
+2 -2
View File
@@ -30,7 +30,7 @@ namespace audio
Source *luax_checksource(lua_State *L, int idx)
{
return luax_checktype<Source>(L, idx, love::audio::Source::type);
return luax_checktype<Source>(L, idx);
}
int w_Source_clone(lua_State *L)
@@ -344,7 +344,7 @@ int w_Source_queue(lua_State *L)
if (luax_istype(L, 2, love::sound::SoundData::type))
{
auto s = luax_totype<love::sound::SoundData>(L, 2, love::sound::SoundData::type);
auto s = luax_totype<love::sound::SoundData>(L, 2);
int offset = 0;
size_t length = s->getSize();