From 50c4b3ff9165438604c2cba22dd9636043ebc5d6 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 27 May 2006 19:58:53 +0000 Subject: [PATCH] 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 --- cl_screen.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 2.39.2