fixed mipmap loading in both plugins.

add an option to limit fps instead of vps for games with bad synchronization
some minor fixes in d3d gui
enjoy :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5394 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2010-04-22 02:51:07 +00:00
parent c15b1d3219
commit 8eb21d1bac
9 changed files with 73 additions and 49 deletions

View File

@ -211,6 +211,13 @@ struct TabAdvanced : public W32Util::Tab
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false;
}
break;
case IDC_ENABLEREALXFB:
{
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : (Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false);
g_Config.bUseRealXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : false;
Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? Button_Enable(GetDlgItem(hDlg,IDC_ENABLEXFB), false) : Button_Enable(GetDlgItem(hDlg,IDC_ENABLEXFB), true);
}
break;
case IDC_ENABLEEFBCOPY:
{
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false);

View File

@ -219,7 +219,7 @@ static const D3DTEXTUREFILTERTYPE d3dMipFilters[4] =
D3DTEXF_NONE,
D3DTEXF_POINT,
D3DTEXF_LINEAR,
D3DTEXF_LINEAR, //reserved
D3DTEXF_NONE, //reserved
};
static const D3DTEXTUREADDRESS d3dClamps[4] =
@ -1402,6 +1402,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
min = (tm0.min_filter & 4) ? D3DTEXF_LINEAR : D3DTEXF_POINT;
mag = tm0.mag_filter ? D3DTEXF_LINEAR : D3DTEXF_POINT;
mip = (tm0.min_filter == 8)?D3DTEXF_NONE:d3dMipFilters[tm0.min_filter & 3];
if((tm0.min_filter & 3) && (tm0.min_filter != 8) && ((tm1.max_lod >> 4) == 0)) mip = D3DTEXF_NONE;
}
if (texindex)
stage += 4;

View File

@ -278,12 +278,12 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width,
}
entry.addr = address;
entry.size_in_bytes = TexDecoder_GetTextureSizeInBytes(width, height, tex_format);
entry.size_in_bytes = TexDecoder_GetTextureSizeInBytes(expandedWidth, expandedHeight, tex_format);
entry.isRenderTarget = false;
bool isPow2 = !((width & (width - 1)) || (height & (height - 1)));
entry.isNonPow2 = false;
int TexLevels = (width > height)?width:height;
TexLevels = (isPow2 && UseNativeMips && tex_format != GX_TF_CMPR) ? (int)(log((double)TexLevels)/log((double)2)) + 1 : (isPow2?0:1);
TexLevels = (isPow2 && UseNativeMips && (maxlevel > 0)) ? (int)(log((double)TexLevels)/log((double)2)) + 1 : ((isPow2 && g_ActiveConfig.bForceFiltering)? 0 : 1);
if(TexLevels > maxlevel && maxlevel > 0)
TexLevels = maxlevel;
if (!skip_texture_create)
@ -292,7 +292,7 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width,
}
else
{
D3D::ReplaceTexture2D(entry.texture, (BYTE*)temp, width, height, expandedWidth, d3d_fmt, swap_r_b);
D3D::ReplaceTexture2D(entry.texture, (BYTE*)temp, width, height, expandedWidth, d3d_fmt, swap_r_b, 0);
}
if(TexLevels > 1 && pcfmt != PC_TEX_FMT_NONE)
{