Skip to content

Commit

Permalink
Fix the scrolling code to take the a/v delay into consideration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsitton committed Sep 14, 2015
1 parent aba5263 commit 617ad56
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions fofix/game/guitarscene/GuitarScene.py
Expand Up @@ -169,7 +169,7 @@ def __init__(self, engine, libraryName, songName):
#self.tempoBpm = Song.DEFAULT_BPM
#self.actualBpm = 0.0
#self.targetPeriod = 60000.0 / self.targetBpm
self.songTime = 0.0
self.songTime = -self.engine.config.get('audio', 'delay')
self.disableVBPM = self.engine.config.get("game", "disable_vbpm")
self.currentBpm = Song.DEFAULT_BPM
self.currentPeriod = 60000.0 / self.currentBpm
Expand Down Expand Up @@ -2324,7 +2324,7 @@ def resetVariablesToDefaults(self):
self.targetBpm = self.currentBpm
self.lastBpmChange = -1.0
self.baseBeat = 0.0
self.songTime = 0.0
self.songTime = -self.engine.config.get('audio', 'delay')


if self.midiLyricMode == 2 and not self.playingVocals:
Expand Down Expand Up @@ -3299,11 +3299,11 @@ def run(self, ticks): #QQstarS: Fix this funcion
if self.song and self.song.readyToGo and not self.pause and not self.failed:

# calculate song position during the song countdown
if self.songTime <= 0:
if self.songTime <= -self.song.delay:
sngPos = self.song.getPosition()
if sngPos <= 0.0:
if sngPos == -self.song.delay:
self.songTime = sngPos - self.countdown * self.song.period
if not self.resumeCountdown and not self.pause:
if not self.countdown and not self.resumeCountdown and not self.pause:
# increment song position
self.songTime += ticks
self.song.update(ticks)
Expand Down Expand Up @@ -6256,8 +6256,6 @@ def render(self, visibility, topMost): #QQstarS: Fix this function for mostly.
Dialogs.wrapText(songFont, (self.songInfoDisplayX, self.songInfoDisplayY - h / 2), "%s \n %s%s%s%s%s" % (Song.removeSongOrderPrefixFromName(self.song.info.name), cover, self.song.info.artist, comma, self.song.info.year, extra), rightMargin = .6, scale = self.songInfoDisplayScale)
else:
#mfh: this is where the song countdown display is generated:
if self.songTime < 0:
self.songTime = 0
if countdownPos < 0:
countdownPos = 0
self.engine.theme.setBaseColor()
Expand Down

0 comments on commit 617ad56

Please sign in to comment.