changeset 36127:18c289284727

Avoid glColor4f, use glColor4ub instead.
author reimar
date Sat, 04 May 2013 15:20:42 +0000
parents fd34a83228ca
children e51b909bdd8e
files libvo/gl_common.c libvo/gl_common.h libvo/matrixview.c libvo/vo_gl.c
diffstat 4 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Sat May 04 13:28:14 2013 +0000
+++ b/libvo/gl_common.c	Sat May 04 15:20:42 2013 +0000
@@ -63,7 +63,6 @@
 void (GLAPIENTRY *mpglTexEnvf)(GLenum, GLenum, GLfloat);
 void (GLAPIENTRY *mpglTexEnvi)(GLenum, GLenum, GLint);
 void (GLAPIENTRY *mpglColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
-void (GLAPIENTRY *mpglColor4f)(GLfloat, GLfloat, GLfloat, GLfloat);
 void (GLAPIENTRY *mpglClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
 void (GLAPIENTRY *mpglClearDepth)(double);
 void (GLAPIENTRY *mpglDepthFunc)(GLenum);
@@ -459,7 +458,6 @@
   DEF_FUNC_DESC(TexEnvf),
   DEF_FUNC_DESC(TexEnvi),
   DEF_FUNC_DESC(Color4ub),
-  DEF_FUNC_DESC(Color4f),
   DEF_FUNC_DESC(ClearColor),
   DEF_FUNC_DESC(ClearDepth),
   DEF_FUNC_DESC(DepthFunc),
--- a/libvo/gl_common.h	Sat May 04 13:28:14 2013 +0000
+++ b/libvo/gl_common.h	Sat May 04 15:20:42 2013 +0000
@@ -252,7 +252,6 @@
 extern void (GLAPIENTRY *mpglTexEnvf)(GLenum, GLenum, GLfloat);
 extern void (GLAPIENTRY *mpglTexEnvi)(GLenum, GLenum, GLint);
 extern void (GLAPIENTRY *mpglColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
-extern void (GLAPIENTRY *mpglColor4f)(GLfloat, GLfloat, GLfloat, GLfloat);
 extern void (GLAPIENTRY *mpglClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
 extern void (GLAPIENTRY *mpglClearDepth)(double);
 extern void (GLAPIENTRY *mpglDepthFunc)(GLenum);
--- a/libvo/matrixview.c	Sat May 04 13:28:14 2013 +0000
+++ b/libvo/matrixview.c	Sat May 04 15:20:42 2013 +0000
@@ -71,13 +71,13 @@
 
     num &= 63;
     //light = light / 255;        //light=7-light;num+=(light*60);
-    light = light / 255 * matrix_brightness;
+    light *= matrix_brightness;
     num2 = num / 10;
     num3 = num - (num2 * 10);
     ty = (float)num2 / 7;
     tx = (float)num3 / 10;
     mpglNormal3f(0.0f, 0.0f, 1.0f);        // Needed for lighting
-    mpglColor4f(0.0, 1.0, 0.0, light);        // Basic polygon color
+    mpglColor4ub(0, 255, 255, light);        // Basic polygon color
 
     mpglTexCoord2f(tx, ty);
     mpglVertex3f(x, y, z);
@@ -99,7 +99,7 @@
     ty = (float)num2 / 7;
     tx = (float)num3 / 10;
     mpglNormal3f(0.0f, 0.0f, 1.0f);        // Needed for lighting
-    mpglColor4f(1.0, 1.0, 1.0, .5);        // Basic polygon color
+    mpglColor4ub(255, 255, 255, 128);        // Basic polygon color
 
     mpglTexCoord2f(tx, ty);
     mpglVertex3f(x, y, z);
@@ -114,7 +114,7 @@
 static void draw_flare(float x, float y, float z)        //flare
 {
     mpglNormal3f(0.0f, 0.0f, 1.0f);        // Needed for lighting
-    mpglColor4f(1.0, 1.0, 1.0, .8);        // Basic polygon color
+    mpglColor4ub(255, 255, 255, 204);        // Basic polygon color
 
     mpglTexCoord2f(0, 0);
     mpglVertex3f(x - 1, y + 1, z);
--- a/libvo/vo_gl.c	Sat May 04 13:28:14 2013 +0000
+++ b/libvo/vo_gl.c	Sat May 04 15:20:42 2013 +0000
@@ -899,7 +899,7 @@
 }
 
 static void do_render(void) {
-  mpglColor4f(1,1,1,1);
+  mpglColor4ub(255, 255, 255, 255);
   if (is_yuv || is_xyz || custom_prog)
     glEnableYUVConversion(gl_target, yuvconvtype);
   if (stereo_mode) {