From 1c8c0912bef097ae4fb245db8a263bbf60112c74 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sat, 29 Aug 2015 02:15:47 +0300 Subject: [PATCH] Update ECSAPI.lua --- lib/ECSAPI.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ECSAPI.lua b/lib/ECSAPI.lua index a4f069ed..1689c758 100644 --- a/lib/ECSAPI.lua +++ b/lib/ECSAPI.lua @@ -306,7 +306,7 @@ function ECSAPI.rememberOldPixels(fromX,fromY,toX,toY) oldPixels[counterY] = {} counterX = 1 for i = fromX, toX do - oldPixels[counterY][counterX] = {i, j, {gpu.get(i,j)}} + oldPixels[counterY][counterX] = {i, j, gpu.get(i, j)} counterX = counterX + 1 end counterY = counterY + 1 @@ -318,7 +318,16 @@ end function ECSAPI.drawOldPixels(oldPixels) for j=1,#oldPixels do for i=1,#oldPixels[j] do - ECSAPI.colorTextWithBack(oldPixels[j][i][1],oldPixels[j][i][2],oldPixels[j][i][3][2],oldPixels[j][i][3][3],oldPixels[j][i][3][1]) + + if oldPixels[j][i][4] ~= gpu.getForeground() then + gpu.setForeground(oldPixels[j][i][4]) + end + + if oldPixels[j][i][5] ~= gpu.getBackground() then + gpu.setBackground(oldPixels[j][i][5]) + end + + gpu.set(oldPixels[j][i][1], oldPixels[j][i][2], oldPixels[j][i][3]) end end end