This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 14
14
// ////////////////////////////////////////////////////////////////////////////////////////
15
15
// Inclusions of header files
16
16
17
+ // TODO: Figure out where we can include this without imploding the whole game and keeping QPC working and having no method/macro conflicts.
17
18
#include < allegro.h>
18
- #include < winalleg.h>
19
+ #include < winalleg.h>
19
20
20
21
// Windows.h defines these and they conflict with our methods so we need to undefine them manually.
21
22
#undef GetClassName
22
23
#undef PlaySound
23
24
25
+ // minwindef.h defines these and they conflict with the std methods so we need to undefine them manually.
26
+ #undef min
27
+ #undef max
28
+
24
29
// #include "Entity.h"
25
30
#include " Singleton.h"
26
31
#define g_TimerMan TimerMan::Instance ()
Original file line number Diff line number Diff line change @@ -80,14 +80,14 @@ namespace RTE {
80
80
// See if there's other analog input, only if the mouse isn't active (or the cursor will float if mouse is used!)
81
81
} else if (GetAnalogCursor ().GetLargest () > 0.1 && !IsMouseControlled ()) {
82
82
// See how much to accelerate the joystick input based on how long the stick has been pushed around
83
- float acceleration = 0.5 + MIN (m_JoyAccelTimer.GetElapsedRealTimeS (), 0.5 ) * 6 ;
83
+ float acceleration = 0.5 + std::min (m_JoyAccelTimer.GetElapsedRealTimeS (), 0.5 ) * 6 ;
84
84
cursorPos += GetAnalogCursor () * 10 * moveScale * acceleration;
85
85
altered = true ;
86
86
87
87
// Digital movement
88
88
} else {
89
89
// See how much to accelerate the keyboard input based on how long any key has been pressed
90
- float acceleration = 0.25 + MIN (m_KeyAccelTimer.GetElapsedRealTimeS (), 0.75 ) * 6 ;
90
+ float acceleration = 0.25 + std::min (m_KeyAccelTimer.GetElapsedRealTimeS (), 0.75 ) * 6 ;
91
91
92
92
if (IsState (HOLD_LEFT)) {
93
93
cursorPos.m_X -= 10 * moveScale * acceleration;
Original file line number Diff line number Diff line change @@ -42,5 +42,7 @@ using std::set;
42
42
using std::vector;
43
43
using std::ios_base;
44
44
using std::make_pair;
45
+ using std::min;
46
+ using std::max;
45
47
46
48
#endif
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ namespace RTE {
161
161
// / 0 means no progress, 1.0 means the timer has reached, or is beyond the limit.
162
162
// / </summary>
163
163
// / <returns>A normalized scalar between 0.0 - 1.0 showing the progress toward the limit.</returns>
164
- double RealTimeLimitProgress () const { return (m_RealTimeLimit == 0 ) ? 1.0 : (MIN (1.0 , GetElapsedRealTimeMS () / (m_RealTimeLimit / m_TicksPerMS))); }
164
+ double RealTimeLimitProgress () const { return (m_RealTimeLimit == 0 ) ? 1.0 : (std::min (1.0 , GetElapsedRealTimeMS () / (m_RealTimeLimit / m_TicksPerMS))); }
165
165
166
166
// / <summary>
167
167
// / Returns true or false, depending on whether the elapsed time falls in one of two repeating intervals which divide it.
@@ -274,7 +274,7 @@ namespace RTE {
274
274
// / 0 means no progress, 1.0 means the timer has reached, or is beyond the limit.
275
275
// / </summary>
276
276
// / <returns>A normalized scalar between 0.0 - 1.0 showing the progress toward the limit.</returns>
277
- double SimTimeLimitProgress () const { return (m_SimTimeLimit == 0 ) ? 1.0 : (MIN (1.0 , GetElapsedSimTimeMS () / (m_SimTimeLimit / m_TicksPerMS))); }
277
+ double SimTimeLimitProgress () const { return (m_SimTimeLimit == 0 ) ? 1.0 : (std::min (1.0 , GetElapsedSimTimeMS () / (m_SimTimeLimit / m_TicksPerMS))); }
278
278
279
279
// / <summary>
280
280
// / Returns true or false, depending on whether the elapsed time falls in one of two repeating intervals which divide it.
You can’t perform that action at this time.
0 commit comments