[AD] Paletted Bitmap Grabber PlugIn & Allegro Extension

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi there,

I have coded a new object type. It is an 8bit BITMAP alongside with a
palette. I needed this because OBS2 runs in 24bit mode but in my opinion it
is a waste of space to store everything in 24bit on HD. I always wanted to
have each image it's own palette, but until now it had needed lots of work.
I have lots of graphics and it would be a pain to grab them manually PLUS
their palette.

I created a new struct in allegro.h

typedef struct PAL_BITMAP
{
  BITMAP *bmp;
  PALETTE pal;
} PAL_BITMAP;

added functions:

create_pal_bitmap(int w, int h);
destroy_pal_bitmap(PAL_BITMAP *bmp);

Lot's of stuff changed in datimage.c to grab/view/export this filetype.
Type registration in datafile.c.

I needed to swap the PALETTE & BITMAP section in allegro.h, because I needed
a fully defined PALETTE for the code to work.

How it works:

Use the dat or grabber utility to create a datafile with PBMP objects. When
accessing these objects through sourcecode, the bmp pointer points to a
normal 8bit bitmap, and the pal is the palette the original bitmap had.

The patch is against Allegro 3.9.32. I hope it works, because I haven't
3.9.33 yet.

Please tell me what you think and please apply this patch since I don't have
CVS access.

Jörg


Attachment: pbmp.zip
Description: Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/