summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.cc
diff options
context:
space:
mode:
authorIxtli <cg@325i.org>2010-02-27 16:37:34 +0900
committerEnne Walker <ennewalker@users.sourceforge.net>2010-04-24 10:19:37 -0400
commitee76ebe8f9cb7bf9f255c60a9545c379211ca584 (patch)
tree3f407dcb39f444c29c1504b89a027b20f2af4add /crawl-ref/source/libgui.cc
parentdcca3a08a423a97466d7fc982ac8c145709b6f49 (diff)
downloadcrawl-ref-ee76ebe8f9cb7bf9f255c60a9545c379211ca584.tar.gz
crawl-ref-ee76ebe8f9cb7bf9f255c60a9545c379211ca584.zip
Added uiwrapper getEventCount and UIDelay, and applied them in libui.cc
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index 9694fd9b83..bb400de5d9 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -29,7 +29,9 @@
#include "travel.h"
#include "viewgeom.h"
-#include <SDL.h>
+#ifdef USE_SDL
+#include "uiwrapper-sdl.h"
+#endif
#include "tilesdl.h"
int tile_idx_unseen_terrain(int x, int y, int what)
@@ -333,7 +335,7 @@ GotoRegion get_cursor_region()
void delay(int ms)
{
tiles.redraw();
- SDL_Delay(ms);
+ wrapper.UIDelay(ms);
}
void update_screen()
@@ -344,14 +346,9 @@ void update_screen()
int kbhit()
{
// Look for the presence of any keyboard events in the queue.
- SDL_Event store;
- SDL_PumpEvents();
- int count = SDL_PeepEvents(&store, 1, SDL_PEEKEVENT,
- SDL_EVENTMASK(SDL_KEYDOWN));
+ int count = wrapper.getEventCount(UI_KEYDOWN);
- // SDL Error?
ASSERT(count != -1);
-
return (count == 1 ? 1 : 0);
}