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.

@bobtista bobtista force-pushed the heightmapUpdateCenter branch from 2f4bc96 to 98cd3e5 Compare May 22, 2023 20:05
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 109 lines in your changes missing coverage. Please review.

Project coverage is 2.97%. Comparing base (c8b118e) to head (709f055).
Report is 103 commits behind head on develop.

Files with missing lines Patch % Lines
src/game/client/heightmap.cpp 0.00% 109 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #926      +/-   ##
==========================================
- Coverage     2.97%   2.97%   -0.01%     
==========================================
  Files          803     803              
  Lines        80343   80343              
  Branches     13764   13764              
==========================================
- Hits          2390    2387       -3     
- Misses       77610   77612       +2     
- Partials       343     344       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bobtista bobtista force-pushed the heightmapUpdateCenter branch from 98cd3e5 to 709f055 Compare May 22, 2023 20:33
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.

3 participants