Skip to content

Commit

Permalink
port: fix optionsmenu.c warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Jan 7, 2024
1 parent 8645d0a commit 6bd3597
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 2 additions & 0 deletions port/include/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ s32 videoGetWidth(void);
s32 videoGetHeight(void);
f32 videoGetAspect(void);
s32 videoGetFullscreen(void);
s32 videoGetMaximizeWindow(void);
void videoSetMaximizeWindow(s32 fs);
u32 videoGetTextureFilter(void);
u32 videoGetTextureFilter2D(void);

Expand Down
32 changes: 20 additions & 12 deletions port/src/optionsmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,63 +945,71 @@ static MenuItemHandlerResult menuhandlerCrosshairSway(s32 operation, struct menu
return 0;
}

static MenuItemHandlerResult menuhandlerCrosshair_R(s32 operation, struct menuitem* item, union handlerdata* data)
static MenuItemHandlerResult menuhandlerCrosshairR(s32 operation, struct menuitem* item, union handlerdata* data)
{
u32 newColor;

switch (operation) {
case MENUOP_GETSLIDER:
data->slider.value = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour >> 24) & 0xFF;
break;

case MENUOP_SET:
u32 newColor = g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFFFF | data->slider.value << 24;
newColor = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFFFF) | data->slider.value << 24;
g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour = newColor;
break;
}

return 0;
}

static MenuItemHandlerResult menuhandlerCrosshair_G(s32 operation, struct menuitem* item, union handlerdata* data)
static MenuItemHandlerResult menuhandlerCrosshairG(s32 operation, struct menuitem* item, union handlerdata* data)
{
u32 newColor;

switch (operation) {
case MENUOP_GETSLIDER:
data->slider.value = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour >> 16) & 0xFF;
break;

case MENUOP_SET:
u32 newColor = g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFF00FFFF | data->slider.value << 16;
newColor = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFF00FFFF) | data->slider.value << 16;
g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour = newColor;
break;
}

return 0;
}

static MenuItemHandlerResult menuhandlerCrosshair_B(s32 operation, struct menuitem* item, union handlerdata* data)
static MenuItemHandlerResult menuhandlerCrosshairB(s32 operation, struct menuitem* item, union handlerdata* data)
{
u32 newColor;

switch (operation) {
case MENUOP_GETSLIDER:
data->slider.value = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour >> 8) & 0xFF;
break;

case MENUOP_SET:
u32 newColor = g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFF00FF | data->slider.value << 8;
newColor = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFF00FF) | data->slider.value << 8;
g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour = newColor;
break;
}

return 0;
}

static MenuItemHandlerResult menuhandlerCrosshair_A(s32 operation, struct menuitem* item, union handlerdata* data)
static MenuItemHandlerResult menuhandlerCrosshairA(s32 operation, struct menuitem* item, union handlerdata* data)
{
u32 newColor;

switch (operation) {
case MENUOP_GETSLIDER:
data->slider.value = g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFF;
break;

case MENUOP_SET:
u32 newColor = g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFFFF00 | data->slider.value;
newColor = (g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour & 0xFFFFFF00) | data->slider.value;
g_PlayerExtCfg[g_ExtMenuPlayer].crosshaircolour = newColor;
break;
}
Expand All @@ -1025,31 +1033,31 @@ struct menuitem g_ExtendedGameCrosshairColourMenuItems[] = {
MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE,
(uintptr_t)"Red",
255,
menuhandlerCrosshair_R,
menuhandlerCrosshairR,
},
{
MENUITEMTYPE_SLIDER,
0,
MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE,
(uintptr_t)"Green",
255,
menuhandlerCrosshair_G,
menuhandlerCrosshairG,
},
{
MENUITEMTYPE_SLIDER,
0,
MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE,
(uintptr_t)"Blue",
255,
menuhandlerCrosshair_B,
menuhandlerCrosshairB,
},
{
MENUITEMTYPE_SLIDER,
0,
MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE,
(uintptr_t)"Alpha",
255,
menuhandlerCrosshair_A,
menuhandlerCrosshairA,
},
{
MENUITEMTYPE_SEPARATOR,
Expand Down

0 comments on commit 6bd3597

Please sign in to comment.