From 2c38dfb397b5dedc3b2326061c536af6e95461dc Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Wed, 4 Apr 2012 13:21:02 -0300 Subject: [PATCH] fix dumbfounding issue on win32 that caused HUGE lags --- src/framework/platform/win32window.cpp | 2 +- src/framework/util/types.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/framework/platform/win32window.cpp b/src/framework/platform/win32window.cpp index b2e64598..a728d6d3 100644 --- a/src/framework/platform/win32window.cpp +++ b/src/framework/platform/win32window.cpp @@ -406,7 +406,7 @@ void WIN32Window::poll() fireKeysPress(); MSG msg; - if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } diff --git a/src/framework/util/types.h b/src/framework/util/types.h index 88837ff4..99b14af4 100644 --- a/src/framework/util/types.h +++ b/src/framework/util/types.h @@ -40,6 +40,8 @@ typedef int32_t int32; typedef int16_t int16; typedef int8_t int8; +// note that on 32 bit platforms the max ticks will overflow for valeus above 2,147,483,647 +// thus this means that the app may crash after running 24 days without restarting typedef long ticks_t; typedef std::function SimpleCallback;