diff --git a/src/console.c b/src/console.c index 3f5b6bcf1..36b167cdf 100644 --- a/src/console.c +++ b/src/console.c @@ -33,6 +33,8 @@ #include "d_main.h" #include "m_menu.h" #include "m_textinput.h" +#include "m_emotes.h" +#include "i_time.h" #include "filesrch.h" #include "m_misc.h" @@ -1450,7 +1452,18 @@ static void CON_DrawHudlines(void) } if (c >= con_width) break; - if (*p < HU_FONTSTART) + + int emotelen; + emote_t *emote; + + if ((emote = M_VerifyEmote((const char *)p, &emotelen))) + { + M_DrawScaledEmote(x<= HU_FONTSTART) + if ((emote = M_VerifyEmote(w_chat_buf+i, &emotelen))) + { + HU_DrawScaledEmote((HU_INPUTX + c)<= HU_FONTSTART) //Hurdler: isn't it better like that? { //charwidth = (fontv[HU_FONT].font[w_chat[i]-HU_FONTSTART]->width) * con_scalefactor; V_DrawCharacter(HU_INPUTX + c, y, w_chat_buf[i] | cv_constextsize.value | V_NOSCALESTART | t, true); @@ -1985,6 +1986,13 @@ static void HU_DrawChat_Old(void) ++i; + if (w_chat.cursor == i && hu_tick < 4) + { + INT32 cursorx = (HU_INPUTX+c+charwidth < vid.width) ? (HU_INPUTX + c + charwidth) : (HU_INPUTX); // we may have to go down. + INT32 cursory = (cursorx != HU_INPUTX) ? (y) : (y+charheight); + V_DrawCharacter(cursorx, cursory+2*con_scalefactor, '_' |cv_constextsize.value | V_NOSCALESTART|t, true); + } + c += charwidth; if (c >= vid.width) { diff --git a/src/m_emotes.cpp b/src/m_emotes.cpp index dd6465ac4..1b5498e1d 100644 --- a/src/m_emotes.cpp +++ b/src/m_emotes.cpp @@ -237,7 +237,7 @@ emote_t *M_VerifyEmote(const char *name, int *emotelen) return match; } -void M_DrawEmote(INT32 x, INT32 y, emote_t *emote, tic_t anim, INT32 flags) +void M_DrawScaledEmote(fixed_t x, fixed_t y, fixed_t scale, emote_t *emote, tic_t anim, INT32 flags) { if (emote->numframes == 0) return; @@ -247,13 +247,8 @@ void M_DrawEmote(INT32 x, INT32 y, emote_t *emote, tic_t anim, INT32 flags) const int CHARHEIGHT = 6; - fixed_t scale = FRACUNIT; - - x *= FRACUNIT; - y *= FRACUNIT; - if (emotepatch->width > EMOTEWIDTH) - scale = (FRACUNIT/emotepatch->width)*EMOTEWIDTH; + scale = FixedMul(scale, (FRACUNIT/emotepatch->width)*EMOTEWIDTH); else if (emotepatch->width < EMOTEWIDTH) x += (EMOTEWIDTH-emotepatch->width)*FRACUNIT/2; diff --git a/src/m_emotes.h b/src/m_emotes.h index 2f11c678c..8b062701f 100644 --- a/src/m_emotes.h +++ b/src/m_emotes.h @@ -6,6 +6,7 @@ extern "C" { #endif #include "doomdef.h" +#include "m_fixed.h" #include "command.h" extern consvar_t cv_emotes; @@ -39,7 +40,8 @@ emote_t *M_VerifyEmote(const char *name, int *emotelen); // Draw the emote, anim should be some kind of timer ticking every game tic // for animated emotes -void M_DrawEmote(INT32 x, INT32 y, emote_t *emote, tic_t anim, INT32 flags); +#define M_DrawEmote(x, y, emote, anim, flags) M_DrawScaledEmote((x)<