mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-03-07 02:47:24 +00:00
(database_info.c) Use dir_list_new_special
This commit is contained in:
parent
095683b2e0
commit
5bfd28c4a9
@ -15,9 +15,8 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include "file_ext.h"
|
||||
#include <file/dir_list.h>
|
||||
#include "dir_list_special.h"
|
||||
#include <file/file_extract.h>
|
||||
|
||||
#include "database_info.h"
|
||||
@ -50,17 +49,12 @@ int database_open_cursor(libretrodb_t *db,
|
||||
|
||||
database_info_handle_t *database_info_init(const char *dir, enum database_type type)
|
||||
{
|
||||
const char *exts = "";
|
||||
global_t *global = global_get_ptr();
|
||||
database_info_handle_t *db = (database_info_handle_t*)calloc(1, sizeof(*db));
|
||||
|
||||
if (!db)
|
||||
return NULL;
|
||||
|
||||
if (global->core_info)
|
||||
exts = core_info_list_get_all_extensions(global->core_info);
|
||||
|
||||
db->list = dir_list_new(dir, exts, false);
|
||||
db->list = dir_list_new_special(dir, DIR_LIST_CORE_INFO);
|
||||
|
||||
if (!db->list)
|
||||
goto error;
|
||||
|
@ -25,6 +25,7 @@ struct string_list *dir_list_new_special(const char *input_dir, enum dir_list_ty
|
||||
const char *exts = NULL;
|
||||
bool include_dirs = false;
|
||||
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
(void)input_dir;
|
||||
@ -33,9 +34,13 @@ struct string_list *dir_list_new_special(const char *input_dir, enum dir_list_ty
|
||||
switch (type)
|
||||
{
|
||||
case DIR_LIST_CORES:
|
||||
dir = settings->libretro_directory;
|
||||
dir = settings->libretro_directory;
|
||||
exts = EXT_EXECUTABLES;
|
||||
break;
|
||||
case DIR_LIST_CORE_INFO:
|
||||
dir = input_dir;
|
||||
exts = (global->core_info) ? core_info_list_get_all_extensions(global->core_info) : NULL;
|
||||
break;
|
||||
case DIR_LIST_SHADERS:
|
||||
dir = settings->video.shader_dir;
|
||||
exts = "cg|cgp|glsl|glslp";
|
||||
|
@ -28,6 +28,7 @@ enum dir_list_type
|
||||
{
|
||||
DIR_LIST_NONE = 0,
|
||||
DIR_LIST_CORES,
|
||||
DIR_LIST_CORE_INFO,
|
||||
DIR_LIST_PLAIN,
|
||||
DIR_LIST_SHADERS,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user