gsdx-ogl:

* fix some issue with cmake and new sdl define
* Implement shortcut key handling on linux.
    + some option are not yet implemented (fxaa)
    + gs dump can be created with <shift> <F8>


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5050 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2012-01-06 07:20:37 +00:00
parent 0e80e0adca
commit 53a5089d7b
3 changed files with 77 additions and 10 deletions

View File

@ -28,22 +28,24 @@ set(OptimizationFlags
)
if(projectSDL)
add_definitions(-DENABLE_SDL_DEV)
set(SDLFlags -DENABLE_SDL_DEV)
else(projectSDL)
set(SDLFlags "")
endif(projectSDL)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -DOGL_DEBUG -g -Wall)
add_definitions(${CommonFlags} ${SDLFlags} -DOGL_DEBUG -g -Wall)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W)
add_definitions(${CommonFlags} ${SDLFlags} ${OptimizationFlags} -g -W)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(${CommonFlags} ${OptimizationFlags} -W)
add_definitions(${CommonFlags} ${SDLFlags} ${OptimizationFlags} -W)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
set(GSdxSources

View File

@ -27,6 +27,8 @@ GSRenderer::GSRenderer()
, m_vt(this)
, m_dev(NULL)
, m_shader(0)
, m_shift_key(false)
, m_control_key(false)
{
m_GStitleInfoBuffer[0] = 0;
@ -407,6 +409,10 @@ void GSRenderer::VSync(int field)
shift = !!(::GetAsyncKeyState(VK_SHIFT) & 0x8000);
#else
shift = m_shift_key;
#endif
if(!m_dump && shift)
@ -440,6 +446,10 @@ void GSRenderer::VSync(int field)
control = !!(::GetAsyncKeyState(VK_CONTROL) & 0x8000);
#else
control = m_control_key;
#endif
m_dump.VSync(field, !control, m_regs);
@ -500,9 +510,9 @@ void GSRenderer::EndCapture()
void GSRenderer::KeyEvent(GSKeyEventData* e)
{
#ifdef _WINDOWS
if(e->type == KEYPRESS)
{
#ifdef _WINDOWS
int step = (::GetAsyncKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
@ -534,12 +544,63 @@ void GSRenderer::KeyEvent(GSKeyEventData* e)
return;
}
#else
// TODO: linux
#endif
}
#else
if(e->type == KEYPRESS)
{
int step = m_shift_key ? -1 : 1;
switch(e->key)
{
case XK_F5:
m_interlace = (m_interlace + 7 + step) % 7;
fprintf(stderr, "GSdx: Set deinterlace mode to %d (%s).\n", (int)m_interlace, theApp.m_gs_interlace.at(m_interlace).name.c_str());
return;
case XK_F6:
if( m_wnd.IsManaged() )
m_aspectratio = (m_aspectratio + 3 + step) % 3;
return;
case XK_F7:
m_shader = (m_shader + 3 + step) % 3;
fprintf(stderr,"GSdx: Set shader %d.\n", (int)m_shader);
return;
case XK_Delete:
m_aa1 = !m_aa1;
fprintf(stderr,"GSdx: (Software) aa1 is now %s.\n", m_aa1 ? "enabled" : "disabled");
return;
case XK_Insert:
m_mipmap = !m_mipmap;
fprintf(stderr,"GSdx: (Software) mipmapping is now %s.\n", m_mipmap ? "enabled" : "disabled");
return;
case XK_Prior:
m_fxaa = !m_fxaa;
fprintf(stderr,"GSdx: fxaa is now %s.\n", m_fxaa ? "enabled" : "disabled");
return;
case XK_Shift_L:
case XK_Shift_R:
m_shift_key = true;
return;
case XK_Control_L:
case XK_Control_R:
m_control_key = true;
return;
}
} else if(e->type == KEYRELEASE)
{
switch(e->key)
{
case XK_Shift_L:
case XK_Shift_R:
m_shift_key = false;
return;
case XK_Control_L:
case XK_Control_R:
m_control_key = false;
return;
}
}
#endif
}
void GSRenderer::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFRegCLAMP& CLAMP, bool linear)

View File

@ -37,6 +37,10 @@ class GSRenderer : public GSState
bool Merge(int field);
// Only used on linux
bool m_shift_key;
bool m_control_key;
protected:
int m_interlace;
int m_aspectratio;