diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 1a9893a25..57adfdfc3 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -10699,8 +10699,8 @@ function set_shader_flag_value(flag, value) end --- @param enabled boolean ---- Enables custom shader flags applying to everything, including HUD elements and menus -function enable_shader_flags_screen(enabled) +--- Enables custom shader flags as a global toggle, useful for disabling without manually going through every effect +function enable_shader_flags_global(enabled) -- ... end diff --git a/docs/lua/functions-6.md b/docs/lua/functions-6.md index c5f0b6b41..6985067f9 100644 --- a/docs/lua/functions-6.md +++ b/docs/lua/functions-6.md @@ -7507,13 +7507,13 @@ Sets a value for one of the custom shader flags (`SHADER_FLAG_*`) for the render
-## [enable_shader_flags_screen](#enable_shader_flags_screen) +## [enable_shader_flags_global](#enable_shader_flags_global) ### Description -Enables custom shader flags applying to everything, including HUD elements and menus +Enables custom shader flags as a global toggle, useful for disabling without manually going through every effect ### Lua Example -`enable_shader_flags_screen(enabled)` +`enable_shader_flags_global(enabled)` ### Parameters | Field | Type | @@ -7524,7 +7524,7 @@ Enables custom shader flags applying to everything, including HUD elements and m - None ### C Prototype -`void enable_shader_flags_screen(bool enabled);` +`void enable_shader_flags_global(bool enabled);` [:arrow_up_small:](#) diff --git a/docs/lua/functions.md b/docs/lua/functions.md index cf9a29fcb..1d880f813 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -1918,7 +1918,7 @@ - smlua_gfx_utils.h - [enable_shader_flag](functions-6.md#enable_shader_flag) - [set_shader_flag_value](functions-6.md#set_shader_flag_value) - - [enable_shader_flags_screen](functions-6.md#enable_shader_flags_screen) + - [enable_shader_flags_global](functions-6.md#enable_shader_flags_global) - [clear_all_shader_flags](functions-6.md#clear_all_shader_flags) - [set_override_fov](functions-6.md#set_override_fov) - [set_override_near](functions-6.md#set_override_near) diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index c166cf71c..b302f04b3 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -128,7 +128,7 @@ f32 gFogIntensity = 1; int gShaderFlags[SHADER_FLAG_MAX] = { 0 }; f32 gDefaultShaderFlagValues[SHADER_FLAG_MAX] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 8.0f, 1.0f }; f32 gShaderFlagValues[SHADER_FLAG_MAX] = { 0 }; -bool gShaderFlagsScreen = false; +bool gShaderFlagsEnabled = true; // need inverse camera matrix to compute world space for lighting engine static Mat4 sInverseCameraMatrix; @@ -1104,7 +1104,7 @@ static void OPTIMIZE_O3 gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t cm->use_2cycle = (rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)) == G_CYC_2CYCLE; cm->use_fog = (rdp.other_mode_l >> 30) == G_BL_CLR_FOG; cm->light_map = (rsp.geometry_mode & G_LIGHT_MAP_EXT) == G_LIGHT_MAP_EXT; - cm->world_geometry = (v1->world_geometry && v2->world_geometry && v3->world_geometry) || gShaderFlagsScreen; + cm->world_geometry = gShaderFlagsEnabled && (v1->world_geometry && v2->world_geometry && v3->world_geometry); if (cm->texture_edge) { cm->use_alpha = true; diff --git a/src/pc/gfx/gfx_pc.h b/src/pc/gfx/gfx_pc.h index 649c8c95e..b4a970822 100644 --- a/src/pc/gfx/gfx_pc.h +++ b/src/pc/gfx/gfx_pc.h @@ -28,7 +28,7 @@ extern f32 gFogIntensity; extern int gShaderFlags[SHADER_FLAG_MAX]; extern f32 gDefaultShaderFlagValues[SHADER_FLAG_MAX]; extern f32 gShaderFlagValues[SHADER_FLAG_MAX]; -extern bool gShaderFlagsScreen; +extern bool gShaderFlagsEnabled; #ifdef __cplusplus extern "C" { diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 769e4ffc5..38f77f8a6 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -32296,19 +32296,19 @@ int smlua_func_set_shader_flag_value(lua_State* L) { return 1; } -int smlua_func_enable_shader_flags_screen(lua_State* L) { +int smlua_func_enable_shader_flags_global(lua_State* L) { if (L == NULL) { return 0; } int top = lua_gettop(L); if (top != 1) { - LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_shader_flags_screen", 1, top); + LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_shader_flags_global", 1, top); return 0; } bool enabled = smlua_to_boolean(L, 1); - if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "enable_shader_flags_screen"); return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "enable_shader_flags_global"); return 0; } - enable_shader_flags_screen(enabled); + enable_shader_flags_global(enabled); return 1; } @@ -38902,7 +38902,7 @@ void smlua_bind_functions_autogen(void) { // smlua_gfx_utils.h smlua_bind_function(L, "enable_shader_flag", smlua_func_enable_shader_flag); smlua_bind_function(L, "set_shader_flag_value", smlua_func_set_shader_flag_value); - smlua_bind_function(L, "enable_shader_flags_screen", smlua_func_enable_shader_flags_screen); + smlua_bind_function(L, "enable_shader_flags_global", smlua_func_enable_shader_flags_global); smlua_bind_function(L, "clear_all_shader_flags", smlua_func_clear_all_shader_flags); smlua_bind_function(L, "set_override_fov", smlua_func_set_override_fov); smlua_bind_function(L, "set_override_near", smlua_func_set_override_near); diff --git a/src/pc/lua/utils/smlua_gfx_utils.c b/src/pc/lua/utils/smlua_gfx_utils.c index 6ca5473d6..6bc75b4ae 100644 --- a/src/pc/lua/utils/smlua_gfx_utils.c +++ b/src/pc/lua/utils/smlua_gfx_utils.c @@ -14,8 +14,8 @@ void set_shader_flag_value(enum ShaderFlag flag, f32 value) { gShaderFlagValues[flag] = value; } -void enable_shader_flags_screen(bool enabled) { - gShaderFlagsScreen = enabled; +void enable_shader_flags_global(bool enabled) { + gShaderFlagsEnabled = enabled; } AT_STARTUP void clear_all_shader_flags(void) { diff --git a/src/pc/lua/utils/smlua_gfx_utils.h b/src/pc/lua/utils/smlua_gfx_utils.h index a83d53c22..801da6936 100644 --- a/src/pc/lua/utils/smlua_gfx_utils.h +++ b/src/pc/lua/utils/smlua_gfx_utils.h @@ -17,8 +17,8 @@ u32 gfx_get_length_no_sentinel(const Gfx *gfx); void enable_shader_flag(enum ShaderFlag flag, bool enabled); /* |description|Sets a value for one of the custom shader flags (`SHADER_FLAG_*`) for the renderer|descriptionEnd| */ void set_shader_flag_value(enum ShaderFlag flag, f32 value); -/* |description|Enables custom shader flags applying to everything, including HUD elements and menus|descriptionEnd| */ -void enable_shader_flags_screen(bool enabled); +/* |description|Enables custom shader flags as a global toggle, useful for disabling without manually going through every effect|descriptionEnd| */ +void enable_shader_flags_global(bool enabled); /* |description|Clears all custom shader flags (`SHADER_FLAG_*`) for the renderer|descriptionEnd| */ void clear_all_shader_flags(void);