Move BoundingBox out of RenderBase

They were essentially just pass-though methods
This commit is contained in:
Scott Mansell
2023-01-30 03:40:15 +13:00
parent 35a69cb1bb
commit 99d3e489ea
11 changed files with 38 additions and 88 deletions

View File

@ -49,6 +49,18 @@ private:
std::array<BBoxType, NUM_BBOX_VALUES> m_values = {};
std::array<bool, NUM_BBOX_VALUES> m_dirty = {};
bool m_is_valid = true;
// Nintendo's SDK seems to write "default" bounding box values before every draw (1023 0 1023 0
// are the only values encountered so far, which happen to be the extents allowed by the BP
// registers) to reset the registers for comparison in the pixel engine, and presumably to detect
// whether GX has updated the registers with real values.
//
// We can store these values when Bounding Box emulation is disabled and return them on read,
// which the game will interpret as "no pixels have been drawn"
//
// This produces much better results than just returning garbage, which can cause games like
// Ultimate Spider-Man to crash
std::array<u16, 4> m_bounding_box_fallback = {};
};
extern std::unique_ptr<BoundingBox> g_bounding_box;