(win32_common.cpp) Cleanups/get rid of warning

This commit is contained in:
twinaphex 2016-06-03 08:20:36 +02:00
parent 01390f8ceb
commit 59413e0289

View File

@ -226,76 +226,83 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
break; break;
case WM_DROPFILES: case WM_DROPFILES:
// Get the count of the files dropped /* Get the count of the files dropped */
{ {
char szFilename[1024] = {0}; char szFilename[1024] = {0};
if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0))
{ {
//poll list of current cores /*poll list of current cores */
content_ctx_info_t content_info = {0}; size_t list_size;
size_t list_size; content_ctx_info_t content_info = {0};
core_info_list_t *core_info_list = NULL; core_info_list_t *core_info_list = NULL;
const core_info_t *core_info = NULL; const core_info_t *core_info = NULL;
DragQueryFile((HDROP)wparam, 0, szFilename, 1024); DragQueryFile((HDROP)wparam, 0, szFilename, 1024);
core_info_get_list(&core_info_list); core_info_get_list(&core_info_list);
core_info_list_get_supported_cores(core_info_list,(const char*)szFilename, &core_info, &list_size); core_info_list_get_supported_cores(core_info_list,(const char*)szFilename, &core_info, &list_size);
runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH,szFilename); runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH,szFilename);
if (strlen(settings->path.libretro)) if (strlen(settings->path.libretro))
{ {
//we already have path for libretro core unsigned i;
for (int i = 0; i < list_size; i++)
{ /*we already have path for libretro core */
const core_info_t *info = (const core_info_t*)&core_info[i]; for (i = 0; i < list_size; i++)
if(!strcmp(settings->path.libretro,info->path)){ {
//our previous core supports the current rom const core_info_t *info = (const core_info_t*)&core_info[i];
content_ctx_info_t content_info = {0};
task_push_content_load_default( if(!strcmp(settings->path.libretro,info->path))
NULL, NULL, {
&content_info, /* Our previous core supports the current rom */
CORE_TYPE_PLAIN, content_ctx_info_t content_info = {0};
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, task_push_content_load_default(
NULL, NULL); NULL, NULL,
DragFinish((HDROP)wparam); &content_info,
return 0; CORE_TYPE_PLAIN,
} CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
} NULL, NULL);
goto load_fail; DragFinish((HDROP)wparam);
} return 0;
else }
{ }
goto load_fail;
}
else
{
load_fail: load_fail:
//poll for cores for current rom since none exist. /*poll for cores for current rom since none exist. */
if(list_size ==1) if(list_size ==1)
{ {
//pick core that only exists and is bound to work. Ish. /*pick core that only exists and is bound to work. Ish. */
const core_info_t *info = (const core_info_t*)&core_info[0]; const core_info_t *info = (const core_info_t*)&core_info[0];
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path);
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path);
task_push_content_load_default( task_push_content_load_default(
NULL, NULL, NULL, NULL,
&content_info, &content_info,
CORE_TYPE_PLAIN, CORE_TYPE_PLAIN,
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
NULL, NULL); NULL, NULL);
} }
else else
{ {
//pick one core that could be compatible, ew /*pick one core that could be compatible, ew */
if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE),hwnd,PickCoreProc,NULL)==IDOK) if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE),
{ hwnd,PickCoreProc,(LPARAM)NULL)==IDOK)
task_push_content_load_default( {
NULL, NULL, task_push_content_load_default(
&content_info, NULL, NULL,
CORE_TYPE_PLAIN, &content_info,
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, CORE_TYPE_PLAIN,
NULL, NULL); CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
} NULL, NULL);
} }
DragFinish((HDROP)wparam); }
return 0; DragFinish((HDROP)wparam);
} return 0;
} }
} }
}
break; break;
case WM_CHAR: case WM_CHAR:
case WM_KEYDOWN: case WM_KEYDOWN: