- implement the physical texture scaling at the drawer transition level as the frontend of the software renderers do not even need to know the textures are scaled

This commit is contained in:
Magnus Norddahl 2018-12-16 14:34:44 +01:00
commit eaf1c4f1e2
12 changed files with 118 additions and 107 deletions

View file

@ -67,6 +67,8 @@ namespace swrenderer
return;
}
tex = texture;
drawerargs.SetSolidColor(3);
drawerargs.SetTexture(Thread, texture);
@ -181,11 +183,11 @@ namespace swrenderer
float zbufferdepth = (float)(1.0 / fabs(planeheight / Thread->Viewport->ScreenToViewY(y, 1.0)));
drawerargs.SetTextureUStep(distance * xstepscale / drawerargs.TextureWidth());
drawerargs.SetTextureUPos((distance * curxfrac + pviewx) / drawerargs.TextureWidth());
drawerargs.SetTextureUStep(distance * xstepscale / tex->GetWidth());
drawerargs.SetTextureUPos((distance * curxfrac + pviewx) / tex->GetWidth());
drawerargs.SetTextureVStep(distance * ystepscale / drawerargs.TextureHeight());
drawerargs.SetTextureVPos((distance * curyfrac + pviewy) / drawerargs.TextureHeight());
drawerargs.SetTextureVStep(distance * ystepscale / tex->GetHeight());
drawerargs.SetTextureVPos((distance * curyfrac + pviewy) / tex->GetHeight());
if (viewport->RenderTarget->IsBgra())
{