mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -232,22 +232,10 @@ int w_Shader_sendMatrix(lua_State *L)
|
||||
lua_pop(L, 1 + dimension);
|
||||
}
|
||||
|
||||
bool should_error = false;
|
||||
|
||||
try
|
||||
{
|
||||
shader->sendMatrix(name, dimension, values, count);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
should_error = true;
|
||||
lua_pushstring(L, e.what());
|
||||
}
|
||||
|
||||
delete[] values;
|
||||
|
||||
if (should_error)
|
||||
return luaL_error(L, "%s", lua_tostring(L, -1));
|
||||
luax_catchexcept(L,
|
||||
[&]() { shader->sendMatrix(name, dimension, values, count); },
|
||||
[&]() { delete[] values; }
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -258,7 +246,7 @@ int w_Shader_sendTexture(lua_State *L)
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
Texture *texture = luax_checktexture(L, 3);
|
||||
|
||||
EXCEPT_GUARD(shader->sendTexture(name, texture);)
|
||||
luax_catchexcept(L, [&](){ shader->sendTexture(name, texture); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user