mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Remove the "Tag" field in struct Bitmap since it is of no real use.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5565 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
d46c3fc5a9
commit
95eb20dc37
@ -66,7 +66,6 @@ Bitmap* NewBitmap (unsigned Width, unsigned Height)
|
||||
/* Initialize the data */
|
||||
B->Type = bmUnknown;
|
||||
B->Name = EmptyStrBuf;
|
||||
B->Tag = 0;
|
||||
B->Width = Width;
|
||||
B->Height = Height;
|
||||
B->Pal = 0;
|
||||
@ -80,8 +79,7 @@ Bitmap* NewBitmap (unsigned Width, unsigned Height)
|
||||
void FreeBitmap (Bitmap* B)
|
||||
/* Free a dynamically allocated bitmap */
|
||||
{
|
||||
/* Free the format specific data, the palette and then the bitmap */
|
||||
xfree (B->Tag);
|
||||
/* Free the palette and then the bitmap */
|
||||
xfree (B->Pal);
|
||||
xfree(B);
|
||||
}
|
||||
|
@ -80,11 +80,6 @@ struct Bitmap {
|
||||
*/
|
||||
StrBuf Name;
|
||||
|
||||
/* Pointer to some format specific data. May be used by the frontend.
|
||||
* The data is free'd as a block when calling FreeBitmap.
|
||||
*/
|
||||
void* Tag;
|
||||
|
||||
/* Size of the bitmap */
|
||||
unsigned Width;
|
||||
unsigned Height;
|
||||
|
@ -105,6 +105,14 @@ static PCXHeader* NewPCXHeader (void)
|
||||
|
||||
|
||||
|
||||
static void FreePCXHeader (PCXHeader* H)
|
||||
/* Free a PCX header structure */
|
||||
{
|
||||
xfree (H);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static PCXHeader* ReadPCXHeader (FILE* F, const char* Name)
|
||||
/* Read a structured PCX header from the given file and return it */
|
||||
{
|
||||
@ -275,9 +283,6 @@ Bitmap* ReadPCXFile (const char* Name)
|
||||
/* Copy the name */
|
||||
SB_CopyStr (&B->Name, Name);
|
||||
|
||||
/* Remember the PCX header in the tag */
|
||||
B->Tag = P;
|
||||
|
||||
/* Allocate memory for the scan line */
|
||||
L = xmalloc (P->Width);
|
||||
|
||||
@ -429,6 +434,9 @@ Bitmap* ReadPCXFile (const char* Name)
|
||||
/* Close the file */
|
||||
fclose (F);
|
||||
|
||||
/* Free the PCX header */
|
||||
FreePCXHeader (P);
|
||||
|
||||
/* Return the bitmap */
|
||||
return B;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user