Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/RhythmGameUtilities/Audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C"

for (auto j = 0; j < step; j += 1)
{
auto index = (int)(x * step + j);
auto index = static_cast<int>(x * step + j);

auto datum = samples[index];

Expand All @@ -55,8 +55,8 @@ extern "C"
}
}

auto minY = (int)((1 + min) * amp);
auto maxY = (int)((1 + max) * amp);
auto minY = static_cast<int>((1 + min) * amp);
auto maxY = static_cast<int>((1 + max) * amp);

for (auto y = 0; y < height; y += 1)
{
Expand Down
15 changes: 8 additions & 7 deletions include/RhythmGameUtilities/Utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int ConvertSecondsToTicks(float seconds, int resolution,

if (remainingSeconds <= timeForSegment)
{
totalTicks += (int)(remainingSeconds * previousBPM /
SECONDS_PER_MINUTE * resolution);
totalTicks += static_cast<int>(remainingSeconds * previousBPM /
SECONDS_PER_MINUTE * resolution);

return totalTicks;
}
Expand All @@ -56,8 +56,8 @@ int ConvertSecondsToTicks(float seconds, int resolution,
previousBPM = value / 1000;
}

totalTicks +=
(int)(remainingSeconds * previousBPM / SECONDS_PER_MINUTE * resolution);
totalTicks += static_cast<int>(remainingSeconds * previousBPM /
SECONDS_PER_MINUTE * resolution);

return totalTicks;
}
Expand Down Expand Up @@ -161,7 +161,7 @@ extern "C"

PACKAGE_API float ConvertTickToPosition(int tick, int resolution)
{
return tick / (float)resolution;
return tick / static_cast<float>(resolution);
}

/**
Expand All @@ -176,7 +176,7 @@ extern "C"
PACKAGE_API bool IsOnTheBeat(int bpm, float currentTime,
float delta = 0.05f)
{
auto beatInterval = SECONDS_PER_MINUTE / (float)bpm;
auto beatInterval = SECONDS_PER_MINUTE / static_cast<float>(bpm);

auto beatFraction = currentTime / beatInterval;

Expand All @@ -197,7 +197,8 @@ extern "C"

PACKAGE_API int RoundUpToTheNearestMultiplier(int value, int multiplier)
{
return (int)std::ceil((float)value / multiplier) * multiplier;
return static_cast<int>(
std::ceil(static_cast<float>(value) / multiplier) * multiplier);
}

/**
Expand Down
Loading