mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-22 05:15:51 +12:00
[GPU] Bottom screen stub
This commit is contained in:
parent
d32de77671
commit
8e90b8a103
6 changed files with 101 additions and 25 deletions
|
@ -13,6 +13,7 @@
|
|||
// Are concerned. We could overload the == operator, but that implies full equality
|
||||
// Including equality of the allocated OpenGL resources, which we don't want
|
||||
// - A "valid" member that tells us whether the function is still valid or not
|
||||
// - A "location" member which tells us which location in 3DS memory this surface occupies
|
||||
template <typename SurfaceType, size_t capacity>
|
||||
class SurfaceCache {
|
||||
// Vanilla std::optional can't hold actual references
|
||||
|
@ -40,6 +41,15 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
OptionalRef findFromAddress(u32 address) {
|
||||
for (auto& e : buffer) {
|
||||
if (e.location == address && e.valid)
|
||||
return e;
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Adds a surface object to the cache and returns it
|
||||
SurfaceType& add(const SurfaceType& surface) {
|
||||
if (size >= capacity) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue