cleaned up BlitRow()
This commit is contained in:
committed by
Joshua Granick
parent
580946913a
commit
71ab0b6e17
@@ -97,13 +97,7 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void ImageBuffer::BlitRow (const unsigned char *data, int sourcePosition, int destPosition, int sourceW, int destX, int destY) {
|
||||
|
||||
if (destX < 0 || destX + sourceW > this->width || destY < 0 || destY + 1 > this->height) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
void ImageBuffer::BlitRow (const unsigned char *data, int sourcePosition, int destPosition, int sourceW) {
|
||||
|
||||
int stride = (sourceW * (((bitsPerPixel + 3) & ~0x3) >> 3));
|
||||
|
||||
|
||||
@@ -129,12 +129,16 @@ namespace lime {
|
||||
|
||||
if(sourceFormat == destFormat && sourcePremultiplied == destPremultiplied) {
|
||||
|
||||
for (int y = 0; y < destView.height; y++) {
|
||||
if (false == (destView.x < 0 || destView.x + sourceView.width > image->width || destView.y < 0 || destView.y + destView.height > image->height)) {
|
||||
|
||||
sourcePosition = sourceView.Row (y);
|
||||
destPosition = destView.Row (y);
|
||||
|
||||
image->buffer->BlitRow(sourceData, sourcePosition, destPosition, sourceView.width, destView.x, destView.y+y);
|
||||
for (int y = 0; y < destView.height; y++) {
|
||||
|
||||
sourcePosition = sourceView.Row (y);
|
||||
destPosition = destView.Row (y);
|
||||
|
||||
image->buffer->BlitRow(sourceData, sourcePosition, destPosition, sourceView.width);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user