This commit is contained in:
Igor Timofeev
2017-09-10 02:04:39 +03:00
parent 50574423e6
commit 8a7288d509
4 changed files with 25 additions and 21 deletions

View File

@@ -63,7 +63,7 @@ function image.draw(x, y, picture)
for alpha in pairs(groupedPicture) do
for symbol in pairs(groupedPicture[alpha]) do
if not (symbol == " " and alpha == 0xFF) then
if not (symbol == " " and alpha == 1) then
for background in pairs(groupedPicture[alpha][symbol]) do
if background ~= currentBackground then
@@ -82,14 +82,14 @@ function image.draw(x, y, picture)
for xPos = 1, #groupedPicture[alpha][symbol][background][foreground][yPos] do
imageX, imageY = x + groupedPicture[alpha][symbol][background][foreground][yPos][xPos] - 1, y + yPos - 1
if alpha > 0x0 then
if alpha > 0 then
_, _, gpuGetBackground = gpu.get(imageX, imageY)
if alpha == 0xFF then
if alpha == 1 then
currentBackground = gpuGetBackground
gpu.setBackground(currentBackground)
else
currentBackground = color.blend(gpuGetBackground, background, alpha / 0xFF)
currentBackground = color.blend(gpuGetBackground, background, alpha)
gpu.setBackground(currentBackground)
end
end