From 7128f5b05505ece64a3bbf7d17e3e8c388ebf93e Mon Sep 17 00:00:00 2001 From: 493msi <493msi@gmail.com> Date: Fri, 18 Sep 2020 15:42:04 +0200 Subject: [PATCH] [PlutoMesher] Renamed all occurrences of 'attrib' to 'attribute' --- UPDATE_NOTES.md | 5 +++ .../engine/graphics/gl/vao/VertexArray.java | 32 +++++++++---------- .../graphics/gl/vao/VertexArrayBuilder.java | 4 +-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/UPDATE_NOTES.md b/UPDATE_NOTES.md index b1e132a..81da351 100644 --- a/UPDATE_NOTES.md +++ b/UPDATE_NOTES.md @@ -1,5 +1,10 @@ ## 20.2.0.0-alpha.2 * `build.gradle` Extracted the version numbers into separate variables +* `build.gradle` **[experimental]** `gradlew` should now automatically download JDK11 when needed +* `build.gradle` Updated the build scripts and added source Maven publication +* `[PlutoMesher]` Renamed all occurrences of `attrib` to `attribute` + * Renamed `VertexArray#createArrayAttrib` to `VertexArray#createArrayAttribute` + * Renamed `VertexArray#getVertexAttribs` to `VertexArray#getVertexAttributes` * `[PlutoCore]` Made `PlutoApplication.StartupConfig` fields private, options can now only be modified only through public setters diff --git a/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArray.java b/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArray.java index 7cebbad..d61887a 100644 --- a/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArray.java +++ b/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArray.java @@ -16,35 +16,35 @@ import cz.tefek.pluto.io.logger.SmartSeverity; public class VertexArray { - protected final List usedAttribs; - protected final Vector> vertexAttribs; + protected final List usedAttributes; + protected final Vector> vertexAttributes; protected IndexArrayBuffer indices; private int vertexCount; - protected int glID = 0; + protected int glID; public VertexArray() { - int maxAttribs = GL33.glGetInteger(GL33.GL_MAX_VERTEX_ATTRIBS); + int maxAttributes = GL33.glGetInteger(GL33.GL_MAX_VERTEX_ATTRIBS); - this.usedAttribs = new ArrayList<>(maxAttribs); - this.vertexAttribs = new Vector>(maxAttribs); - this.vertexAttribs.setSize(maxAttribs); + this.usedAttributes = new ArrayList<>(maxAttributes); + this.vertexAttributes = new Vector<>(maxAttributes); + this.vertexAttributes.setSize(maxAttributes); this.glID = GL33.glGenVertexArrays(); Logger.logf(SmartSeverity.ADDED, "Vertex array ID %d created...\n", this.glID); } - public void createArrayAttrib(ArrayBuffer buffer, int attribID) + public void createArrayAttribute(ArrayBuffer buffer, int attribID) { this.bind(); buffer.bind(); GL33.glVertexAttribPointer(attribID, buffer.getVertexDimensions(), buffer.getType().getGLID(), false, 0, 0); - this.vertexAttribs.set(attribID, buffer); - this.usedAttribs.add(attribID); + this.vertexAttributes.set(attribID, buffer); + this.usedAttributes.add(attribID); if (!this.hasIndices()) { @@ -52,9 +52,9 @@ public class VertexArray } } - public List> getVertexAttribs() + public List> getVertexAttributes() { - return Collections.unmodifiableList(this.vertexAttribs); + return Collections.unmodifiableList(this.vertexAttributes); } public int getVertexCount() @@ -64,7 +64,7 @@ public class VertexArray public void enableAllAttributes() { - this.usedAttribs.stream().forEach(GL33::glEnableVertexAttribArray); + this.usedAttributes.forEach(GL33::glEnableVertexAttribArray); } public void bindIndices(IndexArrayBuffer buffer) @@ -121,9 +121,9 @@ public class VertexArray public void delete() { - this.usedAttribs.stream().map(this.vertexAttribs::get).forEach(ArrayBuffer::delete); - this.vertexAttribs.clear(); - this.usedAttribs.clear(); + this.usedAttributes.stream().map(this.vertexAttributes::get).forEach(ArrayBuffer::delete); + this.vertexAttributes.clear(); + this.usedAttributes.clear(); if (this.indices != null) { diff --git a/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArrayBuilder.java b/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArrayBuilder.java index 74a1a7a..0003e1b 100644 --- a/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArrayBuilder.java +++ b/plutomesher/src/main/java/cz/tefek/pluto/engine/graphics/gl/vao/VertexArrayBuilder.java @@ -16,14 +16,14 @@ public class VertexArrayBuilder public VertexArrayBuilder vertices(VecArray vertices) { - this.va.createArrayAttrib(new FloatArrayBuffer(vertices), ReservedAttributes.POSITION); + this.va.createArrayAttribute(new FloatArrayBuffer(vertices), ReservedAttributes.POSITION); return this; } public VertexArrayBuilder uvs(VecArray uvs) { - this.va.createArrayAttrib(new FloatArrayBuffer(uvs), ReservedAttributes.UV); + this.va.createArrayAttribute(new FloatArrayBuffer(uvs), ReservedAttributes.UV); return this; }