Skip to content

Commit 55d6591

Browse files
committed
xrEngine: fix dirty hack for processing of priority
1 parent 425a91c commit 55d6591

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/xrEngine/pure.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#include "xrCommon/xr_vector.h"
33

44
// messages
5-
#define REG_PRIORITY_LOW 0x11111111ul
6-
#define REG_PRIORITY_NORMAL 0x22222222ul
7-
#define REG_PRIORITY_HIGH 0x33333333ul
8-
#define REG_PRIORITY_CAPTURE 0x7ffffffful
9-
#define REG_PRIORITY_INVALID 0xfffffffful
5+
#define REG_PRIORITY_LOW 0x11111111
6+
#define REG_PRIORITY_NORMAL 0x22222222
7+
#define REG_PRIORITY_HIGH 0x33333333
8+
#define REG_PRIORITY_CAPTURE 0x7fffffff
9+
#define REG_PRIORITY_INVALID 0x80000000 // -2147483648, lowest for int
1010

1111
struct IPure
1212
{
@@ -35,7 +35,7 @@ DECLARE_MESSAGE(ScreenResolutionChanged);
3535
struct MessageObject
3636
{
3737
IPure* Object;
38-
unsigned long Prio;
38+
int Prio;
3939
};
4040

4141
template<class T>
@@ -49,7 +49,7 @@ class MessageRegistry
4949

5050
void Clear() { messages.clear(); }
5151

52-
constexpr void Add(T* object, unsigned long priority = REG_PRIORITY_NORMAL)
52+
constexpr void Add(T* object, const int priority = REG_PRIORITY_NORMAL)
5353
{
5454
Add({ object, priority });
5555
}
@@ -112,7 +112,7 @@ class MessageRegistry
112112
{
113113
if (!messages.empty()) {
114114
std::sort(std::begin(messages), std::end(messages),
115-
[](const auto& a, const auto& b) { return a.Prio < b.Prio; });
115+
[](const auto& a, const auto& b) { return a.Prio > b.Prio; });
116116
}
117117

118118
while (!messages.empty() && messages.back().Prio == REG_PRIORITY_INVALID)

0 commit comments

Comments
 (0)