diff --git a/chapter07/c07-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter07/c07-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index 58d7036c..d13256c5 100644 --- a/chapter07/c07-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter07/c07-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, int[] indices, Texture textur try { this.texture = texture; vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter08/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter08/src/main/java/org/lwjglb/engine/graph/Mesh.java index 58d7036c..d13256c5 100644 --- a/chapter08/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter08/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, int[] indices, Texture textur try { this.texture = texture; vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter09/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter09/src/main/java/org/lwjglb/engine/graph/Mesh.java index f29610ca..914d1793 100644 --- a/chapter09/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter09/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -34,7 +34,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice try { colour = DEFAULT_COLOUR; vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter09/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter09/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter09/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter09/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter10/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter10/src/main/java/org/lwjglb/engine/graph/Mesh.java index ac0c33c9..ad2fad21 100644 --- a/chapter10/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter10/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter10/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter10/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter10/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter10/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index ac0c33c9..ad2fad21 100644 --- a/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter11/c11-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index ac0c33c9..ad2fad21 100644 --- a/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter11/c11-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java index ac0c33c9..ad2fad21 100644 --- a/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter11/c11-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/TextItem.java b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/TextItem.java index 0d870222..0b024a8b 100644 --- a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/TextItem.java +++ b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/TextItem.java @@ -32,10 +32,10 @@ private Mesh buildMesh(Texture texture, int numCols, int numRows) { byte[] chars = text.getBytes(Charset.forName("ISO-8859-1")); int numChars = chars.length; - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); float tileWidth = (float)texture.getWidth() / (float)numCols; float tileHeight = (float)texture.getHeight() / (float)numRows; diff --git a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index a06bf853..0a095543 100644 --- a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter12/c12-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/TextItem.java b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/TextItem.java index 0d870222..0b024a8b 100644 --- a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/TextItem.java +++ b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/TextItem.java @@ -32,10 +32,10 @@ private Mesh buildMesh(Texture texture, int numCols, int numRows) { byte[] chars = text.getBytes(Charset.forName("ISO-8859-1")); int numChars = chars.length; - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); float tileWidth = (float)texture.getWidth() / (float)numCols; float tileHeight = (float)texture.getHeight() / (float)numRows; diff --git a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index a06bf853..0a095543 100644 --- a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter12/c12-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/TextItem.java b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/TextItem.java index 18e4b2d2..f2c00c56 100644 --- a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/TextItem.java +++ b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/TextItem.java @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java index a06bf853..0a095543 100644 --- a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index b51560bb..6d892b60 100644 --- a/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter12/c12-p3/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/TextItem.java b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/TextItem.java index 18e4b2d2..f2c00c56 100644 --- a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/TextItem.java +++ b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/TextItem.java @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index a06bf853..0a095543 100644 --- a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -28,7 +28,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter13/c13-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/TextItem.java b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/TextItem.java index 18e4b2d2..f2c00c56 100644 --- a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/TextItem.java +++ b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/TextItem.java @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index f5e23b96..76611ba5 100644 --- a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter13/c13-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter14/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter14/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index ba280292..459aeb87 100644 --- a/chapter14/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter14/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -52,9 +52,9 @@ public HeightMapMesh(float minY, float maxY, String heightMapFile, String textur float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter14/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter14/src/main/java/org/lwjglb/engine/graph/Mesh.java index e6f3188c..b942c07e 100644 --- a/chapter14/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter14/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter14/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter14/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter14/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter14/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter14/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter14/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter14/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter14/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter15/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter15/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 3ffe6dcf..89c58acb 100644 --- a/chapter15/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter15/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter15/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter15/src/main/java/org/lwjglb/engine/graph/Mesh.java index e6f3188c..b942c07e 100644 --- a/chapter15/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter15/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter15/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter15/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter15/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter15/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter15/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter15/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter15/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter15/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter16/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter16/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 3ffe6dcf..89c58acb 100644 --- a/chapter16/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter16/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter16/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter16/src/main/java/org/lwjglb/engine/graph/Mesh.java index 6a9091b1..15b60a87 100644 --- a/chapter16/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter16/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter16/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter16/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter16/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter16/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter16/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter16/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter16/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter16/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter17/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter17/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter17/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter17/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter17/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter17/src/main/java/org/lwjglb/engine/graph/Mesh.java index b8a8437b..e8948061 100644 --- a/chapter17/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter17/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter17/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter17/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter17/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter17/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter17/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter17/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter17/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter17/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index ddefcf0e..0b3b5e52 100644 --- a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter18/c18-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter18/c18-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index ddefcf0e..0b3b5e52 100644 --- a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java index 1d2c3c8b..eded3b01 100644 --- a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java +++ b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/graph/OBJLoader.java @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter18/c18-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter18/c18-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index ddefcf0e..0b3b5e52 100644 --- a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -30,7 +30,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 908c24c3..bd361bff 100644 --- a/chapter19/c19-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter19/c19-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index c745cdae..bbb349e3 100644 --- a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 908c24c3..bd361bff 100644 --- a/chapter19/c19-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter19/c19-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java index 4b799add..3ad80ac8 100644 --- a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 908c24c3..bd361bff 100644 --- a/chapter19/c19-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter19/c19-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index 4175ea6b..9eda67c3 100644 --- a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 908c24c3..bd361bff 100644 --- a/chapter20/c20-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter20/c20-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index 4175ea6b..9eda67c3 100644 --- a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 908c24c3..bd361bff 100644 --- a/chapter20/c20-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter20/c20-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter21/c21-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter21/c21-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 026d6c89..62223588 100644 --- a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter21/c21-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter21/c21-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter21/c21-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter21/c21-p3/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter22/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter22/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter22/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter22/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter22/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter22/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter22/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter22/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter22/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter22/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter22/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter22/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter22/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter22/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter22/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter22/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter23/c23-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter23/c23-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter23/c23-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter23/c23-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter24/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter24/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter24/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter24/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter24/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter24/src/main/java/org/lwjglb/engine/graph/Mesh.java index 92e68029..e3344380 100644 --- a/chapter24/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter24/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -39,7 +39,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter24/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter24/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter24/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter24/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter24/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter24/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter24/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter24/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index c7c2d962..6c38d514 100644 --- a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -41,7 +41,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter25/c25-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter25/c25-p1/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index c7c2d962..6c38d514 100644 --- a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -41,7 +41,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter25/c25-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter25/c25-p2/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter26/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter26/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter26/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter26/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter26/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter26/src/main/java/org/lwjglb/engine/graph/Mesh.java index 85d136f9..3a3a2ca9 100644 --- a/chapter26/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter26/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -41,7 +41,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice IntBuffer indicesBuffer = null; try { vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter26/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter26/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter26/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter26/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter26/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java b/chapter26/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java index 4c06e877..de46ac03 100644 --- a/chapter26/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java +++ b/chapter26/src/main/java/org/lwjglb/engine/loaders/obj/OBJLoader.java @@ -63,7 +63,7 @@ public static Mesh loadMesh(String fileName, int instances) throws Exception { private static Mesh reorderLists(List posList, List textCoordList, List normList, List facesList, int instances) { - List indices = new ArrayList(); + List indices = new ArrayList<>(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; diff --git a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java index 9bbb2fcd..840c2274 100644 --- a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -43,7 +43,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice calculateBoundingRadius(positions); vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java index 610c246d..dba7dd36 100644 --- a/chapter27/c27-p1/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java +++ b/chapter27/c27-p1/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java @@ -96,7 +96,7 @@ private static Mesh processMesh(AIMesh aiMesh, List materials) { List vertices = new ArrayList<>(); List textures = new ArrayList<>(); List normals = new ArrayList<>(); - List indices = new ArrayList(); + List indices = new ArrayList<>(); processVertices(aiMesh, vertices); processNormals(aiMesh, normals); diff --git a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java index 9bbb2fcd..840c2274 100644 --- a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -43,7 +43,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice calculateBoundingRadius(positions); vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java index bd665c96..345d5aa2 100644 --- a/chapter27/c27-p2/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java +++ b/chapter27/c27-p2/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java @@ -127,7 +127,7 @@ private static Mesh processMesh(AIMesh aiMesh, List materials) { List vertices = new ArrayList<>(); List textures = new ArrayList<>(); List normals = new ArrayList<>(); - List indices = new ArrayList(); + List indices = new ArrayList<>(); processVertices(aiMesh, vertices); processNormals(aiMesh, normals); diff --git a/chapter28/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java b/chapter28/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java index 6e6d981a..fef7257f 100644 --- a/chapter28/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java +++ b/chapter28/src/main/java/org/lwjglb/engine/graph/HeightMapMesh.java @@ -33,9 +33,9 @@ public HeightMapMesh(float minY, float maxY, ByteBuffer heightMapImage, int widt float incx = getXLength() / (width - 1); float incz = getZLength() / (height - 1); - List positions = new ArrayList(); - List textCoords = new ArrayList(); - List indices = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); + List indices = new ArrayList<>(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/chapter28/src/main/java/org/lwjglb/engine/graph/Mesh.java b/chapter28/src/main/java/org/lwjglb/engine/graph/Mesh.java index 6d1ccd70..f35d6612 100644 --- a/chapter28/src/main/java/org/lwjglb/engine/graph/Mesh.java +++ b/chapter28/src/main/java/org/lwjglb/engine/graph/Mesh.java @@ -43,7 +43,7 @@ public Mesh(float[] positions, float[] textCoords, float[] normals, int[] indice calculateBoundingRadius(positions); vertexCount = indices.length; - vboIdList = new ArrayList(); + vboIdList = new ArrayList<>(); vaoId = glGenVertexArrays(); glBindVertexArray(vaoId); diff --git a/chapter28/src/main/java/org/lwjglb/engine/items/TextItem.java b/chapter28/src/main/java/org/lwjglb/engine/items/TextItem.java index a0af60e9..3e65a64e 100644 --- a/chapter28/src/main/java/org/lwjglb/engine/items/TextItem.java +++ b/chapter28/src/main/java/org/lwjglb/engine/items/TextItem.java @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception { } private Mesh buildMesh() { - List positions = new ArrayList(); - List textCoords = new ArrayList(); + List positions = new ArrayList<>(); + List textCoords = new ArrayList<>(); float[] normals = new float[0]; - List indices = new ArrayList(); + List indices = new ArrayList<>(); char[] characters = text.toCharArray(); int numChars = characters.length; diff --git a/chapter28/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java b/chapter28/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java index b87f2d51..a828f511 100644 --- a/chapter28/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java +++ b/chapter28/src/main/java/org/lwjglb/engine/loaders/assimp/StaticMeshesLoader.java @@ -119,7 +119,7 @@ private static Mesh processMesh(AIMesh aiMesh, List materials) { List vertices = new ArrayList<>(); List textures = new ArrayList<>(); List normals = new ArrayList<>(); - List indices = new ArrayList(); + List indices = new ArrayList<>(); processVertices(aiMesh, vertices); processNormals(aiMesh, normals);