Răsfoiți Sursa

fix merge conflicts

djeada 3 zile în urmă
părinte
comite
d96a19dbfc

+ 5 - 5
app/controllers/command_controller.cpp

@@ -253,7 +253,7 @@ auto CommandController::onPatrolClick(qreal sx, qreal sy, int viewportWidth,
 
 auto CommandController::setRallyAtScreen(qreal sx, qreal sy, int viewportWidth,
                                          int viewportHeight, void *camera,
-                                         int localOwnerId) -> CommandResult {
+                                         int local_owner_id) -> CommandResult {
   CommandResult result;
   if ((m_world == nullptr) || (m_selection_system == nullptr) ||
       (m_pickingService == nullptr) || (camera == nullptr)) {
@@ -268,15 +268,15 @@ auto CommandController::setRallyAtScreen(qreal sx, qreal sy, int viewportWidth,
   }
 
   Game::Systems::ProductionService::setRallyForFirstSelectedBarracks(
-      *m_world, m_selection_system->get_selected_units(), localOwnerId, hit.x(),
-      hit.z());
+      *m_world, m_selection_system->get_selected_units(), local_owner_id,
+      hit.x(), hit.z());
 
   result.inputConsumed = true;
   return result;
 }
 
 void CommandController::recruitNearSelected(const QString &unit_type,
-                                            int localOwnerId) {
+                                            int local_owner_id) {
   if ((m_world == nullptr) || (m_selection_system == nullptr)) {
     return;
   }
@@ -288,7 +288,7 @@ void CommandController::recruitNearSelected(const QString &unit_type,
 
   auto result =
       Game::Systems::ProductionService::startProductionForFirstSelectedBarracks(
-          *m_world, sel, localOwnerId, unit_type.toStdString());
+          *m_world, sel, local_owner_id, unit_type.toStdString());
 
   if (result == Game::Systems::ProductionResult::GlobalTroopLimitReached) {
     emit troopLimitReached();

+ 2 - 2
app/controllers/command_controller.h

@@ -39,8 +39,8 @@ public:
                      void *camera) -> CommandResult;
   auto setRallyAtScreen(qreal sx, qreal sy, int viewportWidth,
                         int viewportHeight, void *camera,
-                        int localOwnerId) -> CommandResult;
-  void recruitNearSelected(const QString &unit_type, int localOwnerId);
+                        int local_owner_id) -> CommandResult;
+  void recruitNearSelected(const QString &unit_type, int local_owner_id);
 
   [[nodiscard]] bool hasPatrolFirstWaypoint() const {
     return m_hasPatrolFirstWaypoint;

+ 1 - 1
app/core/game_engine.cpp

@@ -763,7 +763,7 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
     m_renderer->set_hovered_entity_id(m_hoverTracker->getLastHoveredEntity());
   }
   if (m_renderer) {
-    m_renderer->set_local_owner_id(m_runtime.localOwnerId);
+    m_renderer->set_local_owner_id(m_runtime.local_owner_id);
   }
   m_renderer->render_world(m_world.get());
   if (auto *arrow_system = m_world->get_system<Game::Systems::ArrowSystem>()) {

+ 8 - 8
game/systems/victory_service.cpp

@@ -43,7 +43,7 @@ void VictoryService::configure(const Game::Map::VictoryConfig &config,
                                int local_owner_id) {
   reset();
 
-  m_localOwnerId = local_owner_id;
+  m_local_owner_id = local_owner_id;
 
   if (config.victoryType == "elimination") {
     m_victoryType = VictoryType::Elimination;
@@ -140,7 +140,7 @@ void VictoryService::checkVictoryConditions(Engine::Core::World &world) {
       }
     }
 
-    const auto *stats = m_stats_registry.get_stats(m_localOwnerId);
+    const auto *stats = m_stats_registry.get_stats(m_local_owner_id);
     if (stats != nullptr) {
       qInfo() << "Final Stats - Troops Recruited:" << stats->troops_recruited
               << "Enemies Killed:" << stats->enemies_killed
@@ -182,7 +182,7 @@ void VictoryService::checkDefeatConditions(Engine::Core::World &world) {
         }
       }
 
-      const auto *stats = m_stats_registry.get_stats(m_localOwnerId);
+      const auto *stats = m_stats_registry.get_stats(m_local_owner_id);
       if (stats != nullptr) {
         qInfo() << "Final Stats - Troops Recruited:" << stats->troops_recruited
                 << "Enemies Killed:" << stats->enemies_killed
@@ -202,7 +202,7 @@ auto VictoryService::checkElimination(Engine::Core::World &world) -> bool {
 
   bool enemy_key_structures_alive = false;
 
-  int const local_team = m_owner_registry.getOwnerTeam(m_localOwnerId);
+  int const local_team = m_owner_registry.getOwnerTeam(m_local_owner_id);
 
   auto entities = world.get_entities_with<Engine::Core::UnitComponent>();
   for (auto *e : entities) {
@@ -211,11 +211,11 @@ auto VictoryService::checkElimination(Engine::Core::World &world) -> bool {
       continue;
     }
 
-    if (unit->owner_id == m_localOwnerId) {
+    if (unit->owner_id == m_local_owner_id) {
       continue;
     }
 
-    if (m_owner_registry.areAllies(m_localOwnerId, unit->owner_id)) {
+    if (m_owner_registry.areAllies(m_local_owner_id, unit->owner_id)) {
       continue;
     }
 
@@ -244,7 +244,7 @@ auto VictoryService::checkNoUnits(Engine::Core::World &world) const -> bool {
       continue;
     }
 
-    if (unit->owner_id == m_localOwnerId) {
+    if (unit->owner_id == m_local_owner_id) {
       return false;
     }
   }
@@ -261,7 +261,7 @@ auto VictoryService::checkNoKeyStructures(Engine::Core::World &world) -> bool {
       continue;
     }
 
-    if (unit->owner_id == m_localOwnerId) {
+    if (unit->owner_id == m_local_owner_id) {
       QString const unit_type_str = QString::fromStdString(
           Game::Units::spawn_typeToString(unit->spawn_type));
       if (std::find(m_keyStructures.begin(), m_keyStructures.end(),

+ 1 - 1
game/systems/victory_service.h

@@ -67,7 +67,7 @@ private:
   float m_elapsedTime = 0.0F;
   float m_startupDelay = 0.0F;
 
-  int m_localOwnerId = 1;
+  int m_local_owner_id = 1;
   QString m_victoryState;
 
   VictoryCallback m_victoryCallback;

+ 32 - 33
render/entity/nations/carthage/catapult_renderer.cpp

@@ -218,39 +218,38 @@ void drawWindlass(const DrawContext &p, ISubmitter &out, Mesh *unit,
 } // namespace
 
 void register_catapult_renderer(EntityRendererRegistry &registry) {
-  registry.register_renderer(
-      "troops/carthage/catapult", [](const DrawContext &p, ISubmitter &out) {
-        Mesh *unit_cube = getUnitCube();
-        Texture *white_tex = nullptr;
-
-        if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
-          unit_cube = scene_renderer->get_mesh_cube();
-          white_tex = scene_renderer->get_white_texture();
-        }
-
-        if (unit_cube == nullptr || white_tex == nullptr) {
-          return;
-        }
-
-        QVector3D team_color{0.4F, 0.2F, 0.6F};
-        if (p.entity != nullptr) {
-          if (auto *r =
-                  p.entity
-                      ->get_component<Engine::Core::RenderableComponent>()) {
-            team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
-          }
-        }
-
-        auto palette = make_palette(team_color);
-
-        drawBaseFrame(p, out, unit_cube, white_tex, palette);
-        drawWheels(p, out, unit_cube, white_tex, palette);
-        drawTorsionMechanism(p, out, unit_cube, white_tex, palette);
-        drawThrowingArm(p, out, unit_cube, white_tex, palette,
-                        p.animation_time);
-        drawWindlass(p, out, unit_cube, white_tex, palette);
-        drawDecorations(p, out, unit_cube, white_tex, palette);
-      });
+  registry.register_renderer("troops/carthage/catapult", [](const DrawContext
+                                                                &p,
+                                                            ISubmitter &out) {
+    Mesh *unit_cube = getUnitCube();
+    Texture *white_tex = nullptr;
+
+    if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
+      unit_cube = scene_renderer->get_mesh_cube();
+      white_tex = scene_renderer->get_white_texture();
+    }
+
+    if (unit_cube == nullptr || white_tex == nullptr) {
+      return;
+    }
+
+    QVector3D team_color{0.4F, 0.2F, 0.6F};
+    if (p.entity != nullptr) {
+      if (auto *r =
+              p.entity->get_component<Engine::Core::RenderableComponent>()) {
+        team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
+      }
+    }
+
+    auto palette = make_palette(team_color);
+
+    drawBaseFrame(p, out, unit_cube, white_tex, palette);
+    drawWheels(p, out, unit_cube, white_tex, palette);
+    drawTorsionMechanism(p, out, unit_cube, white_tex, palette);
+    drawThrowingArm(p, out, unit_cube, white_tex, palette, p.animation_time);
+    drawWindlass(p, out, unit_cube, white_tex, palette);
+    drawDecorations(p, out, unit_cube, white_tex, palette);
+  });
 }
 
 } // namespace Render::GL::Carthage

+ 40 - 40
render/entity/nations/roman/ballista_renderer.cpp

@@ -231,46 +231,46 @@ void drawRomanOrnaments(const DrawContext &p, ISubmitter &out, Mesh *unit,
 } // namespace
 
 void register_ballista_renderer(EntityRendererRegistry &registry) {
-  registry.register_renderer(
-      "troops/roman/ballista", [](const DrawContext &p, ISubmitter &out) {
-        Mesh *unit = getUnitCube();
-        Texture *white = nullptr;
-
-        if (p.resources != nullptr) {
-          unit = p.resources->unit();
-          white = p.resources->white();
-        }
-        if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
-          unit = scene_renderer->get_mesh_cube();
-          white = scene_renderer->get_white_texture();
-        }
-
-        if (unit == nullptr || white == nullptr) {
-          return;
-        }
-
-        QVector3D team_color{0.8F, 0.2F, 0.2F};
-        if (p.entity != nullptr) {
-          if (auto *r =
-                  p.entity->get_component<Engine::Core::RenderableComponent>()) {
-            team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
-          }
-        }
-        RomanBallistaPalette c = make_palette(team_color);
-
-        DrawContext ctx = p;
-        ctx.model = p.model;
-        ctx.model.rotate(180.0F, 0.0F, 1.0F, 0.0F);
-
-        drawBaseFrame(ctx, out, unit, white, c);
-        drawWheels(ctx, out, unit, white, c);
-        drawTorsionBundles(ctx, out, unit, white, c);
-        drawArms(ctx, out, unit, white, c);
-        drawBowstring(ctx, out, white, c);
-        drawSlide(ctx, out, unit, white, c);
-        drawTriggerMechanism(ctx, out, unit, white, c);
-        drawRomanOrnaments(ctx, out, unit, white, c);
-      });
+  registry.register_renderer("troops/roman/ballista", [](const DrawContext &p,
+                                                         ISubmitter &out) {
+    Mesh *unit = getUnitCube();
+    Texture *white = nullptr;
+
+    if (p.resources != nullptr) {
+      unit = p.resources->unit();
+      white = p.resources->white();
+    }
+    if (auto *scene_renderer = dynamic_cast<Renderer *>(&out)) {
+      unit = scene_renderer->get_mesh_cube();
+      white = scene_renderer->get_white_texture();
+    }
+
+    if (unit == nullptr || white == nullptr) {
+      return;
+    }
+
+    QVector3D team_color{0.8F, 0.2F, 0.2F};
+    if (p.entity != nullptr) {
+      if (auto *r =
+              p.entity->get_component<Engine::Core::RenderableComponent>()) {
+        team_color = QVector3D(r->color[0], r->color[1], r->color[2]);
+      }
+    }
+    RomanBallistaPalette c = make_palette(team_color);
+
+    DrawContext ctx = p;
+    ctx.model = p.model;
+    ctx.model.rotate(180.0F, 0.0F, 1.0F, 0.0F);
+
+    drawBaseFrame(ctx, out, unit, white, c);
+    drawWheels(ctx, out, unit, white, c);
+    drawTorsionBundles(ctx, out, unit, white, c);
+    drawArms(ctx, out, unit, white, c);
+    drawBowstring(ctx, out, white, c);
+    drawSlide(ctx, out, unit, white, c);
+    drawTriggerMechanism(ctx, out, unit, white, c);
+    drawRomanOrnaments(ctx, out, unit, white, c);
+  });
 }
 
 } // namespace Render::GL::Roman

+ 1 - 1
render/ground/fog_renderer.h

@@ -18,7 +18,7 @@ public:
   ~FogRenderer() override = default;
 
   void setEnabled(bool enabled) { m_enabled = enabled; }
-  [[nodiscard]] auto isEnabled() const -> bool { return m_enabled; }
+  [[nodiscard]] auto is_enabled() const -> bool { return m_enabled; }
 
   void updateMask(int width, int height, float tile_size,
                   const std::vector<std::uint8_t> &cells);

+ 1 - 1
render/scene_renderer.cpp

@@ -423,7 +423,7 @@ void Renderer::render_world(Engine::Core::World *world) {
   }
 
   float fullShaderMaxDistance = 30.0F * (1.0F - batching_ratio * 0.7F);
-  if (batchConfig.force_batching) {
+  if (batch_config.force_batching) {
     fullShaderMaxDistance = 0.0F;
   }
 

+ 9 - 9
third_party/miniaudio.h

@@ -5187,7 +5187,7 @@ typedef struct
     ma_atomic_vec3f position;  /* The absolute position of the listener. */
     ma_atomic_vec3f direction; /* The direction the listener is facing. The world up vector is config.worldUp. */
     ma_atomic_vec3f velocity;
-    ma_bool32 isEnabled;
+    ma_bool32 is_enabled;
 
     /* Memory management. */
     ma_bool32 _ownsHeap;
@@ -5211,7 +5211,7 @@ MA_API void ma_spatializer_listener_set_speed_of_sound(ma_spatializer_listener*
 MA_API float ma_spatializer_listener_get_speed_of_sound(const ma_spatializer_listener* pListener);
 MA_API void ma_spatializer_listener_set_world_up(ma_spatializer_listener* pListener, float x, float y, float z);
 MA_API ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listener* pListener);
-MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 isEnabled);
+MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 is_enabled);
 MA_API ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listener* pListener);
 
 
@@ -11369,7 +11369,7 @@ MA_API void ma_engine_listener_set_cone(ma_engine* pEngine, ma_uint32 listenerIn
 MA_API void ma_engine_listener_get_cone(const ma_engine* pEngine, ma_uint32 listenerIndex, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain);
 MA_API void ma_engine_listener_set_world_up(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z);
 MA_API ma_vec3f ma_engine_listener_get_world_up(const ma_engine* pEngine, ma_uint32 listenerIndex);
-MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 isEnabled);
+MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 is_enabled);
 MA_API ma_bool32 ma_engine_listener_is_enabled(const ma_engine* pEngine, ma_uint32 listenerIndex);
 
 #ifndef MA_NO_RESOURCE_MANAGER
@@ -51764,7 +51764,7 @@ MA_API ma_result ma_spatializer_listener_init_preallocated(const ma_spatializer_
     ma_atomic_vec3f_init(&pListener->position,  ma_vec3f_init_3f(0, 0, 0));
     ma_atomic_vec3f_init(&pListener->direction, ma_vec3f_init_3f(0, 0, -1));
     ma_atomic_vec3f_init(&pListener->velocity,  ma_vec3f_init_3f(0, 0,  0));
-    pListener->isEnabled = MA_TRUE;
+    pListener->is_enabled = MA_TRUE;
 
     /* Swap the forward direction if we're left handed (it was initialized based on right handed). */
     if (pListener->config.handedness == ma_handedness_left) {
@@ -51956,13 +51956,13 @@ MA_API ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listen
     return pListener->config.worldUp;
 }
 
-MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 isEnabled)
+MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 is_enabled)
 {
     if (pListener == NULL) {
         return;
     }
 
-    pListener->isEnabled = isEnabled;
+    pListener->is_enabled = is_enabled;
 }
 
 MA_API ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listener* pListener)
@@ -51971,7 +51971,7 @@ MA_API ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listene
         return MA_FALSE;
     }
 
-    return pListener->isEnabled;
+    return pListener->is_enabled;
 }
 
 
@@ -78101,13 +78101,13 @@ MA_API ma_vec3f ma_engine_listener_get_world_up(const ma_engine* pEngine, ma_uin
     return ma_spatializer_listener_get_world_up(&pEngine->listeners[listenerIndex]);
 }
 
-MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 isEnabled)
+MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 is_enabled)
 {
     if (pEngine == NULL || listenerIndex >= pEngine->listenerCount) {
         return;
     }
 
-    ma_spatializer_listener_set_enabled(&pEngine->listeners[listenerIndex], isEnabled);
+    ma_spatializer_listener_set_enabled(&pEngine->listeners[listenerIndex], is_enabled);
 }
 
 MA_API ma_bool32 ma_engine_listener_is_enabled(const ma_engine* pEngine, ma_uint32 listenerIndex)

+ 1 - 0
ui/qml/ProductionPanel.qml

@@ -914,6 +914,7 @@ Rectangle {
 
                             MouseArea {
                                 id: ballistaMouseArea
+
                                 anchors.fill: parent
                                 hoverEnabled: true
                                 enabled: parent.isEnabled