From 7d4f8af2456fd3d357f7bb064cf5a7cd387c3ef1 Mon Sep 17 00:00:00 2001 From: raa-eruanna Date: Wed, 1 Nov 2017 04:13:10 -0400 Subject: [PATCH] - fixed compile on Linux and (maybe?) Mac --- src/posix/cocoa/i_video.mm | 16 +++++++++++----- src/posix/sdl/sdlvideo.cpp | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index c89a6601d..2c305b49e 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -1523,10 +1523,16 @@ void I_SetMainWindowVisible(bool visible) // each platform has its own specific version of this function. void I_SetWindowTitle(const char* title) { - static NSString* const TITLE_STRING; if (title) - TITLE_STRING = [NSString stringWithFormat:@"%s", title]; + { + static NSString* const TITLE_STRING = + [NSString stringWithFormat:@"%s", title]; + [m_window setTitle:TITLE_STRING]; + } else - TITLE_STRING = [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; - [m_window setTitle:TITLE_STRING]; -} \ No newline at end of file + { + static NSString* const TITLE_STRING = + [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; + [m_window setTitle:TITLE_STRING]; + } +} diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 318a91e6e..6a0420ae8 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -556,11 +556,12 @@ ADD_STAT (blit) void I_SetWindowTitle(const char* caption) { if (caption) - SDL_SetWindowTitle(Screen, caption); + SDL_SetWindowTitle(static_cast(screen)->GetSDLWindow(), caption); else { FString default_caption; default_caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); - SDL_SetWindowTitle(Screen, default_caption); + SDL_SetWindowTitle(static_cast(screen)->GetSDLWindow(), default_caption); } } +