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);
|
pal = raster::file::load_gpl_file(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pal)
|
||||||
|
pal->setFilename(filename);
|
||||||
|
|
||||||
return pal;
|
return pal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,11 @@ namespace raster {
|
|||||||
int size() const { return m_colors.size(); }
|
int size() const { return m_colors.size(); }
|
||||||
void resize(int ncolors);
|
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; }
|
int getModifications() const { return m_modifications; }
|
||||||
|
|
||||||
FrameNumber getFrame() const { return m_frame; }
|
FrameNumber getFrame() const { return m_frame; }
|
||||||
@ -101,6 +106,7 @@ namespace raster {
|
|||||||
FrameNumber m_frame;
|
FrameNumber m_frame;
|
||||||
std::vector<color_t> m_colors;
|
std::vector<color_t> m_colors;
|
||||||
int m_modifications;
|
int m_modifications;
|
||||||
|
std::string m_filename; // If the palette is associated with a file.
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace raster
|
} // namespace raster
|
||||||
|
Loading…
Reference in New Issue
Block a user