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

Slight optimizations in ClientMap #14251

Merged
merged 1 commit into from Jan 13, 2024
Merged

Conversation

lhofhansl
Copy link
Contributor

@lhofhansl lhofhansl commented Jan 12, 2024

Remove some unused code, and use MapBlock::getPosRelative() where possible, we have this method just for this purpose.
(Aside: getPosRelative() should probably be renamed to getPosNodes(), but that for another PR)

  • Goal of the PR
    Slight performance improvement, code maintenance.

  • How does the PR work?

  • Does it resolve any reported issue?

  • Does this relate to a goal in the roadmap?

  • If not a bug fix, why is this PR needed? What usecases does it solve?

To do

This PR is Ready for Review.

How to test

No functional changes... Join any world. Make sure everything is still rendered correctly.

@lhofhansl lhofhansl added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines Performance labels Jan 12, 2024
@@ -1245,11 +1245,6 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
{
ScopeProfiler sp(g_profiler, "CM::updateDrawListShadow()", SPT_AVG);

v3s16 cam_pos_nodes = floatToInt(shadow_light_pos, BS);
Copy link
Contributor Author

@lhofhansl lhofhansl Jan 12, 2024

Choose a reason for hiding this comment

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

This is unused. I traced back the commit history, and this was never used. Looks like an accidental cut-n-paste.

If I ever figure out #14239 (if that's even possible) I'm going to re-add this. Until then it's dead code.

@lhofhansl lhofhansl requested a review from sfan5 January 12, 2024 23:46
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

lgtm

@lhofhansl
Copy link
Contributor Author

Fastest review in the West :)

@lhofhansl lhofhansl merged commit 518ecd7 into minetest:master Jan 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️ Performance Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants