-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSplitter.h
29 lines (23 loc) · 1.13 KB
/
Splitter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef SPRITESHEETSPLITTER_SPLITTER_H
#define SPRITESHEETSPLITTER_SPLITTER_H
#include "util/SplitterOptions.h"
#include "IO/SpriteSheetIO.h"
#include "util/SpriteSplittingStatus.h"
#include "util/SpriteSplittingData.h"
class Splitter {
public:
Splitter() = default;
void work(std::vector<SplitterOpts>& jobs);
private:
SpriteSheetIO ssio;
std::regex ground_matcher; // default initialized regexes match nothing, so we do not need to initialize this.
void workFolder(int workCap, std::queue<std::string> &pngs, SpriteSplittingStatus &jobStats);
void split(const std::string &fileDirectory, SpriteSplittingStatus &jobStats, std::basic_ostream<char> &outStream);
static bool validSpriteSheet(unsigned int width, unsigned int height, unsigned int columnCount);
static void splitObjectSheet(SpriteSplittingData& ssd);
static void splitCharSheet(SpriteSplittingData& ssd);
// sprite count per row of type
static const int OBJ_SHEET_ROW = 16; // == GROUND_SHEET_ROW. Ground Sheets also have 16 (1 hex digit) sprites per row.
static const int CHAR_SHEET_ROW = 7;
};
#endif //SPRITESHEETSPLITTER_SPLITTER_H