diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/guic.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/output.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/guic.cc b/crawl-ref/source/guic.cc index 3b3671f6b6..9e3eb26505 100644 --- a/crawl-ref/source/guic.cc +++ b/crawl-ref/source/guic.cc @@ -701,6 +701,10 @@ void TextRegionClass::textbackground(int col) void TextRegionClass::cgotoxy(int x, int y) { + ASSERT(x >= 1); + ASSERT(y >= 1); + ASSERT(x <= text_mode->mx); + ASSERT(y <= text_mode->my); print_x = x-1; print_y = y-1; diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 94a331dfcf..b931ff01bf 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -904,7 +904,7 @@ void redraw_skill(const std::string &your_name, const std::string &class_name) std::string title = your_name + " the " + class_name; int in_len = title.length(); - const int WIDTH = 40; // use crawl_view.hudsz.x instead? + const int WIDTH = crawl_view.hudsz.x; if (in_len > WIDTH) { in_len -= 3; // what we're getting back from removing "the" @@ -923,7 +923,7 @@ void redraw_skill(const std::string &your_name, const std::string &class_name) cgotoxy(1, 1, GOTO_STAT); textcolor( YELLOW ); - cprintf( "%-41s", title.c_str() ); + cprintf( "%-*s", WIDTH, title.c_str() ); cgotoxy(1, 2, GOTO_STAT); cprintf("%s", species_name( you.species, you.experience_level ).c_str()); |