From 6f040e2c56e6e771e9e941286b1d28f69c0c1108 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 19 Apr 2014 09:01:13 -0400 Subject: [PATCH] Turns out we never actually need to check which window is in front --- osx/boe.main.cpp | 6 +++--- osx/tools/winutil.h | 2 -- osx/tools/winutil.mac.mm | 10 ---------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/osx/boe.main.cpp b/osx/boe.main.cpp index 5d149db9..fa14f856 100644 --- a/osx/boe.main.cpp +++ b/osx/boe.main.cpp @@ -294,12 +294,12 @@ void Handle_One_Event() //(cur_time - last_anim_time > 42) if((animTimer.getElapsedTime().asMilliseconds() >= fortyTicks) && (overall_mode != MODE_STARTUP) && (anim_onscreen == true) && (PSD[SDF_NO_TER_ANIM] == 0) - && (isFrontWindow(mainPtr) || isFrontWindow(mini_map)) && (!gInBackground)) { + && (!gInBackground)) { animTimer.restart(); draw_terrain(); } if((animTimer.getElapsedTime().asMilliseconds() > twentyTicks) && (overall_mode == MODE_STARTUP) - && app_started_normally && isFrontWindow(mainPtr)) { + && app_started_normally) { animTimer.restart(); draw_startup_anim(true); } @@ -347,7 +347,7 @@ void Handle_One_Event() // which hides the mouse cursor until it's moved. // SFML's hide cursor function is always permanent, so this is here to balance that out. mainPtr.setMouseCursorVisible(true); - if(!gInBackground && (isFrontWindow(mainPtr) || isFrontWindow(mini_map))) { + if(!gInBackground) { location where(event.mouseMove.x, event.mouseMove.y); change_cursor(where); // TODO: Probably don't actually need the conditional here? diff --git a/osx/tools/winutil.h b/osx/tools/winutil.h index 4383243f..c97ad0a2 100644 --- a/osx/tools/winutil.h +++ b/osx/tools/winutil.h @@ -16,9 +16,7 @@ namespace fs = boost::filesystem; // TODO: Centralize this alias char keyToChar(sf::Keyboard::Key key, bool isShift); -bool isFrontWindow(sf::Window& win); void makeFrontWindow(sf::Window& win); - void setWindowFloating(sf::Window& win, bool floating); void init_fileio(); diff --git a/osx/tools/winutil.mac.mm b/osx/tools/winutil.mac.mm index f5fc4fd7..498dfc10 100644 --- a/osx/tools/winutil.mac.mm +++ b/osx/tools/winutil.mac.mm @@ -70,16 +70,6 @@ char keyToChar(sf::Keyboard::Key key, bool isShift) { return 0; } -bool isFrontWindow(sf::Window& win) { - sf::WindowHandle handle = win.getSystemHandle(); - id nsHandle = id(handle); - if([nsHandle isKindOfClass: [NSWindow class]]) { - BOOL main = [nsHandle isMainWindow]; - return main; - } - return false; -} - void makeFrontWindow(sf::Window& win) { sf::WindowHandle handle = win.getSystemHandle(); id nsHandle = id(handle);