Browse Source

Convert struct member variables to snake_case in humanoid and horse renderers

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 1 week ago
parent
commit
33ed92d05d
4 changed files with 357 additions and 357 deletions
  1. 266 266
      render/horse/rig.cpp
  2. 59 59
      render/horse/rig.h
  3. 11 11
      render/humanoid/rig.cpp
  4. 21 21
      render/humanoid/rig.h

File diff suppressed because it is too large
+ 266 - 266
render/horse/rig.cpp


+ 59 - 59
render/horse/rig.h

@@ -15,20 +15,20 @@ class ISubmitter;
 inline auto calculate_horse_lod(float distance) -> HorseLOD;
 inline auto calculate_horse_lod(float distance) -> HorseLOD;
 
 
 struct HorseRenderStats {
 struct HorseRenderStats {
-  uint32_t horsesTotal{0};
-  uint32_t horsesRendered{0};
-  uint32_t horsesSkippedLOD{0};
-  uint32_t lodFull{0};
-  uint32_t lodReduced{0};
-  uint32_t lodMinimal{0};
+  uint32_t horses_total{0};
+  uint32_t horses_rendered{0};
+  uint32_t horses_skipped_lod{0};
+  uint32_t lod_full{0};
+  uint32_t lod_reduced{0};
+  uint32_t lod_minimal{0};
 
 
   void reset() {
   void reset() {
-    horsesTotal = 0;
-    horsesRendered = 0;
-    horsesSkippedLOD = 0;
-    lodFull = 0;
-    lodReduced = 0;
-    lodMinimal = 0;
+    horses_total = 0;
+    horses_rendered = 0;
+    horses_skipped_lod = 0;
+    lod_full = 0;
+    lod_reduced = 0;
+    lod_minimal = 0;
   }
   }
 };
 };
 
 
@@ -37,52 +37,52 @@ auto get_horse_render_stats() -> const HorseRenderStats &;
 void reset_horse_render_stats();
 void reset_horse_render_stats();
 
 
 struct HorseDimensions {
 struct HorseDimensions {
-  float bodyLength{};
-  float bodyWidth{};
-  float bodyHeight{};
-  float barrel_centerY{};
+  float body_length{};
+  float body_width{};
+  float body_height{};
+  float barrel_center_y{};
 
 
-  float neckLength{};
-  float neckRise{};
+  float neck_length{};
+  float neck_rise{};
 
 
-  float headLength{};
-  float headWidth{};
-  float headHeight{};
-  float muzzleLength{};
+  float head_length{};
+  float head_width{};
+  float head_height{};
+  float muzzle_length{};
 
 
-  float legLength{};
-  float hoofHeight{};
+  float leg_length{};
+  float hoof_height{};
 
 
-  float tailLength{};
+  float tail_length{};
 
 
   float saddle_height{};
   float saddle_height{};
-  float saddleThickness{};
-  float seatForwardOffset{};
+  float saddle_thickness{};
+  float seat_forward_offset{};
 
 
-  float stirrupDrop{};
-  float stirrupOut{};
+  float stirrup_drop{};
+  float stirrup_out{};
 
 
-  float idleBobAmplitude{};
-  float moveBobAmplitude{};
+  float idle_bob_amplitude{};
+  float move_bob_amplitude{};
 };
 };
 
 
 struct HorseVariant {
 struct HorseVariant {
-  QVector3D coatColor;
+  QVector3D coat_color;
   QVector3D mane_color;
   QVector3D mane_color;
   QVector3D tail_color;
   QVector3D tail_color;
-  QVector3D muzzleColor;
+  QVector3D muzzle_color;
   QVector3D hoof_color;
   QVector3D hoof_color;
-  QVector3D saddleColor;
-  QVector3D blanketColor;
+  QVector3D saddle_color;
+  QVector3D blanket_color;
   QVector3D tack_color;
   QVector3D tack_color;
 };
 };
 
 
 struct HorseGait {
 struct HorseGait {
-  float cycleTime{};
-  float frontLegPhase{};
-  float rearLegPhase{};
-  float strideSwing{};
-  float strideLift{};
+  float cycle_time{};
+  float front_leg_phase{};
+  float rear_leg_phase{};
+  float stride_swing{};
+  float stride_lift{};
 };
 };
 
 
 struct HorseProfile {
 struct HorseProfile {
@@ -175,26 +175,26 @@ auto evaluate_horse_motion(HorseProfile &profile, const AnimationInputs &anim,
 void apply_mount_vertical_offset(MountedAttachmentFrame &frame, float bob);
 void apply_mount_vertical_offset(MountedAttachmentFrame &frame, float bob);
 
 
 inline void scale_horse_dimensions(HorseDimensions &dims, float scale) {
 inline void scale_horse_dimensions(HorseDimensions &dims, float scale) {
-  dims.bodyLength *= scale;
-  dims.bodyWidth *= scale;
-  dims.bodyHeight *= scale;
-  dims.neckLength *= scale;
-  dims.neckRise *= scale;
-  dims.headLength *= scale;
-  dims.headWidth *= scale;
-  dims.headHeight *= scale;
-  dims.muzzleLength *= scale;
-  dims.legLength *= scale;
-  dims.hoofHeight *= scale;
-  dims.tailLength *= scale;
-  dims.saddleThickness *= scale;
-  dims.seatForwardOffset *= scale;
-  dims.stirrupOut *= scale;
-  dims.stirrupDrop *= scale;
-  dims.barrel_centerY *= scale;
+  dims.body_length *= scale;
+  dims.body_width *= scale;
+  dims.body_height *= scale;
+  dims.neck_length *= scale;
+  dims.neck_rise *= scale;
+  dims.head_length *= scale;
+  dims.head_width *= scale;
+  dims.head_height *= scale;
+  dims.muzzle_length *= scale;
+  dims.leg_length *= scale;
+  dims.hoof_height *= scale;
+  dims.tail_length *= scale;
+  dims.saddle_thickness *= scale;
+  dims.seat_forward_offset *= scale;
+  dims.stirrup_out *= scale;
+  dims.stirrup_drop *= scale;
+  dims.barrel_center_y *= scale;
   dims.saddle_height *= scale;
   dims.saddle_height *= scale;
-  dims.idleBobAmplitude *= scale;
-  dims.moveBobAmplitude *= scale;
+  dims.idle_bob_amplitude *= scale;
+  dims.move_bob_amplitude *= scale;
 }
 }
 
 
 class HorseRendererBase {
 class HorseRendererBase {

+ 11 - 11
render/humanoid/rig.cpp

@@ -1259,11 +1259,11 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
   HumanoidVariant variant;
   HumanoidVariant variant;
   get_variant(ctx, seed, variant);
   get_variant(ctx, seed, variant);
 
 
-  if (!m_proportionScaleCached) {
-    m_cachedProportionScale = get_proportion_scaling();
-    m_proportionScaleCached = true;
+  if (!m_proportion_scale_cached) {
+    m_cached_proportion_scale = get_proportion_scaling();
+    m_proportion_scale_cached = true;
   }
   }
-  const QVector3D prop_scale = m_cachedProportionScale;
+  const QVector3D prop_scale = m_cached_proportion_scale;
   const float height_scale = prop_scale.y();
   const float height_scale = prop_scale.y();
   const bool needs_height_scaling = std::abs(height_scale - 1.0F) > 0.001F;
   const bool needs_height_scaling = std::abs(height_scale - 1.0F) > 0.001F;
 
 
@@ -1293,7 +1293,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
     return float(state & 0x7FFFFFU) / float(0x7FFFFFU);
     return float(state & 0x7FFFFFU) / float(0x7FFFFFU);
   };
   };
 
 
-  s_renderStats.soldiersTotal += visible_count;
+  s_renderStats.soldiers_total += visible_count;
 
 
   for (int idx = 0; idx < visible_count; ++idx) {
   for (int idx = 0; idx < visible_count; ++idx) {
     int const r = idx / cols;
     int const r = idx / cols;
@@ -1364,7 +1364,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
       }
       }
     }
     }
 
 
-    ++s_renderStats.soldiersRendered;
+    ++s_renderStats.soldiers_rendered;
 
 
     DrawContext inst_ctx{ctx.resources, ctx.entity, ctx.world, inst_model};
     DrawContext inst_ctx{ctx.resources, ctx.entity, ctx.world, inst_model};
     inst_ctx.selected = ctx.selected;
     inst_ctx.selected = ctx.selected;
@@ -1400,7 +1400,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
 
 
         pose = cached.pose;
         pose = cached.pose;
         usedCachedPose = true;
         usedCachedPose = true;
-        ++s_renderStats.posesCached;
+        ++s_renderStats.poses_cached;
       }
       }
     }
     }
 
 
@@ -1408,7 +1408,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
 
 
       compute_locomotion_pose(inst_seed, anim.time + phase_offset, anim.is_moving,
       compute_locomotion_pose(inst_seed, anim.time + phase_offset, anim.is_moving,
                             variation, pose);
                             variation, pose);
-      ++s_renderStats.posesComputed;
+      ++s_renderStats.poses_computed;
 
 
       CachedPoseEntry &entry = s_poseCache[cacheKey];
       CachedPoseEntry &entry = s_poseCache[cacheKey];
       entry.pose = pose;
       entry.pose = pose;
@@ -1648,7 +1648,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
     switch (soldier_lod) {
     switch (soldier_lod) {
     case HumanoidLOD::Full:
     case HumanoidLOD::Full:
 
 
-      ++s_renderStats.lodFull;
+      ++s_renderStats.lod_full;
       draw_common_body(inst_ctx, variant, pose, out);
       draw_common_body(inst_ctx, variant, pose, out);
       draw_facial_hair(inst_ctx, variant, pose, out);
       draw_facial_hair(inst_ctx, variant, pose, out);
       draw_armor(inst_ctx, variant, pose, anim_ctx, out);
       draw_armor(inst_ctx, variant, pose, anim_ctx, out);
@@ -1657,7 +1657,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
 
 
     case HumanoidLOD::Reduced:
     case HumanoidLOD::Reduced:
 
 
-      ++s_renderStats.lodReduced;
+      ++s_renderStats.lod_reduced;
       draw_simplified_body(inst_ctx, variant, pose, out);
       draw_simplified_body(inst_ctx, variant, pose, out);
       draw_armor(inst_ctx, variant, pose, anim_ctx, out);
       draw_armor(inst_ctx, variant, pose, anim_ctx, out);
       add_attachments(inst_ctx, variant, pose, anim_ctx, out);
       add_attachments(inst_ctx, variant, pose, anim_ctx, out);
@@ -1665,7 +1665,7 @@ void HumanoidRendererBase::render(const DrawContext &ctx,
 
 
     case HumanoidLOD::Minimal:
     case HumanoidLOD::Minimal:
 
 
-      ++s_renderStats.lodMinimal;
+      ++s_renderStats.lod_minimal;
       draw_minimal_body(inst_ctx, variant, pose, out);
       draw_minimal_body(inst_ctx, variant, pose, out);
       break;
       break;
 
 

+ 21 - 21
render/humanoid/rig.h

@@ -59,7 +59,7 @@ public:
 
 
   virtual void customize_pose(const DrawContext &ctx,
   virtual void customize_pose(const DrawContext &ctx,
                               const HumanoidAnimationContext &anim_ctx,
                               const HumanoidAnimationContext &anim_ctx,
-                              uint32_t seed, HumanoidPose &ioPose) const;
+                              uint32_t seed, HumanoidPose &io_pose) const;
 
 
   virtual void add_attachments(const DrawContext &ctx, const HumanoidVariant &v,
   virtual void add_attachments(const DrawContext &ctx, const HumanoidVariant &v,
                               const HumanoidPose &pose,
                               const HumanoidPose &pose,
@@ -120,8 +120,8 @@ public:
                                      float uniform_scale) -> QMatrix4x4;
                                      float uniform_scale) -> QMatrix4x4;
 
 
 protected:
 protected:
-  mutable QVector3D m_cachedProportionScale;
-  mutable bool m_proportionScaleCached = false;
+  mutable QVector3D m_cached_proportion_scale;
+  mutable bool m_proportion_scale_cached = false;
 
 
   static auto resolve_formation(const DrawContext &ctx) -> FormationParams;
   static auto resolve_formation(const DrawContext &ctx) -> FormationParams;
 
 
@@ -136,26 +136,26 @@ protected:
 };
 };
 
 
 struct HumanoidRenderStats {
 struct HumanoidRenderStats {
-  uint32_t soldiersTotal{0};
-  uint32_t soldiersRendered{0};
-  uint32_t soldiersSkippedFrustum{0};
-  uint32_t soldiersSkippedLOD{0};
-  uint32_t posesComputed{0};
-  uint32_t posesCached{0};
-  uint32_t lodFull{0};
-  uint32_t lodReduced{0};
-  uint32_t lodMinimal{0};
+  uint32_t soldiers_total{0};
+  uint32_t soldiers_rendered{0};
+  uint32_t soldiers_skipped_frustum{0};
+  uint32_t soldiers_skipped_lod{0};
+  uint32_t poses_computed{0};
+  uint32_t poses_cached{0};
+  uint32_t lod_full{0};
+  uint32_t lod_reduced{0};
+  uint32_t lod_minimal{0};
 
 
   void reset() {
   void reset() {
-    soldiersTotal = 0;
-    soldiersRendered = 0;
-    soldiersSkippedFrustum = 0;
-    soldiersSkippedLOD = 0;
-    posesComputed = 0;
-    posesCached = 0;
-    lodFull = 0;
-    lodReduced = 0;
-    lodMinimal = 0;
+    soldiers_total = 0;
+    soldiers_rendered = 0;
+    soldiers_skipped_frustum = 0;
+    soldiers_skipped_lod = 0;
+    poses_computed = 0;
+    poses_cached = 0;
+    lod_full = 0;
+    lod_reduced = 0;
+    lod_minimal = 0;
   }
   }
 };
 };
 
 

Some files were not shown because too many files changed in this diff