cocos2d-objc icon indicating copy to clipboard operation
cocos2d-objc copied to clipboard

cc_vertexz=automatic not rendering the tile map layer

Open mu1ex opened this issue 10 years ago • 3 comments
trafficstars

Tile map layer does not render and is blank when cc_vertexz is set to automatic in layer properties of an isometric tile map.

mu1ex avatar Dec 25 '14 10:12 mu1ex

AutomaticVertexZ method in CCTiledMapLayer seems to be returning an overflow value, causing an improper setting of z value to tiles in layers with cc_vertexz=automatic layers. To avoid this i converted the z value to int and now proper z values are being set. cctiledmaplayer_m

mu1ex avatar Dec 25 '14 15:12 mu1ex

Confirmed this problem! Thanks for reporting it. I'm adding tests to the testbed for this issue, I bet a lot of people don't know about the automaticZ functionality.

The problem is the use of unsigned integers:

(lldb) p maxVal
(NSUInteger) $2 = 128
(lldb) p (maxVal - (tileX + tileY))
(unsigned int) $0 = 46
(lldb) p -(maxVal - (tileX + tileY))
(unsigned int) $1 = 4294967250

Problem exists both in develop and develop-v4

andykorth avatar Dec 29 '14 22:12 andykorth

@mu1ex Are you still working on your game?

pyrossh avatar Jul 10 '15 09:07 pyrossh