+[OFString stringWithUTF8String:] -> @()

This commit is contained in:
Inori 2019-12-17 02:19:05 -05:00 committed by Inori
parent e67cc9f4d0
commit 70104f2d42
2 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@ OFString* prefPath(const char* org, const char* app)
if (!path)
return [OFString string];
OFString* str = [OFString stringWithUTF8String:path];
OFString* str = @(path);
SDL_free(path);
return str;
}
@ -103,7 +103,7 @@ void Config::read(int argc, char *argv[])
if (argc > 1)
{
OFString* argv1 = [OFString stringWithUTF8String:argv[1]];
OFString* argv1 = @(argv[1]);
if ([argv1 isEqual: @"debug"] || [argv1 isEqual: @"test"])
editor.debug = true;
else if ([argv1 isEqual: @"btest"])
@ -199,7 +199,7 @@ void Config::readGameINI()
if (!customScript.empty())
{
game.title = [[[[OFString stringWithUTF8String:customScript.c_str()] pathComponents] componentsJoinedByString:@"/"] UTF8String];
game.title = customScript.c_str();
if (rgssVersion == 0)
rgssVersion = 1;

View file

@ -221,7 +221,7 @@ int main(int argc, char *argv[])
SDL_free(tmp);
}
}
@try{[fm changeCurrentDirectoryPath:[OFString stringWithUTF8String:dataDir]];}@catch(...){}
@try{[fm changeCurrentDirectoryPath:@(dataDir)];}@catch(...){}
#endif
/* now we load the config */
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
if (!conf.gameFolder.empty())
{
@try{
[fm changeCurrentDirectoryPath:[OFString stringWithUTF8String:conf.gameFolder.c_str()]];
[fm changeCurrentDirectoryPath:@(conf.gameFolder.c_str())];
}
@catch(...){
showInitError(std::string("Unable to switch into gameFolder ") + conf.gameFolder);