MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / paletteSet

Method paletteSet

Source/Surface.cpp:106–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void 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

Callers 6

PaletteSetOverviewMethod · 0.80
PaletteBriefingSetMethod · 0.80
PaletteSetMethod · 0.80
PaletteSetOverviewMethod · 0.80
PaletteSetMethod · 0.80
Mission_Intro_PlayMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected