mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 06:48:33 +00:00
VideoCommon: Refactor TexMode0 mipmaps disabled test into a helper function
This commit is contained in:
parent
902e5cddf7
commit
0b9a72a62d
8 changed files with 35 additions and 15 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "VideoBackends/Software/TextureSampler.h"
|
||||
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/SamplerCommon.h"
|
||||
#include "VideoCommon/TextureDecoder.h"
|
||||
|
||||
#define ALLOW_MIPMAP 1
|
||||
|
@ -69,14 +70,14 @@ void Sample(s32 s, s32 t, s32 lod, bool linear, u8 texmap, u8 *sample)
|
|||
|
||||
s32 lodFract = lod & 0xf;
|
||||
|
||||
if (lod > 0 && tm0.min_filter & 3)
|
||||
if (lod > 0 && SamplerCommon::AreBpTexMode0MipmapsEnabled(tm0))
|
||||
{
|
||||
// use mipmap
|
||||
baseMip = lod >> 4;
|
||||
mipLinear = (lodFract && tm0.min_filter & 2);
|
||||
mipLinear = (lodFract && tm0.min_filter & TexMode0::TEXF_LINEAR);
|
||||
|
||||
// if using nearest mip filter and lodFract >= 0.5 round up to next mip
|
||||
baseMip += (lodFract >> 3) & (tm0.min_filter & 1);
|
||||
baseMip += (lodFract >> 3) & (tm0.min_filter & TexMode0::TEXF_POINT);
|
||||
}
|
||||
|
||||
if (mipLinear)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue