You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
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:
@@ -34,7 +34,7 @@ bool ButtonArray::_set(const StringName& p_name, const Variant& p_value) {
|
||||
String n=String(p_name);
|
||||
if (n.begins_with("button/")) {
|
||||
|
||||
String what = n.get_slice("/",1);
|
||||
String what = n.get_slicec('/',1);
|
||||
if (what=="count") {
|
||||
int new_size=p_value;
|
||||
if (new_size>0 && buttons.size()==0) {
|
||||
@@ -57,7 +57,7 @@ bool ButtonArray::_set(const StringName& p_name, const Variant& p_value) {
|
||||
} else {
|
||||
int idx=what.to_int();
|
||||
ERR_FAIL_INDEX_V(idx,buttons.size(),false);
|
||||
String f = n.get_slice("/",2);
|
||||
String f = n.get_slicec('/',2);
|
||||
if (f=="text")
|
||||
buttons[idx].text=p_value;
|
||||
else if (f=="icon")
|
||||
@@ -80,7 +80,7 @@ bool ButtonArray::_get(const StringName& p_name,Variant &r_ret) const {
|
||||
String n=String(p_name);
|
||||
if (n.begins_with("button/")) {
|
||||
|
||||
String what = n.get_slice("/",1);
|
||||
String what = n.get_slicec('/',1);
|
||||
if (what=="count") {
|
||||
r_ret=buttons.size();
|
||||
} else if (what=="align") {
|
||||
@@ -92,7 +92,7 @@ bool ButtonArray::_get(const StringName& p_name,Variant &r_ret) const {
|
||||
} else {
|
||||
int idx=what.to_int();
|
||||
ERR_FAIL_INDEX_V(idx,buttons.size(),false);
|
||||
String f = n.get_slice("/",2);
|
||||
String f = n.get_slicec('/',2);
|
||||
if (f=="text")
|
||||
r_ret=buttons[idx].text;
|
||||
else if (f=="icon")
|
||||
|
||||
Reference in New Issue
Block a user