100 if (!rect.
Is_Valid())
return(
false);
128 if (!rect.
Is_Valid())
return(
false);
207 bool overlapped =
false;
208 void * dbuffer =
NULL;
209 void * sbuffer =
NULL;
215 if (!
XSurface::Prep_For_Blit(dest, dcliprect, drect, source, scliprect, srect, overlapped, dbuffer, sbuffer)) {
240 int sstride = source.
Stride();
241 int dstride = dest.
Stride();
245 sbuffer = ((
char*)sbuffer) + (srect.
Height-1) * source.
Stride();
246 dbuffer = ((
char*)dbuffer) + (drect.
Height-1) * dest.
Stride();
254 for (
int y = 0; y < height; y++) {
256 dbuffer = (
void*)(((
char*)dbuffer) + dstride);
257 sbuffer = (
void*)(((
char*)sbuffer) + sstride);
260 for (
int y = 0; y < height; y++) {
262 dbuffer = (
void*)(((
char*)dbuffer) + dstride);
263 sbuffer = (
void*)(((
char*)sbuffer) + sstride);
355 if (!
Blit_Clip(drect, dcliprect, srect, scliprect)) {
363 int leftmargin = srect.
X - scliprect.
X;
364 int topmargin = srect.
Y - scliprect.
Y;
368 if (dbuffer ==
NULL)
return(
false);
375 void * sbuffer = source.
Lock();
376 if (sbuffer ==
NULL) {
385 while (topmargin > 0) {
386 sbuffer = ((
unsigned char *)sbuffer) + (*(
unsigned short *)sbuffer);
393 int dstride = dest.
Stride();
395 for (
int y = 0; y < height; y++) {
400 blitter.
Blit(dbuffer, ((
unsigned short *)sbuffer)+1, srect.
Width, leftmargin);
405 sbuffer = ((
unsigned char *)sbuffer) + (*(
unsigned short *)sbuffer);
406 dbuffer = (
void*)(((
char*)dbuffer) + dstride);
bool Bit_Blit(Surface &dest, Rect const &destrect, Surface const &source, Rect const &sourcerect, Blitter const &blitter)
bool RLE_Blit(Surface &dest, Rect const &destrect, Surface const &source, Rect const &sourcerect, RLEBlitter const &blitter)
int Buffer_Size(Surface const &surface, int width, int height)
bool From_Buffer(Surface &surface, Rect const &rect, Buffer const &buffer)
bool To_Buffer(Surface const &surface, Rect const &rect, Buffer &buffer)
virtual void BlitForward(void *dest, void const *source, int length) const =0
virtual void BlitBackward(void *dest, void const *source, int length) const =0
virtual void Blit(void *dest, void const *source, int length, int leadskip=0) const =0
virtual Rect Get_Rect(void) const
virtual bool Blit_From(Rect const &dcliprect, Rect const &destrect, Surface const &source, Rect const &scliprect, Rect const &sourcerect, bool trans=false)=0
virtual bool Unlock(void) const =0
virtual void * Lock(Point2D point=Point2D(0, 0)) const =0
virtual int Bytes_Per_Pixel(void) const =0
virtual int Stride(void) const =0
bool Is_Valid(void) const
TPoint2D< T > Top_Left(void) const
virtual bool Blit_From(Rect const &dcliprect, Rect const &destrect, Surface const &source, Rect const &scliprect, Rect const &sourcerect, bool trans=false)
static bool Prep_For_Blit(Surface &dest, Rect &drect, Surface const &source, Rect &srect, bool &overlapped, void *&dbuffer, void *&sbuffer)
bool Blit_Clip(Rect &drect, Rect const &dwindow, Rect &srect, Rect const &swindow)