From 45fa6795c3f875ba77c896dd7069adafbffc2e84 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 12 Nov 2011 16:43:59 +0100 Subject: [PATCH] Fixups. --- gfx/gl.c | 2 +- gfx/shader_glsl.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index 8800205174..3fb592302b 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1127,7 +1127,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei #if defined(HAVE_XML) || defined(HAVE_CG) memmove(gl->prev_info + 1, gl->prev_info, sizeof(tex_info) * (TEXTURES - 1)); - memcpy(gl->prev_info, &tex_info, sizeof(tex_info)); + memcpy(&gl->prev_info[0], &tex_info, sizeof(tex_info)); gl->tex_index = (gl->tex_index + 1) & TEXTURES_MASK; #endif diff --git a/gfx/shader_glsl.c b/gfx/shader_glsl.c index 88508f6f46..9809d180c5 100644 --- a/gfx/shader_glsl.c +++ b/gfx/shader_glsl.c @@ -1108,8 +1108,7 @@ void gl_glsl_set_params(unsigned width, unsigned height, snprintf(attrib_buf, sizeof(attrib_buf), "rubyPass%uTexture", i + 1); location = pglGetUniformLocation(gl_program[active_index], attrib_buf); - pglUniform1i(location, texunit); - texunit++; + pglUniform1i(location, texunit++); snprintf(attrib_buf, sizeof(attrib_buf), "rubyPass%uTextureSize", i + 1); location = pglGetUniformLocation(gl_program[active_index], attrib_buf); @@ -1163,10 +1162,10 @@ void gl_glsl_set_params(unsigned width, unsigned height, "Prev6", }; - snprintf(attr_buf_tex, sizeof(attr_buf_tex), "ruby%sTexture", prev_names[i]); - snprintf(attr_buf_tex_size, sizeof(attr_buf_tex), "ruby%sTextureSize", prev_names[i]); - snprintf(attr_buf_input_size, sizeof(attr_buf_tex), "ruby%sInputSize", prev_names[i]); - snprintf(attr_buf_coord, sizeof(attr_buf_tex), "ruby%sTexCoord", prev_names[i]); + snprintf(attr_buf_tex, sizeof(attr_buf_tex), "ruby%sTexture", prev_names[i]); + snprintf(attr_buf_tex_size, sizeof(attr_buf_tex_size), "ruby%sTextureSize", prev_names[i]); + snprintf(attr_buf_input_size, sizeof(attr_buf_input_size), "ruby%sInputSize", prev_names[i]); + snprintf(attr_buf_coord, sizeof(attr_buf_coord), "ruby%sTexCoord", prev_names[i]); location = pglGetUniformLocation(gl_program[active_index], attr_buf_tex); if (location >= 0)