Fix T37468: image empties now use no interpolation when mipmaps are disabled.
Image empties don't actually support mipmaps right now, but the user preference doubles as a way to disable any kind of interpolating in texture filter and just show nearest neighbour filter, so for this is a bit more consistent.
This commit is contained in:
		@@ -610,6 +610,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
 | 
			
		||||
 | 
			
		||||
	if (ibuf && ibuf->rect) {
 | 
			
		||||
		const bool use_clip = (U.glalphaclip != 1.0f);
 | 
			
		||||
		int zoomfilter = (U.gameflags & USER_DISABLE_MIPMAP )? GL_NEAREST : GL_LINEAR;
 | 
			
		||||
		/* Setup GL params */
 | 
			
		||||
		glEnable(GL_BLEND);
 | 
			
		||||
		glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA);
 | 
			
		||||
@@ -623,7 +624,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
 | 
			
		||||
		glColor4fv(ob->col);
 | 
			
		||||
 | 
			
		||||
		/* Draw the Image on the screen */
 | 
			
		||||
		glaDrawPixelsTex(ofs_x, ofs_y, ima_x, ima_y, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, ibuf->rect);
 | 
			
		||||
		glaDrawPixelsTex(ofs_x, ofs_y, ima_x, ima_y, GL_RGBA, GL_UNSIGNED_BYTE, zoomfilter, ibuf->rect);
 | 
			
		||||
		glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
 | 
			
		||||
 | 
			
		||||
		glDisable(GL_BLEND);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user