diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 20:48:12 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 20:48:12 +0000 |
commit | 5c837c44830ddb54d50e2a3a39851a8efc9bc6d8 (patch) | |
tree | 47b1f0c2eac6c6a5b3c377c76f717cfa1294cb85 | |
parent | 676dc0d1108ddbf60d3f7988be0be93e808d0f9a (diff) | |
download | crawl-ref-5c837c44830ddb54d50e2a3a39851a8efc9bc6d8.tar.gz crawl-ref-5c837c44830ddb54d50e2a3a39851a8efc9bc6d8.zip |
* Make tile_menu_icons deactivate show_inventory_weights as those two
don't work well together.
* Experimentally increase the redraw tick counter. Maybe that should
become an option, might help track down the lags. Dunno if that's even
part of the problem.
* Another attempt to fix the "missing item in tiles inventory" bug.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9979 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/docs/options_guide.txt | 11 | ||||
-rw-r--r-- | crawl-ref/source/acr.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/tilefont.cc | 35 | ||||
-rw-r--r-- | crawl-ref/source/tilereg.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 2 |
5 files changed, 33 insertions, 26 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index f65f6f6bbd..04ffd2400d 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -92,9 +92,12 @@ The contents of this text are: tile_mapped_wall_col, tile_door_col, tile_downstairs_col, tile_upstairs_col, tile_feature_col, tile_trap_col, tile_water_col, tile_lava_col, tile_excluded_col, - tile_excl_centre_col, tile_key_repeat, tile_tooltip_ms, - tile_window_width, tile_window_height, tile_map_pixels, - tile_full_screen, tile_tag_pref + tile_excl_centre_col, tile_key_repeat_delay, tile_tooltip_ms, + tile_tag_pref, tile_window_width, tile_window_height, + tile_map_pixels, tile_full_screen, tile_font_crt_file, + tile_font_stat_file, tile_font_msg_file, tile_font_tip_file, + tile_font_lbl_file, tile_font_crt_size, tile_font_stat_size, + tile_font_msg_size, tile_font_tip_size, tile_font_lbl_size 5- Character Dump. 5-a Items and Kills. kill_map, dump_kill_places, dump_item_origins, @@ -1641,7 +1644,7 @@ the dungeon level. tile_window_col - colour of the rectangular view window tile_key_repeat_delay = 200 - If you hold down a key, there's a delay until the presses key will + If you hold down a key, there's a delay until the pressed key will take action. This option controls this delay, in milliseconds. If it is set to 0 key presses will never repeat. diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index fd3735db07..2c3d41930d 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3451,6 +3451,10 @@ static bool _initialise(void) #endif #ifdef USE_TILE + // Override inventory weights options for tiled menus. + if (Options.tile_menu_icons && Options.show_inventory_weights) + Options.show_inventory_weights = false; + tiles.resize(); #endif diff --git a/crawl-ref/source/tilefont.cc b/crawl-ref/source/tilefont.cc index 63583a82eb..1d13913ca8 100644 --- a/crawl-ref/source/tilefont.cc +++ b/crawl-ref/source/tilefont.cc @@ -89,23 +89,21 @@ bool FTFont::load_font(const char *font_name, unsigned int font_size, bool outl) // Get maximum advance m_max_advance = coord_def(0,0); - int ascender = face->ascender >> 6; - int min_y = 100000; - int max_y = 0; + int ascender = face->ascender >> 6; + int min_y = 100000; + int max_y = 0; int max_width = 0; - m_min_offset = 0; + m_min_offset = 0; m_glyphs = new GlyphInfo[256]; for (unsigned int c = 0; c < 256; c++) { - m_glyphs[c].offset = 0; + m_glyphs[c].offset = 0; m_glyphs[c].advance = 0; m_glyphs[c].renderable = false; FT_Int glyph_index = FT_Get_Char_Index(face, c); if (!glyph_index) - { continue; - } error = FT_Load_Glyph(face, glyph_index, FT_LOAD_RENDER); ASSERT(!error); @@ -116,13 +114,13 @@ bool FTFont::load_font(const char *font_name, unsigned int font_size, bool outl) m_max_advance.x = std::max(m_max_advance.x, advance); - int bmp_width = bmp->width; - int bmp_top = ascender - face->glyph->bitmap_top; + int bmp_width = bmp->width; + int bmp_top = ascender - face->glyph->bitmap_top; int bmp_bottom = ascender + bmp->rows - face->glyph->bitmap_top; if (outl) { - bmp_width += 2; - bmp_top -= 1; + bmp_width += 2; + bmp_top -= 1; bmp_bottom += 1; } @@ -130,9 +128,9 @@ bool FTFont::load_font(const char *font_name, unsigned int font_size, bool outl) min_y = std::min(min_y, bmp_top); max_y = std::max(max_y, bmp_bottom); - m_glyphs[c].offset = face->glyph->bitmap_left; + m_glyphs[c].offset = face->glyph->bitmap_left; m_glyphs[c].advance = advance; - m_glyphs[c].width = bmp_width; + m_glyphs[c].width = bmp_width; m_min_offset = std::min((char)m_min_offset, m_glyphs[c].offset); } @@ -142,9 +140,9 @@ bool FTFont::load_font(const char *font_name, unsigned int font_size, bool outl) // heights on the characters we care about to get better values for the // text height and the ascender. m_max_advance.y = max_y - min_y; - ascender -= min_y; + ascender -= min_y; - int max_height = m_max_advance.y; + int max_height = m_max_advance.y; // Grow character size to power of 2 coord_def charsz(1,1); @@ -157,8 +155,8 @@ bool FTFont::load_font(const char *font_name, unsigned int font_size, bool outl) // Having to blow out 8-bit alpha values into full 32-bit textures is // kind of frustrating, but not all OpenGL implementations support the // "esoteric" ALPHA8 format and it's not like this texture is very large. - unsigned int width = 16 * charsz.x; - unsigned int height = 16 * charsz.y; + unsigned int width = 16 * charsz.x; + unsigned int height = 16 * charsz.y; unsigned char *pixels = new unsigned char[4 * width * height]; memset(pixels, 0, sizeof(unsigned char) * 4 * width * height); @@ -462,10 +460,9 @@ unsigned int FTFont::string_height(const char *text) { int height = 1; for (const char *itr = text; (*itr); itr++) - { if (*itr == '\n') height++; - } + return char_height() * height; } diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index a3879ab2a1..7b27ac04fe 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -10,6 +10,7 @@ #include "AppHdr.h" REVISION("$Rev$"); +#include <cmath> #include "cio.h" #include "debug.h" #include "describe.h" @@ -2663,7 +2664,7 @@ void MenuRegion::place_entries() continue; } - if (height + max_entry_height > end_height) + if (height + max_entry_height > end_height && column <= max_columns) { height = 0; column++; @@ -2715,6 +2716,8 @@ void MenuRegion::place_entries() int text_sy = m_entries[i].sy; text_sy += (entry_height - m_font_entry->char_height()) / 2; + // Split menu entries that don't fit into a single lines into two + // lines. if (Options.tile_menu_icons && text_sx + text_width > entry_start + column_width) { @@ -2848,7 +2851,7 @@ int MenuRegion::maxpagesize() const // Similar to the definition of max_entry_height in place_entries(). const int div = (Options.tile_menu_icons ? 32 - : m_font_entry->char_height()); + : m_font_entry->char_height() + 1); const int pagesize = ((my - more_height) / div) * m_max_columns; diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index e112c7cc34..f7f29e5bc9 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -744,7 +744,7 @@ int TilesFramework::getch_ck() int key = 0; - const unsigned int ticks_per_redraw = 50; + const unsigned int ticks_per_redraw = 80; unsigned int last_redraw_tick = 0; unsigned int res = Options.tile_tooltip_ms; |