@@ -120,9 +120,9 @@ CP_itemtype SndMenu[] = {
120120};
121121
122122#ifdef JAPAN
123- enum { CTL_MOUSEENABLE, CTL_JOYENABLE, CTL_JOY2BUTTONUNKNOWN, CTL_GAMEPADUNKONWN, CTL_MOUSESENS, CTL_CUSTOMIZE };
123+ enum { CTL_MOUSEENABLE, CTL_JOYENABLE, CTL_JOY2BUTTONUNKNOWN, CTL_GAMEPADUNKONWN, CTL_MOUSESENS, CTL_JOYSENS, CTL_CUSTOMIZE };
124124#else
125- enum { CTL_MOUSEENABLE, CTL_MOUSESENS, CTL_JOYENABLE, CTL_CUSTOMIZE };
125+ enum { CTL_MOUSEENABLE, CTL_MOUSESENS, CTL_JOYENABLE, CTL_JOYSENS, CTL_CUSTOMIZE };
126126#endif
127127
128128CP_itemtype CtlMenu[] = {
@@ -132,11 +132,13 @@ CP_itemtype CtlMenu[] = {
132132 {0 , " " , 0 },
133133 {0 , " " , 0 },
134134 {0 , " " , MouseSensitivity},
135+ {0 , " " , JoySensitivity},
135136 {1 , " " , CustomControls}
136137#else
137138 {0 , STR_MOUSEEN, 0 },
138139 {0 , STR_SENS, MouseSensitivity},
139140 {0 , STR_JOYEN, 0 },
141+ {0 , STR_JOYSENS, JoySensitivity},
140142 {1 , STR_CUSTOM, CustomControls}
141143#endif
142144};
@@ -1985,6 +1987,7 @@ CP_Control (int)
19851987 break ;
19861988
19871989 case CTL_MOUSESENS:
1990+ case CTL_JOYSENS:
19881991 case CTL_CUSTOMIZE:
19891992 DrawCtlScreen ();
19901993 MenuFadeIn ();
@@ -2009,7 +2012,7 @@ CP_Control (int)
20092012// DRAW MOUSE SENSITIVITY SCREEN
20102013//
20112014void
2012- DrawMouseSens ( void )
2015+ DrawSlider ( int value, const char *sorg )
20132016{
20142017#ifdef JAPAN
20152018 CA_CacheScreen (S_MOUSESENSPIC);
@@ -2026,7 +2029,7 @@ DrawMouseSens (void)
20262029 WindowW = 320 ;
20272030 PrintY = 82 ;
20282031 SETFONTCOLOR (READCOLOR, BKGDCOLOR);
2029- US_CPrint (STR_MOUSEADJ );
2032+ US_CPrint (sorg );
20302033
20312034 SETFONTCOLOR (TEXTCOLOR, BKGDCOLOR);
20322035#ifdef SPANISH
@@ -2046,13 +2049,86 @@ DrawMouseSens (void)
20462049
20472050 VWB_Bar (60 , 97 , 200 , 10 , TEXTCOLOR);
20482051 DrawOutline (60 , 97 , 200 , 10 , 0 , HIGHLIGHT);
2049- DrawOutline (60 + 20 * mouseadjustment , 97 , 20 , 10 , 0 , READCOLOR);
2050- VWB_Bar (61 + 20 * mouseadjustment , 98 , 19 , 9 , READHCOLOR);
2052+ DrawOutline (60 + 20 * value , 97 , 20 , 10 , 0 , READCOLOR);
2053+ VWB_Bar (61 + 20 * value , 98 , 19 , 9 , READHCOLOR);
20512054
20522055 VW_UpdateScreen ();
20532056 MenuFadeIn ();
20542057}
20552058
2059+ // /////////////////////////
2060+ //
2061+ // ADJUST MOUSE SENSITIVITY
2062+ //
2063+ int
2064+ JoySensitivity (int )
2065+ {
2066+ ControlInfo ci;
2067+ int exit = 0 , oldJA;
2068+
2069+
2070+ oldJA = joyadjustment;
2071+ DrawSlider (joyadjustment, STR_JOYADJ);
2072+ do
2073+ {
2074+ SDL_Delay (5 );
2075+ ReadAnyControl (&ci);
2076+ switch (ci.dir )
2077+ {
2078+ case dir_North:
2079+ case dir_West:
2080+ if (joyadjustment)
2081+ {
2082+ joyadjustment--;
2083+ VWB_Bar (60 , 97 , 200 , 10 , TEXTCOLOR);
2084+ DrawOutline (60 , 97 , 200 , 10 , 0 , HIGHLIGHT);
2085+ DrawOutline (60 + 20 * joyadjustment, 97 , 20 , 10 , 0 , READCOLOR);
2086+ VWB_Bar (61 + 20 * joyadjustment, 98 , 19 , 9 , READHCOLOR);
2087+ VW_UpdateScreen ();
2088+ SD_PlaySound (MOVEGUN1SND);
2089+ TicDelay (20 );
2090+ }
2091+ break ;
2092+
2093+ case dir_South:
2094+ case dir_East:
2095+ if (joyadjustment < 9 )
2096+ {
2097+ joyadjustment++;
2098+ VWB_Bar (60 , 97 , 200 , 10 , TEXTCOLOR);
2099+ DrawOutline (60 , 97 , 200 , 10 , 0 , HIGHLIGHT);
2100+ DrawOutline (60 + 20 * joyadjustment, 97 , 20 , 10 , 0 , READCOLOR);
2101+ VWB_Bar (61 + 20 * joyadjustment, 98 , 19 , 9 , READHCOLOR);
2102+ VW_UpdateScreen ();
2103+ SD_PlaySound (MOVEGUN1SND);
2104+ TicDelay (20 );
2105+ }
2106+ break ;
2107+ default :
2108+ break ;
2109+ }
2110+
2111+ if (ci.button0 || Keyboard[sc_Space] || Keyboard[sc_Enter])
2112+ exit = 1 ;
2113+ else if (ci.button1 || Keyboard[sc_Escape])
2114+ exit = 2 ;
2115+
2116+ }
2117+ while (!exit);
2118+
2119+ if (exit == 2 )
2120+ {
2121+ joyadjustment = oldJA;
2122+ SD_PlaySound (ESCPRESSEDSND);
2123+ }
2124+ else
2125+ SD_PlaySound (SHOOTSND);
2126+
2127+ WaitKeyUp ();
2128+ MenuFadeOut ();
2129+
2130+ return 0 ;
2131+ }
20562132
20572133// /////////////////////////
20582134//
@@ -2066,7 +2142,7 @@ MouseSensitivity (int)
20662142
20672143
20682144 oldMA = mouseadjustment;
2069- DrawMouseSens ( );
2145+ DrawSlider (mouseadjustment, STR_MOUSEADJ );
20702146 do
20712147 {
20722148 SDL_Delay (5 );
@@ -2145,14 +2221,17 @@ DrawCtlScreen (void)
21452221 DrawStripes (10 );
21462222 VWB_DrawPic (80 , 0 , C_CONTROLPIC);
21472223 VWB_DrawPic (112 , 184 , C_MOUSELBACKPIC);
2148- DrawWindow (CTL_X - 8 , CTL_Y - 5 , CTL_W, CTL_H , BKGDCOLOR);
2224+ DrawWindow (CTL_X - 8 , CTL_Y - 5 , CTL_W, lengthof (CtlMenu) * 15 , BKGDCOLOR);
21492225#endif
21502226 WindowX = 0 ;
21512227 WindowW = 320 ;
21522228 SETFONTCOLOR (TEXTCOLOR, BKGDCOLOR);
21532229
21542230 if (IN_JoyPresent ())
2231+ {
21552232 CtlMenu[CTL_JOYENABLE].active = 1 ;
2233+ CtlMenu[CTL_JOYSENS].active = 1 ;
2234+ }
21562235
21572236 if (MousePresent)
21582237 {
@@ -2712,7 +2791,7 @@ DrawCustomScreen (void)
27122791
27132792#ifndef SPEAR
27142793 PrintY = CST_Y;
2715- US_CPrint (" Game Controller \n " );
2794+ US_CPrint (" Gamepad \n " );
27162795#else
27172796 PrintY = CST_Y + 13 ;
27182797 VWB_DrawPic (128 , 48 , C_MOUSEPIC);
0 commit comments