You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
This commit is contained in:
@@ -514,7 +514,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba
|
||||
ambient_color_sky_mix = env->ambient_sky_contribution;
|
||||
const float ambient_energy = env->ambient_light_energy;
|
||||
ambient_color = env->ambient_light;
|
||||
ambient_color.to_linear();
|
||||
ambient_color = ambient_color.to_linear();
|
||||
ambient_color.r *= ambient_energy;
|
||||
ambient_color.g *= ambient_energy;
|
||||
ambient_color.b *= ambient_energy;
|
||||
@@ -533,7 +533,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba
|
||||
} else {
|
||||
const float bg_energy = env->bg_energy;
|
||||
Color panorama_color = ((environment_background == RS::ENV_BG_CLEAR_COLOR) ? storage->get_default_clear_color() : env->bg_color);
|
||||
panorama_color.to_linear();
|
||||
panorama_color = panorama_color.to_linear();
|
||||
panorama_color.r *= bg_energy;
|
||||
panorama_color.g *= bg_energy;
|
||||
panorama_color.b *= bg_energy;
|
||||
|
||||
Reference in New Issue
Block a user