mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:40:05 +00:00
Enable loading color palettes from embedded Qt resources
This commit is contained in:
parent
1f9392e9f6
commit
1d597eb120
8 changed files with 88 additions and 9 deletions
|
|
@ -137,13 +137,16 @@ bool ColorTable::IsValid() const
|
|||
std::shared_ptr<ColorTable> ColorTable::Load(const std::string& filename)
|
||||
{
|
||||
logger_->debug("Loading color table: {}", filename);
|
||||
std::ifstream f(filename, std::ios_base::in);
|
||||
return Load(f);
|
||||
}
|
||||
|
||||
std::shared_ptr<ColorTable> ColorTable::Load(std::istream& is)
|
||||
{
|
||||
std::shared_ptr<ColorTable> p = std::make_shared<ColorTable>();
|
||||
|
||||
std::ifstream f(filename, std::ios_base::in);
|
||||
|
||||
std::string line;
|
||||
while (scwx::util::getline(f, line))
|
||||
while (scwx::util::getline(is, line))
|
||||
{
|
||||
std::string token;
|
||||
std::istringstream tokens(line);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue