summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/RenderBase.cpp
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2013-11-10 00:10:20 +0100
committerTony Wasserka <NeoBrainX@gmail.com>2013-11-10 00:22:33 +0100
commit0b02880b7699b8049be0ae64ff1461a792a9bf9b (patch)
tree3c81a6938b5083b2635382104485583a121bf49b /Source/Core/VideoCommon/Src/RenderBase.cpp
parent3de2ee5d46c118929bf90540706cf82fc0671920 (diff)
Revert "Be less dumb."
Revert "Actually, filename really does need to be a parameter because of some random debug thing." Revert "fix non-HAVE_WX case" Revert "Handle screenshot saving in RenderBase. Removes dependency on D3DX11 for screenshots (texture dumping is still broken)." This reverts commits 00fe5057f13bca3416b9d25a1fe9df27c514b29c, 74b5fb3ab4b066681336d1be44c7eecfcf6a4dc6, cd46138d299088631bbcbf37543584946c4b174a and 5f72542e0637799092ad1006d16ebad1961020e0 because taking screenshots in D3D still crashed for me so there was no point in the code changes (which I found ugly anyway).
Diffstat (limited to 'Source/Core/VideoCommon/Src/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/RenderBase.cpp77
1 files changed, 3 insertions, 74 deletions
diff --git a/Source/Core/VideoCommon/Src/RenderBase.cpp b/Source/Core/VideoCommon/Src/RenderBase.cpp
index bb3dad8a73..e509ccb980 100644
--- a/Source/Core/VideoCommon/Src/RenderBase.cpp
+++ b/Source/Core/VideoCommon/Src/RenderBase.cpp
@@ -30,12 +30,6 @@
#include "XFMemory.h"
#include "FifoPlayer/FifoRecorder.h"
#include "AVIDump.h"
-#include "OnScreenDisplay.h"
-#if defined(HAVE_WX) && HAVE_WX
-#include "WxUtils.h"
-#include <wx/image.h>
-#endif
-#include "ImageWrite.h"
#include <cmath>
#include <string>
@@ -73,8 +67,6 @@ unsigned int Renderer::efb_scale_numeratorY = 1;
unsigned int Renderer::efb_scale_denominatorX = 1;
unsigned int Renderer::efb_scale_denominatorY = 1;
-// TODO: remove
-extern bool g_aspect_wide;
Renderer::Renderer()
: frame_data()
@@ -250,72 +242,6 @@ void Renderer::SetScreenshot(const char *filename)
s_bScreenshot = true;
}
-#if defined(HAVE_WX) && HAVE_WX
-void Renderer::SaveScreenshotOnThread(u8* data, size_t width, size_t height, std::string filename)
-{
- wxImage *img = new wxImage(width, height, data);
-
- // These will contain the final image size
- float FloatW = (float)width;
- float FloatH = (float)height;
-
- // Handle aspect ratio for the final ScrStrct to look exactly like what's on screen.
- if (g_ActiveConfig.iAspectRatio != ASPECT_STRETCH)
- {
- bool use16_9 = g_aspect_wide;
-
- // Check for force-settings and override.
- if (g_ActiveConfig.iAspectRatio == ASPECT_FORCE_16_9)
- use16_9 = true;
- else if (g_ActiveConfig.iAspectRatio == ASPECT_FORCE_4_3)
- use16_9 = false;
-
- float Ratio = (FloatW / FloatH) / (!use16_9 ? (4.0f / 3.0f) : (16.0f / 9.0f));
-
- // If ratio > 1 the picture is too wide and we have to limit the width.
- if (Ratio > 1)
- FloatW /= Ratio;
- // ratio == 1 or the image is too high, we have to limit the height.
- else
- FloatH *= Ratio;
-
- // This is a bit expensive on high resolutions
- img->Rescale((int)FloatW, (int)FloatH, wxIMAGE_QUALITY_HIGH);
- }
-
- // Save the screenshot and finally kill the wxImage object
- // This is really expensive when saving to PNG, but not at all when using BMP
- img->SaveFile(StrToWxStr(filename), wxBITMAP_TYPE_PNG);
- img->Destroy();
-
- // Show success messages
- OSD::AddMessage(StringFromFormat("Saved %i x %i %s", (int)FloatW, (int)FloatH,
- filename.c_str()), 2000);
-}
-#endif
-
-void Renderer::SaveScreenshot(u8* ptr, size_t width, size_t height, std::string filename)
-{
- std::lock_guard<std::mutex> lk(s_criticalScreenshot);
-#if defined(HAVE_WX) && HAVE_WX
- // Create wxImage
-
- std::thread thread(SaveScreenshotOnThread, ptr, width, height, filename);
-#ifdef _WIN32
- SetThreadPriority(thread.native_handle(), THREAD_PRIORITY_BELOW_NORMAL);
-#endif
- thread.detach();
-
- OSD::AddMessage("Saving Screenshot... ", 2000);
-
-#else
- SaveTGA(filename.c_str(), width, height, ptr);
- free(ptr);
-#endif
-
- s_bScreenshot = false;
-}
-
// Create On-Screen-Messages
void Renderer::DrawDebugText()
{
@@ -421,6 +347,9 @@ void Renderer::DrawDebugText()
g_renderer->RenderText(final_yellow.c_str(), 20, 20, 0xFFFFFF00);
}
+// TODO: remove
+extern bool g_aspect_wide;
+
void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
{
float FloatGLWidth = (float)backbuffer_width;