|
|
|
|
@ -2809,7 +2809,7 @@ void GPUTextureCache::DumpTexture(TextureReplacementType type, u32 offset_x, u32
|
|
|
|
|
SmallString filename = name.ToString();
|
|
|
|
|
filename.append(".png");
|
|
|
|
|
|
|
|
|
|
const std::string path = Path::Combine(dump_directory, filename);
|
|
|
|
|
std::string path = Path::Combine(dump_directory, filename);
|
|
|
|
|
if (FileSystem::FileExists(path.c_str()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@ -2819,6 +2819,7 @@ void GPUTextureCache::DumpTexture(TextureReplacementType type, u32 offset_x, u32
|
|
|
|
|
GPUTextureCache::DecodeTexture(mode, &g_vram[rect.top * VRAM_WIDTH + rect.left], palette_data, image.GetPixels(),
|
|
|
|
|
image.GetPitch(), width, height, GPUTexture::Format::RGBA8);
|
|
|
|
|
|
|
|
|
|
System::QueueAsyncTask([path = std::move(path), image = std::move(image), width, height, semitransparent]() mutable {
|
|
|
|
|
// TODO: Vectorize this.
|
|
|
|
|
u32* image_pixels = reinterpret_cast<u32*>(image.GetPixels());
|
|
|
|
|
const u32* image_pixels_end = image_pixels + (width * height);
|
|
|
|
|
@ -2852,6 +2853,7 @@ void GPUTextureCache::DumpTexture(TextureReplacementType type, u32 offset_x, u32
|
|
|
|
|
|
|
|
|
|
if (!image.SaveToFile(path.c_str()))
|
|
|
|
|
ERROR_LOG("Failed to write texture dump to {}.", Path::GetFileName(path));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool GPUTextureCache::IsMatchingReplacementPalette(HashType full_palette_hash, GPUTextureMode mode,
|
|
|
|
|
|