byte GetBlock( int xx, int yy, int hh ) {
int realx;
int realy;
switch( Rot ) {
case 0:
realx = xx;
realy = yy;
break;
case 1:
realx = dimX1 - yy;
realy = xx;
break;
case 2:
realx = dimX1 - xx;
realy = dimY1 - yy;
break;
default:
realx = yy;
realy = dimY1 - xx;
break;
}
int pos = (hh * dimY + realy) * dimX + realx;
if( Mode == IsoCatMode.Normal ) {
return bp[pos];
} else if( Mode == IsoCatMode.Peeled && (xx == (Rot == 1 || Rot == 3 ? dimY1 : dimX1) || yy == (Rot == 1 || Rot == 3 ? dimX1 : dimY1) || hh == Map.Height - 1) ) {
return 0;
} else if( Mode == IsoCatMode.Cut && xx > (Rot == 1 || Rot == 3 ? dimY2 : dimX2) && yy > (Rot == 1 || Rot == 3 ? dimX2 : dimY2) ) {
return 0;
} else if( Mode == IsoCatMode.Chunk && (realx < chunkCoords[0] || realy < chunkCoords[1] || hh < chunkCoords[2] || realx > chunkCoords[3] || realy > chunkCoords[4] || hh > chunkCoords[5]) ) {
return 0;
}
return bp[pos];
}
}