summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-01-16 21:05:16 +0100
committerGitHub <noreply@github.com>2017-01-16 21:05:16 +0100
commit23eb355ebb78ed2485557773e18afeb38689d499 (patch)
tree5135c2fcd41ddd64edbf163e2d4749e897cd1407
parentd13f2f9e25e380496e706b59720cd85eed299ca2 (diff)
parent757647670501833c4f550a224b5da51d39fb6b9f (diff)
Merge pull request #7562 from RandomShaper/ordered-image-group-files
Make image-groups map in export.cfg ordered
-rw-r--r--tools/editor/editor_import_export.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index a94604743c..6ef238920d 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -2094,13 +2094,21 @@ void EditorImportExport::save_config() {
if (image_groups.size() && image_group_files.size()){
- Vector<String> igfsave;
- igfsave.resize(image_group_files.size()*2);
+ Vector<String> igfkeys;
+ igfkeys.resize(image_group_files.size());
int idx=0;
for (Map<StringName,StringName>::Element *E=image_group_files.front();E;E=E->next()) {
+ igfkeys[idx++]=E->key();
+ }
+ igfkeys.sort();
+
+ Vector<String> igfsave;
+ igfsave.resize(image_group_files.size()*2);
+ idx=0;
+ for (int i=0;i<igfkeys.size();++i) {
- igfsave[idx++]=E->key();
- igfsave[idx++]=E->get();
+ igfsave[idx++]=igfkeys[i];
+ igfsave[idx++]=image_group_files[igfkeys[i]];
}
cf->set_value("image_group_files","files",igfsave);
}