mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 11:02:44 +03:00
fix(event): correct minor logic errors in windows message loop
This commit is contained in:
parent
b295c541e3
commit
e6b43f9758
@ -5,10 +5,22 @@
|
|||||||
int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param2, int32_t* param3) {
|
int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param2, int32_t* param3) {
|
||||||
// TODO window rect comparisons
|
// TODO window rect comparisons
|
||||||
|
|
||||||
while (Input::s_queueTail == Input::s_queueHead) {
|
if (Input::s_queueTail != Input::s_queueHead) {
|
||||||
MSG msg;
|
OsQueueGet(id, param0, param1, param2, param3);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!PeekMessage(&msg, nullptr, 0, 0, 0)) {
|
// TODO Sub8714B0(dwordB1C220);
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
MSG msg;
|
||||||
|
auto peekResult = PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE);
|
||||||
|
|
||||||
|
if (Input::s_queueTail != Input::s_queueHead) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!peekResult) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,11 +38,13 @@ int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param
|
|||||||
}
|
}
|
||||||
|
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
|
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
|
|
||||||
|
if (Input::s_queueTail != Input::s_queueHead) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OsQueueGet(id, param0, param1, param2, param3);
|
OsQueueGet(id, param0, param1, param2, param3);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user