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

Method Sprite_Draw_Frame

Source/Fodder.cpp:3794–3822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3792}
3793
3794void cFodder::Sprite_Draw_Frame(sSprite* pDi, int16 pSpriteType, int16 pFrame, cSurface *pDestination) {
3795 auto SheetData = Sprite_Get_Sheet(pSpriteType, pFrame);
3796
3797 mVideo_Draw_PaletteIndex = SheetData->mPalleteIndex & 0xFF;
3798 mVideo_Draw_FrameDataPtr = SheetData->GetGraphicsPtr();
3799
3800 mVideo_Draw_Columns = SheetData->mColCount;
3801 mVideo_Draw_Rows = SheetData->mRowCount - pDi->field_52;
3802
3803#if defined(_OFED) || defined(_OFBOT)
3804 mMapTile_DrawY = (mMapTile_MovedVertical * 16) + mMapTile_RowOffset;
3805 mMapTile_DrawX = (mMapTile_MovedHorizontal * 16) + mMapTile_ColumnOffset;
3806
3807 mVideo_Draw_PosX = (int16)((SheetData->mModX + pDi->field_0) - mMapTile_DrawX);
3808#else
3809 mVideo_Draw_PosX = (int16)((SheetData->mModX + pDi->field_0) - mMapTile_DrawX + 0x40);
3810#endif
3811
3812 mVideo_Draw_PosY = (int16)((SheetData->mModY + pDi->field_4) - mVideo_Draw_Rows - pDi->field_20 - mMapTile_DrawY);
3813 mVideo_Draw_PosY += 0x10;
3814
3815 if (Sprite_OnScreen_Check()) {
3816 pDi->field_5C = 1;
3817 if(!mStartParams->mDisableVideo)
3818 mGraphics->Video_Draw_8(pDestination);
3819 }
3820 else
3821 pDi->field_5C = 0;
3822}
3823
3824bool cFodder::Sprite_OnScreen_Check() {
3825

Callers

nothing calls this directly

Calls 2

GetGraphicsPtrMethod · 0.80
Video_Draw_8Method · 0.45

Tested by

no test coverage detected