diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-12-05 10:58:03 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-12-05 11:48:42 -0500 |
| commit | 9bd533ebe4cee1dfef9725f32fe0b9ca42f5680d (patch) | |
| tree | 4f7b7b1da059b8299e459e76ebbcf930e58c9df0 /Source/Core/VideoBackends | |
| parent | 15fc71cfcf5f94221443aaff99ae559fa3cb4633 (diff) | |
VideoCommon/BoundingBox: Make interface for querying bounding box data
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWRenderer.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/Tev.cpp | 11 |
2 files changed, 4 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 4d9b821f5a..c128e6bd1a 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -128,12 +128,12 @@ u32 SWRenderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData) u16 SWRenderer::BBoxRead(int index) { - return BoundingBox::coords[index]; + return BoundingBox::GetCoordinate(static_cast<BoundingBox::Coordinate>(index)); } void SWRenderer::BBoxWrite(int index, u16 value) { - BoundingBox::coords[index] = value; + BoundingBox::SetCoordinate(static_cast<BoundingBox::Coordinate>(index), value); } void SWRenderer::ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable, diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 580ab58685..8d03cacac2 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -841,15 +841,8 @@ void Tev::Draw() EfbInterface::IncPerfCounterQuadCount(PQ_ZCOMP_OUTPUT); } - // branchless bounding box update - BoundingBox::coords[BoundingBox::LEFT] = - std::min((u16)Position[0], BoundingBox::coords[BoundingBox::LEFT]); - BoundingBox::coords[BoundingBox::RIGHT] = - std::max((u16)Position[0], BoundingBox::coords[BoundingBox::RIGHT]); - BoundingBox::coords[BoundingBox::TOP] = - std::min((u16)Position[1], BoundingBox::coords[BoundingBox::TOP]); - BoundingBox::coords[BoundingBox::BOTTOM] = - std::max((u16)Position[1], BoundingBox::coords[BoundingBox::BOTTOM]); + BoundingBox::Update(static_cast<u16>(Position[0]), static_cast<u16>(Position[0]), + static_cast<u16>(Position[1]), static_cast<u16>(Position[1])); #if ALLOW_TEV_DUMPS if (g_ActiveConfig.bDumpTevStages) |
