patched code after code review from MihailRis

This commit is contained in:
RomanDonw 2026-08-03 18:25:44 +10:00
parent 67da57d870
commit f8a44c023f
2 changed files with 23 additions and 21 deletions

View file

@ -164,8 +164,11 @@ static int l_clear(State* L) {
size_t pixelscount = image.getWidth() * image.getHeight();
uint32_t* data = reinterpret_cast<uint32_t*>(image.getData());
if (gettop(L) == 1) std::fill(data, data + pixelscount, 0);
else std::fill(data, data + pixelscount, get_rgba(L, 2).rgba);
if (gettop(L) == 1) {
std::fill(data, data + pixelscount, 0);
} else {
std::fill(data, data + pixelscount, get_rgba(L, 2).rgba);
}
return 0;
}