aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorChris Apers2006-09-17 09:49:33 +0000
committerChris Apers2006-09-17 09:49:33 +0000
commit5fa194e62b391b4dd346c4258893a033ba77ad64 (patch)
tree7f5cc4ab61fe196e45b2f781807045645726bd29 /backends/platform
parent42dd017faf6a34ad7747c9d4ab4985576aa50546 (diff)
downloadscummvm-rg350-5fa194e62b391b4dd346c4258893a033ba77ad64.tar.gz
scummvm-rg350-5fa194e62b391b4dd346c4258893a033ba77ad64.tar.bz2
scummvm-rg350-5fa194e62b391b4dd346c4258893a033ba77ad64.zip
Added option to trace memory allocation
Fixed key auto repeat problem in some engines svn-id: r23905
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/PalmOS/Src/base_event.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/platform/PalmOS/Src/base_event.cpp b/backends/platform/PalmOS/Src/base_event.cpp
index 9a5e972bbd..91800e7f8b 100644
--- a/backends/platform/PalmOS/Src/base_event.cpp
+++ b/backends/platform/PalmOS/Src/base_event.cpp
@@ -24,6 +24,10 @@
#include "be_base.h"
+#ifdef STDLIB_TRACE_MEMORY
+# include <stdlib.h>
+#endif
+
#if defined(COMPILE_OS5) && defined(PALMOS_ARM)
extern "C" void SysEventGet(EventType *eventP, Int32 timeout);
extern "C" void SysEventAddToQueue (const EventType *eventP);
@@ -306,6 +310,11 @@ bool OSystem_PalmBase::pollEvent(Event &event) {
key = (key == '0') ? 324 : (315 + key - '1');
mask = 0;
+#ifdef STDLIB_TRACE_MEMORY
+ // print memory
+ } else if (key == 'm' && mask == (KBD_CTRL|KBD_ALT)) {
+ printf("Used memory: %d\n", __stdlib_trace_memory);
+#endif
// exit
} else if ((key == 'z' && mask == KBD_CTRL) || (mask == KBD_ALT && key == 'x')) {
event.type = EVENT_QUIT;
@@ -320,6 +329,7 @@ bool OSystem_PalmBase::pollEvent(Event &event) {
}
// other keys
+ _lastEvent = keyDownEvent;
event.type = EVENT_KEYDOWN;
event.kbd.keycode = key;
event.kbd.ascii = key;
@@ -327,6 +337,11 @@ bool OSystem_PalmBase::pollEvent(Event &event) {
return true;
default:
+ if (_lastEvent == keyDownEvent) {
+ event.type = EVENT_KEYUP;
+ _lastEvent = nilEvent;
+ return true;
+ }
return false;
};
}