GSdx: minor fixes to movie recording.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3291 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-06-24 20:25:33 +00:00
parent e1890f369e
commit 4ad1e48950
3 changed files with 21 additions and 11 deletions

View File

@ -446,12 +446,12 @@ EXPORT_C GSirqCallback(void (*irq)())
EXPORT_C_(int) GSsetupRecording(int start, void* data) EXPORT_C_(int) GSsetupRecording(int start, void* data)
{ {
GSKeyEventData e; if(!s_gs) return 0;
e.type = KEYPRESS; if(start & 1)
e.key = VK_F12; s_gs->BeginCapture();
else
s_gs->KeyEvent(&e, start & 1); s_gs->EndCapture();
return 1; return 1;
} }

View File

@ -436,7 +436,17 @@ bool GSRenderer::MakeSnapshot(const string& path)
return true; 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) if(e->type == KEYPRESS)
{ {
@ -455,10 +465,6 @@ void GSRenderer::KeyEvent(GSKeyEventData* e, int param)
case VK_F7: case VK_F7:
m_shader = (m_shader + 3 + step) % 3; m_shader = (m_shader + 3 + step) % 3;
return; return;
case VK_F12:
if(param) m_capture.BeginCapture(GetFPS());
else m_capture.EndCapture();
return;
case VK_DELETE: case VK_DELETE:
m_aa1 = !m_aa1; m_aa1 = !m_aa1;
return; return;

View File

@ -33,6 +33,7 @@ class GSRenderer : public GSState
{ {
GSCapture m_capture; GSCapture m_capture;
string m_snapshot; string m_snapshot;
bool m_snapdump;
int m_shader; int m_shader;
bool Merge(int field); bool Merge(int field);
@ -85,7 +86,7 @@ public:
} }
virtual void VSync(int field); virtual void VSync(int field);
virtual bool MakeSnapshot(const string& path); virtual bool MakeSnapshot(const string& path);
virtual void KeyEvent(GSKeyEventData* e, int param = 0); virtual void KeyEvent(GSKeyEventData* e);
virtual bool CanUpscale() 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) 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); void SetFrameLimit(bool limit);
virtual void SetExclusive(bool isExcl) {} 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 // TODO : Implement proper locking here *if needed* (not sure yet if it is) --air
uint8* GetTextureBufferLock() { return m_tex_buff; } uint8* GetTextureBufferLock() { return m_tex_buff; }
void ReleaseTextureBufferLock() { } void ReleaseTextureBufferLock() { }