1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Some fixes from Alban

This commit is contained in:
dan
2000-01-16 02:08:38 +00:00
parent b7296cff16
commit e18cba4da9
3 changed files with 26 additions and 40 deletions

View File

@@ -119,7 +119,7 @@ RGetSubImage(RImage *image, int x, int y, unsigned width, unsigned height)
total_line_size = image->width * (HAS_ALPHA(image) ? 4 : 3);
line_size = width * (HAS_ALPHA(image) ? 4 : 3);
ofs = x*(HAS_ALPHA(image) ? 4 : 3);
ofs = x*(HAS_ALPHA(image) ? 4 : 3) + y*total_line_size;;
for (i=0; i<height; i++) {
memcpy(&new_image->data[i*line_size],
@@ -500,11 +500,11 @@ RMakeTiledImage(RImage *tile, unsigned width, unsigned height)
w = (width - x < tile->width) ? width - x : tile->width;
if (has_alpha) {
w *= 3;
memcpy(d, s+tx*3, w);
} else {
w *= 4;
memcpy(d, s+tx*4, w);
} else {
w *= 3;
memcpy(d, s+tx*3, w);
}
d += w;
}