mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-15 14:59:37 +00:00
Split up database runloop data code to tasks/task_database.c
This commit is contained in:
parent
a04debf7c5
commit
8c75fd3530
@ -197,7 +197,8 @@ OBJ += libretro-db/bintree.o \
|
||||
libretro-db/query.o \
|
||||
libretro-db/rmsgpack.o \
|
||||
libretro-db/rmsgpack_dom.o \
|
||||
database_info.o
|
||||
database_info.o \
|
||||
tasks/task_database.o
|
||||
endif
|
||||
|
||||
# Miscellaneous
|
||||
|
@ -692,6 +692,9 @@ NETPLAY
|
||||
DATA RUNLOOP
|
||||
============================================================ */
|
||||
#include "../tasks/task_file_transfer.c"
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
#include "../tasks/task_database.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
SCREENSHOTS
|
||||
|
@ -39,34 +39,6 @@ static void *rarch_main_data_get_ptr(void)
|
||||
return g_data_runloop;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
#ifdef HAVE_MENU
|
||||
static void rarch_main_data_db_iterate(bool is_thread,
|
||||
data_runloop_t *runloop)
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
database_info_handle_t *db = menu ? menu->db : NULL;
|
||||
|
||||
if (!db || !menu)
|
||||
return;
|
||||
|
||||
switch (db->status)
|
||||
{
|
||||
case DATABASE_STATUS_NONE:
|
||||
break;
|
||||
case DATABASE_STATUS_ITERATE:
|
||||
database_info_iterate(db);
|
||||
break;
|
||||
case DATABASE_STATUS_FREE:
|
||||
database_info_free(db);
|
||||
db = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void rarch_main_data_overlay_image_upload_iterate(bool is_thread, data_runloop_t *runloop)
|
||||
{
|
||||
|
@ -0,0 +1,46 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2015 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../menu/menu_driver.h"
|
||||
|
||||
#include "../runloop_data.h"
|
||||
#include "tasks.h"
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
#ifdef HAVE_MENU
|
||||
void rarch_main_data_db_iterate(bool is_thread, void *data)
|
||||
{
|
||||
data_runloop_t *runloop = (data_runloop_t*)data;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
database_info_handle_t *db = menu ? menu->db : NULL;
|
||||
|
||||
if (!db || !menu || !runloop)
|
||||
return;
|
||||
|
||||
switch (db->status)
|
||||
{
|
||||
case DATABASE_STATUS_NONE:
|
||||
break;
|
||||
case DATABASE_STATUS_ITERATE:
|
||||
database_info_iterate(db);
|
||||
break;
|
||||
case DATABASE_STATUS_FREE:
|
||||
database_info_free(db);
|
||||
db = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -44,6 +44,12 @@ void rarch_main_data_nbio_image_upload_iterate(bool is_thread,
|
||||
void *data);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
#ifdef HAVE_MENU
|
||||
void rarch_main_data_db_iterate(bool is_thread, void *data);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void rarch_main_data_nbio_iterate(bool is_thread,
|
||||
void *runloop);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user