Ejemplo n.º 1
0
    def startPick(self, song, pos, controls, hopo=False):
        if not song:
            return False
        if not song.readyToGo:
            return

        self.matchingNotes = self.getRequiredNotesMFH(song, pos)  # MFH - ignore skipped notes please!

        # no self.matchingNotes?
        if not self.matchingNotes:
            return False
        self.playedNotes = []
        self.pickStartPos = pos

        # adding bass drum hit every bass fret:

        for time, note in self.matchingNotes:
            for i in range(5):
                if (
                    note.number == i
                    and (controls.getState(self.keys[i]) or controls.getState(self.keys[i + 5]))
                    and self.drumsHeldDown[i] > 0
                ):
                    if self.guitarSolo:
                        self.currentGuitarSoloHitNotes += 1
                    if i == 0 and self.fretboardHop < 0.07:
                        self.fretboardHop = 0.07  # stump

                    if shaders.turnon:
                        shaders.var["fret"][self.player][note.number] = shaders.time()
                        shaders.var["fretpos"][self.player][note.number] = pos

                    return self.hitNote(time, note)

        return False
Ejemplo n.º 2
0
    def startPick(self, song, pos, controls, hopo=False):
        if not song:
            return False
        if not song.readyToGo:
            return

        self.matchingNotes = self.getRequiredNotesMFH(
            song, pos)  #MFH - ignore skipped notes please!

        # no self.matchingNotes?
        if not self.matchingNotes:
            return False
        self.playedNotes = []
        self.pickStartPos = pos

        #adding bass drum hit every bass fret:

        for time, note in self.matchingNotes:
            for i in range(5):
                if note.number == i and (controls.getState(
                        self.keys[i]) or controls.getState(
                            self.keys[i + 5])) and self.drumsHeldDown[i] > 0:
                    if self.guitarSolo:
                        self.currentGuitarSoloHitNotes += 1
                    if i == 0 and self.fretboardHop < 0.07:
                        self.fretboardHop = 0.07  #stump

                    if shaders.turnon:
                        shaders.var["fret"][self.player][
                            note.number] = shaders.time()
                        shaders.var["fretpos"][self.player][note.number] = pos

                    return self.hitNote(time, note)

        return False
Ejemplo n.º 3
0
 def soloFreestylePick(self, song, pos, controls):
   numHits = 0
   for theFret in range(5):
     self.freestyleHit[theFret] = controls.getState(self.keys[theFret+5])
     if self.freestyleHit[theFret]:
       if shaders.turnon:
         shaders.var["fret"][self.player][theFret]=shaders.time()
         shaders.var["fretpos"][self.player][theFret]=pos
       numHits += 1
   return numHits
Ejemplo n.º 4
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    def project(beat):
      return 0.125 * beat / self.beatsPerUnit  # glorandwarf: was 0.12

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    c = (1,1,1)

    board_tex  = np.array([[0.0, project(offset - 2 * self.beatsPerUnit)],
                         [1.0, project(offset - 2 * self.beatsPerUnit)],
                         [0.0, project(offset - 1 * self.beatsPerUnit)],
                         [1.0, project(offset - 1 * self.beatsPerUnit)],
                         [0.0, project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, project(offset + l * self.beatsPerUnit)],
                         [1.0, project(offset + l * self.beatsPerUnit)]], dtype=np.float32)

    glEnable(GL_TEXTURE_2D)
    if self.theme == 2 and self.instrument.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()

    cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=self.board_col, texcoords=board_tex)
    
    glDisable(GL_TEXTURE_2D)
    
    if self.theme == 1:   
      if shaders.enable("sololight"):
        shaders.modVar("color",shaders.var["solocolor"])
        shaders.setVar("offset",(-3.5,-w/2))
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(w / 2-1.0, 0.4, -2)
        glVertex3f(w / 2+1.0, 0.4, -2)
        glVertex3f(w / 2-1.0, 0.4, l)
        glVertex3f(w / 2+1.0, 0.4, l)
        glEnd()   
        shaders.setVar("offset",(-3.5,w/2))
        shaders.setVar("time",shaders.time()+0.5)
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(-w / 2+1.0, 0.4, -2)
        glVertex3f(-w / 2-1.0, 0.4, -2)
        glVertex3f(-w / 2+1.0, 0.4, l)
        glVertex3f(-w / 2-1.0, 0.4, l)
        glEnd()  
        shaders.disable()
Ejemplo n.º 5
0
 def soloFreestylePick(self, song, pos, controls):
     numHits = 0
     for theFret in range(5):
         self.freestyleHit[theFret] = controls.getState(self.keys[theFret +
                                                                  5])
         if self.freestyleHit[theFret]:
             if shaders.turnon:
                 shaders.var["fret"][self.player][theFret] = shaders.time()
                 shaders.var["fretpos"][self.player][theFret] = pos
             numHits += 1
     return numHits
Ejemplo n.º 6
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    color = (1,1,1)

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    board_tex  = np.array([[0.0, self.project(offset - 2 * self.beatsPerUnit)],
                         [1.0, self.project(offset - 2 * self.beatsPerUnit)],
                         [0.0, self.project(offset - 1 * self.beatsPerUnit)],
                         [1.0, self.project(offset - 1 * self.beatsPerUnit)],
                         [0.0, self.project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, self.project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, self.project(offset + l * self.beatsPerUnit)],
                         [1.0, self.project(offset + l * self.beatsPerUnit)]], dtype=np.float32)

    #must be separate for sidebar flashing.
    board_col  = np.array([[color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], 0]], dtype=np.float32)

    glEnable(GL_TEXTURE_2D)
    if self.instrument.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()
    if self.isFailing and self.failSideBars and v == self.failcount:
      self.failSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()
    cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=board_col, texcoords=board_tex)
    glDisable(GL_TEXTURE_2D)
     
    if shaders.enable("sololight"):
      shaders.modVar("color",shaders.var["solocolor"])
      shaders.setVar("offset",(-3.5,-w/2))
      cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx1)
      shaders.setVar("offset",(-3.5,w/2))
      shaders.setVar("time",shaders.time()+0.5)
      cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx2) 
      shaders.disable()
Ejemplo n.º 7
0
  def freestylePick(self, song, pos, controls):
    numHits = 0
    #if not song:
    #  return numHits
    
    if not controls.getState(self.actions[0]) and not controls.getState(self.actions[1]):
      return 0

    for theFret in range(5):
      self.freestyleHit[theFret] = controls.getState(self.keys[theFret])
      if self.freestyleHit[theFret]:
        if shaders.turnon:
          shaders.var["fret"][self.player][theFret]=shaders.time()
          shaders.var["fretpos"][self.player][theFret]=pos
        numHits += 1
    return numHits
Ejemplo n.º 8
0
    def freestylePick(self, song, pos, controls):
        numHits = 0
        #if not song:
        #  return numHits

        if not controls.getState(self.actions[0]) and not controls.getState(
                self.actions[1]):
            return 0

        for theFret in range(5):
            self.freestyleHit[theFret] = controls.getState(self.keys[theFret])
            if self.freestyleHit[theFret]:
                if shaders.turnon:
                    shaders.var["fret"][self.player][theFret] = shaders.time()
                    shaders.var["fretpos"][self.player][theFret] = pos
                numHits += 1
        return numHits
Ejemplo n.º 9
0
Archivo: Neck.py Proyecto: chk666/fofix
    def drawSideBars(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        color = (1,1,1)

        v = visibility
        w = self.boardWidth + 0.15

        if self.failcount == v:
            board_col = self.board_col_flash
        else:
            board_col = self.board_col

        glEnable(GL_TEXTURE_2D)

        if self.instrument.starPowerActive and self.oSideBars and not (self.guitarSolo or self.soloSideBars):
            self.oSideBars.texture.bind()
        elif self.instrument.starPowerActive and self.oSoloSideBars and self.oSidebars and self.guitarSolo:
            self.oSoloSideBars.texture.bind()
        elif self.guitarSolo and self.soloSideBars:
            self.soloSideBars.texture.bind()
        elif self.sideBars:
            self.sideBars.texture.bind()



        if self.isFailing and self.failSideBars and v == self.failcount:
            self.failSideBars.texture.bind()

        cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=board_col, texcoords=self.board_tex)
        glDisable(GL_TEXTURE_2D)

        if shaders.enable("sololight"):
            shaders.modVar("color",shaders.var["solocolor"])
            shaders.setVar("offset",(-3.5,-w/2))
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx1)
            shaders.setVar("offset",(-3.5,w/2))
            shaders.setVar("time",shaders.time()+0.5)
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx2)
            shaders.disable()
Ejemplo n.º 10
0
    def drawSideBars(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        v = visibility
        w = self.boardWidth + 0.15

        if self.failcount == v:
            board_col = self.board_col_flash
        else:
            board_col = self.board_col

        glEnable(GL_TEXTURE_2D)

        if self.instrument.starPowerActive and self.oSideBars and not (self.guitarSolo or self.soloSideBars):
            self.oSideBars.texture.bind()
        elif self.instrument.starPowerActive and self.oSoloSideBars and self.oSidebars and self.guitarSolo:
            self.oSoloSideBars.texture.bind()
        elif self.guitarSolo and self.soloSideBars:
            self.soloSideBars.texture.bind()
        elif self.sideBars:
            self.sideBars.texture.bind()



        if self.isFailing and self.failSideBars and v == self.failcount:
            self.failSideBars.texture.bind()

        cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=board_col, texcoords=self.board_tex)
        glDisable(GL_TEXTURE_2D)

        if shaders.enable("sololight"):
            shaders.modVar("color",shaders.var["solocolor"])
            shaders.setVar("offset",(-3.5,-w/2))
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx1)
            shaders.setVar("offset",(-3.5,w/2))
            shaders.setVar("time",shaders.time()+0.5)
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx2)
            shaders.disable()
Ejemplo n.º 11
0
  def renderNeck(self, visibility, song, pos):     
    if not song:
      return
    if not song.readyToGo:
      return
    
    v            = visibility
    w            = self.boardWidth
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    #myfingershurt: every theme can have oNeck:

    if self.guitarSolo and self.soloNeck and self.guitarSoloNeckMode == 1:
      neck = self.soloNeck
    elif self.scoreMultiplier > 4 and self.bassGrooveNeck and self.bassGrooveNeckMode == 1:
      neck = self.bassGrooveNeck
    elif self.instrument.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and self.scoreMultiplier <= 4 and not self.ovrneckoverlay:
      neck = self.oNeck
    else:
      neck = self.neckDrawing

    
    self.renderNeckMethod(v*self.neckAlpha[1], offset, neck)
    
    if self.guitarSolo and self.soloNeck and self.guitarSoloNeckMode == 2:   #static overlay
      self.renderNeckMethod(v*self.neckAlpha[2], 0, self.soloNeck)
      
    elif self.bgcount > 0 and self.bassGrooveNeck and self.bassGrooveNeckMode == 2:   #static bass groove overlay
      self.renderNeckMethod(v*self.bgcount*self.neckAlpha[3], 0, self.bassGrooveNeck)
      
    if self.spcount2 != 0 and self.spcount < 1.2 and self.oNeck:   #static overlay
      if self.oNeckovr and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay):
        neck = self.oNeckovr
        alpha = False
      else:
        neck = self.oNeck
        alpha = True          

      self.renderNeckMethod(v*self.spcount*self.neckAlpha[4], offset, neck, alpha)
      
    if self.instrument.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay):   #static overlay
      if self.oNeckovr:
        neck = self.oNeckovr
        alpha = False
      else:
        neck = self.oNeck
        alpha = True

      self.renderNeckMethod(v*self.neckAlpha[4], offset, neck, alpha)

    if shaders.enabled:
      shaders.globals["basspos"] = shaders.var["fret"][self.player][0]
      shaders.globals["notepos"] = shaders.var["fret"][self.player][1:]
      shaders.globals["bpm"] = self.instrument.currentBpm
      shaders.globals["songpos"] = pos
      shaders.globals["spEnabled"] = self.instrument.starPowerActive
      shaders.globals["isFailing"] = self.isFailing
      shaders.globals["isMultChanged"] = (shaders.var["scoreMult"][self.player] != self.scoreMultiplier)
      if shaders.globals["isMultChanged"]:
        shaders.var["multChangePos"][self.player] = pos
      shaders.globals["scoreMult"] = self.scoreMultiplier
      shaders.var["scoreMult"][self.player] = self.scoreMultiplier
      shaders.globals["isDrum"] = self.isDrum
      shaders.globals["soloActive"] = self.guitarSolo
      
      posx = shaders.time()
      fret = []
      neckcol = (0,0,0)
      
      notecolors = list(self.engine.theme.noteColors)
      if self.isDrum:
        notecolors[4] = notecolors[0]
        notecolors[0] = self.engine.theme.noteColors[5]
        
        
      for i in range(5):
        blend = max(shaders.var["fret"][self.player][i] - posx + 1.5,0.01)
        neckcol = mixColors(neckcol, notecolors[i], blend)

      shaders.var["color"][self.player]=neckcol
      
    if shaders.enable("neck"):
      shaders.setVar("fretcol",neckcol)
      shaders.update()
      glBegin(GL_TRIANGLE_STRIP)
      glVertex3f(-w / 2, 0.1, -2)
      glVertex3f(w / 2, 0.1, -2)
      glVertex3f(-w / 2, 0.1, l)
      glVertex3f(w / 2, 0.1, l)
      glEnd()
      shaders.disable()
    else:
      if self.isFailing:
        self.renderNeckMethod(self.failcount, 0, self.failNeck)
        
    if (self.guitarSolo or self.instrument.starPowerActive) and self.theme == 1:
      shaders.var["solocolor"]=self.shaderSolocolor
    else:
      shaders.var["solocolor"]=(0.0,)*4
Ejemplo n.º 12
0
    def renderNeck(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        v = visibility

        offset = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat

        #myfingershurt: every theme can have oNeck:

        if self.guitarSolo and self.soloNeck and self.guitarSoloNeckMode == 1:
            neck = self.soloNeck
        elif self.scoreMultiplier > 4 and self.bassGrooveNeck and self.bassGrooveNeckMode == 1:
            neck = self.bassGrooveNeck
        elif self.fourxNeckMode == 1 and self.fourMultiNeck and self.scoreMultiplier == 4:
            neck = self.fourMultiNeck
        elif self.instrument.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and self.scoreMultiplier <= 4 and not self.ovrneckoverlay:
            neck = self.oNeck
        else:
            neck = self.neckDrawing


        self.renderNeckMethod(v*self.neckAlpha[1], offset, neck)

        if self.guitarSolo and self.soloNeck and self.guitarSoloNeckMode == 2:   #static overlay
            self.renderNeckMethod(v*self.neckAlpha[2], 0, self.soloNeck)

        if self.bgcount > 0 and self.bassGrooveNeck and self.bassGrooveNeckMode == 2:   #static bass groove overlay
            self.renderNeckMethod(v*self.bgcount*self.neckAlpha[3], 0, self.bassGrooveNeck)

        if self.fourXcount > 0 and self.fourMultiNeck and self.fourxNeckMode == 2:   #4x multi overlay neck
            self.renderNeckMethod(v*self.fourXcount*self.neckAlpha[6], offset, self.fourMultiNeck)

        if self.spcount2 != 0 and self.spcount < 1.2 and self.oNeck:   #static overlay
            if self.oNeckovr and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay):
                neck = self.oNeckovr
                alpha = False
            else:
                neck = self.oNeck
                alpha = True

            self.renderNeckMethod(v*self.spcount*self.neckAlpha[4], offset, neck, alpha)

        if self.instrument.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay):   #static overlay
            if self.oNeckovr:
                neck = self.oNeckovr
                alpha = False
            else:
                neck = self.oNeck
                alpha = True

            self.renderNeckMethod(v*self.neckAlpha[4], offset, neck, alpha)

        if shaders.enabled:
            shaders.globals["basspos"]        = shaders.var["fret"][self.player][0]
            shaders.globals["notepos"]        = shaders.var["fret"][self.player][1:]
            shaders.globals["bpm"]            = self.instrument.currentBpm
            shaders.globals["songpos"]        = pos
            shaders.globals["spEnabled"]      = self.instrument.starPowerActive
            shaders.globals["isFailing"]      = self.isFailing
            shaders.globals["isMultChanged"]  = (shaders.var["scoreMult"][self.player] != self.scoreMultiplier)
            if shaders.globals["isMultChanged"]:
                shaders.var["multChangePos"][self.player]  = pos
            shaders.globals["scoreMult"]                 = self.scoreMultiplier
            shaders.var["scoreMult"][self.player]        = self.scoreMultiplier
            shaders.globals["isDrum"]                    = self.isDrum
            shaders.globals["soloActive"]                = self.guitarSolo

            posx = shaders.time()
            neckcol = (0,0,0)

            notecolors = list(self.engine.theme.noteColors)
            if self.isDrum:
                notecolors[4] = notecolors[0]
                notecolors[0] = self.engine.theme.noteColors[5]


            for i in range(5):
                blend   = max(shaders.var["fret"][self.player][i] - posx + 1.5,0.01)
                neckcol = mixColors(neckcol, notecolors[i], blend)

            shaders.var["color"][self.player]=neckcol

        if shaders.enable("neck"):
            shaders.setVar("fretcol",neckcol)
            shaders.update()
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.shader_neck_vtx)
            shaders.disable()
        else:
            if self.isFailing:
                self.renderNeckMethod(self.failcount, 0, self.failNeck)

        if (self.guitarSolo or self.instrument.starPowerActive) and self.theme == 1:
            shaders.var["solocolor"]=self.shaderSolocolor
        else:
            shaders.var["solocolor"]=(0.0,)*4
Ejemplo n.º 13
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    def project(beat):
      return 0.125 * beat / self.beatsPerUnit  # glorandwarf: was 0.12

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    c = (1,1,1)

    board_tex  = array([[0.0, project(offset - 2 * self.beatsPerUnit)],
                         [1.0, project(offset - 2 * self.beatsPerUnit)],
                         [0.0, project(offset - 1 * self.beatsPerUnit)],
                         [1.0, project(offset - 1 * self.beatsPerUnit)],
                         [0.0, project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, project(offset + l * self.beatsPerUnit)],
                         [1.0, project(offset + l * self.beatsPerUnit)]], dtype=float32)

    glEnable(GL_TEXTURE_2D)
    if self.theme == 2 and self.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()

    glEnableClientState(GL_VERTEX_ARRAY)
    glEnableClientState(GL_COLOR_ARRAY)
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glVertexPointerf(self.sidebars_vtx)
    glColorPointerf(self.board_col)
    glTexCoordPointerf(board_tex)
    glDrawArrays(GL_TRIANGLE_STRIP, 0, self.sidebars_vtx.shape[0])
    glDisableClientState(GL_VERTEX_ARRAY)
    glDisableClientState(GL_COLOR_ARRAY)
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    
    glDisable(GL_TEXTURE_2D)
    
    if self.theme == 1:   
      if shaders.enable("sololight"):
        shaders.modVar("color",shaders.var["solocolor"])
        shaders.setVar("offset",(-3.5,-w/2))
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(w / 2-1.0, 0.4, -2)
        glVertex3f(w / 2+1.0, 0.4, -2)
        glVertex3f(w / 2-1.0, 0.4, l)
        glVertex3f(w / 2+1.0, 0.4, l)
        glEnd()   
        shaders.setVar("offset",(-3.5,w/2))
        shaders.setVar("time",shaders.time()+0.5)
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(-w / 2+1.0, 0.4, -2)
        glVertex3f(-w / 2-1.0, 0.4, -2)
        glVertex3f(-w / 2+1.0, 0.4, l)
        glVertex3f(-w / 2-1.0, 0.4, l)
        glEnd()  
        shaders.disable()
Ejemplo n.º 14
0
  def renderNeck(self, visibility, song, pos):     
    if not song:
      return
    if not song.readyToGo:
      return
    
    v            = visibility
    w            = self.boardWidth
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    #myfingershurt: every theme can have oNeck:

    if self.guitarSolo and self.guitarSoloNeck != None and self.guitarSoloNeckMode == 1:
      neck = self.guitarSoloNeck
    elif self.scoreMultiplier > 4 and self.bassGrooveNeck != None and self.bassGrooveNeckMode == 1:
      neck = self.bassGrooveNeck
    elif self.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and self.scoreMultiplier <= 4 and self.ovrneckoverlay == False:
      neck = self.oNeck
    else:
      neck = self.neckDrawing

    
    if not (self.guitarSolo and self.guitarSoloNeck != None and self.guitarSoloNeckMode == 2):
      self.renderNeckMethod(v*self.neckAlpha[1], offset, neck)
    
    if self.bgcount > 0 and self.bassGrooveNeck != None and self.bassGrooveNeckMode == 2:   #static bass groove overlay
      self.renderNeckMethod(v*self.bgcount*self.neckAlpha[3], 0, self.bassGrooveNeck)
      
    elif self.guitarSolo and self.guitarSoloNeck != None and self.guitarSoloNeckMode == 2:   #static overlay
      self.renderNeckMethod(v*self.neckAlpha[2], 0, self.guitarSoloNeck)
      
    if self.spcount2 != 0 and self.spcount < 1.2 and self.oNeck:   #static overlay
      if self.oNeckovr != None and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay == True):
        neck = self.oNeckovr
        alpha = False
      else:
        neck = self.oNeck
        alpha = True          

      self.renderNeckMethod(v*self.spcount*self.neckAlpha[4], offset, neck, alpha)
      
    
      
    if self.starPowerActive and not (self.spcount2 != 0 and self.spcount < 1.2) and self.oNeck and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay == True):   #static overlay
      if self.oNeckovr != None:
        neck = self.oNeckovr
        alpha = False
      else:
        neck = self.oNeck
        alpha = True

      self.renderNeckMethod(v*self.neckAlpha[4], offset, neck, alpha)

    if shaders.enabled:
      shaders.globals["basspos"] = shaders.var["fret"][self.player][0]
      shaders.globals["notepos"] = shaders.var["fret"][self.player][1:]
      shaders.globals["bpm"] = self.currentBpm
      shaders.globals["songpos"] = pos
      shaders.globals["spEnabled"] = self.starPowerActive
      shaders.globals["isFailing"] = self.isFailing
      shaders.globals["isMultChanged"] = (shaders.var["scoreMult"][self.player] != self.scoreMultiplier)
      if shaders.globals["isMultChanged"]:
        shaders.var["multChangePos"][self.player] = pos
      shaders.globals["scoreMult"] = self.scoreMultiplier
      shaders.var["scoreMult"][self.player] = self.scoreMultiplier
      shaders.globals["isDrum"] = self.isDrum
      shaders.globals["soloActive"] = self.guitarSolo
      
      posx = shaders.time()
      fret = []
      neckcol = (0,0,0)
      
      notecolors = list(Theme.fretColors)
      if self.isDrum:
        notecolors[4] = notecolors[0]
        notecolors[0] = Theme.opencolor
        
        
      for i in range(5):
        blend = max(shaders.var["fret"][self.player][i] - posx + 1.5,0.01)
        neckcol = mixColors(neckcol, notecolors[i], blend)

      shaders.var["color"][self.player]=neckcol
      
    if shaders.enable("neck"):
      shaders.setVar("fretcol",neckcol)
      shaders.update()
      glBegin(GL_TRIANGLE_STRIP)
      glVertex3f(-w / 2, 0.1, -2)
      glVertex3f(w / 2, 0.1, -2)
      glVertex3f(-w / 2, 0.1, l)
      glVertex3f(w / 2, 0.1, l)
      glEnd()
      shaders.disable()
    else:
      if self.isFailing:
        self.renderNeckMethod(self.failcount, 0, self.failNeck)
        
    if (self.guitarSolo or self.starPowerActive) and self.theme == 1:
      shaders.var["solocolor"]=(0.3,0.7,0.9,0.6)
    else:
      shaders.var["solocolor"]=(0.0,)*4
Ejemplo n.º 15
0
  def startPick3(self, song, pos, controls, hopo = False):
    if not song:
      return False
    if not song.readyToGo:
      return False
    
    self.lastPlayedNotes = self.playedNotes
    self.playedNotes = []
    
    self.matchingNotes = self.getRequiredNotesMFH(song, pos)

    self.controlsMatchNotes3(controls, self.matchingNotes, hopo)

    #myfingershurt
    
    for time, note in self.matchingNotes:
      if note.played != True:
        continue
      
      if shaders.turnon:
        shaders.var["fret"][self.player][note.number]=shaders.time()
        shaders.var["fretpos"][self.player][note.number]=pos
        
      
      self.pickStartPos = pos
      self.pickStartPos = max(self.pickStartPos, time)
      if hopo:
        note.hopod        = True
      else:
        note.played       = True
      if note.tappable == 1 or note.tappable == 2:
        self.hopoActive = time
        self.wasLastNoteHopod = True
      elif note.tappable == 3:
        self.hopoActive = -time
        self.wasLastNoteHopod = True
        if hopo:  #MFH - you just tapped a 3 - make a note of it. (har har)
          self.hopoProblemNoteNum = note.number
          self.sameNoteHopoString = True
      else:
        self.hopoActive = 0
        self.wasLastNoteHopod = False
      self.hopoLast     = note.number
      self.playedNotes.append([time, note])
      if self.guitarSolo:
        self.currentGuitarSoloHitNotes += 1
        

     
    #myfingershurt: be sure to catch when a chord is played
    if len(self.playedNotes) > 1:
      lastPlayedNote = None
      for time, note in self.playedNotes:
        if isinstance(lastPlayedNote, Note):
          if note.tappable == 1 and lastPlayedNote.tappable == 1:
            self.LastStrumWasChord = True
          else:
            self.LastStrumWasChord = False
        lastPlayedNote = note
    
    elif len(self.playedNotes) > 0: #ensure at least that a note was played here
      self.LastStrumWasChord = False

    if len(self.playedNotes) != 0:
      return True
    return False
Ejemplo n.º 16
0
    def startPick3(self, song, pos, controls, hopo=False):
        if not song:
            return False
        if not song.readyToGo:
            return False

        self.lastPlayedNotes = self.playedNotes
        self.playedNotes = []

        self.matchingNotes = self.getRequiredNotesMFH(song, pos)

        self.controlsMatchNotes3(controls, self.matchingNotes, hopo)

        #myfingershurt

        for time, note in self.matchingNotes:
            if note.played != True:
                continue

            if shaders.turnon:
                shaders.var["fret"][self.player][note.number] = shaders.time()
                shaders.var["fretpos"][self.player][note.number] = pos

            self.pickStartPos = pos
            self.pickStartPos = max(self.pickStartPos, time)
            if hopo:
                note.hopod = True
            else:
                note.played = True
            if note.tappable == 1 or note.tappable == 2:
                self.hopoActive = time
                self.wasLastNoteHopod = True
            elif note.tappable == 3:
                self.hopoActive = -time
                self.wasLastNoteHopod = True
                if hopo:  #MFH - you just tapped a 3 - make a note of it. (har har)
                    self.hopoProblemNoteNum = note.number
                    self.sameNoteHopoString = True
            else:
                self.hopoActive = 0
                self.wasLastNoteHopod = False
            self.hopoLast = note.number
            self.playedNotes.append([time, note])
            if self.guitarSolo:
                self.currentGuitarSoloHitNotes += 1

        #myfingershurt: be sure to catch when a chord is played
        if len(self.playedNotes) > 1:
            lastPlayedNote = None
            for time, note in self.playedNotes:
                if isinstance(lastPlayedNote, Note):
                    if note.tappable == 1 and lastPlayedNote.tappable == 1:
                        self.LastStrumWasChord = True
                    else:
                        self.LastStrumWasChord = False
                lastPlayedNote = note

        elif len(self.playedNotes
                 ) > 0:  #ensure at least that a note was played here
            self.LastStrumWasChord = False

        if len(self.playedNotes) != 0:
            return True
        return False