Use sizeof instead of constant

This commit is contained in:
Robert Müller 2022-06-30 19:46:33 +02:00
parent d5594d8bd6
commit d9b0304adb

View file

@ -455,7 +455,7 @@ void CMapImages::UpdateEntityLayerText(void *pTexBuffer, int ImageColorChannelCo
if(MaxNumber == -1)
MaxNumber = CurrentNumber * 10 - 1;
str_format(aBuf, 4, "%d", CurrentNumber);
str_format(aBuf, sizeof(aBuf), "%d", CurrentNumber);
int CurrentNumberSuitableFontSize = TextRender()->AdjustFontSize(aBuf, DigitsCount, TextureSize, MaxWidth);
int UniversalSuitableFontSize = CurrentNumberSuitableFontSize * 0.92f; // should be smoothed enough to fit any digits combination
@ -464,7 +464,7 @@ void CMapImages::UpdateEntityLayerText(void *pTexBuffer, int ImageColorChannelCo
for(; CurrentNumber <= MaxNumber; ++CurrentNumber)
{
str_format(aBuf, 4, "%d", CurrentNumber);
str_format(aBuf, sizeof(aBuf), "%d", CurrentNumber);
float x = (CurrentNumber % 16) * 64;
float y = (CurrentNumber / 16) * 64;