Skip to content

Commit

Permalink
Refactor: Renaming current -> next, initializing isNewReleaseEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
afska committed Jan 19, 2024
1 parent 0212f20 commit 2fa6436
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/gameplay/DeathMix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ DeathMix::DeathMix(const GBFS_FILE* fs, DifficultyLevel difficultyLevel) {

this->fs = fs;
this->difficultyLevel = difficultyLevel;
this->current = 0;
this->next = 0;
this->total = librarySize;
}

SongChart DeathMix::getNextSongChart() {
if (current >= total)
if (next >= total)
return SongChart{.song = NULL, .chart = NULL};

Song* tempSong = SONG_parse(fs, songFiles[current].get());
Song* tempSong = SONG_parse(fs, songFiles[next].get());
u8 index = SONG_findChartIndexByDifficultyLevel(tempSong, difficultyLevel);
SONG_free(tempSong);
Song* song = SONG_parse(fs, songFiles[current].get(), std::vector<u8>{index});
Song* song = SONG_parse(fs, songFiles[next].get(), std::vector<u8>{index});
Chart* chart = song->charts + index;

current++;
next++;

return SongChart{.song = song, .chart = chart};
}
4 changes: 2 additions & 2 deletions src/gameplay/DeathMix.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class DeathMix {

DeathMix(const GBFS_FILE* fs, DifficultyLevel difficultyLevel);

bool isInitialSong() { return current == 1; }
bool isInitialSong() { return next == 1; }
SongChart getNextSongChart();

private:
const GBFS_FILE* fs;
DifficultyLevel difficultyLevel;
std::vector<std::unique_ptr<SongFile>> songFiles;
u32 current;
u32 next;
u32 total;
};

Expand Down
2 changes: 1 addition & 1 deletion src/objects/base/InputHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InputHandler {
protected:
bool isPressed = false;
bool isNewPressEvent = false;
bool isNewReleaseEvent;
bool isNewReleaseEvent = false;
bool handledFlag = false;
bool isWaiting = false;
};
Expand Down

0 comments on commit 2fa6436

Please sign in to comment.