Remove the bitmap type since it is not really needed and complicate things.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5603 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-11 11:10:41 +00:00
parent 194a007710
commit c9d65c56c2
6 changed files with 86 additions and 106 deletions

View File

@@ -64,7 +64,6 @@ Bitmap* NewBitmap (unsigned Width, unsigned Height)
B = xmalloc (sizeof (*B) + (Size - 1) * sizeof (B->Data[0]));
/* Initialize the data */
B->Type = bmUnknown;
B->Name = EmptyStrBuf;
B->Width = Width;
B->Height = Height;
@@ -120,7 +119,6 @@ Bitmap* SliceBitmap (const Bitmap* O, unsigned OrigX, unsigned OrigY,
B = NewBitmap (Width, Height);
/* Copy fields from the original */
B->Type = O->Type;
if (SB_GetLen (&O->Name) > 0) {
SB_CopyStr (&B->Name, "Slice of ");
SB_Append (&B->Name, &O->Name);
@@ -185,15 +183,11 @@ unsigned GetBitmapColors (const Bitmap* B)
* 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;
case bmRGB:
case bmRGBA: return (1U << 24);
default: Internal ("Unknown bitmap type %u", B->Type);
if (B->Pal) {
return B->Pal->Count;
} else {
return (1U << 24);
}
/* NOTREACHED */
return 0;
}