From 7755873771266da847b6dd1aea5496696696eea8 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 29 Jul 2012 05:59:03 +0000 Subject: Fix for [#27484] "Run-time command line options don't work in Multi-texture mode." reported by Josiah Lane (solarlune). The -g nomipmap = 1 option only changed the mipmapping option for bf_gpu, which BL_Texture wasn't checking. --- source/blender/gpu/GPU_draw.h | 1 + source/blender/gpu/intern/gpu_draw.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 59140b2be80..7a71f33d3d0 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -104,6 +104,7 @@ void GPU_render_text(struct MTFace *tface, int mode, * - these will free textures on changes */ void GPU_set_mipmap(int mipmap); +int GPU_get_mipmap(void); void GPU_set_linear_mipmap(int linear); void GPU_paint_set_mipmap(int mipmap); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index f4e1e0c1147..456e14c8401 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -268,7 +268,7 @@ void GPU_set_linear_mipmap(int linear) } } -static int gpu_get_mipmap(void) +int GPU_get_mipmap(void) { return GTS.domipmap && !GTS.texpaint; } @@ -662,7 +662,7 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *pix, float * frect, int glGenTextures(1, (GLuint *)bind); glBindTexture(GL_TEXTURE_2D, *bind); - if (!(gpu_get_mipmap() && mipmap)) { + if (!(GPU_get_mipmap() && mipmap)) { if (use_high_bit_depth) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect); else @@ -883,7 +883,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap) ibuf = BKE_image_get_ibuf(ima, NULL); - if (ima->repbind || (gpu_get_mipmap() && mipmap) || !ima->bindcode || !ibuf || + if (ima->repbind || (GPU_get_mipmap() && mipmap) || !ima->bindcode || !ibuf || (!is_power_of_2_i(ibuf->x) || !is_power_of_2_i(ibuf->y)) || (w == 0) || (h == 0)) { -- cgit v1.2.3