Codechange: Use std::string in FIO search path handling.
This commit is contained in:
@@ -551,8 +551,8 @@ void cocoaSetApplicationBundleDir()
|
||||
char tmp[MAXPATHLEN];
|
||||
CFAutoRelease<CFURLRef> url(CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()));
|
||||
if (CFURLGetFileSystemRepresentation(url.get(), true, (unsigned char*)tmp, MAXPATHLEN)) {
|
||||
AppendPathSeparator(tmp, lastof(tmp));
|
||||
_searchpaths[SP_APPLICATION_BUNDLE_DIR] = tmp;
|
||||
AppendPathSeparator(_searchpaths[SP_APPLICATION_BUNDLE_DIR]);
|
||||
} else {
|
||||
_searchpaths[SP_APPLICATION_BUNDLE_DIR].clear();
|
||||
}
|
||||
|
||||
@@ -285,10 +285,10 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h, bool resize)
|
||||
return false;
|
||||
}
|
||||
|
||||
char icon_path[MAX_PATH];
|
||||
if (FioFindFullPath(icon_path, lastof(icon_path), BASESET_DIR, "openttd.32.bmp") != nullptr) {
|
||||
std::string icon_path = FioFindFullPath(BASESET_DIR, "openttd.32.bmp");
|
||||
if (!icon_path.empty()) {
|
||||
/* Give the application an icon */
|
||||
SDL_Surface *icon = SDL_LoadBMP(icon_path);
|
||||
SDL_Surface *icon = SDL_LoadBMP(icon_path.c_str());
|
||||
if (icon != nullptr) {
|
||||
/* Get the colourkey, which will be magenta */
|
||||
uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255);
|
||||
|
||||
@@ -266,10 +266,10 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h)
|
||||
|
||||
if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");
|
||||
|
||||
char icon_path[MAX_PATH];
|
||||
if (FioFindFullPath(icon_path, lastof(icon_path), BASESET_DIR, "openttd.32.bmp") != nullptr) {
|
||||
std::string icon_path = FioFindFullPath(BASESET_DIR, "openttd.32.bmp");
|
||||
if (!icon_path.empty()) {
|
||||
/* Give the application an icon */
|
||||
icon = SDL_LoadBMP(icon_path);
|
||||
icon = SDL_LoadBMP(icon_path.c_str());
|
||||
if (icon != nullptr) {
|
||||
/* Get the colourkey, which will be magenta */
|
||||
uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255);
|
||||
|
||||
Reference in New Issue
Block a user