summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilesdl.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-27 04:08:39 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-27 04:08:39 +0000
commitedde105b049c15d3aae50494b49d2f224dc358dc (patch)
tree4b573cf168858bd5b54c387068c6a9c03f1442a3 /crawl-ref/source/tilesdl.cc
parent060203d0595b0e35df976496af86d9610a91e34a (diff)
downloadcrawl-ref-edde105b049c15d3aae50494b49d2f224dc358dc.tar.gz
crawl-ref-edde105b049c15d3aae50494b49d2f224dc358dc.zip
Adding a tile_repeat_key option (on by default) that determines whether to repeat key input when a key is held down. (Also, some doc update from the previous submission.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7036 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r--crawl-ref/source/tilesdl.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index fdb888cf17..886d59f8f1 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -126,7 +126,7 @@ bool TilesFramework::initialise()
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
{
- printf ("Failed to initialise SDL: %s\n", SDL_GetError());
+ printf("Failed to initialise SDL: %s\n", SDL_GetError());
return false;
}
@@ -136,7 +136,7 @@ bool TilesFramework::initialise()
SDL_Surface *icon = IMG_Load("dat/tiles/stone_soup_icon-32x32.png");
if (!icon)
{
- printf ("Failed to load icon: %s\n", SDL_GetError());
+ printf("Failed to load icon: %s\n", SDL_GetError());
return false;
}
SDL_WM_SetIcon(icon, NULL);
@@ -147,6 +147,14 @@ bool TilesFramework::initialise()
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
+
+ if (Options.tile_key_repeat)
+ {
+ int delay = SDL_DEFAULT_REPEAT_DELAY;
+ int interval = SDL_DEFAULT_REPEAT_INTERVAL;
+ if (SDL_EnableKeyRepeat(delay, interval) != 0)
+ printf("Failed to set key repeat mode: %s\n", SDL_GetError());
+ }
unsigned int flags = SDL_OPENGL;
if (Options.tile_full_screen)
@@ -158,7 +166,7 @@ bool TilesFramework::initialise()
m_context = SDL_SetVideoMode(m_windowsz.x, m_windowsz.y, 0, flags);
if (!m_context)
{
- printf ("Failed to set video mode: %s\n", SDL_GetError());
+ printf("Failed to set video mode: %s\n", SDL_GetError());
return false;
}