Browse Source

apply format

djeada 2 months ago
parent
commit
1ee29b0194

+ 2 - 3
app/core/game_engine.cpp

@@ -1445,9 +1445,8 @@ void GameEngine::applyEnvironmentFromMetadata(const QJsonObject &metadata) {
     if (runtimeObj.contains("cursorMode")) {
     if (runtimeObj.contains("cursorMode")) {
       const auto cursorValue = runtimeObj.value("cursorMode");
       const auto cursorValue = runtimeObj.value("cursorMode");
       if (cursorValue.isDouble()) {
       if (cursorValue.isDouble()) {
-        setCursorMode(
-            CursorModeUtils::fromInt(cursorValue.toInt(static_cast<int>(
-                CursorMode::Normal))));
+        setCursorMode(CursorModeUtils::fromInt(
+            cursorValue.toInt(static_cast<int>(CursorMode::Normal))));
       } else if (cursorValue.isString()) {
       } else if (cursorValue.isString()) {
         setCursorMode(cursorValue.toString());
         setCursorMode(cursorValue.toString());
       }
       }

+ 2 - 1
game/core/serialization.cpp

@@ -202,7 +202,8 @@ QJsonObject Serialization::serializeEntity(const Entity *entity) {
   if (const auto *capture = entity->getComponent<CaptureComponent>()) {
   if (const auto *capture = entity->getComponent<CaptureComponent>()) {
     QJsonObject captureObj;
     QJsonObject captureObj;
     captureObj["capturingPlayerId"] = capture->capturingPlayerId;
     captureObj["capturingPlayerId"] = capture->capturingPlayerId;
-    captureObj["captureProgress"] = static_cast<double>(capture->captureProgress);
+    captureObj["captureProgress"] =
+        static_cast<double>(capture->captureProgress);
     captureObj["requiredTime"] = static_cast<double>(capture->requiredTime);
     captureObj["requiredTime"] = static_cast<double>(capture->requiredTime);
     captureObj["isBeingCaptured"] = capture->isBeingCaptured;
     captureObj["isBeingCaptured"] = capture->isBeingCaptured;
     entityObj["capture"] = captureObj;
     entityObj["capture"] = captureObj;

+ 3 - 2
game/systems/global_stats_registry.cpp

@@ -126,8 +126,9 @@ void GlobalStatsRegistry::onBarrackCaptured(
   auto &newStats = m_playerStats[event.newOwnerId];
   auto &newStats = m_playerStats[event.newOwnerId];
   newStats.barracksOwned++;
   newStats.barracksOwned++;
 
 
-  qDebug() << "[Stats] Barrack captured - Previous owner" << event.previousOwnerId
-           << "lost barrack, new owner" << event.newOwnerId << "gained barrack";
+  qDebug() << "[Stats] Barrack captured - Previous owner"
+           << event.previousOwnerId << "lost barrack, new owner"
+           << event.newOwnerId << "gained barrack";
 }
 }
 
 
 void GlobalStatsRegistry::rebuildFromWorld(Engine::Core::World &world) {
 void GlobalStatsRegistry::rebuildFromWorld(Engine::Core::World &world) {

+ 5 - 7
render/entity/barracks_renderer.cpp

@@ -547,12 +547,11 @@ static inline void drawBannerAndPole(const DrawContext &p, ISubmitter &out,
   if (p.entity) {
   if (p.entity) {
     auto *capture = p.entity->getComponent<Engine::Core::CaptureComponent>();
     auto *capture = p.entity->getComponent<Engine::Core::CaptureComponent>();
     if (capture && capture->isBeingCaptured) {
     if (capture && capture->isBeingCaptured) {
-      float progress =
-          std::clamp(capture->captureProgress / capture->requiredTime, 0.0f,
-                     1.0f);
+      float progress = std::clamp(
+          capture->captureProgress / capture->requiredTime, 0.0f, 1.0f);
 
 
-      QVector3D newTeamColor = Game::Visuals::teamColorForOwner(
-          capture->capturingPlayerId);
+      QVector3D newTeamColor =
+          Game::Visuals::teamColorForOwner(capture->capturingPlayerId);
       teamColor = lerp(C.team, clampVec01(newTeamColor), progress);
       teamColor = lerp(C.team, clampVec01(newTeamColor), progress);
       teamTrimColor = lerp(
       teamTrimColor = lerp(
           C.teamTrim,
           C.teamTrim,
@@ -577,8 +576,7 @@ static inline void drawBannerAndPole(const DrawContext &p, ISubmitter &out,
                C.timberLight, white);
                C.timberLight, white);
 
 
   float panelX = beamEnd.x() + (targetWidth * 0.5f - beamLength);
   float panelX = beamEnd.x() + (targetWidth * 0.5f - beamLength);
-  unitBox(out, unit, white, p.model,
-          QVector3D(panelX, flagY, poleZ + 0.01f),
+  unitBox(out, unit, white, p.model, QVector3D(panelX, flagY, poleZ + 0.01f),
           QVector3D(targetWidth / 2.0f, targetHeight / 2.0f, panelDepth),
           QVector3D(targetWidth / 2.0f, targetHeight / 2.0f, panelDepth),
           teamColor);
           teamColor);