1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Reverted changes in CAnimation.h and .cpp

This commit is contained in:
krs
2022-11-23 22:45:58 +02:00
parent 75b4b64b6f
commit cbd3dffb7c
2 changed files with 8 additions and 14 deletions

View File

@@ -95,7 +95,7 @@ public:
void draw(SDL_Surface * where, int posX=0, int posY=0, Rect *src=nullptr, ui8 alpha=255) const override;
void draw(SDL_Surface * where, SDL_Rect * dest, SDL_Rect * src, ui8 alpha=255) const override;
std::shared_ptr<IImage> scaleFast(float scale) const override;
void exportBitmap(const bfs::path & path) const override;
void exportBitmap(const boost::filesystem::path & path) const override;
void playerColored(PlayerColor player) override;
void setFlagColor(PlayerColor player) override;
int width() const override;
@@ -714,7 +714,7 @@ std::shared_ptr<IImage> SDLImage::scaleFast(float scale) const
return std::shared_ptr<IImage>(ret);
}
void SDLImage::exportBitmap(const bfs::path & path) const
void SDLImage::exportBitmap(const boost::filesystem::path& path) const
{
SDL_SaveBMP(surf, path.string().c_str());
}
@@ -951,7 +951,7 @@ void CAnimation::initFromJson(const JsonNode & config)
}
}
void CAnimation::exportBitmaps(const bfs::path & path, bool prependResourceName) const
void CAnimation::exportBitmaps(const boost::filesystem::path& path) const
{
if(images.empty())
{
@@ -959,8 +959,8 @@ void CAnimation::exportBitmaps(const bfs::path & path, bool prependResourceName)
return;
}
bfs::path actualPath = path / "SPRITES" / name;
bfs::create_directories(actualPath);
boost::filesystem::path actualPath = path / "SPRITES" / name;
boost::filesystem::create_directories(actualPath);
size_t counter = 0;
@@ -975,12 +975,8 @@ void CAnimation::exportBitmaps(const bfs::path & path, bool prependResourceName)
boost::format fmt("%d_%d.bmp");
fmt % group % frame;
std::string fileName = fmt.str();
if(prependResourceName)
fileName = name + "_" + fileName;
img->exportBitmap(actualPath / fileName);
img->exportBitmap(actualPath / fmt.str());
counter++;
}
}

View File

@@ -13,8 +13,6 @@
#include "Geometries.h"
#include "../../lib/GameConstants.h"
namespace bfs = boost::filesystem;
#ifdef IN
#undef IN
#endif
@@ -47,7 +45,7 @@ public:
virtual std::shared_ptr<IImage> scaleFast(float scale) const = 0;
virtual void exportBitmap(const bfs::path & path) const = 0;
virtual void exportBitmap(const boost::filesystem::path & path) const = 0;
//Change palette to specific player
virtual void playerColored(PlayerColor player)=0;
@@ -124,7 +122,7 @@ public:
std::shared_ptr<IImage> getImage(size_t frame, size_t group=0, bool verbose=true) const;
void exportBitmaps(const bfs::path & path, bool prependResourceName = false) const;
void exportBitmaps(const boost::filesystem::path & path) const;
//all available frames
void load ();