Add SurfaceCache::operator[]

This commit is contained in:
wheremyfoodat 2023-01-02 20:06:40 +02:00
parent e9217722f1
commit 9d741ba177

View file

@ -51,7 +51,6 @@ public:
if (!e.valid) { if (!e.valid) {
e = surface; e = surface;
e.allocate(); e.allocate();
Sleep(2000);
return e; return e;
} }
} }
@ -59,4 +58,8 @@ public:
// This should be unreachable but helps to panic anyways // This should be unreachable but helps to panic anyways
Helpers::panic("Couldn't add surface to cache\n"); Helpers::panic("Couldn't add surface to cache\n");
} }
SurfaceType& operator[](size_t i) {
return buffer[i];
}
}; };