Skip to content

Commit 3ce5c23

Browse files
committed
Added comments.
1 parent a0ed6df commit 3ce5c23

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

includes/RhythmGameUtilities/Utilities.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ namespace RhythmGameUtilities
2121

2222
const float SECONDS_PER_MINUTE = 60.0f;
2323

24+
/**
25+
* Convert seconds to ticks.
26+
*
27+
* @param seconds The seconds to generate ticks with.
28+
* @param resolution The resolution of the song.
29+
* @param bpmChanges All BPM changes within the song.
30+
*/
31+
2432
int ConvertSecondsToTicks(float seconds, int resolution,
2533
std::map<int, int> bpmChanges)
2634
{
@@ -107,11 +115,26 @@ std::vector<BeatBar> CalculateBeatBars(std::map<int, int> bpmChanges,
107115

108116
extern "C"
109117
{
118+
119+
/**
120+
* Convert a tick to a 2D/3D position.
121+
*
122+
* @param tick The tick.
123+
* @param resolution The resolution of the song.
124+
*/
125+
110126
PACKAGE_API float ConvertTickToPosition(float tick, int resolution)
111127
{
112128
return tick / resolution;
113129
}
114130

131+
/**
132+
* Checks to see if the current time of a game or audio file is on the beat.
133+
*
134+
* @param bpm The base BPM for a song.
135+
* @param currentTime A timestamp to compare to the BPM.
136+
*/
137+
115138
PACKAGE_API bool IsOnTheBeat(float bpm, float currentTime)
116139
{
117140
auto beatInterval = SECONDS_PER_MINUTE / bpm;

0 commit comments

Comments
 (0)