mirror of https://github.com/PCSX2/pcsx2.git
Input/SDL: Don't pass stdio handle to SDL
Apparently on cmake, SDL isn't compiled with stdio support...
This commit is contained in:
parent
9162f176a2
commit
20420da326
|
@ -225,15 +225,15 @@ void SDLInputSource::SetHints()
|
||||||
bool SDLInputSource::LoadControllerDB()
|
bool SDLInputSource::LoadControllerDB()
|
||||||
{
|
{
|
||||||
Error error;
|
Error error;
|
||||||
std::FILE* fp =
|
auto fp = FileSystem::OpenManagedCFile(Path::Combine(EmuFolders::Resources, CONTROLLER_DB_FILENAME).c_str(), "rb", &error);
|
||||||
FileSystem::OpenCFile(Path::Combine(EmuFolders::Resources, CONTROLLER_DB_FILENAME).c_str(), "rb", &error);
|
std::optional<std::string> data;
|
||||||
if (!fp)
|
if (!fp || !(data = FileSystem::ReadFileToString(fp.get())))
|
||||||
{
|
{
|
||||||
Console.Error(fmt::format("SDLInputSource: Failed to open controller database: {}", error.GetDescription()));
|
Console.Error(fmt::format("SDLInputSource: Failed to open controller database: {}", error.GetDescription()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_GameControllerAddMappingsFromRW(SDL_RWFromFP(fp, SDL_TRUE), SDL_TRUE) < 0)
|
if (SDL_GameControllerAddMappingsFromRW(SDL_RWFromConstMem(data->c_str(), data->length()), SDL_TRUE) < 0)
|
||||||
{
|
{
|
||||||
Console.Error(fmt::format("SDLInputSource: SDL_GameControllerAddMappingsFromRW() failed: {}", SDL_GetError()));
|
Console.Error(fmt::format("SDLInputSource: SDL_GameControllerAddMappingsFromRW() failed: {}", SDL_GetError()));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue