From f6ebc8a30af20cb9246a4e2fb9873f15b205fcdb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 10 Feb 2003 21:21:48 +0000 Subject: [PATCH] handle length error returns title update --- stepmania/src/Song.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index ddc9cedbd2..f2fed02ee4 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -402,9 +402,13 @@ void Song::TidyUpData() sound.Load( GetMusicPath(), false ); /* don't pre-cache */ m_fMusicLengthSeconds = sound.GetLengthSeconds(); - /* XXX: if(m_fMusicLengthSeconds == -1), warn and throw out the song */ - if(m_fMusicLengthSeconds == 0) + + if(m_fMusicLengthSeconds == -1) { + /* It failed; bad file or something. It's already logged a warning, + * so just set the file to 0 seconds. */ + m_fMusicLengthSeconds = 0; + } else if(m_fMusicLengthSeconds == 0) { LOG->Warn("File %s is empty?", GetMusicPath().GetString()); } else if(m_fMusicLengthSeconds == -1) { LOG->Warn("File %s: error getting length", GetMusicPath().GetString()); @@ -416,6 +420,12 @@ void Song::TidyUpData() LOG->Warn("This song has no music file; guessing at %f seconds", m_fMusicLengthSeconds); } + if(m_fMusicLengthSeconds < 0) + { + LOG->Warn("File %i has negative length? (%i)", GetMusicPath().GetString(), m_fMusicLengthSeconds); + m_fMusicLengthSeconds = 0; + } + /* Generate these before we autogen notes, so the new notes can inherit * their source's values. */ ReCalculateRadarValuesAndLastBeat(); @@ -644,8 +654,8 @@ void Song::TranslateTitles() /* ロマンスの神様 */ ttab.push_back(TitleTrans("^God of Romance$", "", "", "&kro;&kma;&kn;&ksu;&hno;&kami;&sama;", "", "") ); - /* ダンシン・オール・アローン */ - ttab.push_back(TitleTrans("^Dancing Pompokolin$", "", "", "&kda;&kn;&ksi;&kn;&kdot;&ko;&kdash;&kru;&kdot;&ka;&kro;&kdash;&kn;", "", "") ); + /* おどるポンポコリン */ + ttab.push_back(TitleTrans("^Dancing Pompokolin$", "", "", "&ho;&hdo;&hru;&kpo;&kn;&kpo;&kko;&kri;&kn;", "", "") ); /* 青い振動 */ ttab.push_back(TitleTrans("^Aoi Shoudou$", "", "", "&aoi;&hi;&shoudou1;&shoudou2;", "", "") );