From 2dc77cd1286e47c0ab0d6d59ba4442058f9da2a4 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Sun, 16 Aug 2009 11:35:30 +0000 Subject: [PATCH] GSdx: Re-enabled capturing via F12 key. It was missing the callback entirely. The videos I capture here turn out all blueish though. No idea why :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1635 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GS.cpp | 8 ++++++++ plugins/GSdx/GSRenderer.cpp | 10 ++++++++++ plugins/GSdx/GSRenderer.h | 2 +- plugins/GSdx/GSdx.def | 3 ++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 20dc3aee96..8a104f56fc 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -289,6 +289,14 @@ EXPORT_C GSirqCallback(void (*irq)()) s_irq = irq; } + +EXPORT_C_(int) GSsetupRecording(int start, void* pData) +{ + s_gs->ToggleRecord(); + + return 1; +} + EXPORT_C GSsetGameCRC(uint32 crc, int options) { s_gs->SetGameCRC(crc, options); diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 7964640209..2e25684a94 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -403,6 +403,16 @@ bool GSRenderer::MakeSnapshot(const string& path) return true; } +void GSRenderer::ToggleRecord(void) +{ + if(m_capture.IsCapturing()){ + m_capture.EndCapture(); + } + else { + m_capture.BeginCapture(GetFPS()); + } +} + void GSRenderer::KeyEvent(GSKeyEventData* e) { if(e->type == KEYPRESS) diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 484a144561..2f4118da92 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -77,7 +77,7 @@ public: virtual void VSync(int field); virtual bool MakeSnapshot(const string& path); virtual void KeyEvent(GSKeyEventData* e); - + virtual void ToggleRecord(); virtual bool CanUpscale() { return !m_nativeres && m_regs->PMODE.EN != 0; // upscale ratio depends on the display size, with no output it may not be set correctly (ps2 logo to game transition) diff --git a/plugins/GSdx/GSdx.def b/plugins/GSdx/GSdx.def index ec872b0b12..b08d67fa63 100644 --- a/plugins/GSdx/GSdx.def +++ b/plugins/GSdx/GSdx.def @@ -28,7 +28,8 @@ EXPORTS GSabout GSreadFIFO GSreadFIFO2 - GSirqCallback + GSirqCallback + GSsetupRecording GSsetGameCRC GSsetFrameSkip GSsetFrameLimit