[aseprite] 57/134: Change default JSON file names in DocumentExporter

Tobias Hansen thansen at moszumanska.debian.org
Sat Mar 14 17:10:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit cb45e046f52511d0a9cf4095b3379ee09f7400f4
Author: David Capello <davidcapello at gmail.com>
Date:   Sun Nov 9 20:01:47 2014 -0300

    Change default JSON file names in DocumentExporter
---
 src/app/document_exporter.cpp | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/app/document_exporter.cpp b/src/app/document_exporter.cpp
index c977f39..6b53765 100644
--- a/src/app/document_exporter.cpp
+++ b/src/app/document_exporter.cpp
@@ -27,6 +27,7 @@
 #include "app/document_api.h"
 #include "app/file/file.h"
 #include "app/ui_context.h"
+#include "base/convert_to.h"
 #include "base/path.h"
 #include "base/unique_ptr.h"
 #include "gfx/packing_rects.h"
@@ -275,21 +276,17 @@ void DocumentExporter::captureSamples(Samples& samples)
       std::string filename = doc->filename();
 
       if (sprite->totalFrames() > FrameNumber(1)) {
-        int frameNumWidth =
-          (sprite->totalFrames() < 10)? 1:
-          (sprite->totalFrames() < 100)? 2:
-          (sprite->totalFrames() < 1000)? 3: 4;
-        std::sprintf(&buf[0], "%0*d", frameNumWidth, (int)frame);
-
         std::string path = base::get_file_path(filename);
         std::string title = base::get_file_title(filename);
         if (layer) {
-          title += "-";
+          title += " (";
           title += layer->name();
+          title += ") ";
         }
 
-        std::string ext = base::get_file_extension(filename);
-        filename = base::join_path(path, title + &buf[0] + "." + ext);
+        filename = base::join_path(path, title +
+            base::convert_to<std::string>((int)frame + 1)
+            + "." + base::get_file_extension(filename));
       }
 
       samples.addSample(Sample(doc, sprite, layer, frame, filename));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list