public int[] get( int argLength){ assert(argLength > 0); if(!map.containsKey(argLength)){ map.put(argLength, getInitializedArray(argLength)); } assert(map.get(argLength).length == argLength) : "Array not built of correct length"; return map.get(argLength); }
? intPool.get(Settings.maxPolygonVertices) : new int[Settings.maxPolygonVertices]; int m = 0;
@Override public void drawPolygon(Vec2[] vertices, int vertexCount, Color3f color) { Color s = cpool.getColor(color.x, color.y, color.z, 1f); Graphics2D g = getGraphics(); saveState(g); int[] xInts = xIntsPool.get(vertexCount); int[] yInts = yIntsPool.get(vertexCount); for (int i = 0; i < vertexCount; i++) { getWorldToScreenToOut(vertices[i], temp); xInts[i] = (int) temp.x; yInts[i] = (int) temp.y; } g.setStroke(stroke); g.setColor(s); g.drawPolygon(xInts, yInts, vertexCount); restoreState(g); }
@Override public void drawSolidPolygon(Vec2[] vertices, int vertexCount, Color3f color) { Color f = cpool.getColor(color.x, color.y, color.z, .4f); Color s = cpool.getColor(color.x, color.y, color.z, 1f); Graphics2D g = getGraphics(); saveState(g); int[] xInts = xIntsPool.get(vertexCount); int[] yInts = yIntsPool.get(vertexCount); for (int i = 0; i < vertexCount; i++) { getWorldToScreenToOut(vertices[i], temp); xInts[i] = (int) temp.x; yInts[i] = (int) temp.y; } g.setStroke(stroke); g.setColor(f); g.fillPolygon(xInts, yInts, vertexCount); g.setColor(s); g.drawPolygon(xInts, yInts, vertexCount); restoreState(g); }
public int[] get( int argLength){ assert(argLength > 0); if(!map.containsKey(argLength)){ map.put(argLength, getInitializedArray(argLength)); } assert(map.get(argLength).length == argLength) : "Array not built of correct length"; return map.get(argLength); }
@Override public void drawSolidPolygon(Vec2[] vertices, int vertexCount, Color3f color) { // inside Graphics2D g = getGraphics(); int[] xInts = xIntsPool.get(vertexCount); int[] yInts = yIntsPool.get(vertexCount); for (int i = 0; i < vertexCount; i++) { getWorldToScreenToOut(vertices[i], temp); xInts[i] = (int) temp.x; yInts[i] = (int) temp.y; } Color c = cpool.getColor(color.x, color.y, color.z, .4f); g.setColor(c); g.fillPolygon(xInts, yInts, vertexCount); // outside drawPolygon(vertices, vertexCount, color); }
public int[] get( int argLength){ assert(argLength > 0); if(!map.containsKey(argLength)){ map.put(argLength, getInitializedArray(argLength)); } assert(map.get(argLength).length == argLength) : "Array not built of correct length"; return map.get(argLength); }
? intPool.get(Settings.maxPolygonVertices) : new int[Settings.maxPolygonVertices]; int m = 0;
public int[] get(int argLength) { assert (argLength > 0); if (!map.containsKey(argLength)) { map.put(argLength, getInitializedArray(argLength)); } assert (map.get(argLength).length == argLength) : "Array not built of correct length"; return map.get(argLength); }
? intPool.get(Settings.maxPolygonVertices) : new int[Settings.maxPolygonVertices]; int m = 0;
public int[] get( int argLength){ assert(argLength > 0); if(!map.containsKey(argLength)){ map.put(argLength, getInitializedArray(argLength)); } assert(map.get(argLength).length == argLength) : "Array not built of correct length"; return map.get(argLength); }
? intPool.get(JBoxSettings.maxPolygonVertices) : new int[JBoxSettings.maxPolygonVertices]; int m = 0;
? intPool.get(Settings.maxPolygonVertices) : new int[Settings.maxPolygonVertices]; int m = 0;