Support 8-bit textures

This commit is contained in:
Magnus Norddahl 2019-12-02 00:35:15 +01:00
commit 4a2b763aaa
4 changed files with 38 additions and 25 deletions

View file

@ -233,7 +233,7 @@ void PolyRenderState::ApplyMaterial()
if (base)
{
DCanvas *texcanvas = base->GetImage(mMaterial);
PolyTriangleDrawer::SetTexture(GetPolyFrameBuffer()->GetDrawCommands(), 0, texcanvas->GetPixels(), texcanvas->GetHeight(), texcanvas->GetWidth());
PolyTriangleDrawer::SetTexture(GetPolyFrameBuffer()->GetDrawCommands(), 0, texcanvas->GetPixels(), texcanvas->GetHeight(), texcanvas->GetWidth(), texcanvas->IsBgra());
int numLayers = mMaterial.mMaterial->GetLayers();
for (int i = 1; i < numLayers; i++)
@ -242,7 +242,7 @@ void PolyRenderState::ApplyMaterial()
auto systex = static_cast<PolyHardwareTexture*>(mMaterial.mMaterial->GetLayer(i, 0, &layer));
texcanvas = systex->GetImage(mMaterial);
PolyTriangleDrawer::SetTexture(GetPolyFrameBuffer()->GetDrawCommands(), i, texcanvas->GetPixels(), texcanvas->GetHeight(), texcanvas->GetWidth());
PolyTriangleDrawer::SetTexture(GetPolyFrameBuffer()->GetDrawCommands(), i, texcanvas->GetPixels(), texcanvas->GetHeight(), texcanvas->GetWidth(), texcanvas->IsBgra());
}
}