diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index 4425bfd43..5831d1def 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -361,8 +361,7 @@ Draw_nString (int x, int y, const char *str, int count) qfglBegin (GL_QUADS); while (count-- && *str) { - if ((num = *str++) != 32) // Don't render spaces - { + if ((num = *str++) != 32) { // Don't render spaces frow = (num >> 4) * CELL_SIZE; fcol = (num & 15) * CELL_SIZE; @@ -375,7 +374,7 @@ Draw_nString (int x, int y, const char *str, int count) qfglTexCoord2f (fcol, frow + CELL_SIZE); qfglVertex2f (x, y + 8); } - x+=8; + x += 8; } qfglEnd (); } diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index 9bfdda3fa..35859f918 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -198,7 +198,7 @@ Draw_Init (void) It can be clipped to the top of the screen to allow the console to be smoothly scrolled off. */ -void +inline void Draw_Character (int x, int y, unsigned int num) { byte *dest; @@ -265,9 +265,9 @@ Draw_String (int x, int y, const char *str) void Draw_nString (int x, int y, const char *str, int count) { - int size; - for (size = 0; size < count; size++, x +=8) { + while (count-- && *str) { Draw_Character (x, y, *str++); + x += 8; } } diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index 951f9ad8f..ca833c89a 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -327,9 +327,9 @@ Draw_String (int x, int y, const char *str) void Draw_nString (int x, int y, const char *str, int count) { - int size; - for (size = 0; size < count; size++, x += 8) { + while (count-- && *str) { Draw_Character (x, y, *str++); + x += 8; } }