Automatically deduce the type in luax_pushtype, if possible

--HG--
branch : dynamiccore2
This commit is contained in:
Bart van Strien
2016-11-13 17:38:42 +01:00
parent 7dd960619d
commit 5d43c9601a
32 changed files with 121 additions and 106 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ int w_Decoder_decode(lua_State *L)
decoded / (t->getBitDepth() / 8 * t->getChannels()),
t->getSampleRate(), t->getBitDepth(), t->getChannels());
luax_pushtype(L, SoundData::type, s);
luax_pushtype(L, s);
s->release();
});
}
+2 -2
View File
@@ -46,7 +46,7 @@ int w_newDecoder(lua_State *L)
if (t == nullptr)
return luaL_error(L, "Extension \"%s\" not supported.", data->getExtension().c_str());
luax_pushtype(L, Decoder::type, t);
luax_pushtype(L, t);
t->release();
return 1;
}
@@ -77,7 +77,7 @@ int w_newSoundData(lua_State *L)
luax_catchexcept(L, [&](){ t = instance()->newSoundData(luax_checkdecoder(L, 1)); });
}
luax_pushtype(L, SoundData::type, t);
luax_pushtype(L, t);
t->release();
return 1;
}