Мини-фикс

This commit is contained in:
Igor 2016-03-21 10:59:27 +03:00
parent d4cb35082c
commit f8fce099ca

View File

@ -486,8 +486,9 @@ function buffer.draw(force)
currentBackground, currentForeground = buffer.screen.current[index], buffer.screen.current[index + 1]
buffer.screen.changes[currentForeground] = buffer.screen.changes[currentForeground] or {}
buffer.screen.changes[currentForeground][currentBackground] = buffer.screen.changes[currentForeground][currentBackground] or {}
table.insert(buffer.screen.changes[currentForeground][currentBackground], { index, table.concat(massiv) })
table.insert(buffer.screen.changes[currentForeground][currentBackground], index)
table.insert(buffer.screen.changes[currentForeground][currentBackground], table.concat(massiv))
--Смещаемся по иксу вправо
x = x + #massiv - 1
end
@ -504,11 +505,11 @@ function buffer.draw(force)
if currentForeground ~= foreground then gpu.setForeground(foreground); currentForeground = foreground end
for background in pairs(buffer.screen.changes[foreground]) do
if currentBackground ~= background then gpu.setBackground(background); currentBackground = background end
for i = 1, #buffer.screen.changes[foreground][background] do
for i = 1, #buffer.screen.changes[foreground][background], 2 do
--Конвертируем указанный индекс в координаты
x, y = convertIndexToCoords(buffer.screen.changes[foreground][background][i][1])
x, y = convertIndexToCoords(buffer.screen.changes[foreground][background][i])
--Выставляем ту самую собранную строку из одинаковых цветов
gpu.set(x, y, buffer.screen.changes[foreground][background][i][2])
gpu.set(x, y, buffer.screen.changes[foreground][background][i + 2])
end
end
end