Bug 784462 - Export in C source format reports wrong BPP/buffer-size ...

... when using macros + RGB565
This commit is contained in:
Ell 2017-07-07 03:45:20 -04:00
parent 16cfcf1bde
commit cd3ca47cc1
1 changed files with 5 additions and 5 deletions

View File

@ -634,7 +634,7 @@ save_image (GFile *file,
"%u * %u * %u + 1];\n", "%u * %u * %u + 1];\n",
width, width,
height, height,
config->rgb565 ? 2 : (config->alpha ? 4 : 3))) bpp))
goto fail; goto fail;
} }
@ -645,7 +645,7 @@ save_image (GFile *file,
" %u, %u, %u,\n", " %u, %u, %u,\n",
width, width,
height, height,
config->rgb565 ? 2 : (config->alpha ? 4 : 3))) bpp))
goto fail; goto fail;
} }
else /* use macros */ else /* use macros */
@ -653,10 +653,10 @@ save_image (GFile *file,
if (! print (output, error, if (! print (output, error,
"#define %s_WIDTH (%u)\n" "#define %s_WIDTH (%u)\n"
"#define %s_HEIGHT (%u)\n" "#define %s_HEIGHT (%u)\n"
"#define %s_BYTES_PER_PIXEL (%u) /* 3:RGB, 4:RGBA */\n", "#define %s_BYTES_PER_PIXEL (%u) /* 2:RGB16, 3:RGB, 4:RGBA */\n",
macro_name, width, macro_name, width,
macro_name, height, macro_name, height,
macro_name, config->alpha ? 4 : 3)) macro_name, bpp))
{ {
goto fail; goto fail;
} }
@ -773,7 +773,7 @@ save_image (GFile *file,
"%u * %u * %u + 1] =\n", "%u * %u * %u + 1] =\n",
width, width,
height, height,
config->alpha ? 4 : 3)) bpp))
goto fail; goto fail;
} }