| 104 | } |
| 105 | |
| 106 | void cSurface::paletteSet( cPalette* pPalette, uint32 pColorID, uint32 pColors, bool pUseNow ) { |
| 107 | |
| 108 | // immediately switch to this new palette? |
| 109 | if (pUseNow) { |
| 110 | for (uint32 ColorID = pColorID; ColorID < pColorID + pColors; ++ColorID) { |
| 111 | mPalette[ColorID] = pPalette[ColorID - pColorID]; |
| 112 | } |
| 113 | |
| 114 | } else { |
| 115 | // No, we fade to it later |
| 116 | for (uint32 ColorID = pColorID; ColorID < pColorID + pColors; ++ColorID) { |
| 117 | mPaletteNew[ColorID] = pPalette[ColorID - pColorID]; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | // Set the actual surface palette to mPalette |
| 122 | surfaceSetToPalette(); |
| 123 | |
| 124 | if (!pUseNow) |
| 125 | mPaletteAdjusting = true; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Fade each color of mPalette by a factor of 2, until mPalette reaches mPaletteNew |
no outgoing calls
no test coverage detected