From 4ad1e4895089459ac6a1fbfb184100dc96d95c83 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 24 Jun 2010 20:25:33 +0000 Subject: [PATCH] GSdx: minor fixes to movie recording. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3291 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GS.cpp | 10 +++++----- plugins/GSdx/GSRenderer.cpp | 16 +++++++++++----- plugins/GSdx/GSRenderer.h | 6 +++++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index c3d2765396..6a0d8ed38c 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -446,12 +446,12 @@ EXPORT_C GSirqCallback(void (*irq)()) EXPORT_C_(int) GSsetupRecording(int start, void* data) { - GSKeyEventData e; + if(!s_gs) return 0; - e.type = KEYPRESS; - e.key = VK_F12; - - s_gs->KeyEvent(&e, start & 1); + if(start & 1) + s_gs->BeginCapture(); + else + s_gs->EndCapture(); return 1; } diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index a079a5964b..45dab55fb2 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -436,7 +436,17 @@ bool GSRenderer::MakeSnapshot(const string& path) return true; } -void GSRenderer::KeyEvent(GSKeyEventData* e, int param) +void GSRenderer::BeginCapture() +{ + m_capture.BeginCapture(GetFPS()); +} + +void GSRenderer::EndCapture() +{ + m_capture.EndCapture(); +} + +void GSRenderer::KeyEvent(GSKeyEventData* e) { if(e->type == KEYPRESS) { @@ -455,10 +465,6 @@ void GSRenderer::KeyEvent(GSKeyEventData* e, int param) case VK_F7: m_shader = (m_shader + 3 + step) % 3; return; - case VK_F12: - if(param) m_capture.BeginCapture(GetFPS()); - else m_capture.EndCapture(); - return; case VK_DELETE: m_aa1 = !m_aa1; return; diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 4b362e96e0..90d8b277bd 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -33,6 +33,7 @@ class GSRenderer : public GSState { GSCapture m_capture; string m_snapshot; + bool m_snapdump; int m_shader; bool Merge(int field); @@ -85,7 +86,7 @@ public: } virtual void VSync(int field); virtual bool MakeSnapshot(const string& path); - virtual void KeyEvent(GSKeyEventData* e, int param = 0); + virtual void KeyEvent(GSKeyEventData* e); 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) @@ -100,6 +101,9 @@ public: void SetFrameLimit(bool limit); virtual void SetExclusive(bool isExcl) {} + virtual void BeginCapture(); + virtual void EndCapture(); + // TODO : Implement proper locking here *if needed* (not sure yet if it is) --air uint8* GetTextureBufferLock() { return m_tex_buff; } void ReleaseTextureBufferLock() { }