libpng is already a dependency for MakeObj.
trunk/utils/dr_rdpng.cc
Thanks, have taken a look at dr_rdpng.cc (I presume from what I can read in the code it outputs a 24 bit image, which would then need to be converted down to 16 bit for display).
Current PlansI will look at moving the bmp reading code into the utils folder to match the png reading code
I will look at changing my existing code to check for bmp or png file extension, and use the appropriate code to read in the file
I will look at changing simworld to use the same bmp code for loading in bmp height maps (and possibly look at allowing png height maps to be loaded in).
UpdateAttached patch file creates the following new files, as well as patching other files
utils/bmp.h
utils/bmp.cc
gui/components/gui_flowtext_image.h
gui/components/gui_flowtext_image.ccIt adds a
dependency to
libpng into Simutrans, and requires
utils/dr_rdpng.cc to be added to the build.
It allows PNG and BMP images to be used in <img src=> tags.
It replaces the BMP heightmap loading routines from
simworld.cc with the same BMP loading method used for loading the images, which allows a wider variety of BMP images to be used as height maps.
The BMP specific code has been moved from gui_flowtext_image to bmp (from previous patch) to allow it to be used for simworld.cc
The bmp code has been refactored to more closely match existing code in Simutrans.
UpdatePatch would crash if img tag was used when scenario was not loaded, this has been fixed, and a new version of the patch uploaded.