-- bad displayment thing local disp_common = require("disp_common") local improve_palette,closest_palette_color = disp_common.improve_palette,disp_common.closest_palette_color local function disp(R,img,scrx,scry,w,h,imgx,imgy) scrx = scrx or 1 scry = scry or 1 w = w or img.width h = h or img.height imgx = imgx or 1 imgy = imgy or 1 improve_palette(R,img,w,h,imgx,imgy) for offx=0,w-1 do for offy=0,h-1 do R.setCursorPos(scrx+offx,scry+offy) local icol = img[imgy+offy][imgx+offx] local pcol = closest_palette_color(R,icol) R.setBackgroundColor(pcol) R.write(" ") end end end return {disp=disp}