Added VIC2 sprites as output format. Started to code the processing pipeline:

--slice, --pop.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5582 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-09 11:37:10 +00:00
parent 19ffc1ab08
commit 006be848f2
8 changed files with 317 additions and 28 deletions

View File

@@ -79,9 +79,12 @@ Bitmap* NewBitmap (unsigned Width, unsigned Height)
void FreeBitmap (Bitmap* B)
/* Free a dynamically allocated bitmap */
{
/* Free the palette and then the bitmap */
xfree (B->Pal);
xfree(B);
/* Alloc NULL pointers */
if (B != 0) {
/* Free the palette and then the bitmap */
xfree (B->Pal);
xfree(B);
}
}
@@ -110,9 +113,7 @@ Bitmap* SliceBitmap (const Bitmap* O, unsigned OrigX, unsigned OrigY,
/* Check the coordinates and size */
PRECONDITION (OrigX != 0 && OrigY != 0 &&
OrigX + Width <= O->Width &&
OrigY + Height <= O->Height);
PRECONDITION (OrigX + Width <= O->Width && OrigY + Height <= O->Height);
/* Create a new bitmap with the given size */
B = NewBitmap (Width, Height);
@@ -181,8 +182,8 @@ Pixel GetPixel (const Bitmap* B, unsigned X, unsigned Y)
unsigned GetBitmapColors (const Bitmap* B)
/* Get the number of colors in an image. The function will return the number
* of palette entries for indexed bitmaps and 2^24 for non indexed bitmaps.
*/
{
*/
{
switch (B->Type) {
case bmMonochrome: return 2;
case bmIndexed: return B->Pal->Count;