diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-10-10 11:48:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-10 11:48:57 +0200 |
| commit | a583d36c7f38fac9fb66c059bf6990bfd819591f (patch) | |
| tree | 842adfb6ca1a3ac76b290677bd72db2a406b781f /Source/Core/VideoBackends/OGL/Render.cpp | |
| parent | 562bc01d0e21f103fa9d8ee1993654a81e51fb26 (diff) | |
| parent | 64927a2f81fe64503060c949ead525995fd63a2a (diff) | |
Merge pull request #4326 from degasus/framedump
Framedump: Merge screenshot code with framedumping.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Render.cpp | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 9e133191b2..047ac0f69e 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -36,7 +36,6 @@ #include "VideoCommon/BPFunctions.h" #include "VideoCommon/DriverDetails.h" #include "VideoCommon/Fifo.h" -#include "VideoCommon/ImageWrite.h" #include "VideoCommon/IndexGenerator.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/PixelEngine.h" @@ -1444,23 +1443,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); - // Save screenshot - if (s_bScreenshot) - { - std::lock_guard<std::mutex> lk(s_criticalScreenshot); - - if (SaveScreenshot(s_sScreenshotName, flipped_trc)) - OSD::AddMessage("Screenshot saved to " + s_sScreenshotName); - - // Reset settings - s_sScreenshotName.clear(); - s_bScreenshot = false; - s_screenshotCompleted.Set(); - } - if (IsFrameDumping()) { - std::lock_guard<std::mutex> lk(s_criticalScreenshot); std::vector<u8> image(flipped_trc.GetWidth() * flipped_trc.GetHeight() * 4); glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -1468,7 +1452,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, flipped_trc.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, image.data()); DumpFrameData(image.data(), flipped_trc.GetWidth(), flipped_trc.GetHeight(), - flipped_trc.GetWidth() * 4, AVIDump::DumpFormat::FORMAT_RGBA, true); + flipped_trc.GetWidth() * 4, true); FinishFrameData(); } // Finish up the current frame, print some stats @@ -1726,21 +1710,6 @@ void Renderer::SetInterlacingMode() namespace OGL { -bool Renderer::SaveScreenshot(const std::string& filename, const TargetRectangle& back_rc) -{ - u32 W = back_rc.GetWidth(); - u32 H = back_rc.GetHeight(); - std::unique_ptr<u8[]> data(new u8[W * 4 * H]); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - - glReadPixels(back_rc.left, back_rc.bottom, W, H, GL_RGBA, GL_UNSIGNED_BYTE, data.get()); - - // Turn image upside down - FlipImageData(data.get(), W, H, 4); - - return TextureToPng(data.get(), W * 4, filename, W, H, false); -} - u32 Renderer::GetMaxTextureSize() { // Right now nvidia seems to do something very weird if we try to cache GL_MAX_TEXTURE_SIZE in |
