From 7a84b40ce4bb720cd5fbfbe608b236875028cf09 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 12 Sep 2005 14:51:30 +0000 Subject: Fix border color (forgot to divide by 255.0). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16461 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 5 +++-- libvo/gl_common.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'libvo') diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 2842c2a468..5a888826fb 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -284,8 +284,9 @@ static void getFunctions() { * \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); diff --git a/libvo/gl_common.h b/libvo/gl_common.h index 31792251c1..9223d81c21 100644 --- a/libvo/gl_common.h +++ b/libvo/gl_common.h @@ -65,7 +65,7 @@ int glFindFormat(uint32_t format, uint32_t *bpp, GLint *gl_texfmt, 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); -- cgit v1.2.3