changeset 16460:ec7036dedee4

Fix border color (forgot to divide by 255.0).
author reimar
date Mon, 12 Sep 2005 14:51:30 +0000
parents 2866304d5f4b
children f93eaa5ad64d
files libvo/gl_common.c libvo/gl_common.h
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Mon Sep 12 10:05:06 2005 +0000
+++ b/libvo/gl_common.c	Mon Sep 12 14:51:30 2005 +0000
@@ -284,8 +284,9 @@
  * \param val luminance value to fill texture with
  */
 void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
-                      int w, int h, char val) {
-  GLfloat border[4] = {val, val, val, val};
+                      int w, int h, unsigned char val) {
+  GLfloat fval = (GLfloat)val / 255.0;
+  GLfloat border[4] = {fval, fval, fval, fval};
   GLenum clrfmt = (fmt == GL_ALPHA) ? GL_ALPHA : GL_LUMINANCE;
   char *init = (char *)malloc(w * h);
   memset(init, val, w * h);
--- a/libvo/gl_common.h	Mon Sep 12 10:05:06 2005 +0000
+++ b/libvo/gl_common.h	Mon Sep 12 14:51:30 2005 +0000
@@ -65,7 +65,7 @@
                   GLenum *gl_format, GLenum *gl_type);
 int glFmt2bpp(GLenum format, GLenum type);
 void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
-                      int w, int h, char val);
+                      int w, int h, unsigned char val);
 void glUploadTex(GLenum target, GLenum format, GLenum type,
                  const char *data, int stride,
                  int x, int y, int w, int h, int slice);