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

Method DecodePalette

Source/Amiga/Graphics_Amiga.cpp:665–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665void cGraphics_Amiga::DecodePalette(const uint8* pBuffer, size_t pColorID, const size_t pColors) {
666 size_t ColorID = pColorID;
667
668 for (; pColorID < ColorID + pColors; pColorID++) {
669
670 // Get the next color codes
671 int16 color = readBEWord(pBuffer);
672 pBuffer += 2;
673
674 // Extract each color from the word
675 // X X X X R3 R2 R1 R0 G3 G2 G1 G0 B3 B2 B1 B0
676
677 mPalette[pColorID].mRed = ((color >> 8) & 0xF) << 2;
678 mPalette[pColorID].mGreen = ((color >> 4) & 0xF) << 2;
679 mPalette[pColorID].mBlue = ((color >> 0) & 0xF) << 2;
680 }
681}
682
683void cGraphics_Amiga::Map_Tile_Draw(cSurface* pTarget, uint16 pTile, uint16 pX, uint16 pY, uint16 pOffset) {
684 uint8* Target = pTarget->GetSurfaceBuffer();

Callers

nothing calls this directly

Calls 1

readBEWordFunction · 0.85

Tested by

no test coverage detected