fix warnings + cland-tidy

This commit is contained in:
2025-07-23 19:18:25 +02:00
parent 705671148b
commit 9477099cfc
13 changed files with 47 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
class WorldApply : public td::protocol::PacketHandler {
private:
td::game::World& m_World;
using td::protocol::PacketHandler::Handle;
public:
WorldApply(td::game::World& a_World) : m_World(a_World) {}
@@ -23,6 +24,7 @@ class WorldApply : public td::protocol::PacketHandler {
void Handle(const td::protocol::packets::WorldHeaderPacket& a_Header) override {
m_World.LoadMap(*a_Header);
}
void Handle(const td::protocol::packets::WorldDataPacket& a_Data) override {
m_World.LoadMap(*a_Data);
}

View File

@@ -7,7 +7,7 @@ namespace game {
World::World() : m_CurrentState{.m_Teams{Team{TeamColor::Red}, Team{TeamColor::Blue}}}, m_NextState{.m_Teams{Team{TeamColor::Red}, Team{TeamColor::Blue}}} {}
const Color* World::GetTileColor(TilePtr tile) const {
const Color* World::GetTileColor(const TilePtr& tile) const {
switch (tile->GetType()) {
case TileType::Tower: {
TowerTile* towerTile = dynamic_cast<TowerTile*>(tile.get());

View File

@@ -11,7 +11,7 @@ namespace render {
namespace WorldLoader {
const static int POSITION_VERTEX_SIZE = 3;
const static int TEXTURE_VERTEX_SIZE = 2;
// const static int TEXTURE_VERTEX_SIZE = 2;
GL::VertexArray LoadWorldModel(const td::game::World* world) {
std::vector<float> positions;
@@ -173,7 +173,7 @@ GL::VertexArray LoadTileSelectModel() {
return tileSelectVao;
}
RenderData LoadTowerModel(game::TowerPtr tower) {
RenderData LoadTowerModel(const game::TowerPtr& tower) {
RenderData renderData;
float towerX, towerDX;

View File

@@ -6,7 +6,7 @@ namespace td {
namespace render {
EntityRenderer::EntityRenderer(Camera& a_Camera, const game::World& a_World) : Renderer(a_Camera), m_World(a_World) {
m_EntityVao = std::make_unique<GL::VertexArray>(std::move(WorldLoader::LoadMobModel()));
m_EntityVao = std::make_unique<GL::VertexArray>(WorldLoader::LoadMobModel());
m_Shader->Start();
m_Shader->SetColorEffect({1, 0, 1});
}

View File

@@ -109,7 +109,7 @@ unsigned int ShaderProgram::LoadShader(const std::string& source, GLenum type) {
glCompileShader(shaderID);
GLint compilesuccessful;
glGetShaderiv(shaderID, GL_COMPILE_STATUS, &compilesuccessful);
if (compilesuccessful == false) {
if (!compilesuccessful) {
GLsizei size;
glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &size);
std::vector<char> shaderError(static_cast<std::size_t>(size));