I was working on a tile game with Coco2dx V4, loading a level using a tmx map from Tiled.exe v1.2.2 on Windows 10.
When I loaded and showed the level it had blank cells at the start of each “line” in the tilemap, shifting the subsequent tiles left. For a tile map like this
123 456 789
I got this displayed, where X is a blank black tile
X12 3X4 56X
I know I get a warning only v1 not v1.2.2 of Tiled is supported, but a web post in (I think) Chinese when translated seem to say it is not a problem and can be ignored.
It seemed like a strange bug not to have been found already, so I assumed a recent problem.
I had a look at the recent change log, and noticed TMXTiledMap() had support for CSV added.
I had a look in Tiled.tmx, and yes the map is saved as a block of CSV
1,2,3, 4,5,6, 7,8,9
I then noticed that Tiled would let me save map as xml. When I did this it worked and displayed correctly.
It seems the new Cocos2dx v4 code for handling tmx files using CSV format has a bug.
Steps to reproduce
Make a tmx map in Tiled v1.2.2 and save using the CSV option (default I think)
Load with Coco2dx v4 using TMXTiledMap::create()
Show the tiled map
BUG see a diagonal line of black tiles, and some of last tiles missing
Save the map in XML not CSV in Tiled.exe v1.2.2
This seems like an off by one loop error in code, adding a blank tile. Possibly from interpretation of CSV data. This may be related to line termination in CSV block in tmx file being mishandled, possible a \r \n or \r\n mismatch where Windows by default use \r\n but other systems like linux like just \n.
(if this was the case it may explain how this was missed in testing if testing was on a *nix machine)
I have not tried it, but editing the csv based tmx to delete or change the line breaks from \r\n to \n may also work.