From 93ab30de5f50778f5c1da051294eb09ecbb32715 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 5 Sep 2024 12:14:02 +0300 Subject: [PATCH] Simplify drawing cursor. --- src/common/field.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/field.c b/src/common/field.c index 9bdf1e096..8e1ac8ecf 100644 --- a/src/common/field.c +++ b/src/common/field.c @@ -276,12 +276,10 @@ int IF_Draw(const inputField_t *field, int x, int y, int flags, qhandle_t font) // draw text ret = R_DrawString(x, y, flags, field->visibleChars, text + offset, font); - if (flags & UI_DRAWCURSOR) { - // draw blinking cursor - if ((com_localTime >> 8) & 1) { - int c = Key_GetOverstrikeMode() ? 11 : '_'; - R_DrawChar(x + cursorPos * CHAR_WIDTH, y, flags, c, font); - } + // draw blinking cursor + if (flags & UI_DRAWCURSOR && com_localTime & BIT(8)) { + R_DrawChar(x + cursorPos * CHAR_WIDTH, y, flags, + Key_GetOverstrikeMode() ? 11 : '_', font); } return ret;