Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit cc3e153

Browse files
committed
Misc cleanup
1 parent c5d491a commit cc3e153

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

Managers/UInputMan.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
#ifdef _WIN32
1515
#include "joystickapi.h"
16-
#endif
17-
#ifdef __unix__
16+
#elif __unix__
1817
#include <fcntl.h>
1918
#include "allegro/internal/aintern.h"
2019
#include "allegro/platform/aintunix.h"
@@ -101,12 +100,10 @@ namespace RTE {
101100
}
102101
}
103102

104-
105103
#ifdef __unix__
106104
m_AllegroMousePreviousX = 0;
107105
m_AllegroMousePreviousY = 0;
108106
#endif
109-
110107
}
111108

112109
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1056,13 +1053,11 @@ namespace RTE {
10561053
}
10571054
break;
10581055
}
1059-
10601056
default:
10611057
XPutBackEvent(_xwin.display, &(*event));
10621058
break;
10631059
}
10641060
}
1065-
10661061
XFlush(_xwin.display);
10671062

10681063
_xwin.mouse_warped = 0;
@@ -1072,17 +1067,14 @@ namespace RTE {
10721067
mouse_x = _xwin.window_width / 2;
10731068
mouse_y = _xwin.window_height / 2;
10741069
}
1075-
10761070
_mouse_x = mouse_x;
10771071
_mouse_y = mouse_y;
10781072
}
10791073

10801074
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
10811075

10821076
void UInputMan::WarpMouse(int x, int y) const {
1083-
if (mouse_x != x || mouse_y != y) {
1084-
XWarpPointer(_xwin.display, _xwin.window, _xwin.window, 0, 0, 0, 0, x, y);
1085-
}
1077+
if (mouse_x != x || mouse_y != y) { XWarpPointer(_xwin.display, _xwin.window, _xwin.window, 0, 0, 0, 0, x, y); }
10861078
_mouse_x = mouse_x = x;
10871079
_mouse_y = mouse_y = y;
10881080
}

Managers/UInputMan.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,15 +806,15 @@ namespace RTE {
806806
static void XWinInputHandlerOverride() { g_UInputMan.HandleAllegroMouseInput(); }
807807

808808
/// <summary>
809-
/// Mouse input handler to circumvent the input drops that allegro does regularly, by replacing and disabling the default warping behaviour.
810-
/// Motion events that are generated while the handler is working are offset such that the allegro driver doesn't mess up the mickeys.
811-
/// This also handles the centering warp for relative mouse motion. Might not run in the main thread, depending on how allegro was built.
809+
/// Mouse input handler to circumvent the input drops that Allegro does regularly, by replacing and disabling the default warping behavior.
810+
/// Motion events that are generated while the handler is working are offset such that the Allegro driver doesn't mess up the mickeys.
811+
/// This also handles the centering warp for relative mouse motion. Might not run in the main thread, depending on how Allegro was built.
812812
/// </summary>
813813
void HandleAllegroMouseInput();
814814

815815
/// <summary>
816816
/// Position the mouse on the screen in window coordinates. Generates MouseMotion events if the requested position is different from the actual mouse position.
817-
/// Replaces position_mouse and sets the allegro internal mouse position to the requested x,y.
817+
/// Replaces position_mouse and sets the Allegro internal mouse position to the requested coordinates.
818818
/// </summary>
819819
/// <param name="x"> The x coordinate to warp to. </param>
820820
/// <param name="y"> The y coordinate to warp to. </param>

0 commit comments

Comments
 (0)