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

Method Hill_Prepare_Overlays

Source/Amiga/Graphics_Amiga.cpp:808–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808void cGraphics_Amiga::Hill_Prepare_Overlays() {
809 const sHillOverlay_Amiga* a3 = mHillOverlay_Amiga;
810
811 for (; a3->mSpriteType != -1; ++a3) {
812
813 auto SpriteSheet = mFodder->Sprite_Get_Sheet(a3->mSpriteType, a3->mFrame);
814
815 int d0 = SpriteSheet->mColCount - 1;
816 int d1 = SpriteSheet->mRowCount - 1;
817
818 uint8* DestBase = mImageHillSprites.mData->data();
819
820 int16 d2 = a3->mX;
821 d2 >>= 3;
822 d2 &= 0xFFE;
823
824 DestBase += d2;
825 d2 = a3->mY;
826
827 int16 d1_s = d1;
828 d2 <<= 3;
829 d1 = d2;
830 d2 <<= 2;
831 d2 += d1;
832 d1 = d1_s;
833
834 DestBase += d2;
835 uint8* Source = SpriteSheet->GetGraphicsPtr();
836 uint8* Dest = DestBase;
837
838 do {
839
840 for (d2 = d1; d2 >= 0; --d2) {
841
842 // Draw the overlay
843 writeBEWord(Dest, readBEWord(Source));
844 writeBEWord(Dest + 0x2828, readBEWord(Source + 0x2800));
845 writeBEWord(Dest + 0x5050, readBEWord(Source + 0x5000));
846 writeBEWord(Dest + 0x7878, readBEWord(Source + 0x7800));
847
848 Source += 0x28;
849 Dest += 0x28;
850 }
851
852 Source = SpriteSheet->GetGraphicsPtr() + 2;
853 Dest = DestBase + 2;
854
855 } while (--d0 >= 0);
856 }
857}
858
859void cGraphics_Amiga::MapOverview_Render_Tiles(uint16 pTile, uint16 pDestX, uint16 pDestY) {
860 uint8* Target = mFodder->mSurfaceMapOverview->GetSurfaceBuffer();

Callers 2

PlaygroundMethod · 0.80
Recruit_PrepareMethod · 0.80

Calls 4

writeBEWordFunction · 0.85
readBEWordFunction · 0.85
Sprite_Get_SheetMethod · 0.80
GetGraphicsPtrMethod · 0.80

Tested by

no test coverage detected