- add support for scaled textures in softpoly

This commit is contained in:
Magnus Norddahl 2018-12-16 15:12:45 +01:00
parent eaf1c4f1e2
commit 15d599813b

View file

@ -50,8 +50,8 @@ void PolyDrawArgs::SetTexture(const uint8_t *texels, int width, int height)
void PolyDrawArgs::SetTexture(FSoftwareTexture *texture, FRenderStyle style) void PolyDrawArgs::SetTexture(FSoftwareTexture *texture, FRenderStyle style)
{ {
mTexture = texture; mTexture = texture;
mTextureWidth = texture->GetWidth(); mTextureWidth = texture->GetPhysicalWidth();
mTextureHeight = texture->GetHeight(); mTextureHeight = texture->GetPhysicalHeight();
if (PolyTriangleDrawer::IsBgra()) if (PolyTriangleDrawer::IsBgra())
mTexturePixels = (const uint8_t *)texture->GetPixelsBgra(); mTexturePixels = (const uint8_t *)texture->GetPixelsBgra();
else else
@ -73,8 +73,8 @@ void PolyDrawArgs::SetTexture(FSoftwareTexture *texture, uint32_t translationID,
mTranslation = table->Remap; mTranslation = table->Remap;
mTexture = texture; mTexture = texture;
mTextureWidth = texture->GetWidth(); mTextureWidth = texture->GetPhysicalWidth();
mTextureHeight = texture->GetHeight(); mTextureHeight = texture->GetPhysicalHeight();
mTexturePixels = texture->GetPixels(style); mTexturePixels = texture->GetPixels(style);
return; return;
} }
@ -83,8 +83,8 @@ void PolyDrawArgs::SetTexture(FSoftwareTexture *texture, uint32_t translationID,
if (style.Flags & STYLEF_RedIsAlpha) if (style.Flags & STYLEF_RedIsAlpha)
{ {
mTexture = texture; mTexture = texture;
mTextureWidth = texture->GetWidth(); mTextureWidth = texture->GetPhysicalWidth();
mTextureHeight = texture->GetHeight(); mTextureHeight = texture->GetPhysicalHeight();
mTexturePixels = texture->GetPixels(style); mTexturePixels = texture->GetPixels(style);
} }
else else