コード例 #1
0
        private static int[] GetAtlasQuarterTilesForNeighborMask(int neighbors)
        {
            //Each tile in the atlas is composed of 4 quarter tiles,
            //call them by quadrant:
            //  A B
            //  C D
            //The VXQuarterTileLookup matches the requested quadrant and corner score
            //to the quarter tile index inside the VX AutoTile texture, numbering like this
            //  0  1  2  3
            //  4  5  6  7
            //  8  9 10 11
            // 12 13 14 15
            // 16 17 18 19
            // 20 21 22 23
            //Where 0,1,4,5 are not used, 2,3,6,7 are the "270 degree" tiles
            //and 8-23 are the main pattern
            var c = AutoTile.GetCornerScores(neighbors);

            return(new int[]
            {
                VXQuarterTileLookup[0xA0 + c[0]],
                VXQuarterTileLookup[0xB0 + c[1]],
                VXQuarterTileLookup[0xC0 + c[2]],
                VXQuarterTileLookup[0xD0 + c[3]]
            });
        }
コード例 #2
0
        public static int[] GetTile(int neighbors)
        {
            var key            = AutoTile.FilterNeighbors((byte)neighbors);
            var vxQuarterTiles = GetAtlasQuarterTilesForNeighborMask(key);

            for (int i = 0; i < 4; i++)
            {
                int vxQIndex = vxQuarterTiles[i];
            }
            return(vxQuarterTiles);
        }