int drawModeB = Renderer.NONE;
int drawModeF = Renderer.NONE;
boolean myTrans = transparency;
int isoBh = pillarRiserMode ? blockHeight : 0;
int blockIndex;
Block block;
if (pillarRiserMode)
dstPixHeight += tallestPillar;
for ( ;dstPixY < dstPixHeight; dstPixY += blockGapY) {
mapX = mapXStart;
for (dstPixX = dstXStart ;dstPixX < dstPixWidth; dstPixX += blockGapX) {
if (!pillarRiserMode || (mapY < mapBlockHeight)) {
// inlined Layer.getBlock() for speed
blockIndex = layerData[mapY][mapX];
if (blockIndex < 0)
blockIndex = animBlocks[-blockIndex - 1].getCurrentFrame();
} else
blockIndex = 0;
int isoY = dstPixY;
blockIndex--;
do {
blockIndex++;
block = blocks[blockIndex];
if (pillarRiserMode) {
if (block.getFlag(Block.LEFT_SIDE_PILLAR))
drawModeF = Renderer.DRAW_LEFT_SIDE_ONLY;
else if (block.getFlag(Block.RIGHT_SIDE_PILLAR))
drawModeF = Renderer.DRAW_RIGHT_SIDE_ONLY;
else
drawModeF = Renderer.NONE;
if (isoY == dstPixY) {
drawModeB = Renderer.NONE;
myTrans = transparency;
} else {
drawModeB = drawModeF;
myTrans = true;
}
}
if (drawBackground) {
imageIndex = block.getImageIndex(Block.BACKGROUND);
if ((!myTrans) || (imageIndex != 0))
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, myTrans, drawModeB);
}
isoY -= isoBh;
if (drawForeground1) {
imageIndex = block.getImageIndex(Block.FOREGROUND1);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
if (drawForeground2) {
imageIndex = block.getImageIndex(Block.FOREGROUND2);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
if (drawForeground3) {
imageIndex = block.getImageIndex(Block.FOREGROUND3);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
} while (pillarRiserMode && block.getFlag(Block.ATTACH_NEXT));
mapX++;
}
// if isometric... do the next half row
if (isIsometric) {
mapX = mapXStart;
mapY++;
dstPixY += staggerY;
for (dstPixX = (dstXStart + staggerX); dstPixX < dstPixWidth; dstPixX += blockGapX) {
if (!pillarRiserMode || (mapY < mapBlockHeight)) {
// inlined Layer.getBlock() for speed
blockIndex = layerData[mapY][mapX];
if (blockIndex < 0)
blockIndex = animBlocks[-blockIndex - 1].getCurrentFrame();
} else
blockIndex = 0;
int isoY = dstPixY;
blockIndex--;
do {
blockIndex++;
block = blocks[blockIndex];
if (pillarRiserMode) {
if (block.getFlag(Block.LEFT_SIDE_PILLAR))
drawModeF = Renderer.DRAW_LEFT_SIDE_ONLY;
else if (block.getFlag(Block.RIGHT_SIDE_PILLAR))
drawModeF = Renderer.DRAW_RIGHT_SIDE_ONLY;
else
drawModeF = Renderer.NONE;
if (isoY == dstPixY) {
drawModeB = Renderer.NONE;
myTrans = transparency;
} else {
drawModeB = drawModeF;
myTrans = true;
}
}
if (drawBackground) {
imageIndex = block.getImageIndex(Block.BACKGROUND);
if ((!myTrans) || (imageIndex != 0))
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, myTrans, drawModeB);
}
isoY -= isoBh;
if (drawForeground1) {
imageIndex = block.getImageIndex(Block.FOREGROUND1);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
if (drawForeground2) {
imageIndex = block.getImageIndex(Block.FOREGROUND2);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
if (drawForeground3) {
imageIndex = block.getImageIndex(Block.FOREGROUND3);
if (imageIndex != 0)
renderer.drawImage(gfx, imageIndex, dstPixX, isoY, true, drawModeF);
}
isoY -= isoBh;
} while (pillarRiserMode && block.getFlag(Block.ATTACH_NEXT));
mapX++;
}
dstPixY -= staggerY;
}
mapY++;