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

Method DrawPixel

Source/Amiga/Graphics_Amiga.cpp:1447–1474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1445}
1446
1447void cGraphics_Amiga::DrawPixel(uint8* pSource, uint8* pDestination, uint16 pSourceX, uint16 pSourceY, uint16 pX, uint16 pY) {
1448 uint8 Planes[5] = { 0, 0, 0, 0, 0 };
1449
1450 pSource += (pSourceX / 8);
1451 pSource += (pSourceY * 40);
1452
1453 pDestination += pX;
1454 pDestination += pY * mSurface->GetWidth();
1455
1456
1457 // Load bits for all planes
1458 for (uint8 Plane = 0; Plane < mBMHD_Current->mPlanes; ++Plane)
1459 Planes[Plane] = *(pSource + ((mBMHD_Current->mHeight * 40) * Plane));
1460
1461 // Loop each pixel
1462
1463 uint8 Bit = (0x80 >> (pSourceX % 8));
1464 uint8 Result = 0;
1465
1466 // Value for each plane
1467 for (uint8 Plane = 0; Plane < mBMHD_Current->mPlanes; ++Plane) {
1468 Result |= Planes[Plane] & Bit ? (1 << Plane) : 0;
1469 }
1470
1471 if (Result)
1472 *pDestination = mFodder->mVideo_Draw_PaletteIndex | Result;
1473
1474}
1475
1476void cGraphics_Amiga::DrawPixels_8(uint8* pSource, uint8* pDestination) {
1477 uint8 Planes[8];

Callers

nothing calls this directly

Calls 1

GetWidthMethod · 0.80

Tested by

no test coverage detected