Fix all Java compiler warnings
* raw types * unused imports and variables
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.persesgames.jogl;
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.media.opengl.DebugGL4;
|
import javax.media.opengl.DebugGL4;
|
||||||
@@ -25,9 +24,9 @@ import com.persesgames.jogl.explosion.ExplosionComputeHandler;
|
|||||||
public class Renderer implements GLEventListener {
|
public class Renderer implements GLEventListener {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(Renderer.class);
|
private final static Logger logger = LoggerFactory.getLogger(Renderer.class);
|
||||||
|
|
||||||
private final static int MAX_ENTITIES_PER_COLOR = 2000000;
|
//private final static int MAX_ENTITIES_PER_COLOR = 2000000;
|
||||||
|
|
||||||
private final Random random = new Random(System.nanoTime());
|
//private final Random random = new Random(System.nanoTime());
|
||||||
|
|
||||||
private volatile boolean stopped = false;
|
private volatile boolean stopped = false;
|
||||||
private volatile boolean dirty = true;
|
private volatile boolean dirty = true;
|
||||||
@@ -41,7 +40,7 @@ public class Renderer implements GLEventListener {
|
|||||||
private boolean checkError = false;
|
private boolean checkError = false;
|
||||||
|
|
||||||
private long lastLog = System.nanoTime();
|
private long lastLog = System.nanoTime();
|
||||||
private long start = System.currentTimeMillis();
|
//private long start = System.currentTimeMillis();
|
||||||
private Timer timer = new Timer(TimeUnit.SECONDS, 1);
|
private Timer timer = new Timer(TimeUnit.SECONDS, 1);
|
||||||
|
|
||||||
private ExplosionComputeHandler explosionComputeHandler;
|
private ExplosionComputeHandler explosionComputeHandler;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.persesgames.jogl;
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date: 1/4/14
|
* Date: 1/4/14
|
||||||
* Time: 8:00 PM
|
* Time: 8:00 PM
|
||||||
@@ -17,7 +17,7 @@ public class Timer {
|
|||||||
private Map<String, Long> start = new HashMap<>();
|
private Map<String, Long> start = new HashMap<>();
|
||||||
private Map<String, Long> times = new HashMap<>();
|
private Map<String, Long> times = new HashMap<>();
|
||||||
private Map<String, Long> calls = new HashMap<>();
|
private Map<String, Long> calls = new HashMap<>();
|
||||||
private long nanoStart = System.nanoTime();
|
//private long nanoStart = System.nanoTime();
|
||||||
|
|
||||||
private final TimeUnit unit;
|
private final TimeUnit unit;
|
||||||
private final int units;
|
private final int units;
|
||||||
@@ -93,7 +93,7 @@ public class Timer {
|
|||||||
if (System.nanoTime() > (lastLog + unit.toNanos(units))) {
|
if (System.nanoTime() > (lastLog + unit.toNanos(units))) {
|
||||||
|
|
||||||
for (String timer : times.keySet()) {
|
for (String timer : times.keySet()) {
|
||||||
logger.info("Timer '{}' calls '{}' time '{}ms' time/call '{}ms'", timer, getCalls(timer), (getTime(timer) / 1000000d), (getTime(timer) / 1000000d) / (double)getCalls(timer));
|
logger.info("Timer '{}' calls '{}' time '{}ms' time/call '{}ms'", timer, getCalls(timer), (getTime(timer) / 1000000d), (getTime(timer) / 1000000d) / getCalls(timer));
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import java.io.InputStream;
|
|||||||
*/
|
*/
|
||||||
public class Util {
|
public class Util {
|
||||||
|
|
||||||
public static String loadAsText(Class cls, String name) {
|
public static String loadAsText(Class<?> cls, String name) {
|
||||||
byte [] buffer = new byte[1024];
|
byte [] buffer = new byte[1024];
|
||||||
int nr;
|
int nr;
|
||||||
try (InputStream in = cls.getResourceAsStream(name); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
try (InputStream in = cls.getResourceAsStream(name); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
package com.persesgames.jogl.explosion;
|
package com.persesgames.jogl.explosion;
|
||||||
|
|
||||||
import com.jogamp.common.nio.Buffers;
|
import java.nio.FloatBuffer;
|
||||||
import com.persesgames.jogl.shader.ComputeProgram;
|
import java.nio.IntBuffer;
|
||||||
import com.persesgames.jogl.shader.ShaderProgram;
|
import java.util.Random;
|
||||||
import com.persesgames.jogl.Util;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.media.opengl.GL;
|
import javax.media.opengl.GL;
|
||||||
import javax.media.opengl.GL2ES2;
|
import javax.media.opengl.GL2ES2;
|
||||||
import javax.media.opengl.GL4;
|
import javax.media.opengl.GL4;
|
||||||
import java.nio.FloatBuffer;
|
|
||||||
import java.nio.IntBuffer;
|
import com.jogamp.common.nio.Buffers;
|
||||||
import java.util.Random;
|
import com.persesgames.jogl.Util;
|
||||||
|
import com.persesgames.jogl.shader.ComputeProgram;
|
||||||
|
import com.persesgames.jogl.shader.ShaderProgram;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date: 1/15/14
|
* Date: 1/15/14
|
||||||
* Time: 8:23 PM
|
* Time: 8:23 PM
|
||||||
*/
|
*/
|
||||||
public class ExplosionComputeHandler {
|
public class ExplosionComputeHandler {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ExplosionComputeHandler.class);
|
//private final static Logger logger = LoggerFactory.getLogger(ExplosionComputeHandler.class);
|
||||||
|
|
||||||
private final static int EXPLOSION_PARTICLES = 256;
|
private final static int EXPLOSION_PARTICLES = 256;
|
||||||
private final static int MAX_EXPLOSION_PARTICLES = 250000;
|
private final static int MAX_EXPLOSION_PARTICLES = 250000;
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package com.persesgames.jogl.shader;
|
package com.persesgames.jogl.shader;
|
||||||
|
|
||||||
import com.persesgames.jogl.Renderer;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.media.opengl.GL2ES2;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.media.opengl.GL2ES2;
|
||||||
|
|
||||||
public abstract class Program {
|
public abstract class Program {
|
||||||
|
|
||||||
protected GL2ES2 gl;
|
protected GL2ES2 gl;
|
||||||
|
|||||||
Reference in New Issue
Block a user