Fix warnings about set but unused variables [-Wunused-but-set-variable]
Fixes the following GCC 5 warnings: ``` drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable] drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable] editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable] editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable] modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable] platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable] scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable] scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable] scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable] scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable] servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable] servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable] ``` Also fixes two [-Wunused-value] warnings: ``` scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value] servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value] ``` Some of those are bugs and need further work, they are identified with `// FIXME` comments.
This commit is contained in:
parent
cda5b0bfe1
commit
d95bbb8922
22 changed files with 27 additions and 114 deletions
|
@ -811,8 +811,6 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
|
|||
|
||||
bool rebind_shader = true;
|
||||
|
||||
Size2 rt_size = Size2(storage->frame.current_rt->width, storage->frame.current_rt->height);
|
||||
|
||||
state.current_tex = RID();
|
||||
state.current_tex_ptr = NULL;
|
||||
state.current_normal = RID();
|
||||
|
|
|
@ -712,10 +712,8 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
|
|||
bool has_alpha = has_base_alpha || has_blend_alpha;
|
||||
|
||||
bool mirror = p_instance->mirror;
|
||||
bool no_cull = false;
|
||||
|
||||
if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_DISABLED) {
|
||||
no_cull = true;
|
||||
mirror = false;
|
||||
} else if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_FRONT) {
|
||||
mirror = !mirror;
|
||||
|
@ -738,7 +736,6 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
|
|||
//shader does not use discard and does not write a vertex position, use generic material
|
||||
if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
|
||||
p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material_twosided : default_material_twosided);
|
||||
no_cull = true;
|
||||
mirror = false;
|
||||
} else {
|
||||
p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material : default_material);
|
||||
|
@ -2264,7 +2261,6 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||
uint32_t y;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t vp_height;
|
||||
|
||||
float zfar = 0;
|
||||
bool flip_facing = false;
|
||||
|
@ -2350,14 +2346,12 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||
normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
|
||||
|
||||
fbo = directional_shadow.fbo;
|
||||
vp_height = directional_shadow.size;
|
||||
} else {
|
||||
ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
|
||||
ERR_FAIL_COND(!shadow_atlas);
|
||||
ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
|
||||
|
||||
fbo = shadow_atlas->fbo;
|
||||
vp_height = shadow_atlas->size;
|
||||
|
||||
uint32_t key = shadow_atlas->shadow_owners[p_light];
|
||||
|
||||
|
@ -2666,10 +2660,6 @@ void RasterizerSceneGLES2::initialize() {
|
|||
}
|
||||
|
||||
shadow_filter_mode = SHADOW_FILTER_NEAREST;
|
||||
|
||||
RenderList::Element e;
|
||||
e.sort_key = 0;
|
||||
e.light_type1 = 1;
|
||||
}
|
||||
|
||||
void RasterizerSceneGLES2::iteration() {
|
||||
|
|
|
@ -690,11 +690,6 @@ void ShaderGLES2::use_material(void *p_material) {
|
|||
|
||||
Version *v = version_map.getptr(conditional_version);
|
||||
|
||||
CustomCode *cc = NULL;
|
||||
if (v) {
|
||||
cc = custom_code_map.getptr(v->code_version);
|
||||
}
|
||||
|
||||
// bind uniforms
|
||||
for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = material->shader->uniforms.front(); E; E = E->next()) {
|
||||
|
||||
|
@ -992,8 +987,6 @@ void ShaderGLES2::use_material(void *p_material) {
|
|||
}
|
||||
}
|
||||
|
||||
// GLint location = get_uniform_location(E->key());
|
||||
|
||||
GLint location;
|
||||
if (v->custom_uniform_locations.has(E->key())) {
|
||||
location = v->custom_uniform_locations[E->key()];
|
||||
|
|
|
@ -1223,8 +1223,6 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
|
|||
|
||||
bool rebind_shader = true;
|
||||
|
||||
Size2 rt_size = Size2(storage->frame.current_rt->width, storage->frame.current_rt->height);
|
||||
|
||||
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
|
||||
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo);
|
||||
|
|
|
@ -3036,13 +3036,14 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
|
|||
reflection_ubo.ambient[3] = rpi->probe_ptr->interior_ambient_probe_contrib;
|
||||
} else {
|
||||
Color ambient_linear;
|
||||
float contrib = 0;
|
||||
// FIXME: contrib was retrieved but never used, is it meant to be set as ambient[3]? (GH-20361)
|
||||
//float contrib = 0;
|
||||
if (p_env) {
|
||||
ambient_linear = p_env->ambient_color.to_linear();
|
||||
ambient_linear.r *= p_env->ambient_energy;
|
||||
ambient_linear.g *= p_env->ambient_energy;
|
||||
ambient_linear.b *= p_env->ambient_energy;
|
||||
contrib = p_env->ambient_sky_contribution;
|
||||
//contrib = p_env->ambient_sky_contribution;
|
||||
}
|
||||
|
||||
reflection_ubo.ambient[0] = ambient_linear.r;
|
||||
|
@ -4501,7 +4502,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||
RasterizerStorageGLES3::Light *light = storage->light_owner.getornull(light_instance->light);
|
||||
ERR_FAIL_COND(!light);
|
||||
|
||||
uint32_t x, y, width, height, vp_height;
|
||||
uint32_t x, y, width, height;
|
||||
|
||||
float dp_direction = 0.0;
|
||||
float zfar = 0;
|
||||
|
@ -4583,7 +4584,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||
bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
|
||||
normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
|
||||
fbo = directional_shadow.fbo;
|
||||
vp_height = directional_shadow.size;
|
||||
|
||||
} else {
|
||||
//set from shadow atlas
|
||||
|
@ -4593,7 +4593,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||
ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
|
||||
|
||||
fbo = shadow_atlas->fbo;
|
||||
vp_height = shadow_atlas->size;
|
||||
|
||||
uint32_t key = shadow_atlas->shadow_owners[p_light];
|
||||
|
||||
|
|
|
@ -255,8 +255,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
|
||||
bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false);
|
||||
|
||||
Color script_bg_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0));
|
||||
|
||||
Color preset_accent_color;
|
||||
Color preset_base_color;
|
||||
float preset_contrast;
|
||||
|
@ -1064,8 +1062,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
const float mono_value = mono_color.r;
|
||||
const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07);
|
||||
const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14);
|
||||
const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.5);
|
||||
const Color alpha4 = Color(mono_value, mono_value, mono_value, 0.7);
|
||||
const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.7);
|
||||
|
||||
// editor main color
|
||||
const Color main_color = Color::html(dark_theme ? "#57b3ff" : "#0480ff");
|
||||
|
@ -1099,9 +1096,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
const Color member_variable_color = main_color.linear_interpolate(mono_color, 0.6);
|
||||
const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
|
||||
const Color breakpoint_color = error_color;
|
||||
const Color code_folding_color = alpha4;
|
||||
const Color code_folding_color = alpha3;
|
||||
const Color search_result_color = alpha1;
|
||||
const Color search_result_border_color = alpha4;
|
||||
const Color search_result_border_color = alpha3;
|
||||
|
||||
EditorSettings *setting = EditorSettings::get_singleton();
|
||||
String text_editor_color_theme = setting->get("text_editor/theme/color_theme");
|
||||
|
|
|
@ -323,7 +323,6 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
|
|||
if (mb.is_valid()) {
|
||||
|
||||
Vector2 gpoint = mb->get_position();
|
||||
Vector2 cpoint = node->get_global_transform().affine_inverse().xform(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));
|
||||
|
||||
if (mb->get_button_index() == BUTTON_LEFT) {
|
||||
if (mb->is_pressed()) {
|
||||
|
|
|
@ -65,14 +65,6 @@ void MeshEditor::_notification(int p_what) {
|
|||
first_enter = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
|
||||
Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons");
|
||||
Size2 size = get_size();
|
||||
|
||||
//draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
|
||||
}
|
||||
}
|
||||
|
||||
void MeshEditor::_update_rotation() {
|
||||
|
|
|
@ -86,10 +86,7 @@ void ShaderTextEditor::_load_theme_settings() {
|
|||
Color search_result_border_color = EDITOR_GET("text_editor/highlighting/search_result_border_color");
|
||||
Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color");
|
||||
Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color");
|
||||
Color basetype_color = EDITOR_GET("text_editor/highlighting/base_type_color");
|
||||
Color type_color = EDITOR_GET("text_editor/highlighting/engine_type_color");
|
||||
Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color");
|
||||
Color string_color = EDITOR_GET("text_editor/highlighting/string_color");
|
||||
|
||||
get_text_edit()->add_color_override("background_color", background_color);
|
||||
get_text_edit()->add_color_override("completion_background_color", completion_background_color);
|
||||
|
@ -140,26 +137,9 @@ void ShaderTextEditor::_load_theme_settings() {
|
|||
get_text_edit()->add_keyword_color(E->get(), keyword_color);
|
||||
}
|
||||
|
||||
//colorize core types
|
||||
//Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
|
||||
|
||||
//colorize comments
|
||||
get_text_edit()->add_color_region("/*", "*/", comment_color, false);
|
||||
get_text_edit()->add_color_region("//", "", comment_color, false);
|
||||
|
||||
/*//colorize strings
|
||||
Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff));
|
||||
|
||||
List<String> strings;
|
||||
shader->get_shader_mode()->get_string_delimiters(&strings);
|
||||
|
||||
for (List<String>::Element *E=strings.front();E;E=E->next()) {
|
||||
|
||||
String string = E->get();
|
||||
String beg = string.get_slice(" ",0);
|
||||
String end = string.get_slice_count(" ")>1?string.get_slice(" ",1):String();
|
||||
get_text_edit()->add_color_region(beg,end,string_color,end=="");
|
||||
}*/
|
||||
}
|
||||
|
||||
void ShaderTextEditor::_check_shader_mode() {
|
||||
|
|
|
@ -2518,8 +2518,6 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
|
|||
}
|
||||
ofs /= EDSCALE;
|
||||
|
||||
bool seq_connect = false;
|
||||
|
||||
Set<int> vn;
|
||||
|
||||
switch (p_option) {
|
||||
|
@ -2552,7 +2550,6 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
|
|||
}
|
||||
} break;
|
||||
case CREATE_ACTION: {
|
||||
seq_connect = true;
|
||||
VisualScriptNode::TypeGuess tg = _guess_output_type(port_action_node, port_action_output, vn);
|
||||
PropertyInfo property_info = script->get_node(edited_func, port_action_node)->get_output_value_port_info(port_action_output);
|
||||
if (tg.type == Variant::OBJECT) {
|
||||
|
@ -2656,7 +2653,6 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
|
|||
|
||||
Ref<VisualScriptNode> vnode;
|
||||
|
||||
seq_connect = false;
|
||||
if (p_category == String("method")) {
|
||||
|
||||
Ref<VisualScriptFunctionCall> n;
|
||||
|
@ -2682,38 +2678,32 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
|
|||
Ref<VisualScriptCondition> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
}
|
||||
if (p_text == "VisualScriptSwitch") {
|
||||
|
||||
Ref<VisualScriptSwitch> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
} else if (p_text == "VisualScriptSequence") {
|
||||
|
||||
Ref<VisualScriptSequence> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
} else if (p_text == "VisualScriptIterator") {
|
||||
|
||||
Ref<VisualScriptIterator> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
} else if (p_text == "VisualScriptWhile") {
|
||||
|
||||
Ref<VisualScriptWhile> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
} else if (p_text == "VisualScriptReturn") {
|
||||
|
||||
Ref<VisualScriptReturn> n;
|
||||
n.instance();
|
||||
vnode = n;
|
||||
seq_connect = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3489,7 +3479,6 @@ VisualScriptEditor::VisualScriptEditor() {
|
|||
clipboard = memnew(Clipboard);
|
||||
}
|
||||
updating_graph = false;
|
||||
seq_connect = false;
|
||||
|
||||
edit_menu = memnew(MenuButton);
|
||||
edit_menu->set_text(TTR("Edit"));
|
||||
|
|
|
@ -160,8 +160,6 @@ class VisualScriptEditor : public ScriptEditorBase {
|
|||
MemberType member_type;
|
||||
String member_name;
|
||||
|
||||
bool seq_connect;
|
||||
|
||||
PortAction port_action;
|
||||
int port_action_node;
|
||||
int port_action_output;
|
||||
|
|
|
@ -577,11 +577,11 @@ class EditorExportAndroid : public EditorExportPlatform {
|
|||
uint32_t ofs = 8;
|
||||
|
||||
uint32_t string_count = 0;
|
||||
uint32_t styles_count = 0;
|
||||
//uint32_t styles_count = 0;
|
||||
uint32_t string_flags = 0;
|
||||
uint32_t string_data_offset = 0;
|
||||
|
||||
uint32_t styles_offset = 0;
|
||||
//uint32_t styles_offset = 0;
|
||||
uint32_t string_table_begins = 0;
|
||||
uint32_t string_table_ends = 0;
|
||||
Vector<uint8_t> stable_extra;
|
||||
|
@ -631,10 +631,10 @@ class EditorExportAndroid : public EditorExportPlatform {
|
|||
int iofs = ofs + 8;
|
||||
|
||||
string_count = decode_uint32(&p_manifest[iofs]);
|
||||
styles_count = decode_uint32(&p_manifest[iofs + 4]);
|
||||
//styles_count = decode_uint32(&p_manifest[iofs + 4]);
|
||||
string_flags = decode_uint32(&p_manifest[iofs + 8]);
|
||||
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
|
||||
styles_offset = decode_uint32(&p_manifest[iofs + 16]);
|
||||
//styles_offset = decode_uint32(&p_manifest[iofs + 16]);
|
||||
/*
|
||||
printf("string count: %i\n",string_count);
|
||||
printf("flags: %i\n",string_flags);
|
||||
|
|
|
@ -461,7 +461,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||
fi.internal_fa = info.internal_fa;
|
||||
fi.external_fa = info.external_fa;
|
||||
|
||||
int zerr = zipOpenNewFileInZip(dst_pkg_zip,
|
||||
zipOpenNewFileInZip(dst_pkg_zip,
|
||||
file.utf8().get_data(),
|
||||
&fi,
|
||||
NULL,
|
||||
|
@ -472,7 +472,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||
Z_DEFLATED,
|
||||
Z_DEFAULT_COMPRESSION);
|
||||
|
||||
zerr = zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
|
||||
zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
|
||||
zipCloseFileInZip(dst_pkg_zip);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -257,7 +257,6 @@ void TileMap::update_dirty_quadrants() {
|
|||
VisualServer *vs = VisualServer::get_singleton();
|
||||
Physics2DServer *ps = Physics2DServer::get_singleton();
|
||||
Vector2 tofs = get_cell_draw_offset();
|
||||
Vector2 tcenter = cell_size / 2;
|
||||
Transform2D nav_rel;
|
||||
if (navigation)
|
||||
nav_rel = get_relative_transform_to_parent(navigation);
|
||||
|
|
|
@ -163,6 +163,11 @@ void Light::_update_visibility() {
|
|||
if (!is_inside_tree())
|
||||
return;
|
||||
|
||||
// FIXME: Since the call to VS::instance_light_set_enabled was disabled below,
|
||||
// the whole logic became pointless so editor_ok triggers unused variable warnings.
|
||||
// Commenting out for now but this should be fixed/reimplemented so that editor_only
|
||||
// works as expected (GH-17989).
|
||||
/*
|
||||
bool editor_ok = true;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
@ -180,6 +185,7 @@ void Light::_update_visibility() {
|
|||
#endif
|
||||
|
||||
//VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible_in_tree() && editor_ok);
|
||||
*/
|
||||
_change_notify("geometry/visible");
|
||||
}
|
||||
|
||||
|
|
|
@ -563,7 +563,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
|
|||
bool use_collision = p_use_collision;
|
||||
Vector3 closest_point;
|
||||
float closest_point_d = 1e20;
|
||||
NavMesh *closest_navmesh = NULL;
|
||||
|
||||
for (Map<int, NavMesh>::Element *E = navmesh_map.front(); E; E = E->next()) {
|
||||
|
||||
|
@ -582,12 +581,10 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
|
|||
closest_point = inters;
|
||||
use_collision = true;
|
||||
closest_point_d = p_from.distance_to(inters);
|
||||
closest_navmesh = p.owner;
|
||||
} else if (closest_point_d > inters.distance_to(p_from)) {
|
||||
|
||||
closest_point = inters;
|
||||
closest_point_d = p_from.distance_to(inters);
|
||||
closest_navmesh = p.owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -605,7 +602,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
|
|||
|
||||
closest_point_d = d;
|
||||
closest_point = b;
|
||||
closest_navmesh = p.owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -864,7 +864,6 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item
|
|||
if (r_click_item)
|
||||
*r_click_item = NULL;
|
||||
|
||||
Size2 size = get_size();
|
||||
Rect2 text_rect = _get_text_rect();
|
||||
int ofs = vscroll->get_value();
|
||||
Color font_color_shadow = get_color("font_color_shadow");
|
||||
|
|
|
@ -4400,7 +4400,7 @@ int TextEdit::_is_line_in_region(int p_line) {
|
|||
|
||||
// if not find the closest line we have
|
||||
int previous_line = p_line - 1;
|
||||
for (previous_line; previous_line > -1; previous_line--) {
|
||||
for (; previous_line > -1; previous_line--) {
|
||||
if (color_region_cache.has(p_line)) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -701,15 +701,6 @@ void Viewport::set_canvas_transform(const Transform2D &p_transform) {
|
|||
|
||||
canvas_transform = p_transform;
|
||||
VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
|
||||
|
||||
Transform2D xform = (global_canvas_transform * canvas_transform).affine_inverse();
|
||||
Size2 ss = get_visible_rect().size;
|
||||
/*SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5)));
|
||||
Vector2 ss2 = ss*xform.get_scale();
|
||||
float panrange = MAX(ss2.x,ss2.y);
|
||||
|
||||
SpatialSound2DServer::get_singleton()->listener_set_param(internal_listener_2d, SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE, panrange);
|
||||
*/
|
||||
}
|
||||
|
||||
Transform2D Viewport::get_canvas_transform() const {
|
||||
|
@ -722,15 +713,6 @@ void Viewport::_update_global_transform() {
|
|||
Transform2D sxform = stretch_transform * global_canvas_transform;
|
||||
|
||||
VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport, sxform);
|
||||
|
||||
Transform2D xform = (sxform * canvas_transform).affine_inverse();
|
||||
Size2 ss = get_visible_rect().size;
|
||||
/*SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5)));
|
||||
Vector2 ss2 = ss*xform.get_scale();
|
||||
float panrange = MAX(ss2.x,ss2.y);
|
||||
|
||||
SpatialSound2DServer::get_singleton()->listener_set_param(internal_listener_2d, SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE, panrange);
|
||||
*/
|
||||
}
|
||||
|
||||
void Viewport::set_global_canvas_transform(const Transform2D &p_transform) {
|
||||
|
|
|
@ -427,10 +427,8 @@ void SpatialMaterial::_update_shader() {
|
|||
if (flags[FLAG_USE_VERTEX_LIGHTING]) {
|
||||
code += ",vertex_lighting";
|
||||
}
|
||||
bool using_world = false;
|
||||
if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) {
|
||||
code += ",world_vertex_coords";
|
||||
using_world = true;
|
||||
}
|
||||
if (flags[FLAG_DONT_RECEIVE_SHADOWS]) {
|
||||
code += ",shadows_disabled";
|
||||
|
|
|
@ -2023,10 +2023,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
|
|||
|
||||
StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
|
||||
|
||||
bool all_const = true;
|
||||
for (int i = 1; i < p_func->arguments.size(); i++) {
|
||||
if (p_func->arguments[i]->type != Node::TYPE_CONSTANT)
|
||||
all_const = false;
|
||||
args.push_back(p_func->arguments[i]->get_datatype());
|
||||
}
|
||||
|
||||
|
|
|
@ -902,7 +902,7 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
|
|||
_update_instance_lightmap_captures(p_instance);
|
||||
} else {
|
||||
if (!p_instance->lightmap_capture_data.empty()) {
|
||||
!p_instance->lightmap_capture_data.resize(0); //not in use, clear capture data
|
||||
p_instance->lightmap_capture_data.resize(0); //not in use, clear capture data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1378,9 +1378,12 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
|
|||
float y_min = 0.f, y_max = 0.f;
|
||||
float z_min = 0.f, z_max = 0.f;
|
||||
|
||||
// FIXME: z_max_cam is defined, computed, but not used below when setting up
|
||||
// ortho_camera. Commented out for now to fix warnings but should be investigated.
|
||||
float x_min_cam = 0.f, x_max_cam = 0.f;
|
||||
float y_min_cam = 0.f, y_max_cam = 0.f;
|
||||
float z_min_cam = 0.f, z_max_cam = 0.f;
|
||||
float z_min_cam = 0.f;
|
||||
//float z_max_cam = 0.f;
|
||||
|
||||
float bias_scale = 1.0;
|
||||
|
||||
|
@ -1442,7 +1445,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
|
|||
x_min_cam = x_vec.dot(center) - radius;
|
||||
y_max_cam = y_vec.dot(center) + radius;
|
||||
y_min_cam = y_vec.dot(center) - radius;
|
||||
z_max_cam = z_vec.dot(center) + radius;
|
||||
//z_max_cam = z_vec.dot(center) + radius;
|
||||
z_min_cam = z_vec.dot(center) - radius;
|
||||
|
||||
if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) {
|
||||
|
|
Loading…
Reference in a new issue