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

Method MapOverview_Render_Tiles

Source/Amiga/Graphics_Amiga.cpp:859–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859void cGraphics_Amiga::MapOverview_Render_Tiles(uint16 pTile, uint16 pDestX, uint16 pDestY) {
860 uint8* Target = mFodder->mSurfaceMapOverview->GetSurfaceBuffer();
861
862 pDestX *= 16;
863
864 Target += (pDestY * 16) * mFodder->mSurfaceMapOverview->GetWidth();
865 Target += pDestX;
866
867 pTile <<= 7;
868 uint8* TilePtr = mBlkData->data() + pTile;
869
870 // Each bitfield
871 for (uint16 BitField = 0; BitField < 4; ++BitField) {
872 uint8* TargetTmp = Target;
873
874 // Each Tile Row
875 for (uint16 i = 0; i < 16; ++i) {
876
877 if (TilePtr >= mBlkData->data() + mBlkData->size())
878 continue;
879
880 uint16 RowData = readBEWord(TilePtr);
881 TilePtr += 2;
882
883 // Each pixel of a Tile Row
884 for (uint16 x = 0; x < 16; ++x) {
885 uint8 Bit = (RowData & 0x8000) ? 1 : 0;
886 RowData <<= 1;
887
888 if (Bit)
889 *(TargetTmp + x) |= (Bit << BitField);
890
891 }
892
893 TargetTmp += mFodder->mSurfaceMapOverview->GetWidth();
894 }
895
896 // Next Bitfield
897 TargetTmp = Target;
898 }
899}
900
901void cGraphics_Amiga::Map_Load_Resources() {
902 mFodder->mFilenameCopt += ".lbm";

Callers

nothing calls this directly

Calls 4

readBEWordFunction · 0.85
GetSurfaceBufferMethod · 0.80
GetWidthMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected