I have a class inherited from TileSet and am trying to implement the forwardsubtile_selection method. For the most part I am trying to imitate the way the engine performs subtile selection but with a few modifications. I'm looking at the engine code, specifically TileSet::autotilegetsubtileforbitmask.
That method iterates through the subtiles using this loop:
for (Map<Vector2, uint32_t>::Element *E = tile_map[p_id].autotile_data.flags.front(); E; E = E->next())
(See tile_set.cpp line 639 on branch 3.2)
I'm trying to find a way to similarly iterate through the subtiles, but they don't appear to be exposed to GDScript. It DOES provide the method TileSet.autotilegetbitmask, and I've considered manually incrementing a Vector2 and using that method to get the bitmask from each subtile, but then my problem is that I can't find any method which provides me with the bounds of the autotile on the tileset in order to iterate within.
Is there something obvious that I'm missing? It seems very difficult to implement a method to select a subtile without there being access to the subtiles.
I'd like, if possible, to be able to do this without needing to modify the engine or to create a plugin or module.
Thanks for any help!