megamarc / Tilengine

Free 2D graphics engine with raster effects for retro/classic style game development
https://www.tilengine.org
Mozilla Public License 2.0
847 stars 95 forks source link

decompress() zipped string fails when linked with latest zlib headers. #82

Open turric4n opened 3 years ago

turric4n commented 3 years ago

Hi! I compiled Tilengine library with VS2019 (Windows x64) using latest libpng & zlib headers without problems at compile time and dynamic library is built successfully. Problems began when compiled library is being used... It doesn't load the Tilemaps inside TMX file. Especifically doesn't load correctly when Tilemap data is zipped. I was taking a look into the code and I find that inflateInit() returns -2 and obviously data was not populated.

Did you test the code with latest zlib version? I suppose is not a problem with Tilengine but a TMX/Tiled problem.

What version of zlib do you suggest to use that feature without problems? As you know, sometimes is not easy to find right headers for x,y

Thanks for your work as always.

turric4n commented 3 years ago

zlib.h inflateInit() image loadtilemap.c decompress() image

megamarc commented 3 years ago

Hi Turrican, I haven't tested newer versions of libraries, but there shouldn't be breaking changes... I validated zlib 1.2.8 and libpng 1.6.3, both dating from 2013. They're quite old and maybe I should test current releases. What version of zlib are you testing? Make sure that you aren't mixing headers from one version and implementation from another, that's always a source of problems

turric4n commented 3 years ago

Hi Marc, It worked with zlib 1.2.8 & libpng 1.6.3. that makes zlib 1.2.11 incompatible with TMX afik. No problem with that so you can close the issue.