cleanup
This commit is contained in:
parent
91e4f09b53
commit
c92979d86b
|
@ -1002,8 +1002,8 @@ static int luaB_scale_sprite(lua_State *L) {
|
||||||
char sname[sizeof(unsigned long) * 2 + 16];
|
char sname[sizeof(unsigned long) * 2 + 16];
|
||||||
|
|
||||||
const char *src = luaL_optstring(L, 1, NULL);
|
const char *src = luaL_optstring(L, 1, NULL);
|
||||||
float xs = luaL_optnumber(L, 2, 1.0f);
|
float xs = luaL_optnumber(L, 2, 0);
|
||||||
float ys = luaL_optnumber(L, 3, 1.0f);
|
float ys = luaL_optnumber(L, 3, 0);
|
||||||
const char *desc = luaL_optstring(L, 4, NULL);
|
const char *desc = luaL_optstring(L, 4, NULL);
|
||||||
|
|
||||||
if (!src)
|
if (!src)
|
||||||
|
@ -1013,6 +1013,12 @@ static int luaB_scale_sprite(lua_State *L) {
|
||||||
if (!s)
|
if (!s)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (xs == 0)
|
||||||
|
xs = 1.0f;
|
||||||
|
|
||||||
|
if (ys == 0)
|
||||||
|
ys = xs;
|
||||||
|
|
||||||
img2 = gfx_scale(s, xs, ys);
|
img2 = gfx_scale(s, xs, ys);
|
||||||
|
|
||||||
if (!img2)
|
if (!img2)
|
||||||
|
|
Loading…
Reference in a new issue