mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Simplify
This commit is contained in:
parent
32a485535d
commit
cf898541fd
26
src/text.cpp
26
src/text.cpp
@ -88,30 +88,22 @@ Sint32 GetCharWidth (const char *&c, Sint32 font)
|
|||||||
*/
|
*/
|
||||||
void DrawText (CPixmap *pPixmap, POINT pos, const char *pText, Sint32 font)
|
void DrawText (CPixmap *pPixmap, POINT pos, const char *pText, Sint32 font)
|
||||||
{
|
{
|
||||||
Sint32 rank;
|
Sint32 rank;
|
||||||
|
|
||||||
if (font == FONTLITTLE)
|
while (*pText != '\0')
|
||||||
{
|
{
|
||||||
while (*pText != 0)
|
rank = GetOffset (pText);
|
||||||
{
|
|
||||||
rank = GetOffset (pText);
|
|
||||||
pPixmap->DrawIcon (-1, CHLITTLE, rank, pos);
|
|
||||||
|
|
||||||
pos.x += GetCharWidth (pText, font);
|
if (font != FONTLITTLE)
|
||||||
pText++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while (*pText != 0)
|
|
||||||
{
|
{
|
||||||
rank = GetOffset (pText);
|
|
||||||
rank += 128 * font;
|
rank += 128 * font;
|
||||||
pPixmap->DrawIcon (-1, CHTEXT, rank, pos);
|
pPixmap->DrawIcon (-1, CHTEXT, rank, pos);
|
||||||
|
|
||||||
pos.x += GetCharWidth (pText, font);
|
|
||||||
pText++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
pPixmap->DrawIcon (-1, CHLITTLE, rank, pos);
|
||||||
|
|
||||||
|
pos.x += GetCharWidth (pText, font);
|
||||||
|
pText++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user