From 95047562d743b1c1fdc007432c8a0c145a455c5d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 29 Jun 2015 00:29:49 -0300 Subject: 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. --- scene/resources/mesh.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scene/resources/mesh.cpp') diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 039a4788d5..8cb0904415 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -99,7 +99,7 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (sl==-1) return false; int idx=sname.substr(8,sl-8).to_int()-1; - String what = sname.get_slice("/",1); + String what = sname.get_slicec('/',1); if (what=="material") surface_set_material(idx,p_value); else if (what=="name") @@ -117,8 +117,8 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { return false; - int idx=sname.get_slice("/",1).to_int(); - String what=sname.get_slice("/",2); + int idx=sname.get_slicec('/',1).to_int(); + String what=sname.get_slicec('/',2); if (idx==surfaces.size()) { @@ -180,7 +180,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { if (sl==-1) return false; int idx=sname.substr(8,sl-8).to_int()-1; - String what = sname.get_slice("/",1); + String what = sname.get_slicec('/',1); if (what=="material") r_ret=surface_get_material(idx); else if (what=="name") @@ -195,7 +195,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { return false; - int idx=sname.get_slice("/",1).to_int(); + int idx=sname.get_slicec('/',1).to_int(); ERR_FAIL_INDEX_V(idx,surfaces.size(),false); Dictionary d; -- cgit v1.2.3