Revert "(D3D) Move code up"

This reverts commit d2e778b3f6c47718bff56efa91f7c1825732d7ea.
This commit is contained in:
twinaphex 2015-11-11 05:42:41 +01:00
parent d2e778b3f6
commit 37154219f0

View File

@ -581,53 +581,6 @@ static void d3d_set_osd_msg(void *data, const char *msg,
font_ctx->render_msg(driver->font_osd_data, msg, params);
}
#ifdef HAVE_MONITOR
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
monitor_d3d_all[monitor_d3d_count++] = hMonitor;
return TRUE;
}
/* Multi-monitor support. */
static void d3d_monitor_rect(d3d_video_t *d3d, MONITORINFOEX *mon, HMONITOR *hm_to_use)
{
unsigned fs_monitor, i;
monitor_d3d_count = 0;
settings_t *settings = config_get_ptr();
if (!monitor_d3d_last)
monitor_d3d_last = MonitorFromWindow(
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
*hm_to_use = monitor_d3d_last;
fs_monitor = settings->video.monitor_index;
if (fs_monitor && fs_monitor <= monitor_d3d_count
&& monitor_d3d_all[fs_monitor - 1])
{
*hm_to_use = monitor_d3d_all[fs_monitor - 1];
d3d->cur_mon_id = fs_monitor - 1;
}
else
{
for (i = 0; i < monitor_d3d_count; i++)
{
if (monitor_d3d_all[i] != *hm_to_use)
continue;
d3d->cur_mon_id = i;
break;
}
}
memset(mon, 0, sizeof(*mon));
mon->cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
}
#endif
/* Delay constructor due to lack of exceptions. */
static bool d3d_construct(d3d_video_t *d3d,
@ -957,6 +910,52 @@ static void d3d_free(void *data)
#endif
}
#ifdef HAVE_MONITOR
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
monitor_d3d_all[monitor_d3d_count++] = hMonitor;
return TRUE;
}
/* Multi-monitor support. */
static void d3d_monitor_rect(d3d_video_t *d3d, MONITORINFOEX *mon, HMONITOR *hm_to_use)
{
unsigned fs_monitor, i;
monitor_d3d_count = 0;
settings_t *settings = config_get_ptr();
if (!monitor_d3d_last)
monitor_d3d_last = MonitorFromWindow(
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
*hm_to_use = monitor_d3d_last;
fs_monitor = settings->video.monitor_index;
if (fs_monitor && fs_monitor <= monitor_d3d_count
&& monitor_d3d_all[fs_monitor - 1])
{
*hm_to_use = monitor_d3d_all[fs_monitor - 1];
d3d->cur_mon_id = fs_monitor - 1;
}
else
{
for (i = 0; i < monitor_d3d_count; i++)
{
if (monitor_d3d_all[i] != *hm_to_use)
continue;
d3d->cur_mon_id = i;
break;
}
}
memset(mon, 0, sizeof(*mon));
mon->cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
}
#endif
#ifndef DONT_HAVE_STATE_TRACKER
static bool d3d_init_imports(d3d_video_t *d3d)