Code clearity improvements to Fonticons patch

This commit is contained in:
Jan 2021-09-20 20:40:42 +02:00
parent a9fa476133
commit de107be4e0
2 changed files with 8 additions and 2 deletions

View File

@ -169,9 +169,13 @@ namespace Components
len += 1.0f;
}
}
*p = 0;
Game::cgsArray[0].teamChatMsgTimes[Game::cgsArray[0].teamChatPos % chatHeight] = Game::cgArray[0].time;
if (Game::cgsArray[0].teamChatPos++ + 1 - Game::cgsArray[0].teamLastChatPos > chatHeight)
Game::cgsArray[0].teamChatPos++;
if (Game::cgsArray[0].teamChatPos - Game::cgsArray[0].teamLastChatPos > chatHeight)
Game::cgsArray[0].teamLastChatPos = Game::cgsArray[0].teamChatPos + 1 - chatHeight;
}

View File

@ -395,7 +395,7 @@ namespace Components
UpdateAutocompleteContext(autocompleteContext, edit, font, ww);
if (autocompleteContext.autocompleteActive)
{
DrawAutocomplete(autocompleteContext, std::floor(xx), /*std::floor(*/ yy/*)*/, font, ww, hh);
DrawAutocomplete(autocompleteContext, std::floor(xx), std::floor(yy), font, ww, hh);
}
}
@ -1075,6 +1075,8 @@ namespace Components
const auto width = text[1];
const auto materialNameLength = text[3];
// This is how the game calculates width and height. Probably some 1 byte floating point number.
// Details to be investigated if necessary.
const auto v9 = font->pixelHeight * (width - 16) + 16;
const auto w = ((((v9 >> 24) & 0x1F) + v9) >> 5);