Skip to content

Commit 35e0cc2

Browse files
author
jK
committed
glFont.cpp: fix incorrect EnlargeArrays() params
1 parent f8e85c1 commit 35e0cc2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rts/Rendering/glFont.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ void CglFont::RenderString(float x, float y, const float& scaleX, const float& s
16991699
const float lineHeight_ = scaleY * lineHeight;
17001700
unsigned int length = (unsigned int)str.length();
17011701

1702-
va->EnlargeArrays(length * 16 * sizeof(float), 0);
1702+
va->EnlargeArrays(length * 4, 0, VA_SIZE_2DT);
17031703

17041704
int skippedLines;
17051705
bool endOfString, colorChanged;
@@ -1751,8 +1751,8 @@ void CglFont::RenderStringShadow(float x, float y, const float& scaleX, const fl
17511751
const float lineHeight_ = scaleY * lineHeight;
17521752
unsigned int length = (unsigned int)str.length();
17531753

1754-
va->EnlargeArrays(length * 16 * sizeof(float), 0);
1755-
va2->EnlargeArrays(length * 16 * sizeof(float), 0);
1754+
va->EnlargeArrays(length * 4, 0, VA_SIZE_2DT);
1755+
va2->EnlargeArrays(length * 4, 0, VA_SIZE_2DT);
17561756

17571757
int skippedLines;
17581758
bool endOfString, colorChanged;
@@ -1813,8 +1813,8 @@ void CglFont::RenderStringOutlined(float x, float y, const float& scaleX, const
18131813
const float lineHeight_ = scaleY * lineHeight;
18141814
unsigned int length = (unsigned int)str.length();
18151815

1816-
va->EnlargeArrays(length * 16 * sizeof(float), 0);
1817-
va2->EnlargeArrays(length * 16 * sizeof(float), 0);
1816+
va->EnlargeArrays(length * 4, 0, VA_SIZE_2DT);
1817+
va2->EnlargeArrays(length * 4, 0, VA_SIZE_2DT);
18181818

18191819
int skippedLines;
18201820
bool endOfString, colorChanged;

0 commit comments

Comments
 (0)