Selaa lähdekoodia

Improve flag and banner visuals with larger sizes and better proportions

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 1 viikko sitten
vanhempi
sitoutus
7a59bbe91c

+ 2 - 2
render/entity/barracks_flag_renderer.h

@@ -30,8 +30,8 @@ inline void draw_rally_flag_if_any(const DrawContext &p, ISubmitter &out,
           p.entity->get_component<Engine::Core::ProductionComponent>()) {
     if (prod->rally_set && (p.resources != nullptr)) {
       auto flag = Render::Geom::Flag::create(prod->rally_x, prod->rally_z,
-                                             QVector3D(1.0F, 0.9F, 0.2F),
-                                             colors.woodDark, 1.0F);
+                                             QVector3D(1.0F, 0.95F, 0.3F),
+                                             colors.woodDark, 1.6F);
       Mesh *unit = p.resources->unit();
       out.mesh(unit, flag.pole, flag.poleColor, white, 1.0F);
       out.mesh(unit, flag.pennant, flag.pennantColor, white, 1.0F);

+ 23 - 23
render/entity/nations/carthage/barracks_renderer.cpp

@@ -214,69 +214,69 @@ void draw_phoenician_banner(const DrawContext &p, ISubmitter &out, Mesh *unit,
                             Texture *white, const CarthagePalette &c) {
   float const pole_x = 0.0F;
   float const pole_z = -2.0F;
-  float const pole_height = 2.4F;
-  float const pole_radius = 0.03F;
-  float const banner_width = 0.5F;
-  float const banner_height = 0.4F;
-  float const panel_depth = 0.02F;
+  float const pole_height = 3.0F;
+  float const pole_radius = 0.045F;
+  float const banner_width = 0.9F;
+  float const banner_height = 0.6F;
+  float const panel_depth = 0.03F;
 
   QVector3D const pole_center(pole_x, pole_height / 2.0F, pole_z);
-  QVector3D const pole_size(pole_radius * 1.6F, pole_height / 2.0F,
-                            pole_radius * 1.6F);
+  QVector3D const pole_size(pole_radius * 1.8F, pole_height / 2.0F,
+                            pole_radius * 1.8F);
 
   QMatrix4x4 poleTransform = p.model;
   poleTransform.translate(pole_center);
   poleTransform.scale(pole_size);
   out.mesh(unit, poleTransform, c.cedar, white, 1.0F);
 
-  float const beam_length = banner_width * 0.45F;
+  float const beam_length = banner_width * 0.5F;
   float const max_lowering = pole_height * 0.85F;
 
   auto captureColors = BarracksFlagRenderer::get_capture_colors(
       p, c.team, c.team_trim, max_lowering);
 
   float beam_y =
-      pole_height - banner_height * 0.25F - captureColors.loweringOffset;
+      pole_height - banner_height * 0.2F - captureColors.loweringOffset;
   float flag_y =
       pole_height - banner_height / 2.0F - captureColors.loweringOffset;
 
-  QVector3D const beam_start(pole_x + 0.02F, beam_y, pole_z);
-  QVector3D const beam_end(pole_x + beam_length + 0.02F, beam_y, pole_z);
+  QVector3D const beam_start(pole_x + 0.03F, beam_y, pole_z);
+  QVector3D const beam_end(pole_x + beam_length + 0.03F, beam_y, pole_z);
   out.mesh(getUnitCylinder(),
            p.model * Render::Geom::cylinderBetween(beam_start, beam_end,
-                                                   pole_radius * 0.35F),
+                                                   pole_radius * 0.45F),
            c.cedar, white, 1.0F);
 
   QVector3D const connector_top(
       beam_end.x(), beam_end.y() - banner_height * 0.35F, beam_end.z());
   out.mesh(getUnitCylinder(),
            p.model * Render::Geom::cylinderBetween(beam_end, connector_top,
-                                                   pole_radius * 0.18F),
-           c.limestone, white, 1.0F);
+                                                   pole_radius * 0.25F),
+           c.gold, white, 1.0F);
 
   float const panel_x = beam_end.x() + (banner_width * 0.5F - beam_length);
 
   QMatrix4x4 panelTransform = p.model;
-  panelTransform.translate(QVector3D(panel_x, flag_y, pole_z + 0.01F));
+  panelTransform.translate(QVector3D(panel_x, flag_y, pole_z + 0.02F));
   panelTransform.scale(
       QVector3D(banner_width / 2.0F, banner_height / 2.0F, panel_depth));
   out.mesh(unit, panelTransform, captureColors.teamColor, white, 1.0F);
 
   QMatrix4x4 trimBottom = p.model;
-  trimBottom.translate(QVector3D(panel_x, flag_y - banner_height / 2.0F + 0.04F,
-                                 pole_z + 0.01F));
-  trimBottom.scale(QVector3D(banner_width / 2.0F + 0.02F, 0.04F, 0.015F));
+  trimBottom.translate(QVector3D(panel_x, flag_y - banner_height / 2.0F + 0.06F,
+                                 pole_z + 0.02F));
+  trimBottom.scale(QVector3D(banner_width / 2.0F + 0.03F, 0.06F, 0.02F));
   out.mesh(unit, trimBottom, captureColors.teamTrimColor, white, 1.0F);
 
   QMatrix4x4 trimTop = p.model;
-  trimTop.translate(QVector3D(panel_x, flag_y + banner_height / 2.0F - 0.04F,
-                              pole_z + 0.01F));
-  trimTop.scale(QVector3D(banner_width / 2.0F + 0.02F, 0.04F, 0.015F));
+  trimTop.translate(QVector3D(panel_x, flag_y + banner_height / 2.0F - 0.06F,
+                              pole_z + 0.02F));
+  trimTop.scale(QVector3D(banner_width / 2.0F + 0.03F, 0.06F, 0.02F));
   out.mesh(unit, trimTop, captureColors.teamTrimColor, white, 1.0F);
 
   draw_box(out, unit, white, p.model,
-           QVector3D(pole_x + 0.2F, pole_height + 0.12F, pole_z + 0.03F),
-           QVector3D(0.26F, 0.02F, 0.01F), c.gold);
+           QVector3D(pole_x + 0.25F, pole_height + 0.15F, pole_z + 0.03F),
+           QVector3D(0.35F, 0.03F, 0.015F), c.gold);
 }
 
 void draw_rally_flag(const DrawContext &p, ISubmitter &out, Texture *white,

+ 23 - 23
render/entity/nations/roman/barracks_renderer.cpp

@@ -174,69 +174,69 @@ void drawStandards(const DrawContext &p, ISubmitter &out, Mesh *unit,
                    Texture *white, const RomanPalette &c) {
   float const pole_x = 2.0F;
   float const pole_z = -1.5F;
-  float const pole_height = 2.1F;
-  float const pole_radius = 0.03F;
-  float const banner_width = 0.5F;
-  float const banner_height = 0.3F;
-  float const panel_depth = 0.02F;
+  float const pole_height = 2.6F;
+  float const pole_radius = 0.045F;
+  float const banner_width = 0.8F;
+  float const banner_height = 0.5F;
+  float const panel_depth = 0.03F;
 
   QVector3D const pole_center(pole_x, pole_height / 2.0F, pole_z);
-  QVector3D const pole_size(pole_radius * 1.6F, pole_height / 2.0F,
-                            pole_radius * 1.6F);
+  QVector3D const pole_size(pole_radius * 1.8F, pole_height / 2.0F,
+                            pole_radius * 1.8F);
 
   QMatrix4x4 poleTransform = p.model;
   poleTransform.translate(pole_center);
   poleTransform.scale(pole_size);
   out.mesh(unit, poleTransform, c.wood, white, 1.0F);
 
-  float const beam_length = banner_width * 0.45F;
+  float const beam_length = banner_width * 0.5F;
   float const max_lowering = pole_height * 0.85F;
 
   auto captureColors = BarracksFlagRenderer::get_capture_colors(
       p, c.team, c.team_trim, max_lowering);
 
   float beam_y =
-      pole_height - banner_height * 0.25F - captureColors.loweringOffset;
+      pole_height - banner_height * 0.2F - captureColors.loweringOffset;
   float flag_y =
       pole_height - banner_height / 2.0F - captureColors.loweringOffset;
 
-  QVector3D const beam_start(pole_x + 0.02F, beam_y, pole_z);
-  QVector3D const beam_end(pole_x + beam_length + 0.02F, beam_y, pole_z);
+  QVector3D const beam_start(pole_x + 0.03F, beam_y, pole_z);
+  QVector3D const beam_end(pole_x + beam_length + 0.03F, beam_y, pole_z);
   out.mesh(getUnitCylinder(),
            p.model * Render::Geom::cylinderBetween(beam_start, beam_end,
-                                                   pole_radius * 0.35F),
+                                                   pole_radius * 0.45F),
            c.wood, white, 1.0F);
 
   QVector3D const connector_top(
       beam_end.x(), beam_end.y() - banner_height * 0.35F, beam_end.z());
   out.mesh(getUnitCylinder(),
            p.model * Render::Geom::cylinderBetween(beam_end, connector_top,
-                                                   pole_radius * 0.18F),
-           c.stone_light, white, 1.0F);
+                                                   pole_radius * 0.25F),
+           c.iron, white, 1.0F);
 
   float const panel_x = beam_end.x() + (banner_width * 0.5F - beam_length);
 
   QMatrix4x4 panelTransform = p.model;
-  panelTransform.translate(QVector3D(panel_x, flag_y, pole_z + 0.01F));
+  panelTransform.translate(QVector3D(panel_x, flag_y, pole_z + 0.02F));
   panelTransform.scale(
       QVector3D(banner_width / 2.0F, banner_height / 2.0F, panel_depth));
   out.mesh(unit, panelTransform, captureColors.teamColor, white, 1.0F);
 
   QMatrix4x4 trimBottom = p.model;
-  trimBottom.translate(QVector3D(panel_x, flag_y - banner_height / 2.0F + 0.04F,
-                                 pole_z + 0.01F));
-  trimBottom.scale(QVector3D(banner_width / 2.0F + 0.02F, 0.04F, 0.015F));
+  trimBottom.translate(QVector3D(panel_x, flag_y - banner_height / 2.0F + 0.06F,
+                                 pole_z + 0.02F));
+  trimBottom.scale(QVector3D(banner_width / 2.0F + 0.03F, 0.06F, 0.02F));
   out.mesh(unit, trimBottom, captureColors.teamTrimColor, white, 1.0F);
 
   QMatrix4x4 trimTop = p.model;
-  trimTop.translate(QVector3D(panel_x, flag_y + banner_height / 2.0F - 0.04F,
-                              pole_z + 0.01F));
-  trimTop.scale(QVector3D(banner_width / 2.0F + 0.02F, 0.04F, 0.015F));
+  trimTop.translate(QVector3D(panel_x, flag_y + banner_height / 2.0F - 0.06F,
+                              pole_z + 0.02F));
+  trimTop.scale(QVector3D(banner_width / 2.0F + 0.03F, 0.06F, 0.02F));
   out.mesh(unit, trimTop, captureColors.teamTrimColor, white, 1.0F);
 
   draw_box(out, unit, white, p.model,
-           QVector3D(pole_x, pole_height + 0.15F, pole_z),
-           QVector3D(0.08F, 0.06F, 0.08F), c.iron);
+           QVector3D(pole_x, pole_height + 0.2F, pole_z),
+           QVector3D(0.12F, 0.10F, 0.12F), c.iron);
 }
 
 void draw_rally_flag(const DrawContext &p, ISubmitter &out, Texture *white,

+ 6 - 6
render/geom/flag.cpp

@@ -16,17 +16,17 @@ auto Flag::create(float world_x, float world_z, const QVector3D &flagColor,
   result.poleColor = poleColor;
 
   result.pole = k_identity_matrix;
-  result.pole.translate(world_x, (0.15F + 0.15F) * scale, world_z);
-  result.pole.scale(0.03F * scale, 0.30F * scale, 0.03F * scale);
+  result.pole.translate(world_x, (0.15F + 0.35F) * scale, world_z);
+  result.pole.scale(0.05F * scale, 0.70F * scale, 0.05F * scale);
 
   result.pennant = k_identity_matrix;
-  result.pennant.translate(world_x + 0.10F * scale, (0.25F + 0.15F) * scale,
+  result.pennant.translate(world_x + 0.20F * scale, (0.60F + 0.15F) * scale,
                            world_z);
-  result.pennant.scale(0.18F * scale, 0.12F * scale, 0.02F * scale);
+  result.pennant.scale(0.38F * scale, 0.28F * scale, 0.03F * scale);
 
   result.finial = k_identity_matrix;
-  result.finial.translate(world_x, (0.32F + 0.15F) * scale, world_z);
-  result.finial.scale(0.05F * scale, 0.05F * scale, 0.05F * scale);
+  result.finial.translate(world_x, (0.90F + 0.15F) * scale, world_z);
+  result.finial.scale(0.10F * scale, 0.10F * scale, 0.10F * scale);
 
   return result;
 }

+ 7 - 7
render/geom/patrol_flags.cpp

@@ -25,15 +25,15 @@ void renderPatrolFlags(Renderer *renderer, ResourceManager *resources,
 
   if (preview_waypoint.has_value()) {
     auto flag = Geom::Flag::create(preview_waypoint->x(), preview_waypoint->z(),
-                                   QVector3D(0.3F, 1.0F, 0.4F),
-                                   QVector3D(0.3F, 0.2F, 0.1F), 0.9F);
+                                   QVector3D(0.4F, 1.0F, 0.5F),
+                                   QVector3D(0.35F, 0.25F, 0.15F), 1.5F);
 
     renderer->mesh(resources->unit(), flag.pole, flag.poleColor,
-                   resources->white(), 0.8F);
+                   resources->white(), 1.0F);
     renderer->mesh(resources->unit(), flag.pennant, flag.pennantColor,
-                   resources->white(), 0.8F);
+                   resources->white(), 1.0F);
     renderer->mesh(resources->unit(), flag.finial, flag.pennantColor,
-                   resources->white(), 0.8F);
+                   resources->white(), 1.0F);
 
     auto const grid_x =
         static_cast<int32_t>(preview_waypoint->x() * k_position_grid_precision);
@@ -75,8 +75,8 @@ void renderPatrolFlags(Renderer *renderer, ResourceManager *resources,
       }
 
       auto flag = Geom::Flag::create(waypoint.first, waypoint.second,
-                                     QVector3D(0.2F, 0.9F, 0.3F),
-                                     QVector3D(0.3F, 0.2F, 0.1F), 0.8F);
+                                     QVector3D(0.3F, 1.0F, 0.4F),
+                                     QVector3D(0.35F, 0.25F, 0.15F), 1.4F);
 
       renderer->mesh(resources->unit(), flag.pole, flag.poleColor,
                      resources->white(), 1.0F);