From 11351dd95381a4dbb876741a21eb8a99bd6c9e63 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 7 Apr 2016 09:48:04 +0200 Subject: [PATCH] Cleaned ImageRenderer.java --- .../sketchmap/map/ImageRenderer.java | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/VirtualComputer/src/com/mcplugindev/slipswhitley/sketchmap/map/ImageRenderer.java b/VirtualComputer/src/com/mcplugindev/slipswhitley/sketchmap/map/ImageRenderer.java index 30eb045..082ef20 100644 --- a/VirtualComputer/src/com/mcplugindev/slipswhitley/sketchmap/map/ImageRenderer.java +++ b/VirtualComputer/src/com/mcplugindev/slipswhitley/sketchmap/map/ImageRenderer.java @@ -13,32 +13,21 @@ public class ImageRenderer extends MapRenderer private BufferedImage image; - //private Boolean imageRendered; - public ImageRenderer(BufferedImage image) { this.image = image; - //this.imageRendered = false; } private int progress = 0; - //private final int updatepixels = 20; public static int updatepixels = 15; @Override public void render(MapView view, MapCanvas canvas, Player player) { - /* - * if(imageRendered) { - * return; - * } - */ - long time = System.nanoTime(); try { - //if (progress != 128 / updatepixels) //<-- Never had an issue with this before 2016.02.20. because I wasn't using 16 as updatepixels canvas.drawImage(0, progress * updatepixels, image.getSubimage(0, progress * updatepixels, 128, (progress * updatepixels + updatepixels >= 128 ? 128 - progress @@ -47,26 +36,13 @@ public class ImageRenderer extends MapRenderer progress++; else progress = 0; - //this.imageRendered = true; long diff = System.nanoTime() - time; if (TimeUnit.NANOSECONDS.toMillis(diff) > 40) { System.out.println("Map rendering took " + TimeUnit.NANOSECONDS.toMillis(diff) + " ms"); - /* - * if (progress == 0 && updatepixels > 5) - * updatepixels--; - */ - } /* - * else if (TimeUnit.NANOSECONDS.toMillis(diff) < 25) - * if (progress == 0 && updatepixels < 50) - * updatepixels++; - */ - /* - * if (progress >= 128 / updatepixels) - * progress = 0; - */ + } } catch (Exception e) { e.printStackTrace();