compile errors:
src/platforms/sdl/SDLUtility.cpp:267:37: error: invalid use of incomplete type ‘png_info {aka struct png_info_def}’
info_ptr->bit_depth = 8;
fix:
/
info_ptr->width = surf->w;
info_ptr->height = surf->h;
info_ptr->bit_depth = 8;
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
info_ptr->interlace_type = 1;
info_ptr->valid = 0; // will be updated by various png_set_FOO() functions
/
/ dguptill at accesswave dot ca /
// replacement, for libpng version > 1.5 . 2020-07-24
png_set_IHDR (png_ptr, info_ptr, surf->w, surf->h, 8, PNG_COLOR_TYPE_RGB, 1, \
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
Anonymous
Oops. Somehow the * after / got deleted. All the lines like
info_ptr->
and my email
are meant to be commented out.
i confirm that this fix solves the problem on ubuntu 20.04 focal fossa as well.
I have replaced the older png save code (which didn't work) with sdl's secret IMG_SavePNG, which does not use libpng directly.