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:
parent
bd5b2b3495
commit
ab218ceca6
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue