[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49348] trunk/blender/source: Fix for [ #27484] "Run-time command line options don't work in Multi-texture mode." reported by Josiah Lane (solarlune).

Mitchell Stokes mogurijin at gmail.com
Sun Jul 29 07:59:04 CEST 2012


Revision: 49348
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49348
Author:   moguri
Date:     2012-07-29 05:59:03 +0000 (Sun, 29 Jul 2012)
Log Message:
-----------
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. 

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/GPU_draw.h
    trunk/blender/source/blender/gpu/intern/gpu_draw.c
    trunk/blender/source/gameengine/Ketsji/BL_Texture.cpp

Modified: trunk/blender/source/blender/gpu/GPU_draw.h
===================================================================
--- trunk/blender/source/blender/gpu/GPU_draw.h	2012-07-29 04:42:12 UTC (rev 49347)
+++ trunk/blender/source/blender/gpu/GPU_draw.h	2012-07-29 05:59:03 UTC (rev 49348)
@@ -104,6 +104,7 @@
  * - 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);
 

Modified: trunk/blender/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_draw.c	2012-07-29 04:42:12 UTC (rev 49347)
+++ trunk/blender/source/blender/gpu/intern/gpu_draw.c	2012-07-29 05:59:03 UTC (rev 49348)
@@ -268,7 +268,7 @@
 	}
 }
 
-static int gpu_get_mipmap(void)
+int GPU_get_mipmap(void)
 {
 	return GTS.domipmap && !GTS.texpaint;
 }
@@ -662,7 +662,7 @@
 	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 @@
 	
 	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))
 	{

Modified: trunk/blender/source/gameengine/Ketsji/BL_Texture.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/BL_Texture.cpp	2012-07-29 04:42:12 UTC (rev 49347)
+++ trunk/blender/source/gameengine/Ketsji/BL_Texture.cpp	2012-07-29 05:59:03 UTC (rev 49348)
@@ -116,6 +116,7 @@
 		return mOk;
 	}
 
+	mipmap = mipmap && GPU_get_mipmap();
 
 	mTexture = img->bindcode;
 	mType = GL_TEXTURE_2D;
@@ -182,7 +183,7 @@
 	} 
 	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 );
 	}
 




More information about the Bf-blender-cvs mailing list