mirror of
https://github.com/minetest/minetest.git
synced 2024-08-19 04:54:18 +02:00
Const correctness
This commit is contained in:
parent
34286d77c7
commit
2f35b121a4
@ -617,14 +617,14 @@ void MapblockMeshGenerator::calculateCornerLevels()
|
|||||||
cur_liquid.corner_levels[k][i] = getCornerLevel(i, k);
|
cur_liquid.corner_levels[k][i] = getCornerLevel(i, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 MapblockMeshGenerator::getCornerLevel(int i, int k)
|
f32 MapblockMeshGenerator::getCornerLevel(int i, int k) const
|
||||||
{
|
{
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int air_count = 0;
|
int air_count = 0;
|
||||||
for (int dk = 0; dk < 2; dk++)
|
for (int dk = 0; dk < 2; dk++)
|
||||||
for (int di = 0; di < 2; di++) {
|
for (int di = 0; di < 2; di++) {
|
||||||
LiquidData::NeighborData &neighbor_data = cur_liquid.neighbors[k + dk][i + di];
|
const LiquidData::NeighborData &neighbor_data = cur_liquid.neighbors[k + dk][i + di];
|
||||||
content_t content = neighbor_data.content;
|
content_t content = neighbor_data.content;
|
||||||
|
|
||||||
// If top is liquid, draw starting from top of node
|
// If top is liquid, draw starting from top of node
|
||||||
|
@ -138,7 +138,7 @@ private:
|
|||||||
void prepareLiquidNodeDrawing();
|
void prepareLiquidNodeDrawing();
|
||||||
void getLiquidNeighborhood();
|
void getLiquidNeighborhood();
|
||||||
void calculateCornerLevels();
|
void calculateCornerLevels();
|
||||||
f32 getCornerLevel(int i, int k);
|
f32 getCornerLevel(int i, int k) const;
|
||||||
void drawLiquidSides();
|
void drawLiquidSides();
|
||||||
void drawLiquidTop();
|
void drawLiquidTop();
|
||||||
void drawLiquidBottom();
|
void drawLiquidBottom();
|
||||||
|
Loading…
Reference in New Issue
Block a user