mirror of https://github.com/bjornbytes/lovr.git
nicer assert in sound data append
This commit is contained in:
parent
213c721d1f
commit
0d36cdd443
|
@ -13,12 +13,13 @@ static int l_lovrSoundDataAppend(lua_State* L) {
|
|||
SoundData* soundData = luax_checktype(L, 1, SoundData);
|
||||
Blob* blob = luax_totype(L, 2, Blob);
|
||||
SoundData* sound = luax_totype(L, 2, SoundData);
|
||||
lovrAssert(blob || sound, "Invalid blob appended");
|
||||
size_t appendedSamples = 0;
|
||||
if (sound) {
|
||||
appendedSamples = lovrSoundDataStreamAppendSound(soundData, sound);
|
||||
} else if (blob) {
|
||||
appendedSamples = lovrSoundDataStreamAppendBlob(soundData, blob);
|
||||
} else {
|
||||
luaL_argerror(L, 2, "Invalid blob appended");
|
||||
}
|
||||
lua_pushinteger(L, appendedSamples);
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue