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.

This commit is contained in:
Mitchell Stokes 2012-07-29 05:59:03 +00:00
parent 0cfd402a7f
commit 7755873771
3 changed files with 6 additions and 4 deletions

@ -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);

@ -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))
{

@ -116,6 +116,7 @@ bool BL_Texture::InitFromImage(int unit, Image *img, bool mipmap)
return mOk;
}
mipmap = mipmap && GPU_get_mipmap();
mTexture = img->bindcode;
mType = GL_TEXTURE_2D;
@ -182,7 +183,7 @@ void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap)
}
else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, pix );
}