diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/SCsub | 2 | ||||
-rw-r--r-- | core/bind/SCsub | 2 | ||||
-rw-r--r-- | core/globals.cpp | 2 | ||||
-rw-r--r-- | core/hashfuncs.h | 5 | ||||
-rw-r--r-- | core/io/SCsub | 2 | ||||
-rw-r--r-- | core/math/SCsub | 2 | ||||
-rw-r--r-- | core/math/math_2d.cpp | 2 | ||||
-rw-r--r-- | core/os/SCsub | 2 | ||||
-rw-r--r-- | core/variant.cpp | 14 | ||||
-rw-r--r-- | core/variant_parser.cpp | 8 |
10 files changed, 23 insertions, 18 deletions
diff --git a/core/SCsub b/core/SCsub index 4ce91c794f..cbed2e4f35 100644 --- a/core/SCsub +++ b/core/SCsub @@ -1,3 +1,5 @@ +#!/usr/bin/env python + Import('env') env.core_sources=[] diff --git a/core/bind/SCsub b/core/bind/SCsub index 7b4a6acbc0..c2731d60e6 100644 --- a/core/bind/SCsub +++ b/core/bind/SCsub @@ -1,3 +1,5 @@ +#!/usr/bin/env python + Import('env') env.add_source_files(env.core_sources,"*.cpp") diff --git a/core/globals.cpp b/core/globals.cpp index b822f52f15..bef40ff330 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -54,7 +54,7 @@ String Globals::localize_path(const String& p_path) const { if (resource_path=="") return p_path; //not initialied yet - if (p_path.begins_with("res://") || p_path.begins_with("user://")) + if (p_path.begins_with("res://") || p_path.begins_with("user://") || p_path.is_abs_path()) return p_path.simplify_path(); diff --git a/core/hashfuncs.h b/core/hashfuncs.h index a917ee5edb..6c029a3458 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -74,7 +74,10 @@ static inline uint32_t hash_djb2_one_float(float p_in,uint32_t p_prev=5381) { float f; uint32_t i; } u; - u.f=p_in; + + // handle -0 case + if (p_in==0.0f) u.f=0.0f; + else u.f=p_in; return ((p_prev<<5)+p_prev)+u.i; } diff --git a/core/io/SCsub b/core/io/SCsub index 3ff9b355a4..48cc9a5275 100644 --- a/core/io/SCsub +++ b/core/io/SCsub @@ -1,3 +1,5 @@ +#!/usr/bin/env python + Import('env') env.add_source_files(env.core_sources,"*.cpp") diff --git a/core/math/SCsub b/core/math/SCsub index 7b4a6acbc0..c2731d60e6 100644 --- a/core/math/SCsub +++ b/core/math/SCsub @@ -1,3 +1,5 @@ +#!/usr/bin/env python + Import('env') env.add_source_files(env.core_sources,"*.cpp") diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 2cc11aa738..e616f05914 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -424,7 +424,7 @@ Matrix32 Matrix32::inverse() const { void Matrix32::affine_invert() { - float det = elements[0][0]*elements[1][1] - elements[1][0]*elements[0][1]; + float det = basis_determinant(); ERR_FAIL_COND(det==0); float idet = 1.0 / det; diff --git a/core/os/SCsub b/core/os/SCsub index 7b4a6acbc0..c2731d60e6 100644 --- a/core/os/SCsub +++ b/core/os/SCsub @@ -1,3 +1,5 @@ +#!/usr/bin/env python + Import('env') env.add_source_files(env.core_sources,"*.cpp") diff --git a/core/variant.cpp b/core/variant.cpp index a78c07d819..b2afc9d080 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -429,6 +429,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { return true; i++; } + } else if (invalid_types) { @@ -439,6 +440,8 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { return false; i++; } + + return true; } return false; @@ -457,7 +460,6 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; const Type *valid_types=NULL; - const Type *invalid_types=NULL; switch(p_type_to) { case BOOL: { @@ -679,16 +681,6 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ return true; i++; } - } else if (invalid_types) { - - - int i=0; - while(invalid_types[i]!=NIL) { - - if (p_type_from==invalid_types[i]) - return false; - i++; - } } return false; diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 6b3828a572..5ed2415e36 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1177,16 +1177,16 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } else if (id=="IntArray") { - Vector<int32_t> args; - Error err = _parse_construct<int32_t>(p_stream,args,line,r_err_str); + Vector<int> args; + Error err = _parse_construct<int>(p_stream,args,line,r_err_str); if (err) return err; - DVector<int32_t> arr; + DVector<int> arr; { int len=args.size(); arr.resize(len); - DVector<int32_t>::Write w = arr.write(); + DVector<int>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=int(args[i]); } |