Skip to content

Commit a0fbe60

Browse files
author
mathis
committed
some linter warnings
1 parent 4564ba9 commit a0fbe60

4 files changed

Lines changed: 18 additions & 21 deletions

File tree

OpenGL/OpenGL/src/Application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int main(int argc, char* argv[]) {
134134

135135
// draw the terrain
136136
window.camera.activate();
137-
// shadows.activate(shader);
137+
shadows.activate(shader);
138138
terrain.render();
139139

140140
// dot in the middle of the screen

OpenGL/OpenGL/src/entity/Entity.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ using namespace glm;
44
static const mat4 I(1.f);
55

66
Entity::Entity(Hitbox hitbox)
7-
: maxSpeed(4.3f), maxAccel(10.f), verticalFriction(5.5f), horizontalFriction(5.f),
7+
: view(View::FIRST_PERSON), state(State::Idle), god(true), sprint(false),
8+
maxSpeed(4.3f), maxAccel(10.f), verticalFriction(5.5f), horizontalFriction(5.f),
89
gravity(32.f), jumpSpeed(10.5f), maxFallSpeed(78.4f),
9-
speed(0), accel(0),
10-
onFloor(false), god(true), sprint(false),
11-
state(State::Idle),
12-
hitbox(std::move(hitbox)),
13-
playerFovY(45.0f)
10+
playerFovY(45.0f),
11+
speed(0), accel(0), direction(0),
12+
onFloor(false),
13+
hitbox(std::move(hitbox))
1414
{}
1515

1616
Entity::~Entity() {}

OpenGL/OpenGL/src/entity/Entity.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class Entity
7575

7676
glm::vec3 speed;
7777
glm::vec3 accel;
78+
glm::vec3 direction;
7879

7980
bool onFloor;
8081
Hitbox hitbox;
81-
glm::vec3 direction;
8282

8383
Node node;
8484
Node headNode;

OpenGL/OpenGL/src/terrain/Generator.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,16 @@ std::unique_ptr<Chunk> Generator::generate(ivec3 cpos) const {
3737
}
3838

3939
Block::unique_ptr_t Generator::computeSurfaceBlock(ivec3 const& pos, Biome const& biome, int const& blockHeight) const {
40-
if (abs(pos.y) < 3 && biome.type == BiomeType::SEA) return Block::create_static<Sand_Block>();
41-
if (abs(pos.y) < 2) return Block::create_static<Sand_Block>();
42-
if (pos.y <= 0) return AllBlocks::create_static(biome.underWaterBlock);
43-
if (pos.y > 35 + valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(67, 102)) % 5 && biome.surface != BlockType::Ice) return Block::create_static<Snow_Block>();
44-
if(pos.y > 8 + valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(-12, 0)) % 2 && biome.surface == BlockType::Sand) return Block::create_static<Snow_Block>();
40+
if (abs(pos.y) < 3.f && biome.type == BiomeType::SEA) return Block::create_static<Sand_Block>();
41+
if (abs(pos.y) < 2.f) return Block::create_static<Sand_Block>();
42+
if (pos.y <= 0.f) return AllBlocks::create_static(biome.underWaterBlock);
43+
if (pos.y > 35.f + valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(67, 102)) % 5 && biome.surface != BlockType::Ice) return Block::create_static<Snow_Block>();
44+
if(pos.y > 8.f + valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(-12, 0)) % 2 && biome.surface == BlockType::Sand) return Block::create_static<Snow_Block>();
4545
if (pos.y != blockHeight && biome.surface == BlockType::Grass)return Block::create_static<Dirt_Block>();
4646

4747
return AllBlocks::create_static(biome.surface);
4848
}
4949

50-
51-
52-
5350
Block::unique_ptr_t Generator::createBlock(ivec3 pos, Biome const& biome) const {
5451
Block::unique_ptr_t block;
5552
float height = noise.fractal2(ivec2(pos.x, pos.z), biome.frequencies);
@@ -65,13 +62,13 @@ Block::unique_ptr_t Generator::createBlock(ivec3 pos, Biome const& biome) const
6562
return Block::create_static<Air_Block>();
6663
}
6764
}
68-
if(pos.y >= blockHeight - (valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(-91, 859)) % 3))
65+
if(pos.y >= blockHeight - (int)(valueNoise.sample1D(ivec2(pos.x, pos.z) + ivec2(-91, 859)) % 3))
6966
return computeSurfaceBlock(pos, biome, blockHeight);
70-
71-
if(pos.y >= blockHeight - (2+ valueNoise.sample1D(ivec2(pos.x,pos.z) + ivec2(2,-59)) % 3))
67+
68+
if(pos.y >= blockHeight - (int)(2+ valueNoise.sample1D(ivec2(pos.x,pos.z) + ivec2(2,-59)) % 3))
7269
block = AllBlocks::create_static(biome.underLayers);
73-
74-
70+
71+
7572
return Block::create_static<Stone_Block>();
7673
}
7774

0 commit comments

Comments
 (0)