Updated love.graphics.clear() to use new color format
This commit is contained in:
@@ -239,10 +239,9 @@ int l_graphics_reset(lua_State *L) {
|
|||||||
|
|
||||||
|
|
||||||
int l_graphics_clear(lua_State *L) {
|
int l_graphics_clear(lua_State *L) {
|
||||||
int color = lua_isnoneornil(L, 1) ? graphics_backgroundColor
|
int idx = getColorFromArgs(L, NULL, graphics_backgroundColor_rgb);
|
||||||
: luaL_checkint(L, 1);
|
int sz = graphics_canvas->width * graphics_canvas->height;
|
||||||
memset(graphics_canvas->data, color,
|
memset(graphics_canvas->data, idx, sz);
|
||||||
graphics_canvas->width * graphics_canvas->height);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user