mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Improved error checking for some enum strings (resolves issue #690).
Also moved love.audio.newSource from Lua code into C++ code
This commit is contained in:
@@ -433,8 +433,9 @@ int w_newSpriteBatch(lua_State *L)
|
||||
SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
|
||||
if (lua_gettop(L) > 2)
|
||||
{
|
||||
if (!SpriteBatch::getConstant(luaL_checkstring(L, 3), usage))
|
||||
usage = SpriteBatch::USAGE_DYNAMIC;
|
||||
const char *usagestr = luaL_checkstring(L, 3);
|
||||
if (!SpriteBatch::getConstant(usagestr, usage))
|
||||
return luaL_error(L, "Invalid SpriteBatch usage: %s", usagestr);
|
||||
}
|
||||
SpriteBatch *t = NULL;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user