Pass the source image of the conversion down to the output function, so they
are able to output the image properties as comments. git-svn-id: svn://svn.cc65.org/cc65/trunk@5616 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
14
src/sp65/c.c
14
src/sp65/c.c
@@ -125,7 +125,7 @@ static const char* GetIdentifier (const Collection* A)
|
||||
|
||||
|
||||
|
||||
void WriteCFile (const StrBuf* Data, const Collection* A)
|
||||
void WriteCFile (const StrBuf* Data, const Collection* A, const Bitmap* B)
|
||||
/* Write the contents of Data to a file in C format */
|
||||
{
|
||||
FILE* F;
|
||||
@@ -133,6 +133,9 @@ void WriteCFile (const StrBuf* Data, const Collection* A)
|
||||
unsigned Size;
|
||||
|
||||
|
||||
/* Get the name of the image */
|
||||
const StrBuf* S = GetBitmapName (B);
|
||||
|
||||
/* Get the file name */
|
||||
const char* Name = NeedAttrVal (A, "name", "write");
|
||||
|
||||
@@ -154,11 +157,16 @@ void WriteCFile (const StrBuf* Data, const Collection* A)
|
||||
/* Write a readable header */
|
||||
fprintf (F,
|
||||
"/*\n"
|
||||
" * This file was generated by %s %s\n"
|
||||
" * This file was generated by %s %s from\n"
|
||||
" * %.*s (%ux%u, %u colors%s)\n"
|
||||
" */\n"
|
||||
"\n",
|
||||
ProgName,
|
||||
GetVersionAsString ());
|
||||
GetVersionAsString (),
|
||||
SB_GetLen (S), SB_GetConstBuf (S),
|
||||
GetBitmapWidth (B), GetBitmapHeight (B),
|
||||
GetBitmapColors (B),
|
||||
BitmapIsIndexed (B)? ", indexed" : "");
|
||||
|
||||
|
||||
/* Output the declaration and identifier */
|
||||
|
||||
Reference in New Issue
Block a user