1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

tiles are now culled

This commit is contained in:
fgenesis 2023-07-14 01:33:59 +02:00
parent bd5b2b3495
commit ab218ceca6

View file

@ -75,6 +75,17 @@ void TileRender::onRender(const RenderState& rs) const
}
const ElementTemplate * const et = tile.et;
// adapted from RenderObject::isOnScreen()
{
const float cw = et->w * tile.scalex;
const float ch = et->h * tile.scaley;
const float cullRadiusSqr = ((cw*cw + ch*ch) * core->invGlobalScaleSqr) + core->cullRadiusSqr;
if ((pos - core->cullCenter).getSquaredLength2D() >= cullRadiusSqr)
continue;
}
if(const Texture * const tex = et->tex.content())
{
unsigned texid = tex->gltexid;