1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-21 20:05:45 +02:00

Optimize updateFastFaceRow processing by removing some TileSpec copy (#5678)

* Optimize updateFastFaceRow processing by removing some TileSpec copy

It permit to decrease this function from 54% runtime to 45% and reduce copy from 14% runtime to 12.5%
getTileInfo also reduced from 27% to 23%

* makeFastFace should use a const ref too

this trigger a const pointer need in the underlying function

Also fix some code style and prevent calculating 4 times the same position at a point

* Reduce a comparison cost for lights in updateFastFaceRow
This commit is contained in:
Loïc Blot
2017-04-29 20:36:09 +02:00
committed by GitHub
parent c729543ec4
commit 95409da87d
4 changed files with 35 additions and 43 deletions

View File

@@ -65,7 +65,7 @@ public:
void useTile(int index, bool disable_backface_culling);
void useDefaultTile(bool set_color = true);
TileSpec getTile(const v3s16 &direction);
void getTile(const v3s16 &direction, TileSpec &tile);
// face drawing
void drawQuad(v3f *vertices, const v3s16 &normal = v3s16(0, 0, 0));