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

Method Sidebar_Copy_Sprite_To_ScreenBufPtr

Source/Amiga/Graphics_Amiga.cpp:1095–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1093}
1094
1095void cGraphics_Amiga::Sidebar_Copy_Sprite_To_ScreenBufPtr(int16 pSpriteType, size_t pX, size_t pY) {
1096 const sSpriteSheet_pstuff* str2 = &mSpriteSheet_PStuff[pSpriteType];
1097
1098 mFodder->mVideo_Draw_Columns = str2->mColumns >> 3;
1099 mFodder->mVideo_Draw_Rows = str2->mRows;
1100
1101 uint16 ax = str2->mY & 0xFF;
1102 uint16 bx = str2->mX >> 3 & -2;
1103
1104 ax <<= 3;
1105 int16 d1 = ax;
1106
1107 ax <<= 2;
1108 ax += d1;
1109
1110 mFodder->mVideo_Draw_FrameDataPtr = str2->GetGraphicsPtr(ax + bx);
1111
1112 mFodder->mDraw_Source_SkipPixelsPerRow = 40 - mFodder->mVideo_Draw_Columns;
1113 mFodder->mDraw_Dest_SkipPixelsPerRow = 0x30 - (mFodder->mVideo_Draw_Columns * 8);
1114
1115 uint8* di = ((uint8*)mFodder->mSidebar_Screen_BufferPtr) + (0x30 * pY) + pX;
1116 uint8* si = mFodder->mVideo_Draw_FrameDataPtr;
1117
1118 // Height
1119 for (int16 dx = mFodder->mVideo_Draw_Rows; dx > 0; --dx) {
1120
1121 // Width
1122 for (int16 cx = 0; cx < mFodder->mVideo_Draw_Columns / 2; ++cx) {
1123
1124 DrawPixels_16(si, di, mFodder->mVideo_Draw_PaletteIndex);
1125
1126 di += 16;
1127 si += 2;
1128 }
1129
1130 si += mFodder->mDraw_Source_SkipPixelsPerRow;
1131 di += mFodder->mDraw_Dest_SkipPixelsPerRow;
1132 }
1133}
1134
1135void cGraphics_Amiga::Sidebar_Copy_ScreenBuffer(uint16 pRow, int16 pRows, int16 pCopyToScreen, uint32*& pBuffer) {
1136 pRow += 8;

Callers

nothing calls this directly

Calls 1

GetGraphicsPtrMethod · 0.80

Tested by

no test coverage detected