Several performance improvements, mainly in loading and instancing scenes and resources.

A general speedup should be apparent, with even more peformance increase when compiling optimized.

WARNING: Tested and it seems to work, but if something breaks, please report.
This commit is contained in:
Juan Linietsky
2015-06-29 00:29:49 -03:00
parent 2b64f73b04
commit 95047562d7
62 changed files with 475 additions and 294 deletions

View File

@ -122,8 +122,8 @@ bool CollisionObject::_set(const StringName& p_name, const Variant& p_value) {
} else if (name.begins_with("shapes/")) {
int idx=name.get_slice("/",1).to_int();
String what=name.get_slice("/",2);
int idx=name.get_slicec('/',1).to_int();
String what=name.get_slicec('/',2);
if (what=="shape")
set_shape(idx,RefPtr(p_value));
else if (what=="transform")
@ -148,8 +148,8 @@ bool CollisionObject::_get(const StringName& p_name,Variant &r_ret) const {
r_ret= shapes.size();
} else if (name.begins_with("shapes/")) {
int idx=name.get_slice("/",1).to_int();
String what=name.get_slice("/",2);
int idx=name.get_slicec('/',1).to_int();
String what=name.get_slicec('/',2);
if (what=="shape")
r_ret= get_shape(idx);
else if (what=="transform")