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:
uz
2012-03-15 17:02:12 +00:00
parent fbbf7e50d2
commit 7260b3687a
9 changed files with 53 additions and 18 deletions

View File

@@ -139,7 +139,7 @@ static const char* GetSegment (const Collection* A)
void WriteAsmFile (const StrBuf* Data, const Collection* A)
void WriteAsmFile (const StrBuf* Data, const Collection* A, const Bitmap* B)
/* Write the contents of Data to the given file in assembler (ca65) format */
{
FILE* F;
@@ -147,6 +147,9 @@ void WriteAsmFile (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");
@@ -171,12 +174,16 @@ void WriteAsmFile (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" : "");
/* If we have a segment defined, output a segment directive */
if (Segment) {