mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
export bitmaps now by default prepends def name to exported PNG
This commit is contained in:
@@ -688,7 +688,7 @@ std::shared_ptr<QImage> Animation::getImage(size_t frame, size_t group, bool ver
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Animation::exportBitmaps(const bfs::path & path, bool prependResourceName) const
|
||||
void Animation::exportBitmaps(const bfs::path & path) const
|
||||
{
|
||||
if(images.empty())
|
||||
{
|
||||
@@ -713,8 +713,7 @@ void Animation::exportBitmaps(const bfs::path & path, bool prependResourceName)
|
||||
boost::format fmt("%d_%d.png");
|
||||
fmt % group % frame;
|
||||
std::string fileName = fmt.str();
|
||||
if(prependResourceName)
|
||||
fileName = name + "_" + fileName;
|
||||
fileName = name + "_" + fileName;
|
||||
|
||||
auto s = img->size();
|
||||
img->save(pathToQString(actualPath / fileName), "PNG");
|
||||
|
@@ -85,7 +85,7 @@ public:
|
||||
void load (size_t frame, size_t group = 0);
|
||||
void unload(size_t frame, size_t group = 0);
|
||||
|
||||
void exportBitmaps(const bfs::path & path, bool prependResourceName = false) const;
|
||||
void exportBitmaps(const bfs::path & path) const;
|
||||
|
||||
//total count of frames in group (including not loaded)
|
||||
size_t size(size_t group = 0) const;
|
||||
|
@@ -68,7 +68,7 @@ void splitDefFile(const std::string & fileName, const bfs::path & spritesPath, b
|
||||
{
|
||||
std::unique_ptr<Animation> anim = make_unique<Animation>(fileName);
|
||||
anim->preload();
|
||||
anim->exportBitmaps(VCMIDirs::get().userCachePath() / "extracted", true);
|
||||
anim->exportBitmaps(VCMIDirs::get().userCachePath() / "extracted");
|
||||
|
||||
if(deleteOriginals)
|
||||
bfs::remove(spritesPath / fileName);
|
||||
|
Reference in New Issue
Block a user