/* Every bit represent a side/corner: 1 same tile, 0 different tile: 0 1 2 3 x 4 -> 0b7654_3210 5 6 7 So single tile surrounded by different tiles would be: 0 0 0 0 x 0 -> 0b0000_0000 0 0 0 A top left corner tile would be: 1 1 0 1 x 0 -> 0b1101_0000 0 0 0 Resources: - https://i.ibb.co/jGRdNZm/image.png - https://web.archive.org/web/20210909030608/https://codereview.stackexchange.com/questions/257655/algorithm-for-auto-tiling-of-tiles-in-a-2d-tile-map - https://web.archive.org/web/20210909030608im_/https://i.stack.imgur.com/9p0st.png - https://web.archive.org/web/20210909030608im_/https://i.stack.imgur.com/j3IXI.png */ Tile_Value :: distinct u16 TILE_VALUES := [60]Tile_Value { 0b0000_1011, // 0 0 0b0001_1111, // 1 0 0b0001_0110, // 2 0 0b0000_1000, // 3 0 0b0001_1000, // 4 0 0b0001_0000, // 5 0 0b0001_1011, // 6 0 0b0001_1110, // 7 0 0b0111_1011, // 8 0 0b1101_1110, // 9 0 0b0101_1011, // 10 0 0b0101_1110, // 11 0 0b0110_1011, // 0 1 0b1111_1111, // 1 1 0b1101_0110, // 2 1 0b0000_0000, // 3 1 0b0000_0010, // 4 1 0b0000_0000, // 5 1 0b0111_1000, // 6 1 0b1101_1000, // 7 1 0b1111_1010, // 8 1 0b0101_1111, // 9 1 0b0111_1010, // 10 1 0b1101_1010, // 11 1 0b0110_1000, // 0 2 0b1111_1000, // 1 2 0b1101_0000, // 2 2 0b0101_1010, // 3 2 0b0100_0010, // 4 2 0b0000_0000, // 5 2 0b0100_1011, // 6 2 0b0101_0110, // 7 2 0b0100_1010, // 8 2 0b0001_1010, // 9 2 0b0111_1110, // 10 2 0b0000_0000, // 11 2 0b0111_1111, // 0 3 0b1101_1111, // 1 3 0b0000_1010, // 2 3 0b0001_0010, // 3 3 0b0100_0000, // 4 3 0b0000_0000, // 5 3 0b0110_1010, // 6 3 0b1101_0010, // 7 3 0b0101_1000, // 8 3 0b0101_0010, // 9 3 0b1101_1011, // 10 3 0b0000_0000, // 11 3 0b1111_1011, // 0 4 0b1111_1110, // 1 4 0b0100_1000, // 2 4 0b0101_0000, // 3 4 0b0000_0000, // 4 4 0b0000_0000, // 5 4 0b0000_0000, // 6 4 0b0000_0000, // 7 4 0b0000_0000, // 8 4 0b0000_0000, // 9 4 0b0000_0000, // 10 4 0b0000_0000, // 11 4 } TILE_GRID_SIZE :: Vector2i32 { 12, 5 }