diff options
Diffstat (limited to 'src/XPM.cxx')
-rw-r--r-- | src/XPM.cxx | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index f0277c65f..cdaa69535 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -46,11 +46,11 @@ static size_t MeasureLength(const char *s) { } ColourDesired XPM::ColourDesiredFromCode(int ch) const { - return colourCodeTable[ch]->desired; + return *colourCodeTable[ch]; } -ColourAllocated XPM::ColourFromCode(int ch) const { - return colourCodeTable[ch]->allocated; +ColourDesired XPM::ColourFromCode(int ch) const { + return *colourCodeTable[ch]; #ifdef SLOW for (int i=0; i<nColours; i++) { if (codes[i] == ch) { @@ -124,7 +124,7 @@ void XPM::Init(const char *const *linesForm) { return; } codes = new char[nColours]; - colours = new ColourPair[nColours]; + colours = new ColourDesired[nColours]; int strings = 1+height+nColours; lines = new char *[strings]; @@ -151,9 +151,9 @@ void XPM::Init(const char *const *linesForm) { codes[c] = colourDef[0]; colourDef += 4; if (*colourDef == '#') { - colours[c].desired.Set(colourDef); + colours[c].Set(colourDef); } else { - colours[c].desired = ColourDesired(0xff, 0xff, 0xff); + colours[c] = ColourDesired(0xff, 0xff, 0xff); codeTransparent = codes[c]; } colourCodeTable[static_cast<unsigned char>(codes[c])] = &(colours[c]); @@ -171,24 +171,6 @@ void XPM::Clear() { lines = 0; } -void XPM::RefreshColourPalette(Palette &pal, bool want) { - if (!data || !codes || !colours || !lines) { - return; - } - for (int i=0; i<nColours; i++) { - pal.WantFind(colours[i], want); - } -} - -void XPM::CopyDesiredColours() { - if (!data || !codes || !colours || !lines) { - return; - } - for (int i=0; i<nColours; i++) { - colours[i].Copy(); - } -} - void XPM::Draw(Surface *surface, PRectangle &rc) { if (!data || !codes || !colours || !lines) { return; @@ -296,7 +278,6 @@ void XPMSet::Add(int ident, const char *textForm) { for (int i = 0; i < len; i++) { if (set[i]->GetId() == ident) { set[i]->Init(textForm); - set[i]->CopyDesiredColours(); return; } } @@ -305,7 +286,6 @@ void XPMSet::Add(int ident, const char *textForm) { XPM *pxpm = new XPM(textForm); if (pxpm) { pxpm->SetId(ident); - pxpm->CopyDesiredColours(); if (len == maximum) { maximum += 64; XPM **setNew = new XPM *[maximum]; |