for ( int dsty = 0; dsty < height; dsty++ )
{
// We need to calculate the source pixel to interpolate from - Y-axis
- double srcpixy = dsty * M_IMGDATA->m_height / height;
+ double srcpixy = double(dsty * M_IMGDATA->m_height) / height;
double dy = srcpixy - (int)srcpixy;
for ( int dstx = 0; dstx < width; dstx++ )
{
// X-axis of pixel to interpolate from
- double srcpixx = dstx * M_IMGDATA->m_width / width;
+ double srcpixx = double(dstx * M_IMGDATA->m_width) / width;
double dx = srcpixx - (int)srcpixx;
// Sums for each color channel
alpha = (unsigned char *)malloc(M_IMGDATA->m_width*M_IMGDATA->m_height);
}
- free(M_IMGDATA->m_alpha);
+ if( !M_IMGDATA->m_staticAlpha )
+ free(M_IMGDATA->m_alpha);
+
M_IMGDATA->m_alpha = alpha;
M_IMGDATA->m_staticAlpha = static_data;
}
}
}
- free(M_IMGDATA->m_alpha);
+ if( !M_IMGDATA->m_staticAlpha )
+ free(M_IMGDATA->m_alpha);
+
M_IMGDATA->m_alpha = NULL;
+ M_IMGDATA->m_staticAlpha = false;
return true;
}