diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 91798548a..376329f08 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -913,9 +913,9 @@ void D_RegisterClientCommands(void) #ifdef HAVE_OPENMPT CV_RegisterVar(&cv_modfilter); CV_RegisterVar(&cv_amigafilter); -//#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 - //CV_RegisterVar(&cv_amigatype); -//#endif +#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 + CV_RegisterVar(&cv_amigatype); +#endif //CV_RegisterVar(&cv_mptdither); #endif diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 9145a6ba9..4c291c62b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2282,7 +2282,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // From PrBoom: // -// e6y: Check whether the player can look beyond this line, rturns true if we can't +// e6y: Check whether the player can look beyond this line, returns true if we can't // boolean checkforemptylines = true; diff --git a/src/m_menu.c b/src/m_menu.c index 56e68dca6..bf20fad58 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1413,9 +1413,9 @@ static menuitem_t OP_SoundAdvancedMenu[] = {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 22}, {IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 42}, -//#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 - //{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62}, -//#endif +#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 + {IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62}, +#endif //{IT_STRING | IT_CVAR, NULL, "Dithering", &cv_mptdither, 82} }; #endif diff --git a/src/s_sound.c b/src/s_sound.c index 8490111b4..aa20c0f17 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -67,9 +67,9 @@ static void PlaySoundIfUnfocused_OnChange(void); #ifdef HAVE_OPENMPT static void ModFilter_OnChange(void); static void AmigaFilter_OnChange(void); -//#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 -//static void AmigaType_OnChange(void); -//#endif +#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 +static void AmigaType_OnChange(void); +#endif //static void MPTDither_OnChange(void); #endif @@ -147,14 +147,14 @@ consvar_t cv_modfilter = {"modfilter", "4", CV_SAVE|CV_CALL, interpolationfilter static CV_PossibleValue_t amigafilter_cons_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; consvar_t cv_amigafilter = {"amigafilter", "1", CV_SAVE|CV_CALL, amigafilter_cons_t, AmigaFilter_OnChange, 0, NULL, NULL, 0, 0, NULL}; -/* + #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 -static CV_PossibleValue_t amigatype_cons_t[] = {{0, "auto"}, {1, "a500"}, {2, "a1200"}, {4, "unfiltered"}, {0, NULL}}; -consvar_t cv_amigatype = {"amigatype", "1", CV_SAVE|CV_CALL, amigatype_cons_t, AmigaType_OnChange, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t amigatype_cons_t[] = {{0, "auto"}, {1, "a500"}, {2, "a1200"}, {3, "unfiltered"}, {0, NULL}}; +consvar_t cv_amigatype = {"amigatype", "0", CV_SAVE|CV_CALL, amigatype_cons_t, AmigaType_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif -static CV_PossibleValue_t mptdither_cons_t[] = {{0, "No dithering"}, {1, "Default"}, {2, "Rectangular 0.5 bit"}, {3, "Rectangular 1 bit"}, {0, NULL}}; -consvar_t cv_mptdither = {"mptdither", "1", CV_SAVE|CV_CALL, mptdither_cons_t, MPTDither_OnChange, 0, NULL, NULL, 0, 0, NULL};*/ +//static CV_PossibleValue_t mptdither_cons_t[] = {{0, "No dithering"}, {1, "Default"}, {2, "Rectangular 0.5 bit"}, {3, "Rectangular 1 bit"}, {0, NULL}}; +//consvar_t cv_mptdither = {"mptdither", "1", CV_SAVE|CV_CALL, mptdither_cons_t, MPTDither_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif #define S_MAX_VOLUME 127 @@ -2219,15 +2219,16 @@ void AmigaFilter_OnChange(void) openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigafilter.value ? "1" : "0"); } -/* + #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 void AmigaType_OnChange(void) { if (openmpt_mhandle) - openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigatype.value ? "1" : "0"); + openmpt_module_ctl_set_text(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigatype.string); } #endif - + +/* void MPTDither_OnChange(void) { if (openmpt_mhandle) diff --git a/src/s_sound.h b/src/s_sound.h index 97a4770fb..a26e0ec86 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -45,9 +45,9 @@ extern consvar_t cv_playsoundifunfocused; #ifdef HAVE_OPENMPT extern consvar_t cv_modfilter; extern consvar_t cv_amigafilter; -//#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 -//extern consvar_t cv_amigatype; -//#endif +#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 +extern consvar_t cv_amigatype; +#endif //extern consvar_t cv_mptdither; #endif diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 9762c382f..6300f53e8 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1258,7 +1258,7 @@ boolean I_PlaySong(boolean looping) openmpt_module_select_subsong(openmpt_mhandle, 0); openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigafilter.value ? "1" : "0"); #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 - openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga_type", "auto"); + openmpt_module_ctl_set_text(openmpt_mhandle, "render.resampler.emulate_amiga_type", cv_amigatype.string); #endif openmpt_module_ctl_set(openmpt_mhandle, "dither", "1"); openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, cv_modfilter.value);