Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjglgamedev committed Oct 3, 2019
2 parents 49ec24e + 4034e30 commit b65bb6b
Show file tree
Hide file tree
Showing 123 changed files with 229 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion chapter08/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion chapter09/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
2 changes: 1 addition & 1 deletion chapter10/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();

float tileWidth = (float)texture.getWidth() / (float)numCols;
float tileHeight = (float)texture.getHeight() / (float)numRows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();

float tileWidth = (float)texture.getWidth() / (float)numCols;
float tileHeight = (float)texture.getHeight() / (float)numRows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception {
}

private Mesh buildMesh() {
List<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
char[] characters = text.toCharArray();
int numChars = characters.length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception {
}

private Mesh buildMesh() {
List<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
char[] characters = text.toCharArray();
int numChars = characters.length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception {
}

private Mesh buildMesh() {
List<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
char[] characters = text.toCharArray();
int numChars = characters.length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Integer> indices = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
List<Integer> indices = new ArrayList<>();

for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
Expand Down
2 changes: 1 addition & 1 deletion chapter14/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
6 changes: 3 additions & 3 deletions chapter14/src/main/java/org/lwjglb/engine/items/TextItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception {
}

private Mesh buildMesh() {
List<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
char[] characters = text.toCharArray();
int numChars = characters.length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Integer> indices = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
List<Integer> indices = new ArrayList<>();

for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
Expand Down
2 changes: 1 addition & 1 deletion chapter15/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
6 changes: 3 additions & 3 deletions chapter15/src/main/java/org/lwjglb/engine/items/TextItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public TextItem(String text, FontTexture fontTexture) throws Exception {
}

private Mesh buildMesh() {
List<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
float[] normals = new float[0];
List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
char[] characters = text.toCharArray();
int numChars = characters.length;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float> positions = new ArrayList();
List<Float> textCoords = new ArrayList();
List<Integer> indices = new ArrayList();
List<Float> positions = new ArrayList<>();
List<Float> textCoords = new ArrayList<>();
List<Integer> indices = new ArrayList<>();

for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
Expand Down
2 changes: 1 addition & 1 deletion chapter16/src/main/java/org/lwjglb/engine/graph/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Mesh loadMesh(String fileName) throws Exception {
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList,
List<Vector3f> normList, List<Face> facesList) {

List<Integer> indices = new ArrayList();
List<Integer> indices = new ArrayList<>();
// Create position array in the order it has been declared
float[] posArr = new float[posList.size() * 3];
int i = 0;
Expand Down
Loading

0 comments on commit b65bb6b

Please sign in to comment.