diff options
author | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2019-08-04 10:18:13 +0000 |
---|---|---|
committer | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2019-08-04 10:18:13 +0000 |
commit | ba6f243c728de5d5c024aeb177026bcc59909e2e (patch) | |
tree | af8fdeb1c6cdf9cd8584f0d693a4049bfc408b9d /tools/mid2agb/midi.cpp | |
parent | 6211b0c5ecbe4a43aa3f6e8fd96e99af29caa77a (diff) | |
parent | 250a331df9dbd312d572aaf0d629503417cfc9d4 (diff) |
Forgot upstream tools tracking
Diffstat (limited to 'tools/mid2agb/midi.cpp')
-rw-r--r-- | tools/mid2agb/midi.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/mid2agb/midi.cpp b/tools/mid2agb/midi.cpp index 09480e1..fa7d9ce 100644 --- a/tools/mid2agb/midi.cpp +++ b/tools/mid2agb/midi.cpp @@ -780,7 +780,7 @@ int CalculateCompressionScore(std::vector<Event>& events, int index) std::uint8_t lastVelocity = 0x80u; EventType lastType = events[index].type; std::int32_t lastDuration = 0x80000000; - std::uint8_t lastNote = 0x80u; + std::uint8_t lastNote = 0x40u; if (events[index].time > 0) score++; @@ -844,7 +844,7 @@ int CalculateCompressionScore(std::vector<Event>& events, int index) lastType = events[i].type; if (events[i].time) - ++score; + score++; } return score; @@ -852,6 +852,12 @@ int CalculateCompressionScore(std::vector<Event>& events, int index) bool IsCompressionMatch(std::vector<Event>& events, int index1, int index2) { + if (events[index1].type != events[index2].type || + events[index1].note != events[index2].note || + events[index1].param1 != events[index2].param1 || + events[index1].time != events[index2].time) + return false; + index1++; index2++; |