Explorar el Código

Fix compilation on Visual Studio 2013 (#10219).

scorched hace 8 años
padre
commit
3ba5ee42c3

+ 1 - 1
editor/editor_themes.cpp

@@ -392,7 +392,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
 		editor_register_and_generate_icons(theme, dark_theme, thumb_size);
 	}
 	// thumbnail size has changed, so we regenerate the medium sizes
-	if (p_theme != NULL && fabs(p_theme->get_constant("thumb_size", "Editor") - thumb_size) > 0.00001) {
+	if (p_theme != NULL && fabs((double)p_theme->get_constant("thumb_size", "Editor") - thumb_size) > 0.00001) {
 		editor_register_and_generate_icons(p_theme, dark_theme, thumb_size, true);
 	}
 

+ 2 - 2
editor/plugins/canvas_item_editor_plugin.cpp

@@ -2165,8 +2165,8 @@ void CanvasItemEditor::_draw_grid() {
 		Vector2 real_grid_offset;
 		if (snap_relative && get_item_count() > 0) {
 			Vector2 topleft = _find_topleftmost_point();
-			real_grid_offset.x = fmod(topleft.x, grid_step.x * Math::pow(2.0, grid_step_multiplier));
-			real_grid_offset.y = fmod(topleft.y, grid_step.y * Math::pow(2.0, grid_step_multiplier));
+			real_grid_offset.x = fmod(topleft.x, grid_step.x * (real_t)Math::pow(2.0, grid_step_multiplier));
+			real_grid_offset.y = fmod(topleft.y, grid_step.y * (real_t)Math::pow(2.0, grid_step_multiplier));
 		} else {
 			real_grid_offset = grid_offset;
 		}

+ 9 - 0
modules/gdnative/include/gdnative/array.h

@@ -46,11 +46,20 @@ typedef struct {
 } godot_array;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/pool_arrays.h>
 #include <gdnative/variant.h>
 
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_array_new(godot_array *r_dest);
 void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src);
 void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca);

+ 9 - 0
modules/gdnative/include/gdnative/basis.h

@@ -45,10 +45,19 @@ typedef struct {
 } godot_basis;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/quat.h>
 #include <gdnative/vector3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
 void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
 void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler);

+ 9 - 0
modules/gdnative/include/gdnative/color.h

@@ -45,9 +45,18 @@ typedef struct {
 } godot_color;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
 void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
 

+ 9 - 0
modules/gdnative/include/gdnative/dictionary.h

@@ -45,10 +45,19 @@ typedef struct {
 } godot_dictionary;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/array.h>
 #include <gdnative/gdnative.h>
 #include <gdnative/variant.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_dictionary_new(godot_dictionary *r_dest);
 void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src);
 void GDAPI godot_dictionary_destroy(godot_dictionary *p_self);

+ 9 - 0
modules/gdnative/include/gdnative/node_path.h

@@ -45,9 +45,18 @@ typedef struct {
 } godot_node_path;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from);
 void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src);
 void GDAPI godot_node_path_destroy(godot_node_path *p_self);

+ 9 - 0
modules/gdnative/include/gdnative/plane.h

@@ -45,9 +45,18 @@ typedef struct {
 } godot_plane;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/vector3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
 void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
 void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d);

+ 9 - 0
modules/gdnative/include/gdnative/pool_arrays.h

@@ -113,6 +113,11 @@ typedef struct {
 } godot_pool_color_array;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/array.h>
 #include <gdnative/color.h>
 #include <gdnative/vector2.h>
@@ -120,6 +125,10 @@ typedef struct {
 
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // byte
 
 void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest);

+ 9 - 0
modules/gdnative/include/gdnative/quat.h

@@ -45,9 +45,18 @@ typedef struct {
 } godot_quat;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/vector3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
 void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
 

+ 9 - 0
modules/gdnative/include/gdnative/rect2.h

@@ -43,9 +43,18 @@ typedef struct godot_rect2 {
 } godot_rect2;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/vector2.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
 void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height);
 

+ 9 - 0
modules/gdnative/include/gdnative/rect3.h

@@ -45,10 +45,19 @@ typedef struct {
 } godot_rect3;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/plane.h>
 #include <gdnative/vector3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
 
 godot_vector3 GDAPI godot_rect3_get_position(const godot_rect3 *p_self);

+ 9 - 0
modules/gdnative/include/gdnative/rid.h

@@ -45,8 +45,17 @@ typedef struct {
 } godot_rid;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_rid_new(godot_rid *r_dest);
 
 godot_int GDAPI godot_rid_get_id(const godot_rid *p_self);

+ 9 - 0
modules/gdnative/include/gdnative/string.h

@@ -46,9 +46,18 @@ typedef struct {
 } godot_string;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/variant.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_string_new(godot_string *r_dest);
 void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src);
 void GDAPI godot_string_new_data(godot_string *r_dest, const char *p_contents, const int p_size);

+ 9 - 0
modules/gdnative/include/gdnative/string_name.h

@@ -46,8 +46,17 @@ typedef struct {
 } godot_string_name;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name);
 void GDAPI godot_string_name_new_data(godot_string_name *r_dest, const char *p_name);
 

+ 9 - 0
modules/gdnative/include/gdnative/transform.h

@@ -45,11 +45,20 @@ typedef struct {
 } godot_transform;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/basis.h>
 #include <gdnative/gdnative.h>
 #include <gdnative/variant.h>
 #include <gdnative/vector3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
 void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
 

+ 9 - 0
modules/gdnative/include/gdnative/transform2d.h

@@ -45,10 +45,19 @@ typedef struct {
 } godot_transform2d;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 #include <gdnative/variant.h>
 #include <gdnative/vector2.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
 void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
 

+ 9 - 0
modules/gdnative/include/gdnative/variant.h

@@ -99,6 +99,11 @@ typedef struct godot_variant_call_error {
 	godot_variant_type expected;
 } godot_variant_call_error;
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/array.h>
 #include <gdnative/basis.h>
 #include <gdnative/color.h>
@@ -119,6 +124,10 @@ typedef struct godot_variant_call_error {
 
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
 
 void GDAPI godot_variant_new_copy(godot_variant *r_dest, const godot_variant *p_src);

+ 9 - 0
modules/gdnative/include/gdnative/vector2.h

@@ -45,8 +45,17 @@ typedef struct {
 } godot_vector2;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
 
 godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self);

+ 9 - 0
modules/gdnative/include/gdnative/vector3.h

@@ -45,9 +45,18 @@ typedef struct {
 } godot_vector3;
 #endif
 
+// reduce extern "C" nesting for VS2013
+#ifdef __cplusplus
+}
+#endif
+
 #include <gdnative/basis.h>
 #include <gdnative/gdnative.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum {
 	GODOT_VECTOR3_AXIS_X,
 	GODOT_VECTOR3_AXIS_Y,

+ 1 - 1
modules/mobile_vr/mobile_interface.h

@@ -90,7 +90,7 @@ private:
 
 	///@TODO a few support functions for trackers, most are math related and should likely be moved elsewhere
 	float floor_decimals(float p_value, float p_decimals) {
-		float power_of_10 = pow(10.0, p_decimals);
+		float power_of_10 = pow(10.0f, p_decimals);
 		return floor(p_value * power_of_10) / power_of_10;
 	};