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

Method Video_Draw_8_Alt

Source/Amiga/Graphics_Amiga.cpp:944–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942}
943
944void cGraphics_Amiga::Video_Draw_8_Alt(const uint8* RowPalette) {
945
946 uint8* di = mSurface->GetSurfaceBuffer();
947 uint8* si = mFodder->mVideo_Draw_FrameDataPtr;
948
949 int screenWidth = (int)mSurface->GetWidth();
950 int screenHeight = (int)mSurface->GetHeight();
951
952 // Adjust start position
953 di += screenWidth * mFodder->mVideo_Draw_PosY;
954 di += mFodder->mVideo_Draw_PosX;
955
956 mFodder->mDraw_Source_SkipPixelsPerRow = (mBMHD_Current->mWidth >> 3) - mFodder->mVideo_Draw_Columns;
957 mFodder->mDraw_Dest_SkipPixelsPerRow = screenWidth - (mFodder->mVideo_Draw_Columns * 8);
958
959 // Height
960 for (int16 dx = 0; dx < mFodder->mVideo_Draw_Rows; ++dx) {
961
962 uint8 Palette = mFodder->mVideo_Draw_PaletteIndex;
963 if (RowPalette) {
964 // TODO: palette should degrade closer to top/bottom of screen
965 //int16 bx = mFodder->mVideo_Draw_PosY + dx;
966 //Palette = 1;// RowPallete[bx];
967 }
968
969 int currentY = mFodder->mVideo_Draw_PosY + dx;
970 if (currentY >= 0 && currentY < screenHeight) {
971
972 // Width
973 for (int16 cx = 0; cx < mFodder->mVideo_Draw_Columns; ++cx) {
974
975 int currentX = mFodder->mVideo_Draw_PosX + (cx * 8);
976 if (currentX >= 0 && currentX <= screenWidth) {
977 DrawPixels_8(si, di);
978 }
979
980 di += 8;
981 si += 1;
982 }
983 }
984 else {
985 // Skip entire row
986 si += mFodder->mVideo_Draw_Columns;
987 }
988
989 si += mFodder->mDraw_Source_SkipPixelsPerRow;
990 di += mFodder->mDraw_Dest_SkipPixelsPerRow;
991 }
992}
993
994
995void cGraphics_Amiga::Video_Draw_16_Offset(int16 pCx) {

Callers

nothing calls this directly

Calls 3

GetSurfaceBufferMethod · 0.80
GetWidthMethod · 0.80
GetHeightMethod · 0.80

Tested by

no test coverage detected