rasterizer: tweak alpha blending edge cases. it seemed wrong. keep on the lookout for newly mis-blended things. also slightly tweak fat printf diagnostics

This commit is contained in:
zeromus 2011-07-30 22:08:10 +00:00
parent 57606c4aa8
commit 4244eb69c6
2 changed files with 14 additions and 3 deletions

View File

@ -287,10 +287,11 @@ static FORCEINLINE void alphaBlend(FragmentColor & dst, const FragmentColor & sr
{
if(gfx3d.renderState.enableAlphaBlending)
{
if(src.a == 0 || dst.a == 0)
if(src.a == 31 || dst.a == 0)
{
dst = src;
}
//else if(src.a == 0) { } //this is not necessary since it was handled earlier
else
{
u8 alpha = src.a+1;
@ -1416,6 +1417,15 @@ void SoftRasterizerEngine::framebufferProcess()
destFragmentColor.a = ((128-fog)*destFragmentColor.a + a*fog)>>7;
}
}
////debug alpha channel framebuffer contents
//for(int i=0;i<256*192;i++)
//{
// FragmentColor &destFragmentColor = screenColor[i];
// destFragmentColor.r = destFragmentColor.a;
// destFragmentColor.g = destFragmentColor.a;
// destFragmentColor.b = destFragmentColor.a;
//}
}
void SoftRasterizerEngine::performClipping(bool hirez)

View File

@ -142,11 +142,12 @@ void build_ListCallback(FsEntry* fs, EListCallbackArg arg)
fclose(inf);
std::string path = currVirtPath + "/" + fname;
printf("adding path %s for libfat\n",path.c_str());
bool ok = LIBFAT::WriteFile(path.c_str(),buf,len);
if(!ok)
printf("ERROR adding file %s via libfat\n",path.c_str());
printf("ERROR adding file to fat\n");
delete[] buf;
} else printf("ERROR opening file %s for add via libfat\n",path.c_str());
} else printf("ERROR opening file for fat\n");
}
}