Open glebm opened 3 months ago
The floor is drawn before everything else and I think floor tiles never overlap with each other
That said, so far I haven't been able to get any performance improvement out of this so far (and I tried quite a few things).
The floor drawing gets faster but DrawDungeon
, which I haven't change at all, gets slower. It's a mystery.
The floor is drawn before everything else and I think floor tiles never overlap with each other
That said, so far I haven't been able to get any performance improvement out of this so far (and I tried quite a few things). The floor drawing gets faster but
DrawDungeon
, which I haven't change at all, gets slower. It's a mystery.
the foliage
part is for tiles that do not limit them selfs to the "tile" shape. I think for floor this is only and issue in town, for the dungeons they all appears to adhere to the shape.
I guess you can simply handle it by not applying this optimization to any where foliage
is true.
foliage
is only checked in DrawCell
, which is not used for drawing floor tiles:
Floor tiles are always drawn without mask (MaskType::Solid
), doesn't look like our code supports foliage for them:
😑 We might want to look in to that then
I think what happens is that foliage is drawn again in DrawCell
, after the floor.
The condition for whether something is a floor tile is exactly the same as foliage
:
!TileHasAny(tilePosition, TileProperties::Solid);
Moreover, we only draw foliage for tiles of TransparentSquare
type.
So for a transparent square tile, we first draw it fully in DrawFloor
.
Then, in DrawCell
, we draw only the masked part again.
I think the foliage condition is not very precise. Not all TransparentSquare
tiles have foliage.
However, I don't know of a more precise way to detect whether a tile has foliage.
Thanks for investigating that.
Do you check to make sure that the tiles you do this for do not have content drawn on them from other ones and that they do not draw outside of the general rectangular area?