Skip to content

Commit

Permalink
Implement crossfade
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Dec 1, 2019
1 parent 1b9479e commit 8ca05fe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/rendering/polyrenderer/backend/poly_hwtexture.cpp
Expand Up @@ -121,6 +121,22 @@ void PolyHardwareTexture::CreateWipeTexture(int w, int h, const char *name)
mCanvas.reset(new DCanvas(0, 0, true));
mCanvas->Resize(w, h, false);
}

auto fb = static_cast<PolyFrameBuffer*>(screen);

fb->FlushDrawCommands();
DrawerThreads::WaitForWorkers();

uint32_t* dest = (uint32_t*)mCanvas->GetPixels();
uint32_t* src = (uint32_t*)fb->GetCanvas()->GetPixels();
int dpitch = mCanvas->GetPitch();
int spitch = fb->GetCanvas()->GetPitch();
int pixelsize = 4;

for (int y = 0; y < h; y++)
{
memcpy(dest + dpitch * (h - 1 - y), src + spitch * y, w * pixelsize);
}
}

void PolyHardwareTexture::CreateImage(FTexture *tex, int translation, int flags)
Expand Down

0 comments on commit 8ca05fe

Please sign in to comment.