FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

texture wrap can be set multiple times in a sketch, fixes #5322 · moisespollo/processing@fd7c5a0 · GitHub

Repository navigation

Commit fd7c5a0

Browse files
committed
texture wrap can be set multiple times in a sketch, fixes processing#5322
1 parent 74868ee commit fd7c5a0

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

‎core/src/processing/opengl/PGraphicsOpenGL.java‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public void setPrimary(boolean primary) {
617617
format = ARGB;
618618
if (primary) {
619619
fbStack = new FrameBuffer[FB_STACK_DEPTH];
620-
fontMap = new WeakHashMap<PFont, FontTexture>();
620+
fontMap = new WeakHashMap<>();
621621
tessellator = new Tessellator();
622622
} else {
623623
tessellator = getPrimaryPG().tessellator;
@@ -1993,6 +1993,9 @@ protected void endShape(int[] indices) {
19931993

19941994
@Override
19951995
public void textureWrap(int wrap) {
1996+
if (this.textureWrap != wrap) {
1997+
flush();
1998+
}
19961999
this.textureWrap = wrap;
19972000
}
19982001

@@ -7142,7 +7145,7 @@ static protected AttributeMap newAttributeMap() {
71427145

71437146

71447147
static protected class AttributeMap extends HashMap<String, VertexAttribute> {
7145-
public ArrayList<String> names = new ArrayList<String>();
7148+
public ArrayList<String> names = new ArrayList<>();
71467149
public int numComp = 0; // number of components for a single vertex
71477150

71487151
@Override
@@ -7668,9 +7671,9 @@ void allocate() {
76687671
shininess = new float[PGL.DEFAULT_IN_VERTICES];
76697672
edges = new int[PGL.DEFAULT_IN_EDGES][3];
76707673

7671-
fattribs = new HashMap<String, float[]>();
7672-
iattribs = new HashMap<String, int[]>();
7673-
battribs = new HashMap<String, byte[]>();
7674+
fattribs = new HashMap<>();
7675+
iattribs = new HashMap<>();
7676+
battribs = new HashMap<>();
76747677

76757678
clear();
76767679
}
@@ -9105,7 +9108,7 @@ static protected class TessGeometry {
91059108
FloatBuffer polyShininessBuffer;
91069109

91079110
// Generic attributes
9108-
HashMap<String, Buffer> polyAttribBuffers = new HashMap<String, Buffer>();
9111+
HashMap<String, Buffer> polyAttribBuffers = new HashMap<>();
91099112

91109113
int polyIndexCount;
91119114
int firstPolyIndex;
@@ -9160,9 +9163,9 @@ static protected class TessGeometry {
91609163
float[] pointOffsets;
91619164
short[] pointIndices;
91629165

9163-
HashMap<String, float[]> fpolyAttribs = new HashMap<String, float[]>();
9164-
HashMap<String, int[]> ipolyAttribs = new HashMap<String, int[]>();
9165-
HashMap<String, byte[]> bpolyAttribs = new HashMap<String, byte[]>();
9166+
HashMap<String, float[]> fpolyAttribs = new HashMap<>();
9167+
HashMap<String, int[]> ipolyAttribs = new HashMap<>();
9168+
HashMap<String, byte[]> bpolyAttribs = new HashMap<>();
91669169

91679170
TessGeometry(PGraphicsOpenGL pg, AttributeMap attr, int mode) {
91689171
this.pg = pg;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL