Skip to content

Commit

Permalink
Simplify drawing cursor.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Sep 5, 2024
1 parent 600328d commit 93ab30d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/common/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 93ab30d

Please sign in to comment.