Turns out we never actually need to check which window is in front
This commit is contained in:
@@ -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?
|
||||
|
@@ -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();
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user