Try to do Z textures better. Z texturing does not work if early z or no z update. Corrected the Z texture bias used on 8 and 16 bit textures.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4596 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania
2009-11-21 02:49:46 +00:00
parent c9f5521d26
commit 6e7395cef1
3 changed files with 27 additions and 22 deletions

View File

@ -676,10 +676,10 @@ void Tev::Draw()
// z texture
if (bpmem.ztex2.op)
{
s32 ztex = bpmem.ztex1.bias;
u32 ztex = bpmem.ztex1.bias;
switch (bpmem.ztex2.type) {
case 0: // 8 bit
ztex += TexColor[RED_C];
ztex += TexColor[ALP_C];
break;
case 1: // 16 bit
ztex += TexColor[ALP_C] << 8 | TexColor[RED_C];
@ -689,14 +689,10 @@ void Tev::Draw()
break;
}
switch (bpmem.ztex2.op) {
case ZTEXTURE_ADD:
Position[2] += ztex;
break;
case ZTEXTURE_REPLACE:
Position[2] = ztex;
break;
}
if (bpmem.ztex2.op == ZTEXTURE_ADD)
ztex += Position[2];
Position[2] = ztex & 0x00ffffff;
}
if (!bpmem.zcontrol.zcomploc && bpmem.zmode.testenable)