1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00
- instructions in linux readme use cmake instead of autotools
- update autoconf files
This commit is contained in:
Ivan Savenko
2012-10-02 14:22:58 +00:00
parent 1cf99f7be1
commit 3542bfdc63
9 changed files with 92 additions and 92 deletions

View File

@ -1265,6 +1265,31 @@ void CBoundedLabel::setTxt(const std::string &Txt)
CLabel::setTxt(Txt);
}
void CBoundedLabel::blitLine(SDL_Surface *to, Point where, std::string what)
{
const Font &f = *graphics->fonts[font];
size_t begin = 0;
size_t end;
std::string delimeters = "{}";
size_t currDelimeter = 0;
do
{
end = what.find_first_of(delimeters[currDelimeter % 2], begin);
std::string toPrint = what.substr(begin, end);
if (currDelimeter % 2)
CSDL_Ext::printAt(toPrint, where.x, where.y, font, Colors::Jasmine, to);
else
CSDL_Ext::printAt(toPrint, where.x, where.y, font, color, to);
begin = end;
where.x += f.getWidth(toPrint.c_str());
currDelimeter++;
}
while (begin++ != std::string::npos);
}
void CBoundedLabel::showAll(SDL_Surface * to)
{
CIntObject::showAll(to);
@ -1290,10 +1315,7 @@ void CBoundedLabel::showAll(SDL_Surface * to)
x += (pos.w - f.getWidth(line.c_str())) / 2;
}
if(line[0] == '{' && line[line.size()-1] == '}')
CSDL_Ext::printAt(line, x, base_y + i*dy, font, Colors::Jasmine, to);
else
CSDL_Ext::printAt(line, x, base_y + i*dy, font, color, to);
blitLine(to, Point(x, base_y + i * dy), line);
}
}
@ -1386,10 +1408,7 @@ void CTextBox::showAll(SDL_Surface * to)
x -= slider->pos.w / 2 + 5;
}
if(line[0] == '{' && line[line.size()-1] == '}')
CSDL_Ext::printAt(line, x, base_y + i*dy, font, Colors::Jasmine, to);
else
CSDL_Ext::printAt(line, x, base_y + i*dy, font, color, to);
blitLine(to, Point(x, base_y + i * dy), line);
}
}