From ecbfff3c60c8c83636167ee4419a691e4e66c154 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 24 Dec 2020 03:13:01 +1000 Subject: [PATCH] HostDisplay: Fix incorrect extension check for other formats --- src/core/host_display.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/host_display.cpp b/src/core/host_display.cpp index 5a37f765d..1f4626bc8 100644 --- a/src/core/host_display.cpp +++ b/src/core/host_display.cpp @@ -424,15 +424,15 @@ static bool CompressAndWriteTextureToFile(u32 width, u32 height, std::string fil result = (stbi_write_png_to_func(write_func, fp.get(), width, height, 4, texture_data.data(), texture_data_stride) != 0); } - else if (StringUtil::Strcasecmp(filename.c_str(), ".jpg") == 0) + else if (StringUtil::Strcasecmp(extension, ".jpg") == 0) { result = (stbi_write_jpg_to_func(write_func, fp.get(), width, height, 4, texture_data.data(), 95) != 0); } - else if (StringUtil::Strcasecmp(filename.c_str(), ".tga") == 0) + else if (StringUtil::Strcasecmp(extension, ".tga") == 0) { result = (stbi_write_tga_to_func(write_func, fp.get(), width, height, 4, texture_data.data()) != 0); } - else if (StringUtil::Strcasecmp(filename.c_str(), ".bmp") == 0) + else if (StringUtil::Strcasecmp(extension, ".bmp") == 0) { result = (stbi_write_bmp_to_func(write_func, fp.get(), width, height, 4, texture_data.data()) != 0); }