add and use utility to set Int color as uniform

This commit is contained in:
Hannes Janetzek
2013-03-16 01:35:41 +01:00
parent f262efee7f
commit 3e6ac7d5d4
6 changed files with 67 additions and 55 deletions

View File

@@ -167,12 +167,8 @@ public class LineTexRenderer {
LineTexLayer ll = (LineTexLayer) l;
Line line = ll.line;
if (line.stippleColor == null)
GLES20.glUniform4f(hTexColor, 1.0f, 1.0f, 1.0f, 1.0f);
else
GLES20.glUniform4fv(hTexColor, 1, line.stippleColor, 0);
GLES20.glUniform4fv(hBgColor, 1, line.color, 0);
GlUtils.setColor(hTexColor, line.stippleColor, 1);
GlUtils.setColor(hBgColor, line.color, 1);
float ps = FastMath.clamp((int) (s+0.5f), 1, 3);
GLES20.glUniform1f(hPatternScale, (GLRenderer.COORD_SCALE * line.stipple) / ps);

View File

@@ -113,13 +113,13 @@ public final class PolygonRenderer {
GLState.blend(false);
if (a.blend == zoom)
GlUtils.setBlendColors(hPolygonColor,
GlUtils.setColorBlend(hPolygonColor,
a.color, a.blendColor, scale - 1.0f);
else
GlUtils.setColor(hPolygonColor, a.blendColor, 1);
} else {
if (a.color[3] != 1)
if (a.color < 0xff000000)
GLState.blend(true);
else
GLState.blend(false);