- updated common code from screenjob branch.

That is, all parts not related to cutscenes.
This commit is contained in:
Christoph Oelckers 2021-08-03 12:30:44 +02:00
commit c1a8776a15
16 changed files with 163 additions and 21 deletions

View file

@ -98,8 +98,7 @@ unsigned FCommandBuffer::CalcCellSize(unsigned length)
unsigned cellcount = 0;
for (unsigned i = 0; i < length; i++)
{
int w;
NewConsoleFont->GetChar(Text[i], CR_UNTRANSLATED, &w);
int w = NewConsoleFont->GetCharWidth(Text[i]);
cellcount += w / 9;
}
return cellcount;
@ -112,8 +111,7 @@ unsigned FCommandBuffer::CharsForCells(unsigned cellin, bool *overflow)
int cells = cellin;
while (cells > 0)
{
int w;
NewConsoleFont->GetChar(Text[chars++], CR_UNTRANSLATED, &w);
int w = NewConsoleFont->GetCharWidth(Text[chars++]);
cells -= w / 9;
}
*overflow = (cells < 0);