Code refactoring.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / RenderingContext.java
index 83dcae8..5e74a94 100644 (file)
@@ -21,11 +21,11 @@ public class RenderingContext {
 
     public static final int bufferedImageType = BufferedImage.TYPE_4BYTE_ABGR;
 
-    public final BufferedImage bufferedImage;
+    final BufferedImage bufferedImage;
 
     public final Graphics2D graphics;
 
-    public final byte[] bytes;
+    public final byte[] pixels;
 
     public final int width;
     public final int height;
@@ -44,13 +44,17 @@ public class RenderingContext {
      */
     public boolean doRender = true; // TODO: make use of the variable
 
+    /**
+     * Mouse click. During rendering we can detect which item user clicked on.
+     */
     public MouseClick mouseClick;
 
+    /**
+     * Item that user clicked on.
+     */
     public MouseInteractionController clickedItem;
 
-    public RenderingContext(final int width, final int height,
-                            final RenderingContext oldContext) {
-
+    public RenderingContext(final int width, final int height) {
         this.width = width;
         this.height = height;
 
@@ -63,7 +67,7 @@ public class RenderingContext {
 
         final WritableRaster raster = bufferedImage.getRaster();
         final DataBufferByte dbi = (DataBufferByte) raster.getDataBuffer();
-        bytes = dbi.getData();
+        pixels = dbi.getData();
 
         graphics = (Graphics2D) bufferedImage.getGraphics();
 
@@ -72,11 +76,6 @@ public class RenderingContext {
 
         graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                 RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-
-        if (oldContext != null) {
-            mouseClick = oldContext.mouseClick;
-            clickedItem = oldContext.clickedItem;
-        }
     }
 
 }