From 0273b1a8cc329a9e54c0d2142ecd0c5681cd3663 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 18 Nov 2017 07:42:15 -0500 Subject: [PATCH] - revert to before adding I_SetWindowTitle to DFrameBuffer --- src/d_main.cpp | 7 ++++--- src/posix/cocoa/i_video.mm | 10 ++-------- src/posix/sdl/sdlvideo.cpp | 7 ++----- src/posix/sdl/sdlvideo.h | 4 +--- src/v_video.h | 2 -- src/win32/i_main.cpp | 2 +- 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index f1a56cc7d..301be20f8 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -128,6 +128,7 @@ void DrawHUD(); // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- +extern void I_SetWindowTitle(const char* caption); extern void ReadStatistics(); extern void M_RestoreMode (); extern void M_SetDefaultMode (); @@ -2744,7 +2745,7 @@ void D_DoomMain (void) } if (I_FriendlyWindowTitle) - screen->I_SetWindowTitle(DoomStartupInfo.Name.GetChars()); + I_SetWindowTitle(DoomStartupInfo.Name.GetChars()); D_DoomLoop (); // this only returns if a 'restart' CCMD is given. // @@ -2909,7 +2910,7 @@ DEFINE_FIELD_X(InputEventData, event_t, y) CUSTOM_CVAR(Bool, I_FriendlyWindowTitle, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL) { if (self) - screen->I_SetWindowTitle(DoomStartupInfo.Name.GetChars()); + I_SetWindowTitle(DoomStartupInfo.Name.GetChars()); else - screen->I_SetWindowTitle(NULL); + I_SetWindowTitle(NULL); } \ No newline at end of file diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index e80ff0ab4..c89a6601d 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -1521,18 +1521,12 @@ void I_SetMainWindowVisible(bool visible) } // each platform has its own specific version of this function. -void CocoaVideo::I_SetWindowTitle(const char* title) +void I_SetWindowTitle(const char* title) { - static NSString* TITLE_STRING; + static NSString* const TITLE_STRING; if (title) TITLE_STRING = [NSString stringWithFormat:@"%s", title]; else TITLE_STRING = [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; [m_window setTitle:TITLE_STRING]; -} - -void DFrameBuffer::I_SetWindowTitle(const char* title) -{ - if (Video != nullptr) - Video->I_SetWindowTitle(title); } \ No newline at end of file diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 46d35568f..e85c08235 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -553,9 +553,9 @@ ADD_STAT (blit) } // each platform has its own specific version of this function. -void SDLFB::I_SetWindowTitle(const char* caption) +void I_SetWindowTitle(const char* caption) { - Screen = GetSDLWindow(); + Screen = screen->GetSDLWindow(); if (caption) SDL_SetWindowTitle(Screen, caption); else @@ -565,6 +565,3 @@ void SDLFB::I_SetWindowTitle(const char* caption) SDL_SetWindowTitle(Screen, default_caption); } } -void DFrameBuffer::I_SetWindowTitle(const char* caption) -{ -} diff --git a/src/posix/sdl/sdlvideo.h b/src/posix/sdl/sdlvideo.h index 3fd31ff07..31a168aa6 100644 --- a/src/posix/sdl/sdlvideo.h +++ b/src/posix/sdl/sdlvideo.h @@ -30,9 +30,8 @@ public: virtual void SetVSync(bool vsync); virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y); - void I_SetWindowTitle(const char* caption); - SDL_Window *GetSDLWindow() override { return Screen; } + private: PalEntry SourcePalette[256]; uint8_t GammaTable[3][256]; @@ -58,5 +57,4 @@ private: void ResetSDLRenderer(); SDLFB() {} - void I_SetWindowTitle(); }; diff --git a/src/v_video.h b/src/v_video.h index 5cd54c7ef..1cbf565af 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -444,8 +444,6 @@ public: uint64_t GetLastFPS() const { return LastCount; } - virtual void I_SetWindowTitle(const char* caption); - #ifdef _WIN32 virtual void PaletteChanged () = 0; virtual int QueryNewPalette () = 0; diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index a4e59da76..019b01e7e 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -1362,7 +1362,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n } // each platform has its own specific version of this function. -void DFrameBuffer::I_SetWindowTitle(const char* caption) +void I_SetWindowTitle(const char* caption) { if (caption) SetWindowText(Window, (LPCTSTR)caption);