diff options
author | Dualtagh Murray <dualtagh.murray@gonitro.com> | 2018-10-04 14:38:52 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-10-19 11:45:24 +0200 |
commit | b902a2f2a7438810cdcb053568ed5c27089b1e8a (patch) | |
tree | 0a70fb9dd0093ea6f3ad024616c665f9669077ff /scene | |
parent | a3072aa35e3bfd69d826fa33328b3ce1862f472a (diff) |
Fixing warnings generated by MSVC
Fixes #22684.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/node_2d.cpp | 6 | ||||
-rw-r--r-- | scene/2d/node_2d.h | 2 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 2 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/voxel_light_baker.cpp | 6 | ||||
-rw-r--r-- | scene/resources/convex_polygon_shape.cpp | 3 | ||||
-rw-r--r-- | scene/resources/dynamic_font.cpp | 4 |
7 files changed, 8 insertions, 17 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 29065a89b3..2f94c3c6f5 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -204,12 +204,6 @@ Size2 Node2D::get_scale() const { return _scale; } -void Node2D::_notification(int p_what) { - - switch (p_what) { - } -} - Transform2D Node2D::get_transform() const { return _mat; diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 725686cdf8..924a84fb88 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -52,8 +52,6 @@ class Node2D : public CanvasItem { void _update_xform_values(); protected: - void _notification(int p_what); - static void _bind_methods(); public: diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index a60ce47f5c..67e25ec508 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -593,7 +593,7 @@ void TileMap::update_dirty_quadrants() { if (quadrant_order_dirty) { - int index = -0x80000000; //always must be drawn below children + int index = -(int64_t)0x80000000; //always must be drawn below children for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) { Quadrant &q = E->get(); diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 7ad43b722d..3046cad624 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -448,7 +448,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { //float dist_att_db = -20 * Math::log(dist + 0.00001); //logarithmic attenuation, like in real life - float center_val[3] = { 0.5, 0.25, 0.16666 }; + float center_val[3] = { 0.5f, 0.25f, 0.16666f }; AudioFrame center_frame(center_val[vol_index_max - 1], center_val[vol_index_max - 1]); if (attenuation < 1.0) { diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp index f9bd905181..541f6047d9 100644 --- a/scene/3d/voxel_light_baker.cpp +++ b/scene/3d/voxel_light_baker.cpp @@ -1619,7 +1619,7 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const Vector3(-0.700629, -0.509037, 0.5), Vector3(0.267617, -0.823639, 0.5) }; - static const float weights[6] = { 0.25, 0.15, 0.15, 0.15, 0.15, 0.15 }; + static const float weights[6] = { 0.25f, 0.15f, 0.15f, 0.15f, 0.15f, 0.15f }; // cone_dirs = dirs; cone_dir_count = 6; @@ -1641,7 +1641,7 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const Vector3(0.19124006749743122, 0.39355745585016605, 0.8991883926788214), Vector3(0.19124006749743122, -0.39355745585016605, 0.8991883926788214), }; - static const float weights[10] = { 0.08571, 0.08571, 0.08571, 0.08571, 0.08571, 0.08571, 0.08571, 0.133333, 0.133333, 0.13333 }; + static const float weights[10] = { 0.08571f, 0.08571f, 0.08571f, 0.08571f, 0.08571f, 0.08571f, 0.08571f, 0.133333f, 0.133333f, 0.13333f }; cone_dirs = dirs; cone_dir_count = 10; cone_aperture = 0.404; // tan(angle) 45 degrees @@ -1875,7 +1875,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh if (bake_mode == BAKE_MODE_RAY_TRACE) { //blur //gauss kernel, 7 step sigma 2 - static const float gauss_kernel[4] = { 0.214607, 0.189879, 0.131514, 0.071303 }; + static const float gauss_kernel[4] = { 0.214607f, 0.189879f, 0.131514f, 0.071303f }; //horizontal pass for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 9d47bca5ed..39488760cd 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -38,10 +38,9 @@ Vector<Vector3> ConvexPolygonShape::_gen_debug_mesh_lines() { if (points.size() > 3) { - QuickHull qh; Vector<Vector3> varr = Variant(points); Geometry::MeshData md; - Error err = qh.build(varr, md); + Error err = QuickHull::build(varr, md); if (err == OK) { Vector<Vector3> lines; lines.resize(md.edges.size() * 2); diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 6790c35c4b..458cbf6718 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -201,10 +201,10 @@ Error DynamicFontAtSize::_load() { if (FT_HAS_COLOR(face)) { int best_match = 0; - int diff = ABS(id.size - face->available_sizes[0].width); + int diff = ABS(id.size - ((int64_t)face->available_sizes[0].width)); scale_color_font = float(id.size) / face->available_sizes[0].width; for (int i = 1; i < face->num_fixed_sizes; i++) { - int ndiff = ABS(id.size - face->available_sizes[i].width); + int ndiff = ABS(id.size - ((int64_t)face->available_sizes[i].width)); if (ndiff < diff) { best_match = i; diff = ndiff; |