From 777f88702d07a47249604205ec163cf5c7bd8270 Mon Sep 17 00:00:00 2001 From: FreakyMutantMan Date: Fri, 1 Nov 2024 20:04:45 -0700 Subject: [PATCH 1/6] testing menu change --- src/menus/options-profiles-edit-accessibility.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/menus/options-profiles-edit-accessibility.cpp b/src/menus/options-profiles-edit-accessibility.cpp index 14dd0643d..a4d00c7fa 100644 --- a/src/menus/options-profiles-edit-accessibility.cpp +++ b/src/menus/options-profiles-edit-accessibility.cpp @@ -137,6 +137,9 @@ menuitem_t OPTIONS_ProfileAccessibility[] = { {IT_STRING | IT_CVAR, "Input Display", "Show virtual controller on the HUD.", NULL, {.cvar = &cv_drawinput}, 0, 0}, + + {IT_STRING | IT_CVAR, "It's a me", "Hi hi hello.", + NULL, {.cvar = &cv_globalsaturation}, 0, 0}, }; menu_t OPTIONS_ProfileAccessibilityDef = { From a92b116c7725e23279ae267c6775b6c35505064f Mon Sep 17 00:00:00 2001 From: FreakyMutantMan Date: Fri, 1 Nov 2024 21:34:53 -0700 Subject: [PATCH 2/6] Basic color profile menu functionality. --- src/k_menu.h | 3 + src/menus/CMakeLists.txt | 1 + .../options-profiles-edit-accessibility.cpp | 3 - src/menus/options-video-1.c | 3 + src/menus/options-video-colorprofile.c | 120 ++++++++++++++++++ 5 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 src/menus/options-video-colorprofile.c diff --git a/src/k_menu.h b/src/k_menu.h index 116caa793..22cd3e40d 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -462,6 +462,9 @@ extern menu_t OPTIONS_VideoDef; extern menuitem_t OPTIONS_VideoModes[]; extern menu_t OPTIONS_VideoModesDef; +extern menuitem_t OPTIONS_VideoColorProfile[]; +extern menu_t OPTIONS_VideoColorProfileDef; + extern menuitem_t OPTIONS_VideoAdvanced[]; extern menu_t OPTIONS_VideoAdvancedDef; diff --git a/src/menus/CMakeLists.txt b/src/menus/CMakeLists.txt index 80d3c261e..c2e57a66e 100644 --- a/src/menus/CMakeLists.txt +++ b/src/menus/CMakeLists.txt @@ -28,6 +28,7 @@ target_sources(SRB2SDL2 PRIVATE options-sound.cpp options-video-1.c options-video-advanced.c + options-video-colorprofile.c options-video-modes.c play-1.c play-char-select.c diff --git a/src/menus/options-profiles-edit-accessibility.cpp b/src/menus/options-profiles-edit-accessibility.cpp index a4d00c7fa..14dd0643d 100644 --- a/src/menus/options-profiles-edit-accessibility.cpp +++ b/src/menus/options-profiles-edit-accessibility.cpp @@ -137,9 +137,6 @@ menuitem_t OPTIONS_ProfileAccessibility[] = { {IT_STRING | IT_CVAR, "Input Display", "Show virtual controller on the HUD.", NULL, {.cvar = &cv_drawinput}, 0, 0}, - - {IT_STRING | IT_CVAR, "It's a me", "Hi hi hello.", - NULL, {.cvar = &cv_globalsaturation}, 0, 0}, }; menu_t OPTIONS_ProfileAccessibilityDef = { diff --git a/src/menus/options-video-1.c b/src/menus/options-video-1.c index e4965ca29..884121ab1 100644 --- a/src/menus/options-video-1.c +++ b/src/menus/options-video-1.c @@ -36,6 +36,9 @@ menuitem_t OPTIONS_Video[] = {IT_STRING | IT_CVAR, "Screen Effect", "Uses a special effect when displaying the game.", NULL, {.cvar = &cv_scr_effect}, 0, 0}, + + {IT_STRING | IT_SUBMENU, "Color Profile...", "Adjust the color profile of the game's display.", + NULL, {.submenu = &OPTIONS_VideoColorProfileDef}, 0, 0}, {IT_NOTHING|IT_SPACE, NULL, NULL, NULL, {NULL}, 0, 0}, diff --git a/src/menus/options-video-colorprofile.c b/src/menus/options-video-colorprofile.c new file mode 100644 index 000000000..12fd0dbdb --- /dev/null +++ b/src/menus/options-video-colorprofile.c @@ -0,0 +1,120 @@ +// DR. ROBOTNIK'S RING RACERS +//----------------------------------------------------------------------------- +// Copyright (C) 2024 by Kart Krew. +// This file created by Freaky Mutant Man. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file menus/options-video-colorprofile.c +/// \brief Color Profile Options + +#include "../k_menu.h" +#include "../v_video.h" // cv_globalgamma +#include "../r_fps.h" // fps cvars + +// color profile menu +menuitem_t OPTIONS_VideoColorProfile[] = +{ + + {IT_STRING | IT_CVAR, "Global Saturation", "Reduce the saturation of the displayed image.", + NULL, {.cvar = &cv_globalsaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Global Gamma", "Increase or decrease the brightness of the displayed image.", + NULL, {.cvar = &cv_globalgamma}, 0, 0}, + + {IT_NOTHING|IT_SPACE, NULL, NULL, + NULL, {NULL}, 0, 0}, + + {IT_HEADER, "Red...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Red Saturation", "Reduce the saturation of red in the displayed image.", + NULL, {.cvar = &cv_rsaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Red Gamma", "Increase or decrease the brightness of red in the displayed image.", + NULL, {.cvar = &cv_rgamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Red Hue", "Adjust the hue of red in the displayed image.", + NULL, {.cvar = &cv_rhue}, 0, 0}, + + {IT_HEADER, "Yellow...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Yellow Saturation", "Reduce the saturation of yellow in the displayed image.", + NULL, {.cvar = &cv_ysaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Yellow Gamma", "Increase or decrease the brightness of yellow in the displayed image.", + NULL, {.cvar = &cv_ygamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Yellow Hue", "Adjust the hue of yellow in the displayed image.", + NULL, {.cvar = &cv_yhue}, 0, 0}, + + {IT_HEADER, "Green...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Green Saturation", "Reduce the saturation of green in the displayed image.", + NULL, {.cvar = &cv_gsaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Green Gamma", "Increase or decrease the brightness of green in the displayed image.", + NULL, {.cvar = &cv_ggamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Green Hue", "Adjust the hue of green in the displayed image.", + NULL, {.cvar = &cv_ghue}, 0, 0}, + + {IT_HEADER, "Cyan...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Cyan Saturation", "Reduce the saturation of cyan in the displayed image.", + NULL, {.cvar = &cv_csaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Cyan Gamma", "Increase or decrease the brightness of cyan in the displayed image.", + NULL, {.cvar = &cv_cgamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Cyan Hue", "Adjust the hue of cyan in the displayed image.", + NULL, {.cvar = &cv_chue}, 0, 0}, + + {IT_HEADER, "Blue...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Blue Saturation", "Reduce the saturation of blue in the displayed image.", + NULL, {.cvar = &cv_bsaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Blue Gamma", "Increase or decrease the brightness of blue in the displayed image.", + NULL, {.cvar = &cv_bgamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Blue Hue", "Adjust the hue of blue in the displayed image.", + NULL, {.cvar = &cv_bhue}, 0, 0}, + + {IT_HEADER, "Magenta...", NULL, + NULL, {NULL}, 0, 0}, + + {IT_STRING | IT_CVAR, "Magenta Saturation", "Reduce the saturation of magenta in the displayed image.", + NULL, {.cvar = &cv_msaturation}, 0, 0}, + + {IT_STRING | IT_CVAR, "Magenta Gamma", "Increase or decrease the brightness of magenta in the displayed image.", + NULL, {.cvar = &cv_mgamma}, 0, 0}, + + {IT_STRING | IT_CVAR, "Magenta Hue", "Adjust the hue of magenta in the displayed image.", + NULL, {.cvar = &cv_mhue}, 0, 0}, + +}; + +menu_t OPTIONS_VideoColorProfileDef = { + sizeof (OPTIONS_VideoColorProfile) / sizeof (menuitem_t), + &OPTIONS_VideoDef, + 0, + OPTIONS_VideoColorProfile, + 48, 80-8, + SKINCOLOR_LAVENDER, 0, + MBF_DRAWBGWHILEPLAYING, + NULL, + 2, 5, + M_DrawGenericOptions, + M_DrawOptionsCogs, + M_OptionsTick, + NULL, + NULL, + NULL, +}; From dccdffa53771a8bd17d517185d4e72e1f31b9e49 Mon Sep 17 00:00:00 2001 From: FreakyMutantMan Date: Fri, 1 Nov 2024 22:30:42 -0700 Subject: [PATCH 3/6] Added new skincolor for use in color profile menu. --- src/deh_tables.c | 2 ++ src/doomdef.h | 2 ++ src/info.c | 1 + src/menus/options-video-colorprofile.c | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 1474296f9..1aa971571 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4397,6 +4397,8 @@ const char *COLOR_ENUMS[] = { "INTERMISSION1", "INTERMISSION2", "INTERMISSION3", + + "COLORPROFILE", }; const char *const KARTHUD_LIST[] = { diff --git a/src/doomdef.h b/src/doomdef.h index 69faba1a0..fa81f38c3 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -387,6 +387,8 @@ typedef enum SKINCOLOR_INTERMISSION1, SKINCOLOR_INTERMISSION2, SKINCOLOR_INTERMISSION3, + + SKINCOLOR_COLORPROFILE, SKINCOLOR_FIRSTFREESLOT, SKINCOLOR_LASTFREESLOT = SKINCOLOR_FIRSTFREESLOT + NUMCOLORFREESLOTS - 1, diff --git a/src/info.c b/src/info.c index ffdf5daf8..fa8125dc7 100644 --- a/src/info.c +++ b/src/info.c @@ -22265,6 +22265,7 @@ skincolor_t skincolors[MAXSKINCOLORS] = { {"Intermission 1", { 0, 80, 80, 80, 81, 81, 81, 84, 84, 85, 86, 86, 87, 87, 246, 248}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION1 {"Intermission 2", { 0, 81, 81, 81, 88, 88, 88, 89, 89, 140, 140, 141, 141, 142, 142, 142}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION2 {"Intermission 3", { 0, 144, 144, 144, 129, 129, 129, 130, 130, 146, 147, 147, 14, 16, 17, 19}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION3 + {"Color Profile", { 35, 35, 73, 73, 112, 112, 255, 255, 152, 152, 181, 181, 181, 181, 0, 0}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_COLORPROFILE }; /** Patches the mobjinfo, state, and skincolor tables. diff --git a/src/menus/options-video-colorprofile.c b/src/menus/options-video-colorprofile.c index 12fd0dbdb..56ca88aad 100644 --- a/src/menus/options-video-colorprofile.c +++ b/src/menus/options-video-colorprofile.c @@ -107,7 +107,7 @@ menu_t OPTIONS_VideoColorProfileDef = { 0, OPTIONS_VideoColorProfile, 48, 80-8, - SKINCOLOR_LAVENDER, 0, + SKINCOLOR_COLORPROFILE, 0, MBF_DRAWBGWHILEPLAYING, NULL, 2, 5, From 6ce4b76d9faa51a2511b366869e3c156661c23dd Mon Sep 17 00:00:00 2001 From: FreakyMutantMan Date: Sun, 3 Nov 2024 04:14:27 -0800 Subject: [PATCH 4/6] Created M_DrawOptionsColorProfile to handle new background assets for color profile menu. SKINCOLOR_COLORPROFILE has been removed entirely, since it is no longer needed. --- src/deh_tables.c | 2 - src/doomdef.h | 2 - src/info.c | 1 - src/k_menu.h | 1 + src/k_menudraw.c | 51 ++++++++++++++++++++++++++ src/menus/options-video-colorprofile.c | 46 +++++++++++------------ 6 files changed, 75 insertions(+), 28 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 1aa971571..1474296f9 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4397,8 +4397,6 @@ const char *COLOR_ENUMS[] = { "INTERMISSION1", "INTERMISSION2", "INTERMISSION3", - - "COLORPROFILE", }; const char *const KARTHUD_LIST[] = { diff --git a/src/doomdef.h b/src/doomdef.h index fa81f38c3..69faba1a0 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -387,8 +387,6 @@ typedef enum SKINCOLOR_INTERMISSION1, SKINCOLOR_INTERMISSION2, SKINCOLOR_INTERMISSION3, - - SKINCOLOR_COLORPROFILE, SKINCOLOR_FIRSTFREESLOT, SKINCOLOR_LASTFREESLOT = SKINCOLOR_FIRSTFREESLOT + NUMCOLORFREESLOTS - 1, diff --git a/src/info.c b/src/info.c index fa8125dc7..ffdf5daf8 100644 --- a/src/info.c +++ b/src/info.c @@ -22265,7 +22265,6 @@ skincolor_t skincolors[MAXSKINCOLORS] = { {"Intermission 1", { 0, 80, 80, 80, 81, 81, 81, 84, 84, 85, 86, 86, 87, 87, 246, 248}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION1 {"Intermission 2", { 0, 81, 81, 81, 88, 88, 88, 89, 89, 140, 140, 141, 141, 142, 142, 142}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION2 {"Intermission 3", { 0, 144, 144, 144, 129, 129, 129, 130, 130, 146, 147, 147, 14, 16, 17, 19}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_INTERMISSION3 - {"Color Profile", { 35, 35, 73, 73, 112, 112, 255, 255, 152, 152, 181, 181, 181, 181, 0, 0}, SKINCOLOR_NONE, 0, 0, false, UINT16_MAX}, // SKINCOLOR_COLORPROFILE }; /** Patches the mobjinfo, state, and skincolor tables. diff --git a/src/k_menu.h b/src/k_menu.h index 22cd3e40d..fbb34dcc8 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1359,6 +1359,7 @@ void M_DrawPlaybackMenu(void); // Options menus: void M_DrawOptionsCogs(void); +void M_DrawOptionsColorProfile(void); void M_DrawOptionsMovingButton(void); // for sick transitions... void M_DrawOptions(void); void M_DrawGenericOptions(void); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index a9f48161f..9edf05c52 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4377,6 +4377,57 @@ void M_DrawOptionsCogs(void) } } +// Hacking up M_DrawOptionsCogs to try and make something better suited for changing the color profile. - Freaky Mutant Man +void M_DrawOptionsColorProfile(void) +{ + boolean eggahack = ( + currentMenu->prevMenu == &PLAY_MP_HostDef + || ( + currentMenu->prevMenu + && currentMenu->prevMenu->prevMenu == &PLAY_MP_HostDef + ) + ); + boolean solidbg = M_GameTrulyStarted() && !eggahack; + UINT32 tick = ((optionsmenu.ticker/10) % 3) + 1; + + // the background isn't drawn outside of being in the main menu state. + if (gamestate == GS_MENU && solidbg) + { + patch_t *back = W_CachePatchName(va("OPT_BC%u", tick), PU_CACHE); + INT32 tflag = 0; + UINT8 *c; + UINT8 *c2; // colormap for the one we're changing + + if (optionsmenu.fade) + { + c2 = R_GetTranslationColormap(TC_DEFAULT, optionsmenu.lastcolour, GTC_CACHE); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, back, c2); + + // prepare fade flag: + tflag = min(V_90TRANS, (optionsmenu.fade)< Date: Sun, 3 Nov 2024 06:09:15 -0800 Subject: [PATCH 5/6] In-game color profile menu now removes background tint for optimal use. --- src/k_menudraw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 9edf05c52..c8538d328 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -978,7 +978,7 @@ void M_Drawer(void) { M_DrawGonerBack(); } - else if (!WipeInAction && currentMenu != &PAUSE_PlaybackMenuDef) + else if (!WipeInAction && currentMenu != &PAUSE_PlaybackMenuDef && currentMenu != &OPTIONS_VideoColorProfileDef) { V_DrawFadeScreen(122, 3); } @@ -4409,6 +4409,7 @@ void M_DrawOptionsColorProfile(void) } c = R_GetTranslationColormap(TC_DEFAULT, optionsmenu.currcolour, GTC_CACHE); V_DrawFixedPatch(0, 0, FRACUNIT, tflag, back, c); + //M_DrawCharSelectSprite( //figure this out later } // Given the need for accessibility, I don't want the background to be drawn transparent here - a clear color reference is needed for proper utilization. - Freaky Mutant Man else From 700ff96ea1ff6beb2776d16d2114891744cb13b4 Mon Sep 17 00:00:00 2001 From: FreakyMutantMan Date: Sun, 3 Nov 2024 19:58:47 -0800 Subject: [PATCH 6/6] Replaced background graphics with separated graphic lumps; added a button on the menu to automatically revert to the default color profile. --- src/k_menu.h | 1 + src/k_menudraw.c | 12 ++++++---- src/menus/options-video-colorprofile.c | 32 ++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index fbb34dcc8..8b70d09c5 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1148,6 +1148,7 @@ void M_RefreshAdvancedVideoOptions(void); void M_HandleItemToggles(INT32 choice); // For item toggling void M_EraseData(INT32 choice); // For data erasing void M_CheckProfileData(INT32 choice); // check if we have profiles. +void M_ColorProfileDefault(INT32 choice); // For the reset button in the color profile menu. // profile selection menu void M_ProfileSelectInit(INT32 choice); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index c8538d328..ae95c8798 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4393,7 +4393,9 @@ void M_DrawOptionsColorProfile(void) // the background isn't drawn outside of being in the main menu state. if (gamestate == GS_MENU && solidbg) { - patch_t *back = W_CachePatchName(va("OPT_BC%u", tick), PU_CACHE); + patch_t *back = W_CachePatchName(va("OPT_BG%u", tick), PU_CACHE); + patch_t *colorp_photo = W_CachePatchName("COL_PHO", PU_CACHE); + patch_t *colorp_bar = W_CachePatchName("COL_BAR", PU_CACHE); INT32 tflag = 0; UINT8 *c; UINT8 *c2; // colormap for the one we're changing @@ -4409,6 +4411,8 @@ void M_DrawOptionsColorProfile(void) } c = R_GetTranslationColormap(TC_DEFAULT, optionsmenu.currcolour, GTC_CACHE); V_DrawFixedPatch(0, 0, FRACUNIT, tflag, back, c); + V_DrawFixedPatch(243<