mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-06 04:04:53 +01:00
UTF8 paths are now properly handled on windows.
This commit is contained in:
parent
b8eae2b709
commit
51702b898e
5 changed files with 147 additions and 96 deletions
|
|
@ -31,7 +31,7 @@ static void consume_bom(std::ifstream &input)
|
|||
static void load_custom_broadcasts(std::string broadcasts_filepath, std::set<uint32> &custom_broadcasts)
|
||||
{
|
||||
PRINT_DEBUG("Broadcasts file path: %s\n", broadcasts_filepath.c_str());
|
||||
std::ifstream broadcasts_file(broadcasts_filepath);
|
||||
std::ifstream broadcasts_file(utf8_decode(broadcasts_filepath));
|
||||
consume_bom(broadcasts_file);
|
||||
if (broadcasts_file.is_open()) {
|
||||
std::string line;
|
||||
|
|
@ -69,7 +69,7 @@ static void load_gamecontroller_settings(Settings *settings)
|
|||
std::transform(action_set_name.begin(), action_set_name.end(), action_set_name.begin(),[](unsigned char c){ return std::toupper(c); });
|
||||
|
||||
std::string controller_config_path = path + PATH_SEPARATOR + p;
|
||||
std::ifstream input( controller_config_path );
|
||||
std::ifstream input( utf8_decode(controller_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
std::map<std::string, std::pair<std::set<std::string>, std::string>> button_pairs;
|
||||
|
|
@ -307,7 +307,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string dlc_config_path = Local_Storage::get_game_settings_path() + "DLC.txt";
|
||||
std::ifstream input( dlc_config_path );
|
||||
std::ifstream input( utf8_decode(dlc_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
settings_client->unlockAllDLC(false);
|
||||
|
|
@ -349,7 +349,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string dlc_config_path = Local_Storage::get_game_settings_path() + "app_paths.txt";
|
||||
std::ifstream input( dlc_config_path );
|
||||
std::ifstream input( utf8_decode(dlc_config_path) );
|
||||
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
|
|
@ -384,7 +384,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string dlc_config_path = Local_Storage::get_game_settings_path() + "leaderboards.txt";
|
||||
std::ifstream input( dlc_config_path );
|
||||
std::ifstream input( utf8_decode(dlc_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
settings_client->setCreateUnknownLeaderboards(false);
|
||||
|
|
@ -426,7 +426,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string stats_config_path = Local_Storage::get_game_settings_path() + "stats.txt";
|
||||
std::ifstream input( stats_config_path );
|
||||
std::ifstream input( utf8_decode(stats_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
for( std::string line; getline( input, line ); ) {
|
||||
|
|
@ -491,7 +491,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string depots_config_path = Local_Storage::get_game_settings_path() + "depots.txt";
|
||||
std::ifstream input( depots_config_path );
|
||||
std::ifstream input( utf8_decode(depots_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
for( std::string line; getline( input, line ); ) {
|
||||
|
|
@ -513,7 +513,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
|
||||
{
|
||||
std::string depots_config_path = Local_Storage::get_game_settings_path() + "subscribed_groups.txt";
|
||||
std::ifstream input( depots_config_path );
|
||||
std::ifstream input( utf8_decode(depots_config_path) );
|
||||
if (input.is_open()) {
|
||||
consume_bom(input);
|
||||
for( std::string line; getline( input, line ); ) {
|
||||
|
|
@ -553,4 +553,4 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
|
|||
*local_storage_out = local_storage;
|
||||
|
||||
return appid;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue