From c63beef346b3659f0313a8d15a860eaca8275ad3 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 16 Apr 2021 13:47:05 +0200 Subject: [PATCH] remove mouse sensitivity limit for the in-game thermometer --- Source/m_menu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/m_menu.c b/Source/m_menu.c index eeaf562c..ec62646d 100644 --- a/Source/m_menu.c +++ b/Source/m_menu.c @@ -1366,10 +1366,10 @@ void M_DrawMouse(void) V_DrawPatchDirect (60,38,0,W_CacheLumpName("M_MSENS",PU_CACHE)); //jff 4/3/98 clamp horizontal sensitivity display - mhmx = mouseSensitivity_horiz>23? 23 : mouseSensitivity_horiz; + mhmx = mouseSensitivity_horiz; // >23? 23 : mouseSensitivity_horiz; M_DrawThermo(MouseDef.x,MouseDef.y+LINEHEIGHT*(mouse_horiz+1),24,mhmx); //jff 4/3/98 clamp vertical sensitivity display - mvmx = mouseSensitivity_vert>23? 23 : mouseSensitivity_vert; + mvmx = mouseSensitivity_vert; // >23? 23 : mouseSensitivity_vert; M_DrawThermo(MouseDef.x,MouseDef.y+LINEHEIGHT*(mouse_vert+1),24,mvmx); } @@ -1409,7 +1409,7 @@ void M_Mouse(int choice, int *sens) --*sens; break; case 1: - if (*sens < 23) +// if (*sens < 23) ++*sens; break; } @@ -5844,6 +5844,7 @@ void M_DrawThermo(int x,int y,int thermWidth,int thermDot ) { int xx; int i; + char num[4]; xx = x; V_DrawPatchDirect (xx,y,0,W_CacheLumpName("M_THERML",PU_CACHE)); @@ -5855,6 +5856,14 @@ void M_DrawThermo(int x,int y,int thermWidth,int thermDot ) } V_DrawPatchDirect (xx,y,0,W_CacheLumpName("M_THERMR",PU_CACHE)); + // [FG] write numerical values next to thermometer + M_snprintf(num, 4, "%3d", thermDot); + M_WriteText(xx + 8, y + 3, num); + + // [FG] do not crash anymore if value exceeds thermometer range + if (thermDot >= thermWidth) + thermDot = thermWidth - 1; + V_DrawPatchDirect ((x+8) + thermDot*8,y, 0,W_CacheLumpName("M_THERMO",PU_CACHE)); }