Try to fix opening graphics menu crashing on N64

This commit is contained in:
UnknownShadow200 2024-06-05 12:28:52 +10:00
parent 483c7b6b07
commit e7e50b6164
3 changed files with 7 additions and 12 deletions

View File

@ -90,7 +90,7 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
export LD := $(CC)
export LD := $(CXX)
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CFILES:.c=.o) $(SFILES:.s=.o)

View File

@ -389,13 +389,13 @@ static void DrawTriangle(Vertex* frag1, Vertex* frag2, Vertex* frag3) {
BitmapCol tColor = curTexPixels[texIndex];
int a1 = PackedCol_A(color), a2 = BitmapCol_A(tColor);
A = ( a1 * a2 ) / 255;
A = ( a1 * a2 ) >> 8;
int r1 = PackedCol_R(color), r2 = BitmapCol_R(tColor);
R = ( r1 * r2 ) / 255;
R = ( r1 * r2 ) >> 8;
int g1 = PackedCol_G(color), g2 = BitmapCol_G(tColor);
G = ( g1 * g2 ) / 255;
G = ( g1 * g2 ) >> 8;
int b1 = PackedCol_B(color), b2 = BitmapCol_B(tColor);
B = ( b1 * b2 ) / 255;
B = ( b1 * b2 ) >> 8;
} else {
R = PackedCol_R(color);
G = PackedCol_G(color);

View File

@ -2898,13 +2898,7 @@ void EnvSettingsScreen_Show(void) {
*--------------------------------------------------GraphicsOptionsScreen--------------------------------------------------*
*#########################################################################################################################*/
static void GraphicsOptionsScreen_CheckLightingModeAllowed(struct MenuOptionsScreen* s) {
struct Widget** widgets = s->widgets;
cc_bool disabled = Lighting_ModeLockedByServer;
struct ButtonWidget* btn = (struct ButtonWidget*)widgets[4];
MenuOptionsScreen_Update(s, btn);
Widget_SetDisabled(widgets[4], disabled);
MenuInputOverlay_CheckStillValid(s);
Widget_SetDisabled(s->widgets[4], Lighting_ModeLockedByServer);
}
static void GraphicsOptionsScreen_GetViewDist(cc_string* v) { String_AppendInt(v, Game_ViewDistance); }
@ -2916,6 +2910,7 @@ static void GraphicsOptionsScreen_SetSmooth(const cc_string* v) {
Builder_ApplyActive();
MapRenderer_Refresh();
}
static void GraphicsOptionsScreen_GetLighting(cc_string* v) { String_AppendConst(v, LightingMode_Names[Lighting_Mode]); }
static void GraphicsOptionsScreen_SetLighting(const cc_string* v) {
cc_uint8 mode = Utils_ParseEnum(v, 0, LightingMode_Names, LIGHTING_MODE_COUNT);