Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion SSE Hand Relief Very Nice/Surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,26 @@ class Surface
}
}
}
void BltMemcpy(Vei2 dstPt, const RectI& srcRect, const Surface& src)
{
const Color* __restrict ptSrc = src.GetBufferConst();
Color* __restrict ptDst = GetBuffer();

ptSrc += srcRect.top * src.GetWidth() + srcRect.left;
ptDst += dstPt.y * GetWidth() + dstPt.x;

Color* ptDstEnd = ptDst + srcRect.GetHeight() * GetWidth();

const int rowByteSize = srcRect.GetWidth() * sizeof(Color);

while (ptDst < ptDstEnd)
{
::memcpy(ptDst, ptSrc, rowByteSize);

ptDst += GetWidth();
ptSrc += src.GetWidth();
}
}
void BltBlend( Vei2 dstPt,const RectI& srcRect,const Surface& src,unsigned char alpha )
{
const unsigned int mask = 0xFF;
Expand Down Expand Up @@ -2237,4 +2257,4 @@ class TextSurface : public Surface
private:
Gdiplus::Bitmap bitmap;
Gdiplus::Graphics g;
};
};