VideoCommon: Abstract bounding box

This moves much of the duplicated bounding box code into VideoCommon,
leaving only the specific buffer implementations in each backend.
This commit is contained in:
Techjar
2021-06-09 07:42:21 -04:00
parent 7ec02ee4d3
commit 1161af8059
41 changed files with 617 additions and 708 deletions

View File

@ -255,7 +255,7 @@ static void BPWritten(const BPCmd& bp)
if (PE_copy.copy_to_xfb == 1)
{
// Make sure we disable Bounding box to match the side effects of the non-failure path
BoundingBox::Disable();
g_renderer->BBoxDisable();
}
return;
@ -287,7 +287,7 @@ static void BPWritten(const BPCmd& bp)
// We should be able to get away with deactivating the current bbox tracking
// here. Not sure if there's a better spot to put this.
// the number of lines copied is determined by the y scale * source efb height
BoundingBox::Disable();
g_renderer->BBoxDisable();
float yScale;
if (PE_copy.scale_invert)
@ -452,7 +452,7 @@ static void BPWritten(const BPCmd& bp)
case BPMEM_CLEARBBOX2:
{
const u8 offset = bp.address & 2;
BoundingBox::Enable();
g_renderer->BBoxEnable();
g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff);
g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10);