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

Method LoadPalette

Source/Graphics.hpp:77–88  ·  view source on GitHub ↗

* Load a Palette from a location in the loaded data */

Source from the content-addressed store, hash-verified

75 * Load a Palette from a location in the loaded data
76 */
77 void LoadPalette(size_t pFrom, const size_t pCount, const size_t pStartColorID = 0) {
78
79 auto Buffer = mData->data();
80
81 for (size_t ColorID = pStartColorID; ColorID < pStartColorID + pCount; ColorID++) {
82
83 // Get the next color values
84 mPalette[ColorID].mRed = *(Buffer + pFrom++);
85 mPalette[ColorID].mGreen = *(Buffer + pFrom++);
86 mPalette[ColorID].mBlue = *(Buffer + pFrom++);
87 }
88 }
89
90 /**
91 * Load a Palette from a buffer (BIG ENDIAN)

Callers 3

Decode_ImageMethod · 0.80
Map_Load_ResourcesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected