Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2012-07-29 09:59:03 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-07-29 09:59:03 +0400
commit7755873771266da847b6dd1aea5496696696eea8 (patch)
treeb47bcb40df8f6f2680bfdeeb07054b1a8c435135 /source
parent0cfd402a7f7783dd29aab802b6d34412c1c11492 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/GPU_draw.h1
-rw-r--r--source/blender/gpu/intern/gpu_draw.c6
-rw-r--r--source/gameengine/Ketsji/BL_Texture.cpp3
3 files changed, 6 insertions, 4 deletions
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))
{
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp
index f2d67e9131d..fee8047642d 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -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 );
}