mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 17:23:40 +01:00
Simplification around textures
This commit is contained in:
1 parent
d8dbb8389b
commit
528af8a939
11 files changed
+86
-51
No files matched your search
+4
-8
@@ -105,18 +105,14 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag
|
||||
desc.height = height[0];
|
||||
desc.depth = 1;
|
||||
desc.mipLevels = num_levels;
|
||||
for (int i = 0; i < num_levels; i++) {
|
||||
desc.initData.push_back(image[i]);
|
||||
}
|
||||
texture_ = draw_->CreateTexture(desc);
|
||||
for (int i = 0; i < num_levels; i++) {
|
||||
if (image[i]) {
|
||||
texture_->SetImageData(0, 0, 0, width[i], height[i], 1, i, width[i] * 4, image[i]);
|
||||
if (image[i])
|
||||
free(image[i]);
|
||||
}
|
||||
else {
|
||||
ELOG("Missing image level %i", i);
|
||||
}
|
||||
}
|
||||
|
||||
texture_->Finalize();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user