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

Update animationinfo.cpp #7550

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update animationinfo.cpp #7550

wants to merge 4 commits into from

Conversation

Nairdaa
Copy link

@Nairdaa Nairdaa commented Nov 19, 2024

Deshitified the code abit...

Moved some repeated logic into a helper function (configureFrameDistribution) to handle frame distribution calculation.

Used std::max and std::clamp in places to ensure values stay within valid ranges.

Added validation for ticksPerFrame to avoid potential division by zero.

Added const where possible to indicate immutability.

Deshitified the code abit...

Moved some repeated logic into a helper function (configureFrameDistribution) to handle frame distribution calculation.

Used std::max and std::clamp in places to ensure values stay within valid ranges.

Added validation for ticksPerFrame to avoid potential division by zero.

Added const where possible to indicate immutability.
@kphoenix137
Copy link
Collaborator

kphoenix137 commented Nov 19, 2024

I think this will fail the formatting check. For example, we do functions like this:

void func()
{
}

But do conditionals like

if () {
} else {
}

Also namespaces:

namespace devilution {
} // namespace devilution

@AJenbo
Copy link
Member

AJenbo commented Nov 19, 2024

Please write a less shit title for your PRs and follow the project code style, there is a tool for it if you don't want to bother doing it manually, see https://github.com/diasurgical/devilutionX/wiki/Code-Style#formatting for details

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

Successfully merging this pull request may close these issues.

3 participants