Work towards unifying ApplyTexture

This commit is contained in:
Henrik Rydgard committed 2017-02-19 23:07:00 +01:00
1 parent 665ffe34ab
commit f839f1944e
10 files changed
+47 -25

No files matched your search

+9 -5
View File
@@ -332,6 +332,14 @@ void TextureCacheDX9::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase
clutLastFormat_ = gstate.clutformat;
}
void TextureCacheDX9::BindTexture(TexCacheEntry *entry) {
LPDIRECT3DTEXTURE9 texture = DxTex(entry);
if (texture != lastBoundTexture) {
pD3Ddevice->SetTexture(0, texture);
lastBoundTexture = texture;
}
}
void TextureCacheDX9::Unbind() {
pD3Ddevice->SetTexture(0, NULL);
}
@@ -382,11 +390,7 @@ void TextureCacheDX9::ApplyTexture() {
if (entry->framebuffer) {
ApplyTextureFramebuffer(entry, entry->framebuffer);
} else {
LPDIRECT3DTEXTURE9 texture = DxTex(entry);
if (texture != lastBoundTexture) {
pD3Ddevice->SetTexture(0, texture);
lastBoundTexture = texture;
}
BindTexture(entry);
UpdateSamplingParams(*entry, false);
gstate_c.textureFullAlpha = entry->GetAlphaStatus() == TexCacheEntry::STATUS_ALPHA_FULL;