From 0be6cce19735a7b23368b24e99acbedcc41906ad Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 31 May 2010 22:49:11 +0000 Subject: [PATCH] Changed blend for modulate mode in A3D text rendering --- android/core/src/processing/core/PFont.java | 2 +- android/core/src/processing/core/PGraphicsAndroid3D.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/core/src/processing/core/PFont.java b/android/core/src/processing/core/PFont.java index eba6d4bee..d434cc044 100644 --- a/android/core/src/processing/core/PFont.java +++ b/android/core/src/processing/core/PFont.java @@ -699,7 +699,7 @@ public class PFont implements PConstants { // This is the right texture environment mode to use the current fill color to tint the fonts: // http://www.khronos.org/opengles/documentation/opengles1_0/html/glTexEnv.html - gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_BLEND); + gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE); gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, texWidth, texHeight, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, null); gl.glBindTexture(GL10.GL_TEXTURE_2D, 0); diff --git a/android/core/src/processing/core/PGraphicsAndroid3D.java b/android/core/src/processing/core/PGraphicsAndroid3D.java index eeff5af01..d5675ebf4 100644 --- a/android/core/src/processing/core/PGraphicsAndroid3D.java +++ b/android/core/src/processing/core/PGraphicsAndroid3D.java @@ -2278,8 +2278,8 @@ public class PGraphicsAndroid3D extends PGraphics { gl.glPushMatrix(); gl.glLoadIdentity(); - // Setting the current fill color as the environment color to multiply the texture color of the font. - gl.glTexEnvfv(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_COLOR, colorFloats, 0); + // Setting the current fill color as the font color. + gl.glColor4f(colorFloats[0], colorFloats[1], colorFloats[2], colorFloats[3]); super.textLineImpl(buffer, start, stop, x, y); @@ -2310,8 +2310,7 @@ public class PGraphicsAndroid3D extends PGraphics { float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; - textCharModelImpl(glyph.texture, - x1, y1, x2, y2); + textCharModelImpl(glyph.texture, x1, y1, x2, y2); } else if (textMode == SCREEN) { int xx = (int) x + glyph.leftExtent;