mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Make TempImage act a bit more robustly.
This commit is contained in:
1 parent
24017a1ba4
commit
52a16ea365
2 files changed
+7
-6
No files matched your search
@@ -54,11 +54,6 @@ private:
|
||||
ManagedTexture::LoadState *state_;
|
||||
};
|
||||
|
||||
TempImage::~TempImage() {
|
||||
// Make sure you haven't forgotten to call Free.
|
||||
_dbg_assert_(levels[0] == nullptr);
|
||||
}
|
||||
|
||||
static Draw::DataFormat ZimToT3DFormat(int zim) {
|
||||
switch (zim) {
|
||||
case ZIM_RGBA8888: return Draw::DataFormat::R8G8B8A8_UNORM;
|
||||
|
||||
@@ -23,7 +23,13 @@ class LimitedWaitable;
|
||||
// The reason for the separation is so that the image can be loaded and decompressed on a thread,
|
||||
// and then only uploaded to the GPU on the main thread.
|
||||
struct TempImage {
|
||||
~TempImage();
|
||||
TempImage() = default;
|
||||
// Owns levels[0], so no copies.
|
||||
TempImage(const TempImage &) = delete;
|
||||
TempImage &operator=(const TempImage &) = delete;
|
||||
~TempImage() {
|
||||
Free();
|
||||
}
|
||||
Draw::DataFormat fmt = Draw::DataFormat::UNDEFINED;
|
||||
ImageFileType type = ImageFileType::UNKNOWN;
|
||||
uint8_t *levels[16]{}; // only free the first pointer, they all point to the same buffer.
|
||||
|
||||
Reference in new issue
Block a user