Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves readability in HeightMapRenderObjClass::Update_Center #926

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bobtista
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.07 ⚠️

Comparison is base (e2c0ddc) 3.03% compared to head (98cd3e5) 2.97%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #926      +/-   ##
==========================================
- Coverage     3.03%   2.97%   -0.07%     
==========================================
  Files          802     803       +1     
  Lines        78769   80343    +1574     
  Branches     13351   13764     +413     
==========================================
- Hits          2390    2387       -3     
- Misses       76036   77613    +1577     
  Partials       343     343              
Impacted Files Coverage Δ
src/game/client/heightmap.cpp 0.00% <0.00%> (ø)

... and 41 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

min_x = m_map->Border_Size() + min_x;
max_x = m_map->Border_Size() + max_x;
min_y = m_map->Border_Size() + min_y;
max_y = m_map->Border_Size() + max_y;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or +=

min_x = min_x / 10.0f;
max_x = max_x / 10.0f;
min_y = min_y / 10.0f;
max_y = max_y / 10.0f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or /=

} else {
i6 = i6 + m_x - 1;
x_start_tile = x_start_tile + m_x - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or +=

i6 -= i1;
i7 += i1;
x_start_tile -= increment;
x_end_tile += increment;

if (m_originX < 0) {
m_originX = m_originX + m_x - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or +=

} else {
i4 = i4 + m_y - 1;
y_start_tile = y_start_tile + m_y - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or +=

float x_dist = viewport_max.X - viewport_min.X;
float y_dist = viewport_max.Y - viewport_min.Y;
float scale_factor = -1.0f;
float min_x = 200000.0f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now there is

x_dist
min_x

among others.

Perhaps it makes sense to name those x,y variables in consistent order?

Perhaps x,y always at the end of the name?


float z = max_height;
Vector2 viewport_min;
Vector2 viewport_max;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just view_max for short.

Vector2 viewport_max;
camera->Get_View_Plane(viewport_min, viewport_max);
float x_dist = viewport_max.X - viewport_min.X;
float y_dist = viewport_max.Y - viewport_min.Y;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this variable can still retain view in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants