From e971005153bca7816f777b8407224f3fb1533245 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 9 Oct 2017 07:36:48 +0000 Subject: [PATCH] Menus: Use SMALLFNTCURSOR for a text caret in the absence of a SPINNINGNUKEICON tile. git-svn-id: https://svn.eduke32.com/eduke32@6464 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/menus.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index a76868b43..3280c0582 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -141,17 +141,30 @@ static void Menu_DrawCursorCommon(int32_t x, int32_t y, int32_t z, int32_t picnu } static void Menu_DrawCursorLeft(int32_t x, int32_t y, int32_t z) { + if (KXDWN) return; Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON+((totalclock>>3)%7)); } static void Menu_DrawCursorRight(int32_t x, int32_t y, int32_t z) { + if (KXDWN) return; Menu_DrawCursorCommon(x, y, z, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7)); } +static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2s_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1) +{ + vec2_t const adjsiz = { siz.x<<15, siz.y<<16 }; + Menu_DrawCursorCommon(x + scale(adjsiz.x, h, adjsiz.y), y, divscale16(h, adjsiz.y), picnum, ydim_upper, ydim_lower); +} static void Menu_DrawCursorText(int32_t x, int32_t y, int32_t h, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1) { vec2s_t const & siz = tilesiz[SPINNINGNUKEICON]; - vec2_t const adjsiz = { siz.x<<15, siz.y<<16 }; - Menu_DrawCursorCommon(x + scale(adjsiz.x, h, adjsiz.y), y, divscale16(h, adjsiz.y), SPINNINGNUKEICON+((totalclock>>3)%7), ydim_upper, ydim_lower); + + if (KXDWN || siz.x == 0) + { + Menu_DrawCursorTextTile(x, y, h, SMALLFNTCURSOR, tilesiz[SMALLFNTCURSOR], ydim_upper, ydim_lower); + return; + } + + Menu_DrawCursorTextTile(x, y, h, SPINNINGNUKEICON+((totalclock>>3)%7), siz, ydim_upper, ydim_lower); } extern int32_t g_quitDeadline;