From: havoc Date: Sat, 27 May 2006 19:58:53 +0000 (+0000) Subject: centerprint no longer counts color codes when centering lines X-Git-Tag: xonotic-v0.1.0preview~3976 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=50c4b3ff9165438604c2cba22dd9636043ebc5d6;p=xonotic%2Fdarkplaces.git centerprint no longer counts color codes when centering lines git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6394 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 56fb1ff1..19f06842 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -125,11 +125,19 @@ void SCR_DrawCenterString (void) color = -1; do { - // scan the width of the line + // scan the number of characters on the line, not counting color codes + int chars = 0; for (l=0 ; l= '0' && start[l+1] <= '9')) + l++; + else + chars++; + } + x = (vid_conwidth.integer - chars*8)/2; if (l > 0) { if (remaining < l)