- Fix mipmap filtering bug when using nearest filter

This commit is contained in:
Magnus Norddahl 2017-05-21 11:01:37 +02:00
parent 371a8755c2
commit aff9205057
2 changed files with 10 additions and 8 deletions

View file

@ -86,9 +86,6 @@ namespace swrenderer
texdata.ystep = args.TextureVStep();
texdata.xfrac = args.TextureUPos();
texdata.yfrac = args.TextureVPos();
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
texdata.source = (const uint32_t*)args.TexturePixels();
@ -111,7 +108,11 @@ namespace swrenderer
}
}
bool is_nearest_filter = !((magnifying && r_magfilter) || (!magnifying && r_minfilter));
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
bool is_nearest_filter = (magnifying && !r_magfilter) || (!magnifying && !r_minfilter);
bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6;
auto shade_constants = args.ColormapConstants();

View file

@ -86,9 +86,6 @@ namespace swrenderer
texdata.ystep = args.TextureVStep();
texdata.xfrac = args.TextureUPos();
texdata.yfrac = args.TextureVPos();
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
texdata.source = (const uint32_t*)args.TexturePixels();
@ -111,7 +108,11 @@ namespace swrenderer
}
}
bool is_nearest_filter = !((magnifying && r_magfilter) || (!magnifying && r_minfilter));
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
bool is_nearest_filter = (magnifying && !r_magfilter) || (!magnifying && !r_minfilter);
bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6;
auto shade_constants = args.ColormapConstants();