From 75c277c10f206f5bf3799caa03a52f40c1c8b6cf Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 27 Nov 2012 15:45:35 +0000 Subject: characters reacting to level ends --- vfg/src/music.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'vfg/src/music.h') diff --git a/vfg/src/music.h b/vfg/src/music.h index 7e54292..1cb92ff 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -17,14 +17,22 @@ class levelscore { if( !XML.loadFile(filename) ){ printf("unable to load %s check data/ folder\n",filename.c_str()); }else{ + int multiplier=1000/XML.getAttribute("VFxmas", "timebase",1000,0); if(XML.pushTag("VFxmas")) { for (int i=0;i::iterator iter=levels.end(); + iter--; + for (int i=0;ifirst;i+=500) { + printf("time %i: level %i, nextleveltime %i\n",i,getLevel(i), nextLevelTime(i)); + } + } int getLives(int time) { map::iterator iter; int lives=0; @@ -52,6 +60,14 @@ class levelscore { } return bound; } + int nextLevelTime(int time) { + map::iterator iter; + int level=-1; + for (iter = levels.begin(); iter != levels.end(); ++iter) { + if (iter->first>time) return iter->first-time; + } + return 2<<20; // a big number + } private: map levels; }; @@ -115,7 +131,7 @@ class lyricscore: public score { if( !XML.loadFile(filename) ){ printf("unable to load %s check data/ folder\n",filename.c_str()); }else{ - int multiplier=1000/XML.getAttribute("VFxmas", "timebase",0,0); + int multiplier=1000/XML.getAttribute("VFxmas", "timebase",1000,0); if(XML.pushTag("VFxmas")) { for (int i=0;i