- replace softpoly block drawers with span drawers and make them use blending rules directly from render styles

- add dynlights to softpoly pal mode
This commit is contained in:
Magnus Norddahl 2018-05-29 23:32:57 +02:00
commit 4e6226fc2d
12 changed files with 629 additions and 1386 deletions

View file

@ -39,12 +39,19 @@
#include "screen_triangle.h"
#include "x86.h"
static bool isBgraRenderTarget = false;
void PolyTriangleDrawer::ClearBuffers(DCanvas *canvas)
{
PolyStencilBuffer::Instance()->Clear(canvas->GetWidth(), canvas->GetHeight(), 0);
PolyZBuffer::Instance()->Resize(canvas->GetPitch(), canvas->GetHeight());
}
bool PolyTriangleDrawer::IsBgra()
{
return isBgraRenderTarget;
}
void PolyTriangleDrawer::SetViewport(const DrawerCommandQueuePtr &queue, int x, int y, int width, int height, DCanvas *canvas, bool span_drawers)
{
uint8_t *dest = (uint8_t*)canvas->GetPixels();
@ -52,6 +59,7 @@ void PolyTriangleDrawer::SetViewport(const DrawerCommandQueuePtr &queue, int x,
int dest_height = canvas->GetHeight();
int dest_pitch = canvas->GetPitch();
bool dest_bgra = canvas->IsBgra();
isBgraRenderTarget = dest_bgra;
int offsetx = clamp(x, 0, dest_width);
int offsety = clamp(y, 0, dest_height);