Merge 1.6

# Conflicts:
#	cocos2d/core/CCDirector.js
#	cocos2d/core/components/CCSprite.js
This commit is contained in:
Jare Guo
2017-09-22 10:48:01 +08:00
20 changed files with 513 additions and 327 deletions
+3 -3
View File
@@ -45,7 +45,7 @@ var proto = _ccsg.TMXLayer.CanvasRenderCmd.prototype = Object.create(_ccsg.Node.
proto.constructor = _ccsg.TMXLayer.CanvasRenderCmd;
proto.rendering = function (ctx, scaleX, scaleY) {
var node = this._node, hasRotation = (node._rotationX || node._rotationY),
var node = this._node,
layerOrientation = node.layerOrientation,
tiles = node.tiles,
alpha = node._opacity / 255;
@@ -80,7 +80,7 @@ proto.rendering = function (ctx, scaleX, scaleY) {
maxCol = cols, maxRow = rows;
if (cc.macro.ENABLE_TILEDMAP_CULLING) {
if (!hasRotation && layerOrientation === Orientation.ORTHO) {
if (layerOrientation === Orientation.ORTHO) {
startCol = Math.floor(-(mapx - extw * a) / (maptw * a));
startRow = Math.floor((mapy - exth * d + mapth * rows * d - winh) / (mapth * d));
maxCol = Math.ceil((winw - mapx + extw * a) / (maptw * a));
@@ -171,7 +171,7 @@ proto.rendering = function (ctx, scaleX, scaleY) {
right = left + tilew;
top = bottom - tileh;
// TMX_ORIENTATION_ISO trim
if (!hasRotation && layerOrientation === Orientation.ISO) {
if (layerOrientation === Orientation.ISO) {
gb = -mapy + bottom*d;
if (gb < -winh-h) {
col += Math.floor((-winh - gb)*2/h) - 1;
+4 -4
View File
@@ -70,7 +70,7 @@ proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
// enable Depth Test
cc.renderer.setDepthTest(true);
var node = this._node, hasRotation = (node._rotationX || node._rotationY),
var node = this._node,
layerOrientation = node.layerOrientation,
tiles = node.tiles;
@@ -121,7 +121,7 @@ proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
if (enabledCulling) {
if (this._cameraFlag > 0) {
var tmpt = cc.affineTransformConcat(cc.Camera.main.viewMatrix, wt);
var tmpt = cc.affineTransformConcat(wt, cc.Camera.main.viewMatrix);
cullingA = tmpt.a;
cullingD = tmpt.d;
cullingMapx = ox * cullingA + oy * tmpt.c + tmpt.tx;
@@ -130,7 +130,7 @@ proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
cullingH = tileh * cullingD;
}
if (!hasRotation && layerOrientation === Orientation.ORTHO) {
if (layerOrientation === Orientation.ORTHO) {
startCol = Math.floor(-(cullingMapx - extw * cullingA) / (maptw * cullingA));
startRow = Math.floor((cullingMapy - exth * cullingD + mapth * rows * cullingD - winh) / (mapth * cullingD));
maxCol = Math.ceil((winw - cullingMapx + extw * cullingA) / (maptw * cullingA));
@@ -211,7 +211,7 @@ proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
top = bottom + tileh;
// TMX_ORIENTATION_ISO trim
if (enabledCulling && !hasRotation && layerOrientation === Orientation.ISO) {
if (enabledCulling && layerOrientation === Orientation.ISO) {
gb = cullingMapy + bottom*cullingD;
if (gb > winh+cullingH) {
col += Math.floor((gb-winh)*2/cullingH) - 1;