support for fast tmx hex

This commit is contained in:
Huabing.Xu 2014-07-02 15:19:11 +08:00
parent 187646ef3f
commit efa452e0c4
1 changed files with 9 additions and 3 deletions

View File

@ -237,7 +237,7 @@ void FastTMXLayer::updateTiles(const Rect& culledRect)
else else
{ {
//do nothing, do not support //do nothing, do not support
CCASSERT(0, "TMX invalid value"); //CCASSERT(0, "TMX invalid value");
} }
_indicesVertexZNumber.clear(); _indicesVertexZNumber.clear();
@ -387,7 +387,13 @@ Mat4 FastTMXLayer::tileToNodeTransform()
} }
case FAST_TMX_ORIENTATION_HEX: case FAST_TMX_ORIENTATION_HEX:
{ {
_tileToNodeTransform = Mat4::IDENTITY; _tileToNodeTransform = Mat4
(
h * sqrtf(0.75), 0, 0, 0,
-h/2, -h, 0, offY,
0, 0, 1, 0,
0, 0, 0, 1
);
return _tileToNodeTransform; return _tileToNodeTransform;
} }
default: default:
@ -617,7 +623,7 @@ int FastTMXLayer::getVertexZForPos(const Vec2& pos)
ret = static_cast<int>(-(_layerSize.height-pos.y)); ret = static_cast<int>(-(_layerSize.height-pos.y));
break; break;
case FAST_TMX_ORIENTATION_HEX: case FAST_TMX_ORIENTATION_HEX:
CCASSERT(0, "TMX Hexa zOrder not supported"); CCASSERT(0, "TMX Hexa vertexZ not supported");
break; break;
default: default:
CCASSERT(0, "TMX invalid value"); CCASSERT(0, "TMX invalid value");