Merge some frame dumping code to VideoCommon, fixes a memory leak in D3D9 and OpenGL if emulation is stopped while dumping frames.

Breaks D3D11 frame dumping for some weird reason (memory corruption or whatever?).
This commit is contained in:
NeoBrainX
2011-09-08 17:09:24 +02:00
parent bd4a5b5ef6
commit c710ea33f9
5 changed files with 93 additions and 119 deletions

View File

@ -132,9 +132,6 @@ public:
protected:
static std::mutex s_criticalScreenshot;
static std::string s_sScreenshotName;
static void CalculateTargetScale(int x, int y, int &scaledX, int &scaledY);
static bool CalculateTargetSize(int multiplier = 1);
static void CalculateXYScale(const TargetRectangle& dst_rect);
@ -143,6 +140,16 @@ protected:
static void RecordVideoMemory();
static volatile bool s_bScreenshot;
static std::mutex s_criticalScreenshot;
static std::string s_sScreenshotName;
#if defined _WIN32 || defined HAVE_LIBAV
bool bAVIDumping;
#else
File::IOFile pFrameDump;
#endif
char* frame_data;
bool bLastFrameDumped;
// The framebuffer size
static int s_target_width;