@@ -91,7 +91,7 @@ void drawFontInit(void)
9191 GX_SetCullMode (GX_CULL_NONE );
9292}
9393
94- void drawString (int x , int y , char * string , float scale , bool centered , GXColor fontColor )
94+ void drawString (int x , int y , char * string , float scale , int align , GXColor fontColor )
9595{
9696 if (string == NULL ) {
9797 return ;
@@ -100,7 +100,7 @@ void drawString(int x, int y, char *string, float scale, bool centered, GXColor
100100 Mtx GXmodelView2D ;
101101 int strWidth = 0 ;
102102 int strHeight = font -> cell_height ;
103- if (centered )
103+ if (align )
104104 {
105105 char * string_work = string ;
106106 while (* string_work )
@@ -110,7 +110,7 @@ void drawString(int x, int y, char *string, float scale, bool centered, GXColor
110110 string_work ++ ;
111111 }
112112 }
113- guMtxTrans (GXmodelView2D , - strWidth /2 , - strHeight /2 , 0 );
113+ guMtxTrans (GXmodelView2D , - ( align * strWidth ) /2 , - strHeight /2 , 0 );
114114 guMtxScaleApply (GXmodelView2D , GXmodelView2D , scale , scale , 1 );
115115 guMtxTransApply (GXmodelView2D , GXmodelView2D , x , y , 0 );
116116 GX_LoadPosMtxImm (GXmodelView2D ,GX_PNMTX0 );
@@ -143,7 +143,7 @@ void drawString(int x, int y, char *string, float scale, bool centered, GXColor
143143 }
144144}
145145
146- void drawStringWithCaret (int x , int y , char * string , float scale , bool centered , GXColor fontColor , int caretPosition , GXColor caretColor )
146+ void drawStringWithCaret (int x , int y , char * string , float scale , int align , GXColor fontColor , int caretPosition , GXColor caretColor )
147147{
148148 if (string == NULL ) {
149149 string = "" ;
@@ -152,7 +152,7 @@ void drawStringWithCaret(int x, int y, char *string, float scale, bool centered,
152152 Mtx GXmodelView2D ;
153153 int strWidth = 0 ;
154154 int strHeight = font -> cell_height ;
155- if (centered )
155+ if (align )
156156 {
157157 char * string_work = string ;
158158 while (* string_work )
@@ -162,7 +162,7 @@ void drawStringWithCaret(int x, int y, char *string, float scale, bool centered,
162162 string_work ++ ;
163163 }
164164 }
165- guMtxTrans (GXmodelView2D , - strWidth /2 , - strHeight /2 , 0 );
165+ guMtxTrans (GXmodelView2D , - ( align * strWidth ) /2 , - strHeight /2 , 0 );
166166 guMtxScaleApply (GXmodelView2D , GXmodelView2D , scale , scale , 1 );
167167 guMtxTransApply (GXmodelView2D , GXmodelView2D , x , y , 0 );
168168 GX_LoadPosMtxImm (GXmodelView2D ,GX_PNMTX0 );
@@ -225,7 +225,7 @@ int GetCharsThatFitInWidth(char *string, int max, float scale)
225225}
226226
227227// maxSize is how far we can draw, abbreviate with "..." if we're going to exceed it.
228- void drawStringEllipsis (int x , int y , char * string , float scale , bool centered , GXColor fontColor , bool rotateVertical , int maxSize )
228+ void drawStringEllipsis (int x , int y , char * string , float scale , int align , GXColor fontColor , bool rotateVertical , int maxSize )
229229{
230230 if (string == NULL ) {
231231 return ;
@@ -239,7 +239,7 @@ void drawStringEllipsis(int x, int y, char *string, float scale, bool centered,
239239 }
240240 int strWidth = 0 ;
241241 int strHeight = font -> cell_height ;
242- if (centered )
242+ if (align )
243243 {
244244 char * string_work = string ;
245245 while (* string_work )
@@ -249,7 +249,7 @@ void drawStringEllipsis(int x, int y, char *string, float scale, bool centered,
249249 string_work ++ ;
250250 }
251251 }
252- guMtxApplyTrans (GXmodelView2D , GXmodelView2D , - strWidth /2 , - strHeight /2 , 0 );
252+ guMtxApplyTrans (GXmodelView2D , GXmodelView2D , - ( align * strWidth ) /2 , - strHeight /2 , 0 );
253253 guMtxScaleApply (GXmodelView2D , GXmodelView2D , scale , scale , 1 );
254254 guMtxTransApply (GXmodelView2D , GXmodelView2D , x , y , 0 );
255255 GX_LoadPosMtxImm (GXmodelView2D ,GX_PNMTX0 );
0 commit comments