Fix windows imageBuffer transparent value
This commit is contained in:
@@ -26,6 +26,7 @@ namespace lime {
|
|||||||
ByteArray *data;
|
ByteArray *data;
|
||||||
int height;
|
int height;
|
||||||
int width;
|
int width;
|
||||||
|
bool transparent;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace lime {
|
|||||||
buffer = new ImageBuffer (val_field (image, id_buffer));
|
buffer = new ImageBuffer (val_field (image, id_buffer));
|
||||||
offsetX = val_int (val_field (image, id_offsetX));
|
offsetX = val_int (val_field (image, id_offsetX));
|
||||||
offsetY = val_int (val_field (image, id_offsetY));
|
offsetY = val_int (val_field (image, id_offsetY));
|
||||||
transparent = val_int (val_field (image, id_transparent));
|
transparent = val_bool (val_field (image, id_transparent));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace lime {
|
|||||||
static int id_data;
|
static int id_data;
|
||||||
static int id_height;
|
static int id_height;
|
||||||
static int id_width;
|
static int id_width;
|
||||||
|
static int id_transparent;
|
||||||
static bool init = false;
|
static bool init = false;
|
||||||
|
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ namespace lime {
|
|||||||
height = 0;
|
height = 0;
|
||||||
bpp = 4;
|
bpp = 4;
|
||||||
data = 0;
|
data = 0;
|
||||||
|
transparent = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +31,7 @@ namespace lime {
|
|||||||
|
|
||||||
id_bpp = val_id ("bpp");
|
id_bpp = val_id ("bpp");
|
||||||
id_bitsPerPixel = val_id ("bitsPerPixel");
|
id_bitsPerPixel = val_id ("bitsPerPixel");
|
||||||
|
id_transparent = val_id ("transparent");
|
||||||
id_buffer = val_id ("buffer");
|
id_buffer = val_id ("buffer");
|
||||||
id_width = val_id ("width");
|
id_width = val_id ("width");
|
||||||
id_height = val_id ("height");
|
id_height = val_id ("height");
|
||||||
@@ -40,6 +43,7 @@ namespace lime {
|
|||||||
width = val_int (val_field (imageBuffer, id_width));
|
width = val_int (val_field (imageBuffer, id_width));
|
||||||
height = val_int (val_field (imageBuffer, id_height));
|
height = val_int (val_field (imageBuffer, id_height));
|
||||||
bpp = val_int (val_field (imageBuffer, id_bitsPerPixel));
|
bpp = val_int (val_field (imageBuffer, id_bitsPerPixel));
|
||||||
|
transparent = val_bool (val_field (imageBuffer, id_transparent));
|
||||||
value data_value = val_field (imageBuffer, id_data);
|
value data_value = val_field (imageBuffer, id_data);
|
||||||
value buffer_value = val_field (data_value, id_buffer);
|
value buffer_value = val_field (data_value, id_buffer);
|
||||||
|
|
||||||
@@ -94,6 +98,7 @@ namespace lime {
|
|||||||
|
|
||||||
id_bpp = val_id ("bpp");
|
id_bpp = val_id ("bpp");
|
||||||
id_bitsPerPixel = val_id ("bitsPerPixel");
|
id_bitsPerPixel = val_id ("bitsPerPixel");
|
||||||
|
id_transparent = val_id ("transparent");
|
||||||
id_buffer = val_id ("buffer");
|
id_buffer = val_id ("buffer");
|
||||||
id_width = val_id ("width");
|
id_width = val_id ("width");
|
||||||
id_height = val_id ("height");
|
id_height = val_id ("height");
|
||||||
@@ -106,6 +111,7 @@ namespace lime {
|
|||||||
alloc_field (mValue, id_width, alloc_int (width));
|
alloc_field (mValue, id_width, alloc_int (width));
|
||||||
alloc_field (mValue, id_height, alloc_int (height));
|
alloc_field (mValue, id_height, alloc_int (height));
|
||||||
alloc_field (mValue, id_bpp, alloc_int (bpp));
|
alloc_field (mValue, id_bpp, alloc_int (bpp));
|
||||||
|
alloc_field (mValue, id_transparent, alloc_bool (transparent));
|
||||||
alloc_field (mValue, id_data, data->mValue);
|
alloc_field (mValue, id_data, data->mValue);
|
||||||
return mValue;
|
return mValue;
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ namespace lime {
|
|||||||
int rows = sourceRect->y + sourceRect->height + sourceImage->offsetY;
|
int rows = sourceRect->y + sourceRect->height + sourceImage->offsetY;
|
||||||
int columns = sourceRect->x + sourceRect->width + sourceImage->offsetX;
|
int columns = sourceRect->x + sourceRect->width + sourceImage->offsetX;
|
||||||
|
|
||||||
if (!mergeAlpha || !sourceImage->transparent) {
|
if (!mergeAlpha || !sourceImage->buffer->transparent) {
|
||||||
|
|
||||||
for (int row = sourceRect->y + sourceImage->offsetY; row < rows; row++) {
|
for (int row = sourceRect->y + sourceImage->offsetY; row < rows; row++) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user