diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 11:48:30 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 11:48:30 +0000 |
commit | 54705c0c81e24cfd76ba4fe654c37de217c5beae (patch) | |
tree | ea3625f8dfd68d7ae17501e771d610eee8834479 /crawl-ref/source/tilesdl.cc | |
parent | bf43967bc6de08383813ea532bf75c2d441d0e89 (diff) | |
download | crawl-ref-54705c0c81e24cfd76ba4fe654c37de217c5beae.tar.gz crawl-ref-54705c0c81e24cfd76ba4fe654c37de217c5beae.zip |
Apply my recent commits to trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9978 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 25240361e9..e112c7cc34 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -150,13 +150,13 @@ void TilesFramework::shutdown() delete m_region_menu; delete m_region_title; - m_region_tile = NULL; - m_region_stat = NULL; - m_region_msg = NULL; - m_region_map = NULL; - m_region_inv = NULL; - m_region_crt = NULL; - m_region_menu = NULL; + m_region_tile = NULL; + m_region_stat = NULL; + m_region_msg = NULL; + m_region_map = NULL; + m_region_inv = NULL; + m_region_crt = NULL; + m_region_menu = NULL; m_region_title = NULL; for (unsigned int i = 0; i < LAYER_MAX; i++) @@ -178,6 +178,7 @@ void TilesFramework::draw_title() m_active_layer = LAYER_TITLE; set_need_redraw(); + mouse_control mc(MOUSE_MODE_MORE); getch(); } @@ -251,9 +252,9 @@ bool TilesFramework::initialise() SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); - if (Options.tile_key_repeat) + if (Options.tile_key_repeat_delay > 0) { - int delay = SDL_DEFAULT_REPEAT_DELAY; + int delay = Options.tile_key_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()); @@ -281,7 +282,7 @@ bool TilesFramework::initialise() } else { - m_windowsz.x = std::max(800, m_screen_width - 100); + m_windowsz.x = std::max(800, m_screen_width - 100); m_windowsz.y = std::max(480, m_screen_height - 100); } @@ -707,7 +708,7 @@ static unsigned int _timer_callback(unsigned int ticks) event.type = SDL_USEREVENT; SDL_PushEvent(&event); - unsigned int res = std::max(30, Options.tile_tooltip_ms); + unsigned int res = Options.tile_tooltip_ms; return res; } @@ -746,7 +747,7 @@ int TilesFramework::getch_ck() const unsigned int ticks_per_redraw = 50; unsigned int last_redraw_tick = 0; - unsigned int res = std::max(30, Options.tile_tooltip_ms); + unsigned int res = Options.tile_tooltip_ms; SDL_SetTimer(res, &_timer_callback); if (m_need_redraw) @@ -791,7 +792,7 @@ int TilesFramework::getch_ck() { case SDL_KEYDOWN: m_key_mod |= _get_modifiers(event.key.keysym); - key = _translate_keysym(event.key.keysym); + key = _translate_keysym(event.key.keysym); m_region_tile->place_cursor(CURSOR_MOUSE, Region::NO_CURSOR); // If you hit a key, disable tooltips until the mouse @@ -840,9 +841,9 @@ int TilesFramework::getch_ck() { MouseEvent mouse_event; _translate_event(event.button, mouse_event); - m_buttons_held &= ~(mouse_event.button); + m_buttons_held &= ~(mouse_event.button); mouse_event.held = m_buttons_held; - mouse_event.mod = m_key_mod; + mouse_event.mod = m_key_mod; key = handle_mouse(mouse_event); m_last_tick_moved = ticks; } @@ -852,9 +853,9 @@ int TilesFramework::getch_ck() { MouseEvent mouse_event; _translate_event(event.button, mouse_event); - m_buttons_held |= mouse_event.button; + m_buttons_held |= mouse_event.button; mouse_event.held = m_buttons_held; - mouse_event.mod = m_key_mod; + mouse_event.mod = m_key_mod; key = handle_mouse(mouse_event); m_last_tick_moved = ticks; } @@ -1097,12 +1098,10 @@ bool TilesFramework::layout_statcol(bool message_overlay, bool show_gold_turns) inv_col = m_region_stat->sx; m_region_inv->place(inv_col, m_region_map->ey, 0); - m_region_inv->resize_to_fit(m_windowsz.x - - m_region_inv->sx, - m_windowsz.y - - m_region_inv->sy); + m_region_inv->resize_to_fit(m_windowsz.x - m_region_inv->sx, + m_windowsz.y - m_region_inv->sy); m_region_inv->resize(std::min(13, (int)m_region_inv->mx), - std::min(6, (int)m_region_inv->my)); + std::min( 6, (int)m_region_inv->my)); int self_inv_y = m_windowsz.y - m_region_inv->wy - margin; m_region_inv->place(inv_col, self_inv_y, 0); |