Replaced background graphics with separated graphic lumps; added a button on the menu to automatically revert to the default color profile.

This commit is contained in:
FreakyMutantMan 2024-11-03 19:58:47 -08:00
parent 67400f3c6d
commit 700ff96ea1
3 changed files with 39 additions and 6 deletions

View file

@ -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);

View file

@ -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<<FRACBITS, 67<<FRACBITS, FRACUNIT, 0, colorp_bar, NULL);
V_DrawFixedPatch(0, 0, FRACUNIT, 0, colorp_photo, NULL);
//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
@ -4419,12 +4423,12 @@ void M_DrawOptionsColorProfile(void)
M_DrawEggaChannelAlignable(true);
}
patch_t *back_pause = W_CachePatchName(va("OPT_BAC%u", tick), PU_CACHE);
V_DrawFixedPatch(0, 0, FRACUNIT, 0, back_pause, NULL);
patch_t *colorp_bar = W_CachePatchName("COL_BAR", PU_CACHE);
V_DrawFixedPatch(243<<FRACBITS, 67<<FRACBITS, FRACUNIT, 0, colorp_bar, NULL);
if (!solidbg)
{
V_DrawFixedPatch(0, 0, FRACUNIT, 0, back_pause, NULL);
V_DrawFixedPatch(243<<FRACBITS, 67<<FRACBITS, FRACUNIT, 0, colorp_bar, NULL);
}
}
}

View file

@ -24,8 +24,8 @@ menuitem_t OPTIONS_VideoColorProfile[] =
{IT_STRING | IT_CVAR, "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_STRING | IT_CALL, "Reset All", "Reset the color profile to default settings.",
NULL, {.routine = M_ColorProfileDefault}, 0, 0},
{IT_HEADER, "Red...", NULL,
NULL, {NULL}, 0, 0},
@ -118,3 +118,31 @@ menu_t OPTIONS_VideoColorProfileDef = {
NULL,
NULL,
};
// Set all color profile settings to the default values.
void M_ColorProfileDefault(INT32 choice)
{
(void)choice;
// The set value army approaches - gotta be a better way to handle this.
CV_SetValue(&cv_globalsaturation, 10);
CV_SetValue(&cv_rsaturation, 10);
CV_SetValue(&cv_ysaturation, 10);
CV_SetValue(&cv_gsaturation, 10);
CV_SetValue(&cv_csaturation, 10);
CV_SetValue(&cv_bsaturation, 10);
CV_SetValue(&cv_msaturation, 10);
CV_SetValue(&cv_globalgamma, 0);
CV_SetValue(&cv_rgamma, 0);
CV_SetValue(&cv_ygamma, 0);
CV_SetValue(&cv_ggamma, 0);
CV_SetValue(&cv_cgamma, 0);
CV_SetValue(&cv_bgamma, 0);
CV_SetValue(&cv_mgamma, 0);
CV_SetValue(&cv_rhue, 0);
CV_SetValue(&cv_yhue, 4);
CV_SetValue(&cv_ghue, 8);
CV_SetValue(&cv_chue, 12);
CV_SetValue(&cv_bhue, 16);
CV_SetValue(&cv_mhue, 20);
}