Fixed progressive drawing of texts with UTF-8 encoding.

This commit is contained in:
Sofronius 2003-11-23 23:12:27 +00:00
parent 70424f113c
commit f508eaa262
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -91,10 +91,10 @@ void show_intro(display& screen, config& data)
int xpos = textx, ypos = texty;
size_t height = 0;
std::string buf;
for(;;) {
std::string buf;
if(j != story.end()) {
char c = *j;
unsigned char c = *j;
if(c == ' ' && cur_length >= max_length) {
xpos = textx;
ypos += height;
@ -102,7 +102,7 @@ void show_intro(display& screen, config& data)
} else {
buf.resize(buf.size()+1);
buf[buf.size()-1] = c;
//if this is definitely a non-UTF8 character, output it now
if(c < 128 || j+1 == story.end()) {
const SDL_Rect rect = font::draw_text(&screen,