anonl / nvlist

@@ -108,7 +108,7 @@
Loading
108 108
109 109
        @Override
110 110
        public void render(IScreenRenderer renderer) {
111 -
            GLScreenRenderer rr = (GLScreenRenderer)renderer;
111 +
            final GLScreenRenderer rr = (GLScreenRenderer)renderer;
112 112
113 113
            ShaderProgram shader = getShader();
114 114
            if (shader == null) {
@@ -128,17 +128,15 @@
Loading
128 128
129 129
            LOG.trace("CrossFade[start={}, end={}, time={}]", startTexture, endTexture, normalizedTime);
130 130
131 -
            shader.begin();
132 -
            try {
133 -
                // Must init textures in reverse order for some reason (maybe active unit must be 0?)
134 -
                GdxShaderUtil.setTexture(shader, 1, endTexture, "u_tex1");
135 -
                GdxShaderUtil.setTexture(shader, 0, startTexture, "u_tex0");
136 -
                shader.setUniformf("alpha", normalizedTime);
137 -
138 -
                rr.renderTriangleGrid(geometry, shader);
139 -
            } finally {
140 -
                shader.end();
141 -
            }
131 +
            shader.bind();
132 +
133 +
            // Must init textures in reverse order for some reason (maybe active unit must be 0?)
134 +
            GdxShaderUtil.setTexture(shader, 1, endTexture, "u_tex1");
135 +
            GdxShaderUtil.setTexture(shader, 0, startTexture, "u_tex0");
136 +
            shader.setUniformf("alpha", normalizedTime);
137 +
138 +
            rr.renderTriangleGrid(geometry, shader);
139 +
142 140
            for (int n = 3; n >= 0; n--) {
143 141
                GdxTextureUtil.bindTexture(n, null);
144 142
            }

@@ -225,7 +225,7 @@
Loading
225 225
        }
226 226
        triangleMesh.setIndices(indices);
227 227
228 -
        shader.begin();
228 +
        shader.bind();
229 229
        shader.setUniformMatrix("u_projTrans", matrixStack.getCombined());
230 230
        for (int n = 0; n < texCount; n++) {
231 231
            int loc = shader.fetchUniformLocation("u_texture" + n, false);
@@ -233,26 +233,22 @@
Loading
233 233
                shader.setUniformi(loc, n);
234 234
            }
235 235
        }
236 -
        try {
237 -
            FloatBuffer buf = FloatBuffer.allocate(requiredFloats);
238 -
            for (int row = 0; row < rows; row++) {
239 -
                buf.position(0);
240 -
                grid.getVertices(row, buf, floatsPerVertex - 2);
241 -
                buf.position(2);
242 -
                for (int v = 0; v < verticesPerRow; v++) {
243 -
                    buf.put(buf.position() + floatsPerVertex * v, packedColor);
244 -
                }
245 -
                for (int t = 0; t < grid.getTextures(); t++) {
246 -
                    buf.position(3 + 2 * t);
247 -
                    grid.getTexCoords(t, row, buf, floatsPerVertex - 2);
248 -
                }
249 -
                buf.rewind();
250 -
251 -
                triangleMesh.setVertices(buf.array(), 0, requiredFloats);
252 -
                triangleMesh.render(shader, GL20.GL_TRIANGLES);
236 +
        FloatBuffer buf = FloatBuffer.allocate(requiredFloats);
237 +
        for (int row = 0; row < rows; row++) {
238 +
            buf.position(0);
239 +
            grid.getVertices(row, buf, floatsPerVertex - 2);
240 +
            buf.position(2);
241 +
            for (int v = 0; v < verticesPerRow; v++) {
242 +
                buf.put(buf.position() + floatsPerVertex * v, packedColor);
253 243
            }
254 -
        } finally {
255 -
            shader.end();
244 +
            for (int t = 0; t < grid.getTextures(); t++) {
245 +
                buf.position(3 + 2 * t);
246 +
                grid.getTexCoords(t, row, buf, floatsPerVertex - 2);
247 +
            }
248 +
            buf.rewind();
249 +
250 +
            triangleMesh.setVertices(buf.array(), 0, requiredFloats);
251 +
            triangleMesh.render(shader, GL20.GL_TRIANGLES);
256 252
        }
257 253
    }
258 254

@@ -178,7 +178,7 @@
Loading
178 178
179 179
        @Override
180 180
        public void render(IScreenRenderer renderer) {
181 -
            GLScreenRenderer rr = (GLScreenRenderer)renderer;
181 +
            final GLScreenRenderer rr = (GLScreenRenderer)renderer;
182 182
183 183
            ShaderProgram shader = getShader();
184 184
            if (shader == null) {
@@ -200,18 +200,16 @@
Loading
200 200
201 201
            LOG.trace("BitmapTween[start={}, end={}, control={}]", startTexture, endTexture, controlTexture);
202 202
203 -
            shader.begin();
204 -
            try {
205 -
                // Must init textures in reverse order for some reason (maybe active unit must be 0?)
206 -
                GdxShaderUtil.setTexture(shader, 3, getRemapTexture(), "u_interpolationLUT");
207 -
                GdxShaderUtil.setTexture(shader, 2, controlTexture, "u_controlTex");
208 -
                GdxShaderUtil.setTexture(shader, 1, endTexture, "u_tex1");
209 -
                GdxShaderUtil.setTexture(shader, 0, startTexture, "u_tex0");
210 -
211 -
                rr.renderTriangleGrid(geometry, shader);
212 -
            } finally {
213 -
                shader.end();
214 -
            }
203 +
            shader.bind();
204 +
205 +
            // Must init textures in reverse order for some reason (maybe active unit must be 0?)
206 +
            GdxShaderUtil.setTexture(shader, 3, getRemapTexture(), "u_interpolationLUT");
207 +
            GdxShaderUtil.setTexture(shader, 2, controlTexture, "u_controlTex");
208 +
            GdxShaderUtil.setTexture(shader, 1, endTexture, "u_tex1");
209 +
            GdxShaderUtil.setTexture(shader, 0, startTexture, "u_tex0");
210 +
211 +
            rr.renderTriangleGrid(geometry, shader);
212 +
215 213
            for (int n = 3; n >= 0; n--) {
216 214
                GdxTextureUtil.bindTexture(n, null);
217 215
            }
Files Complexity Coverage
api/src/main/java/nl/weeaboo/vn 91.53% 96.76%
buildtools/src/main/java/nl/weeaboo/vn/buildtools 83.33% 89.43%
core/src/main/java/nl/weeaboo/vn 82.55% 86.77%
desktop/src/main/java/nl/weeaboo/vn/desktop 1.52% 2.26%
Project Totals (382 files) 81.14% 84.47%
1
codecov:
2
  status:
3
    project: yes
4
    patch: no
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading