Change RenderTarget global to be an internal swrenderer variable

This commit is contained in:
Magnus Norddahl 2017-01-15 03:19:03 +01:00
commit f9175561bb
10 changed files with 42 additions and 26 deletions

View file

@ -244,18 +244,7 @@ void FSoftwareRenderer::OnModeSet ()
void FSoftwareRenderer::ClearBuffer(int color)
{
if (!r_swtruecolor)
{
memset(RenderTarget->GetBuffer(), color, RenderTarget->GetPitch() * RenderTarget->GetHeight());
}
else
{
uint32_t bgracolor = GPalette.BaseColors[color].d;
int size = RenderTarget->GetPitch() * RenderTarget->GetHeight();
uint32_t *dest = (uint32_t *)RenderTarget->GetBuffer();
for (int i = 0; i < size; i++)
dest[i] = bgracolor;
}
RenderScene::Instance()->SetClearColor(color);
}
void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov)