X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/9338e46bb1d0e049aa37b65107862c9d8e85abbc..0db2e8f1a55ff385e5fea5f218b77f39374bd427:/src/gui/render.c
diff --git a/src/gui/render.c b/src/gui/render.c
index 9dd4e9b..e30e6c8 100644
--- a/src/gui/render.c
+++ b/src/gui/render.c
@@ -16,6 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+
+#include
#include
#include
@@ -46,27 +48,25 @@ static void get_colour(unsigned char index, unsigned char out[static 4])
out[3] = -1; /* opaque */
}
-int render_to_pixbuf(LBX_IMG *image, GdkPixbuf *pixbuf, unsigned frame)
+int render_to_pixbuf(struct lbx_image *image, GdkPixbuf *pixbuf, unsigned frame)
{
unsigned char **framedata, **framemask, *outbuf;
- struct lbx_imginfo info;
unsigned stride;
- lbximg_getinfo(image, &info);
- assert(info.width == gdk_pixbuf_get_width(pixbuf));
- assert(info.height == gdk_pixbuf_get_height(pixbuf));
+ assert(image->width == gdk_pixbuf_get_width(pixbuf));
+ assert(image->height == gdk_pixbuf_get_height(pixbuf));
- framedata = lbximg_getframe(image, frame);
+ framedata = lbx_img_getframe(image, frame);
g_return_val_if_fail(framedata, -1);
- framemask = lbximg_getmask(image);
+ framemask = lbx_img_getmask(image);
outbuf = gdk_pixbuf_get_pixels(pixbuf);
stride = gdk_pixbuf_get_rowstride(pixbuf);
- for (unsigned i = 0; i < info.height; i++) {
+ for (unsigned i = 0; i < image->height; i++) {
unsigned char (*px)[4] = (void *)(outbuf + i*stride);
- for (unsigned j = 0; j < info.width; j++) {
+ for (unsigned j = 0; j < image->width; j++) {
if (framemask[i][j])
get_colour(framedata[i][j], px[j]);
else