summaryrefslogtreecommitdiff
path: root/src/video/sdl2_v.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-06 21:11:44 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-27 13:19:25 +0100
commitf3326d34e78bd28fba6d8cfd3bc455a506b429fe (patch)
tree307a0608a7fb1c211fd72a8b8326cfe9bb1d37a2 /src/video/sdl2_v.cpp
parent0c6e8a8123c9f74db757272f73adcbd8621e012d (diff)
downloadopenttd-f3326d34e78bd28fba6d8cfd3bc455a506b429fe.tar.xz
Codechange: Use std::string in FIO search path handling.
Diffstat (limited to 'src/video/sdl2_v.cpp')
-rw-r--r--src/video/sdl2_v.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index 852f7298d..ea2a88bb9 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -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);