mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 15:05:59 +00:00
input: add SDL_GameControllerDB
This commit is contained in:
parent
d105b0bd9f
commit
452a4654da
8 changed files with 43 additions and 1 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include "sdl_pad_handler.h"
|
||||
#include "Emu/system_utils.hpp"
|
||||
#include "Emu/system_config.h"
|
||||
|
||||
LOG_CHANNEL(sdl_log, "SDL");
|
||||
|
||||
|
|
@ -217,6 +219,24 @@ bool sdl_pad_handler::Init()
|
|||
}
|
||||
}, nullptr);
|
||||
|
||||
if (g_cfg.io.load_sdl_mappings)
|
||||
{
|
||||
const std::string db_path = rpcs3::utils::get_input_config_root() + "gamecontrollerdb.txt";
|
||||
sdl_log.notice("Adding mappings from file '%s'", db_path);
|
||||
|
||||
if (fs::is_file(db_path))
|
||||
{
|
||||
if (SDL_GameControllerAddMappingsFromFile(db_path.c_str()) < 0)
|
||||
{
|
||||
sdl_log.error("Could not add mappings from file '%s'! SDL Error: %s", db_path, SDL_GetError());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sdl_log.error("Could not add mappings from file '%s'! File does not exist!", db_path);
|
||||
}
|
||||
}
|
||||
|
||||
m_is_init = true;
|
||||
enumerate_devices();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue