summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-12-19 21:45:21 -0500
committerGitHub <noreply@github.com>2020-12-19 21:45:21 -0500
commit0315ca5e37f0f240e1fb7df72e1bb3bc3f7222eb (patch)
tree5af5f79f322b98aaae41f2986e0dc3c0b9399141 /Source/Core/VideoCommon/RenderBase.cpp
parent2097de603c1e225dd4fb8118d7c1cfd3f5162471 (diff)
parent0ad2f3da454feca1fc9ba9c3f8592e104028b936 (diff)
Merge pull request #9332 from leoetlino/warning-fixes
Core: Fix various warnings
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 94379909ec..02deb3a8b1 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -29,9 +29,9 @@
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/Config/Config.h"
-#include "Common/Event.h"
#include "Common/FileUtil.h"
#include "Common/Flag.h"
+#include "Common/Image.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/Profiler.h"
@@ -64,7 +64,6 @@
#include "VideoCommon/FramebufferManager.h"
#include "VideoCommon/FramebufferShaderGen.h"
#include "VideoCommon/FreeLookCamera.h"
-#include "VideoCommon/ImageWrite.h"
#include "VideoCommon/NetPlayChatUI.h"
#include "VideoCommon/NetPlayGolfUI.h"
#include "VideoCommon/OnScreenDisplay.h"
@@ -92,6 +91,12 @@ static float AspectToWidescreen(float aspect)
return aspect * ((16.0f / 9.0f) / (4.0f / 3.0f));
}
+static bool DumpFrameToPNG(const FrameDump::FrameData& frame, const std::string& file_name)
+{
+ return Common::ConvertRGBAToRGBAndSavePNG(file_name, frame.data, frame.width, frame.height,
+ frame.stride);
+}
+
Renderer::Renderer(int backbuffer_width, int backbuffer_height, float backbuffer_scale,
AbstractTextureFormat backbuffer_format)
: m_backbuffer_width(backbuffer_width), m_backbuffer_height(backbuffer_height),
@@ -1572,8 +1577,7 @@ void Renderer::FrameDumpThreadFunc()
{
std::lock_guard<std::mutex> lk(m_screenshot_lock);
- if (TextureToPng(frame.data, frame.stride, m_screenshot_name, frame.width, frame.height,
- false))
+ if (DumpFrameToPNG(frame, m_screenshot_name))
OSD::AddMessage("Screenshot saved to " + m_screenshot_name);
// Reset settings
@@ -1681,8 +1685,7 @@ bool Renderer::StartFrameDumpToImage(const FrameDump::FrameData&)
void Renderer::DumpFrameToImage(const FrameDump::FrameData& frame)
{
- std::string filename = GetFrameDumpNextImageFileName();
- TextureToPng(frame.data, frame.stride, filename, frame.width, frame.height, false);
+ DumpFrameToPNG(frame, GetFrameDumpNextImageFileName());
m_frame_dump_image_counter++;
}