Merge pull request #617 from ssakash/patch-26

Console log message for current renderer.
This commit is contained in:
refractionpcsx2 2015-06-28 13:24:09 +01:00
commit c659b1aa18
1 changed files with 36 additions and 15 deletions

View File

@ -68,6 +68,7 @@ static bool s_vsync = false;
static bool s_exclusive = true; static bool s_exclusive = true;
static const char *s_renderer_name = ""; static const char *s_renderer_name = "";
static const char *s_renderer_type = ""; static const char *s_renderer_type = "";
static const char *s_type_log ="";
#ifdef _WINDOWS #ifdef _WINDOWS
static bool s_isgsopen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/ static bool s_isgsopen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/
#endif #endif
@ -216,7 +217,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
try try
{ {
if(s_renderer != renderer) if (s_renderer != renderer)
{ {
// Emulator has made a render change request, which requires a completely // Emulator has made a render change request, which requires a completely
// new s_gs -- if the emu doesn't save/restore the GS state across this // new s_gs -- if the emu doesn't save/restore the GS state across this
@ -227,36 +228,55 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
s_gs = NULL; s_gs = NULL;
} }
switch(renderer) switch (renderer)
{
case 1: case 4: case 10: case 13:
s_type_log = "(Software mode)";
break;
case 2: case 5: case 11:
s_type_log = "(Null mode)";
break;
case 14: case 15: case 16: case 17:
s_type_log = "(OpenCL)";
break;
default:
s_type_log = "(Hardware mode)";
break;
}
switch (renderer)
{ {
default: default:
#ifdef _WINDOWS #ifdef _WINDOWS
case 0: case 1: case 2: case 14: case 0: case 1: case 2: case 14:
dev = new GSDevice9(); dev = new GSDevice9();
s_renderer_name = " D3D9"; s_renderer_name = " D3D9";
printf("\n Current Renderer: Direct3D9%s \n", s_type_log);
break; break;
case 3: case 4: case 5: case 15: case 3: case 4: case 5: case 15:
dev = new GSDevice11(); dev = new GSDevice11();
s_renderer_name = " D3D11"; s_renderer_name = " D3D11";
printf("\n Current Renderer: Direct3D11%s \n", s_type_log);
break; break;
#endif #endif
case 9: case 10: case 11: case 16: case 9: case 10: case 11: case 16:
dev = new GSDeviceNull(); dev = new GSDeviceNull();
break; break;
case 12: case 13: case 17: case 12: case 13: case 17:
dev = new GSDeviceOGL(); dev = new GSDeviceOGL();
s_renderer_name = " OGL"; s_renderer_name = " OGL";
printf("\n Current Renderer: OpenGL%s \n", s_type_log);
break; break;
} }
if(dev == NULL) if (dev == NULL)
{ {
return -1; return -1;
} }
if(s_gs == NULL) if (s_gs == NULL)
{ {
switch(renderer) switch (renderer)
{ {
default: default:
#ifdef _WINDOWS #ifdef _WINDOWS
@ -264,13 +284,13 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
s_gs = (GSRenderer*)new GSRendererDX9(); s_gs = (GSRenderer*)new GSRendererDX9();
s_renderer_type = " HW"; s_renderer_type = " HW";
break; break;
case 3: case 3:
s_gs = (GSRenderer*)new GSRendererDX11(); s_gs = (GSRenderer*)new GSRendererDX11();
s_renderer_type = " HW"; s_renderer_type = " HW";
break; break;
#endif #endif
case 12: case 12:
s_gs = (GSRenderer*)new GSRendererOGL(); s_gs = (GSRenderer*)new GSRendererOGL();
s_renderer_type = " HW"; s_renderer_type = " HW";
break; break;
case 1: case 4: case 10: case 13: case 1: case 4: case 10: case 13:
@ -279,6 +299,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
break; break;
case 2: case 5: case 11: case 2: case 5: case 11:
s_gs = new GSRendererNull(); s_gs = new GSRendererNull();
s_renderer_type = " Null";
break; break;
case 14: case 15: case 16: case 17: case 14: case 15: case 16: case 17:
#ifdef ENABLE_OPENCL #ifdef ENABLE_OPENCL
@ -298,7 +319,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
if (s_gs->m_wnd == NULL) if (s_gs->m_wnd == NULL)
{ {
#ifdef _WINDOWS #ifdef _WINDOWS
switch(renderer) switch (renderer)
{ {
case 12: case 13: case 17: case 12: case 13: case 17:
s_gs->m_wnd = new GSWndWGL(); s_gs->m_wnd = new GSWndWGL();
@ -317,7 +338,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
#endif #endif
} }
} }
catch(std::exception& ex) catch (std::exception& ex)
{ {
// Allowing std exceptions to escape the scope of the plugin callstack could // Allowing std exceptions to escape the scope of the plugin callstack could
// be problematic, because of differing typeids between DLL and EXE compilations. // be problematic, because of differing typeids between DLL and EXE compilations.