diff --git a/SSE Hand Relief Very Nice/Surface.h b/SSE Hand Relief Very Nice/Surface.h index 710ab9b..e5234e8 100644 --- a/SSE Hand Relief Very Nice/Surface.h +++ b/SSE Hand Relief Very Nice/Surface.h @@ -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; @@ -2237,4 +2257,4 @@ class TextSurface : public Surface private: Gdiplus::Bitmap bitmap; Gdiplus::Graphics g; -}; \ No newline at end of file +};