|
From: Lasse Kärkkäi. <tr...@us...> - 2009-07-18 16:50:17
|
Module: performous
Branch: master
Commit: 58311481bb1e69390d9a93a3c8c1de0b9cdc51a1
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Jul 18 19:49:17 2009 +0300
Lift the restriction that songs always need to have (vocal) notes.
---
game/notegraph.cc | 3 ++-
game/songparser.hh | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/notegraph.cc b/game/notegraph.cc
index d82dc91..31fdd5a 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -167,6 +167,7 @@ namespace {
}
void NoteGraph::drawWaves(std::list<Player> const& players) {
+ if (m_song.notes.empty()) return; // Cannot draw without notes
UseTexture tblock(m_wave);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
for (std::list<Player>::const_iterator p = players.begin(); p != players.end(); ++p) {
@@ -196,7 +197,7 @@ void NoteGraph::drawWaves(std::list<Player> const& players) {
Notes::const_iterator notePrev = noteIt;
while (notePrev != m_song.notes.begin() && (notePrev->type == Note::SLEEP || t < notePrev->begin)) --notePrev;
bool hasNote = (noteIt != m_song.notes.end());
- bool hasPrev = (notePrev->type != Note::SLEEP && t >= notePrev->begin);
+ bool hasPrev = notePrev->type != Note::SLEEP && t >= notePrev->begin;
double val;
if (hasNote && hasPrev) val = 0.5 * (noteIt->note + notePrev->note);
else if (hasNote) val = noteIt->note;
diff --git a/game/songparser.hh b/game/songparser.hh
index 3714064..56e939f 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -46,7 +46,6 @@ class SongParser {
} catch (std::runtime_error& e) {
throw SongParserException(e.what(), m_linenum);
}
- if (s.notes.empty()) throw SongParserException("No notes", m_linenum);
// Adjust negative notes
if (m_song.noteMin <= 0) {
unsigned int shift = (1 - m_song.noteMin / 12) * 12;
|