mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
Add filename to raster::Palette (this will be useful to know the original location of a palette)
This commit is contained in:
parent
811a530013
commit
50a10a9056
@ -426,6 +426,9 @@ Palette* Palette::load(const char *filename)
|
||||
pal = raster::file::load_gpl_file(filename);
|
||||
}
|
||||
|
||||
if (pal)
|
||||
pal->setFilename(filename);
|
||||
|
||||
return pal;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,11 @@ namespace raster {
|
||||
int size() const { return m_colors.size(); }
|
||||
void resize(int ncolors);
|
||||
|
||||
std::string getFilename() const { return m_filename; }
|
||||
void setFilename(const std::string& filename) {
|
||||
m_filename = filename;
|
||||
}
|
||||
|
||||
int getModifications() const { return m_modifications; }
|
||||
|
||||
FrameNumber getFrame() const { return m_frame; }
|
||||
@ -101,6 +106,7 @@ namespace raster {
|
||||
FrameNumber m_frame;
|
||||
std::vector<color_t> m_colors;
|
||||
int m_modifications;
|
||||
std::string m_filename; // If the palette is associated with a file.
|
||||
};
|
||||
|
||||
} // namespace raster
|
||||
|
Loading…
Reference in New Issue
Block a user