def renderFrets(self, visibility, song, controls): w = self.boardWidth / self.strings size = (.22, .22) v = 1.0 - visibility gl.glEnable(gl.GL_DEPTH_TEST) for n in range(self.strings2): keyNumb = n f = self.fretWeight[keyNumb] c = list(self.fretColors[keyNumb]) y = v / 6 x = (self.strings / 2 - n) * w if self.twoDkeys == True or not self.keyMesh: fretColor = (1, 1, 1, 1) size = (self.boardWidth / self.strings / 2, self.boardWidth / self.strings / 2.4) texSize = (n / self.lanenumber, n / self.lanenumber + 1 / self.lanenumber) # fret normal guitar/bass/drums texY = (0.0, 1.0 / self.fretImgColNumber) # fret press if controls.getState(self.keys[n]) or controls.getState( self.keys[n + 5]): texY = (1.0 / self.fretImgColNumber, 2.0 / self.fretImgColNumber) #frets on note hit elif self.hit[n]: texY = (2.0 / self.fretImgColNumber, 1.0) draw3Dtex(self.fretButtons, vertex=(size[0], size[1], -size[0], -size[1]), texcoord=(texSize[0], texY[0], texSize[1], texY[1]), coord=(x, v, 0), multiples=True, color=fretColor, depth=True) else: self.keypos = self.engine.theme.keypos self.keyrot = self.engine.theme.keyrot if self.keytex: texture = getattr(self, "keytex" + chr(97 + n)).texture else: texture = None c = [ .1 + .8 * c[0] + f, .1 + .8 * c[1] + f, .1 + .8 * c[2] + f, v ] self.render3DKey(texture, self.keyMesh, x, y, c, n, f) gl.glDisable(gl.GL_DEPTH_TEST)
def renderFrets(self, visibility, song, controls): w = self.boardWidth / self.strings size = (.22, .22) v = 1.0 - visibility glEnable(GL_DEPTH_TEST) for n in range(self.strings2): keyNumb = n f = self.fretWeight[keyNumb] c = list(self.fretColors[keyNumb]) y = v / 6 x = (self.strings / 2 - n) * w if self.twoDkeys == True or not self.keyMesh: fretColor = (1,1,1,1) size = (self.boardWidth / self.strings / 2, self.boardWidth / self.strings / 2.4) texSize = (n / self.lanenumber, n / self.lanenumber + 1 / self.lanenumber) if self.battleStatus[3] and self.battleFrets != None and self.battleBreakString == n: texSize = (n/5.0+.042,n/5.0+0.158) size = (.30, .40) fretPos = 8 - round((self.battleBreakNow/self.battleBreakLimit) * 8) texY = (fretPos/8.0,(fretPos + 1.0)/8) else: texY = (0.0, 1.0 / self.fretImgColNumber)#fret normal guitar/bass/drums if controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]):#fret press texY = (1.0 / self.fretImgColNumber, 2.0 / self.fretImgColNumber) elif self.hit[n] or (self.battleStatus[3] and self.battleBreakString == n):#frets on note hit texY = (2.0 / self.fretImgColNumber,1.0) draw3Dtex(self.fretButtons, vertex = (size[0],size[1],-size[0],-size[1]), texcoord = (texSize[0], texY[0], texSize[1], texY[1]), coord = (x,v,0), multiples = True,color = fretColor, depth = True) else: self.keypos = self.engine.theme.keypos self.keyrot = self.engine.theme.keyrot if self.keytex: texture = getattr(self,"keytex"+chr(97+n)).texture else: texture = None c = [.1 + .8 * c[0] + f, .1 + .8 * c[1] + f, .1 + .8 * c[2] + f, v] self.render3DKey(texture,self.keyMesh, x, y, c, n, f) glDisable(GL_DEPTH_TEST)
def renderFreestyleFlames(self, visibility, controls): if self.flameColors[0][0] == -1: return w = self.boardWidth / self.strings v = 1.0 - visibility flameLimit = 10.0 flameLimitHalf = round(flameLimit/2.0) for fretNum in range(self.strings): if controls.getState(self.keys[fretNum]) or controls.getState(self.keys[fretNum+5]): if self.freestyleHitFlameCounts[fretNum] < flameLimit: ms = math.sin(self.time) * .25 + 1 x = (self.strings / 2 - fretNum) * w ff = 1 + 0.25 y = v + ff / 6 if self.theme == 2: y -= 0.5 flameSize = self.hitFlameSize if self.theme == 0 or self.theme == 1: #THIS SETS UP GH3 COLOR, ELSE ROCKBAND(which is DEFAULT in Theme.py) flameColor = self.gh3flameColor else: #MFH - fixing crash! flameColor = self.fretColors[fretNum] if flameColor[0] == -2: flameColor = self.fretColors[fretNum] ff += 1.5 #ff first time is 2.75 after this if self.freestyleHitFlameCounts[fretNum] < flameLimitHalf: flamecol = tuple([flameColor[ifc] for ifc in range(3)]) rbStarColor = (.1, .1, .2, .3) xOffset = (.0, - .005, .005, .0) yOffset = (.20, .255, .255, .255) scaleMod = .6 * ms * ff scaleFix = (6.0, 5.5, 5.0, 4.7) for step in range(4): if self.starPowerActive and self.theme < 2: flamecol = self.spColor else: #Default starcolor (Rockband) flamecol = (rbStarColor[step],)*3 hfCount = self.freestyleHitFlameCounts[fretNum] if step == 0: hfCount += 1 if self.disableFlameSFX != True: draw3Dtex(self.hitflames2Drawing, coord = (x+xOffset[step], y+yOffset[step], 0), rot = (90, 1, 0, 0), scale = (.25 + .05 * step + scaleMod, hfCount/scaleFix[step] + scaleMod, hfCount/scaleFix[step] + scaleMod), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) else: flameColorMod = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = tuple([flameColor[ifc]*flameColorMod for ifc in range(3)]) xOffset = (.0, - .005, .005, .005) yOffset = (.35, .405, .355, .355) scaleMod = .6 * ms * ff scaleFix = (3.0, 2.5, 2.0, 1.7) for step in range(4): hfCount = self.freestyleHitFlameCounts[fretNum] if step == 0: hfCount += 1 else: if self.starPowerActive and self.theme < 2: flamecol = self.spColor else: #Default starcolor (Rockband) flamecol = (.4+.1*step,)*3 if self.disableFlameSFX != True: draw3Dtex(self.hitflames1Drawing, coord = (x+xOffset[step], y+yOffset[step], 0), rot = (90, 1, 0, 0), scale = (.25 + .05 * step + scaleMod, hfCount/scaleFix[step] + scaleMod, hfCount/scaleFix[step] + scaleMod), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) self.freestyleHitFlameCounts[fretNum] += 1 else: #MFH - flame count is done - reset it! self.freestyleHitFlameCounts[fretNum] = 0 #MFH
def renderFreestyleFlames(self, visibility, controls): if self.flameColors[0][0] == -1: return w = self.boardWidth / self.strings v = 1.0 - visibility flameLimit = 10.0 flameLimitHalf = round(flameLimit/2.0) for fretNum in range(self.strings+1): #need to add 1 to string count to check this correctly (bass drum doesnt count as a string) #MFH - must include secondary drum keys here if controls.getState(self.keys[fretNum]) or controls.getState(self.keys[fretNum+5]): if self.freestyleHitFlameCounts[fretNum] < flameLimit: ms = math.sin(self.time) * .25 + 1 if fretNum == 0: x = (self.strings / 2 - 2) * w else: x = (self.strings / 2 +.5 - fretNum) * w ff = 1 + 0.25 y = v + ff / 6 gl.glBlendFunc(gl.GL_ONE, gl.GL_ONE) if self.theme == 2: y -= 0.5 flameSize = self.hitFlameSize if self.theme == 0 or self.theme == 1: #THIS SETS UP GH3 COLOR, ELSE ROCKBAND(which is DEFAULT in Theme.py) flameColor = self.gh3flameColor else: #MFH - fixing crash! flameColor = self.fretColors[fretNum] if flameColor[0] == -2: flameColor = self.fretColors[fretNum] ff += 1.5 #ff first time is 2.75 after this if self.freestyleHitFlameCounts[fretNum] < flameLimitHalf: flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.1,.1,.1) if self.disableFlameSFX != True: draw3Dtex(self.hitflames2Drawing, coord = (x, y + .20, 0), rot = (90, 1, 0, 0), scale = (.25 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum]/6.0 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 6.0 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.1,.1,.1) if self.disableFlameSFX != True: draw3Dtex(self.hitflames2Drawing, coord = (x - .005, y + .25 + .005, 0), rot = (90, 1, 0, 0), scale = (.30 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.5 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.5 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) #flamecol = gl.glColor3f(.2,.2,.2) flamecol = (.2,.2,.2) if self.disableFlameSFX != True: draw3Dtex(self.hitflames2Drawing, coord = (x+.005, y +.25 +.005, 0), rot = (90, 1, 0, 0), scale = (.35 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.0 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.0 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.3,.3,.3) if self.disableFlameSFX != True: draw3Dtex(self.hitflames2Drawing, coord = (x, y +.25 +.005, 0), rot = (90, 1, 0, 0), scale = (.40 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1)/ 4.7 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 4.7 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) else: flameColorMod0 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) #MFH - hit lightning logic is not needed for freestyle flames... if self.disableFlameSFX != True: draw3Dtex(self.hitflames1Drawing, coord = (x, y + .35, 0), rot = (90, 1, 0, 0), scale = (.25 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 3.0 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 3.0 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flameColorMod0 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.5,.5,.5) if self.disableFlameSFX != True: draw3Dtex(self.hitflames1Drawing, coord = (x - .005, y + .40 + .005, 0), rot = (90, 1, 0, 0), scale = (.30 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1)/ 2.5 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.5 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flameColorMod0 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.6,.6,.6) if self.disableFlameSFX != True: draw3Dtex(self.hitflames1Drawing, coord = (x + .005, y + .35 + .005, 0), rot = (90, 1, 0, 0), scale = (.35 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.0 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.0 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) flameColorMod0 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * (flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.7,.7,.7) if self.disableFlameSFX != True: draw3Dtex(self.hitflames1Drawing, coord = (x + .005, y + .35 + .005, 0), rot = (90, 1, 0, 0), scale = (.40 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 1.7 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 1.7 + .6 * ms * ff), vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = flamecol) self.freestyleHitFlameCounts[fretNum] += 1 else: #MFH - flame count is done - reset it! self.freestyleHitFlameCounts[fretNum] = 0 #MFH
def renderFrets(self, visibility, song, controls): w = self.boardWidth / self.strings size = (.22, .22) v = 1.0 - visibility gl.glEnable(gl.GL_DEPTH_TEST) for n in range(self.strings2): if n == 4: keyNumb = 0 else: keyNumb = n + 1 f = self.drumsHeldDown[keyNumb]/200.0 pressed = self.drumsHeldDown[keyNumb] if n == 3: #Set colors of frets c = list(self.fretColors[0]) elif not n == 4: c = list(self.fretColors[n + 1]) if n == 4: y = v + f / 6 x = 0 else: y = v / 6 x = (self.strings / 2 - .5 - n) * w if self.twoDkeys == True or not self.keyMesh: if n == 4: #Weirdpeople - so the drum bass fret can be seen with 2d frets gl.glDisable(gl.GL_DEPTH_TEST) size = (self.boardWidth/2, self.boardWidth/self.strings/2.4) texSize = (0.0,1.0) else: size = (self.boardWidth / self.strings / 2, self.boardWidth / self.strings / 2.4) texSize = (n / self.lanenumber, n / self.lanenumber + 1 / self.lanenumber) fretColor = (1,1,1,1) if self.drumFretButtons == None: if n == 4: continue whichFret = n+1 if whichFret == 4: whichFret = 0 #reversing fret 0 since it's angled in Rock Band texSize = (whichFret/5.0+0.2,whichFret/5.0) else: texSize = (whichFret/5.0,whichFret/5.0+0.2) texY = (0.0,1.0/3.0) if pressed: texY = (1.0/3.0,2.0/3.0) if self.hit[n]: #Currently broken texY = (2.0/3.0,1.0) else: if controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]) or pressed: #pressed if n == 4: #bass drum texY = (3.0 / self.fretImgColNumber, 4.0 / self.fretImgColNumber) else: texY = (2.0 / self.fretImgColNumber, 3.0 / self.fretImgColNumber) elif self.hit[n]: #being hit - Currently broken if n == 4: #bass drum texY = (5.0 / self.fretImgColNumber, 1.0) else: texY = (4.0 / self.fretImgColNumber, 5.0 / self.fretImgColNumber) else: #nothing being pressed or hit if n == 4: #bass drum texY = (1.0 / self.fretImgColNumber, 2.0 / self.fretImgColNumber) else: texY = (0.0, 1.0 / self.fretImgColNumber) draw3Dtex(self.fretButtons, vertex = (size[0],size[1],-size[0],-size[1]), texcoord = (texSize[0], texY[0], texSize[1], texY[1]), coord = (x,v,0), multiples = True,color = fretColor, depth = True) else: self.keypos = self.engine.theme.drumkeypos self.keyrot = self.engine.theme.drumkeyrot texture = None model = self.keyMesh if self.keytex: if n == 0: texture = self.keytexb.texture elif n == 1: texture = self.keytexc.texture elif n == 2: texture = self.keytexd.texture elif n == 3: texture = self.keytexa.texture elif n == 4 and self.keytexopen: texture = self.keytexopen.texture if n == 4: model = self.keyMeshOpen c = [.1 + .8 * c[0] + f, .1 + .8 * c[1] + f, .1 + .8 * c[2] + f, v] self.render3DKey(texture, model, x, y, c, n, f) gl.glDisable(gl.GL_DEPTH_TEST)
def renderNote(self, length, sustain, color, tailOnly = False, isTappable = False, fret = 0, spNote = False, isOpen = False, spAct = False): if tailOnly: return if self.twoDnote == True: tailOnly = True y = 0 if spNote: y += 1 elif self.starPowerActive: y += 2 if isOpen: vtx = self.openVtx if self.noteSpin: texCoord = self.animatedOpenTexCoord[self.noteSpinFrameIndex] if spNote == True: noteImage = self.noteOpenAnimatedPower elif self.starPowerActive == True: #death_au: drum sp active notes. noteImage = self.noteOpenAnimatedPowerActive else: noteImage = self.noteOpenAnimated if not noteImage: noteImage = self.noteButtons texCoord = self.openTexCoord[y] else: if not noteImage: noteImage = self.noteButtons texCoord = self.noteTexCoord[y] else: fret -= 1 vtx = self.noteVtx if self.noteSpin: texCoord = self.animatedNoteTexCoord[self.noteSpinFrameIndex][fret] if spNote: noteImage = self.noteAnimatedPower elif self.starPowerActive: noteImage = self.noteAnimatedPowerActive else: noteImage = self.noteAnimatedNormal if not noteImage: noteImage = self.noteButtons texCoord = self.noteTexCoord[y][fret] else: noteImage = self.noteButtons texCoord = self.noteTexCoord[y][fret] draw3Dtex(noteImage, vertex = vtx, texcoord = texCoord, scale = (1,1,1), rot = (self.camAngle,1,0,0), multiples = False, color = color) else: #3d Notes shaders.setVar("Material",color,"notes") self.notepos = self.engine.theme.drumnotepos self.noterot = self.engine.theme.drumnoterot if fret == 0: fret = 4 #fret 4 is angled, get fret 2 :) #fret = 2 #compensating for this in drum. elif fret == 4: fret = 0 if isOpen and self.openMesh is not None: meshObj = self.openMesh elif spNote and self.starMesh is not None: meshObj = self.starMesh else: meshObj = self.noteMesh gl.glPushMatrix() gl.glEnable(gl.GL_DEPTH_TEST) gl.glDepthMask(1) gl.glShadeModel(gl.GL_SMOOTH) if not isOpen: if spNote and self.threeDspin: gl.glRotate(90 + self.time/3, 0, 1, 0) elif not spNote and self.noterotate: gl.glRotatef(90, 0, 1, 0) gl.glRotatef(-90, 1, 0, 0) if fret >= 0 and fret <= 4: gl.glRotate(self.noterot[fret], 0, 0, 1) gl.glTranslatef(0, self.notepos[fret], 0) texture = None if self.notetex: if isOpen: if self.opentexture_star: texture = self.opentexture_star elif self.opentexture_stara and self.starPowerActive: texture = self.opentexture_stara elif self.opentexture: texture = self.opentexture elif self.startex and spNote: texture = getattr(self,"startex"+chr(97+fret)) elif self.spActTex and spAct: texture = self.spActTex elif self.staratex and self.starPowerActive: texture = getattr(self,"staratex"+chr(97+fret)) else: texture = getattr(self,"notetex"+chr(97+fret)) self.render3DNote(texture, meshObj, color, isTappable) gl.glDepthMask(0) gl.glPopMatrix() gl.glDisable(gl.GL_DEPTH_TEST)
def renderFreestyleFlames(self, visibility, controls): if self.flameColors[0][0] == -1: return w = self.boardWidth / self.strings v = 1.0 - visibility flameLimit = 10.0 flameLimitHalf = round(flameLimit / 2.0) for fretNum in range(self.strings): if controls.getState(self.keys[fretNum]) or controls.getState( self.keys[fretNum + 5]): if self.freestyleHitFlameCounts[fretNum] < flameLimit: ms = math.sin(self.time) * .25 + 1 x = (self.strings / 2 - fretNum) * w ff = 1 + 0.25 y = v + ff / 6 if self.theme == 2: y -= 0.5 flameSize = self.hitFlameSize if self.theme == 0 or self.theme == 1: #THIS SETS UP GH3 COLOR, ELSE ROCKBAND(which is DEFAULT in Theme.py) flameColor = self.gh3flameColor else: #MFH - fixing crash! flameColor = self.fretColors[fretNum] if flameColor[0] == -2: flameColor = self.fretColors[fretNum] ff += 1.5 #ff first time is 2.75 after this if self.freestyleHitFlameCounts[fretNum] < flameLimitHalf: flamecol = tuple([flameColor[ifc] for ifc in range(3)]) rbStarColor = (.1, .1, .2, .3) xOffset = (.0, -.005, .005, .0) yOffset = (.20, .255, .255, .255) scaleMod = .6 * ms * ff scaleFix = (6.0, 5.5, 5.0, 4.7) for step in range(4): if self.starPowerActive and self.theme < 2: flamecol = self.spColor else: #Default starcolor (Rockband) flamecol = (rbStarColor[step], ) * 3 hfCount = self.freestyleHitFlameCounts[fretNum] if step == 0: hfCount += 1 if self.disableFlameSFX != True: draw3Dtex( self.hitflames2Drawing, coord=(x + xOffset[step], y + yOffset[step], 0), rot=(90, 1, 0, 0), scale=(.25 + .05 * step + scaleMod, hfCount / scaleFix[step] + scaleMod, hfCount / scaleFix[step] + scaleMod), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) else: flameColorMod = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = tuple([ flameColor[ifc] * flameColorMod for ifc in range(3) ]) xOffset = (.0, -.005, .005, .005) yOffset = (.35, .405, .355, .355) scaleMod = .6 * ms * ff scaleFix = (3.0, 2.5, 2.0, 1.7) for step in range(4): hfCount = self.freestyleHitFlameCounts[fretNum] if step == 0: hfCount += 1 else: if self.starPowerActive and self.theme < 2: flamecol = self.spColor else: #Default starcolor (Rockband) flamecol = (.4 + .1 * step, ) * 3 if self.disableFlameSFX != True: draw3Dtex( self.hitflames1Drawing, coord=(x + xOffset[step], y + yOffset[step], 0), rot=(90, 1, 0, 0), scale=(.25 + .05 * step + scaleMod, hfCount / scaleFix[step] + scaleMod, hfCount / scaleFix[step] + scaleMod), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) self.freestyleHitFlameCounts[fretNum] += 1 else: #MFH - flame count is done - reset it! self.freestyleHitFlameCounts[fretNum] = 0 #MFH
def renderFreestyleFlames(self, visibility, controls): if self.flameColors[0][0] == -1: return w = self.boardWidth / self.strings v = 1.0 - visibility flameLimit = 10.0 flameLimitHalf = round(flameLimit / 2.0) for fretNum in range( self.strings + 1 ): #need to add 1 to string count to check this correctly (bass drum doesnt count as a string) #MFH - must include secondary drum keys here if controls.getState(self.keys[fretNum]) or controls.getState( self.keys[fretNum + 5]): if self.freestyleHitFlameCounts[fretNum] < flameLimit: ms = math.sin(self.time) * .25 + 1 if fretNum == 0: x = (self.strings / 2 - 2) * w else: x = (self.strings / 2 + .5 - fretNum) * w ff = 1 + 0.25 y = v + ff / 6 gl.glBlendFunc(gl.GL_ONE, gl.GL_ONE) if self.theme == 2: y -= 0.5 flameSize = self.hitFlameSize if self.theme == 0 or self.theme == 1: #THIS SETS UP GH3 COLOR, ELSE ROCKBAND(which is DEFAULT in Theme.py) flameColor = self.gh3flameColor else: #MFH - fixing crash! flameColor = self.fretColors[fretNum] if flameColor[0] == -2: flameColor = self.fretColors[fretNum] ff += 1.5 #ff first time is 2.75 after this if self.freestyleHitFlameCounts[fretNum] < flameLimitHalf: flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.1, .1, .1) if self.disableFlameSFX != True: draw3Dtex( self.hitflames2Drawing, coord=(x, y + .20, 0), rot=(90, 1, 0, 0), scale=(.25 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 6.0 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 6.0 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.1, .1, .1) if self.disableFlameSFX != True: draw3Dtex( self.hitflames2Drawing, coord=(x - .005, y + .25 + .005, 0), rot=(90, 1, 0, 0), scale=(.30 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.5 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.5 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) #flamecol = gl.glColor3f(.2,.2,.2) flamecol = (.2, .2, .2) if self.disableFlameSFX != True: draw3Dtex( self.hitflames2Drawing, coord=(x + .005, y + .25 + .005, 0), rot=(90, 1, 0, 0), scale=(.35 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.0 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 5.0 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flamecol = (flameColor[0], flameColor[1], flameColor[2]) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.3, .3, .3) if self.disableFlameSFX != True: draw3Dtex( self.hitflames2Drawing, coord=(x, y + .25 + .005, 0), rot=(90, 1, 0, 0), scale=(.40 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 4.7 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 4.7 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) else: flameColorMod0 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) #MFH - hit lightning logic is not needed for freestyle flames... if self.disableFlameSFX != True: draw3Dtex( self.hitflames1Drawing, coord=(x, y + .35, 0), rot=(90, 1, 0, 0), scale=(.25 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 3.0 + .6 * ms * ff, self.freestyleHitFlameCounts[fretNum] / 3.0 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flameColorMod0 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.5, .5, .5) if self.disableFlameSFX != True: draw3Dtex( self.hitflames1Drawing, coord=(x - .005, y + .40 + .005, 0), rot=(90, 1, 0, 0), scale=(.30 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.5 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.5 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flameColorMod0 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.6, .6, .6) if self.disableFlameSFX != True: draw3Dtex( self.hitflames1Drawing, coord=(x + .005, y + .35 + .005, 0), rot=(90, 1, 0, 0), scale=(.35 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.0 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 2.0 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) flameColorMod0 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod1 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flameColorMod2 = 0.1 * ( flameLimit - self.freestyleHitFlameCounts[fretNum]) flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) if self.starPowerActive: if self.theme == 0 or self.theme == 1: #GH3 starcolor flamecol = self.spColor #(.3,.7,.9) else: #Default starcolor (Rockband) flamecol = (.7, .7, .7) if self.disableFlameSFX != True: draw3Dtex( self.hitflames1Drawing, coord=(x + .005, y + .35 + .005, 0), rot=(90, 1, 0, 0), scale=(.40 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 1.7 + .6 * ms * ff, (self.freestyleHitFlameCounts[fretNum] + 1) / 1.7 + .6 * ms * ff), vertex=(-flameSize * ff, -flameSize * ff, flameSize * ff, flameSize * ff), texcoord=(0.0, 0.0, 1.0, 1.0), multiples=True, alpha=True, color=flamecol) self.freestyleHitFlameCounts[fretNum] += 1 else: #MFH - flame count is done - reset it! self.freestyleHitFlameCounts[fretNum] = 0 #MFH
def renderFrets(self, visibility, song, controls): w = self.boardWidth / self.strings size = (.22, .22) v = 1.0 - visibility gl.glEnable(gl.GL_DEPTH_TEST) for i in range(self.strings2): # Rearrange so bass is rendered last n = i + 1 if n == self.strings2: n = 0 # n==0 is bass; 1..4 is regular drums f = self.drumsHeldDown[n] / 200.0 pressed = self.drumsHeldDown[n] if n > 0: c = list(self.fretColors[n - 1]) if n == 0: y = v + f / 6 x = 0 else: y = v / 6 x = (self.strings / 2 - .5 - (n - 1)) * w if self.twoDkeys == True or not self.keyMesh: if n == 0: #Weirdpeople - so the drum bass fret can be seen with 2d frets gl.glDisable(gl.GL_DEPTH_TEST) size = (self.boardWidth / 2, self.boardWidth / self.strings / 2.4) texSize = (0.0, 1.0) else: size = (self.boardWidth / self.strings / 2, self.boardWidth / self.strings / 2.4) texSize = ((n - 1) / self.lanenumber, n / self.lanenumber) fretColor = (1, 1, 1, 1) if self.drumFretButtons == None: if n == 0: continue if n == 1: #reversing fret 1 since it's angled in Rock Band texSize = (0.2, 0.0) else: texSize = (n / 5.0, n / 5.0 + 0.2) texY = (0.0, 1.0 / 3.0) if pressed: texY = (1.0 / 3.0, 2.0 / 3.0) if self.hit[n]: #Currently broken texY = (2.0 / 3.0, 1.0) else: if controls.getState(self.keys[n]) or controls.getState( self.keys[n + 5]) or pressed: #pressed if n == 0: #bass drum texY = (3.0 / self.fretImgColNumber, 4.0 / self.fretImgColNumber) else: texY = (2.0 / self.fretImgColNumber, 3.0 / self.fretImgColNumber) elif self.hit[n]: #being hit - Currently broken if n == 0: #bass drum texY = (5.0 / self.fretImgColNumber, 1.0) else: texY = (4.0 / self.fretImgColNumber, 5.0 / self.fretImgColNumber) else: #nothing being pressed or hit if n == 0: #bass drum texY = (1.0 / self.fretImgColNumber, 2.0 / self.fretImgColNumber) else: texY = (0.0, 1.0 / self.fretImgColNumber) draw3Dtex(self.fretButtons, vertex=(size[0], size[1], -size[0], -size[1]), texcoord=(texSize[0], texY[0], texSize[1], texY[1]), coord=(x, v, 0), multiples=True, color=fretColor, depth=True) else: #TODO finish 3d keys! keytex and friends are never defined so this block is completely undeveloped! self.keypos = self.engine.theme.drumkeypos self.keyrot = self.engine.theme.drumkeyrot texture = None model = self.keyMesh if self.keytex: if n == 0 and self.keytexopen: texture = self.keytexopen.texture elif n == 1: texture = self.keytexa.texture elif n == 2: texture = self.keytexb.texture elif n == 3: texture = self.keytexc.texture elif n == 4: texture = self.keytexd.texture if n == 0: model = self.keyMeshOpen c = [ .1 + .8 * c[0] + f, .1 + .8 * c[1] + f, .1 + .8 * c[2] + f, v ] self.render3DKey(texture, model, x, y, c, n, f) gl.glDisable(gl.GL_DEPTH_TEST)
def renderNote(self, length, sustain, color, tailOnly=False, isTappable=False, fret=0, spNote=False, isOpen=False, spAct=False): if tailOnly: return if self.twoDnote == True: tailOnly = True y = 0 if spNote: y += 1 elif self.starPowerActive: y += 2 if isOpen: vtx = self.openVtx if self.noteSpin: texCoord = self.animatedOpenTexCoord[ self.noteSpinFrameIndex] if spNote == True: noteImage = self.noteOpenAnimatedPower elif self.starPowerActive == True: #death_au: drum sp active notes. noteImage = self.noteOpenAnimatedPowerActive else: noteImage = self.noteOpenAnimated if not noteImage: noteImage = self.noteButtons texCoord = self.openTexCoord[y] else: noteImage = self.noteButtons texCoord = self.openTexCoord[y] else: fret -= 1 vtx = self.noteVtx if self.noteSpin: texCoord = self.animatedNoteTexCoord[ self.noteSpinFrameIndex][fret] if spNote: noteImage = self.noteAnimatedPower elif self.starPowerActive: noteImage = self.noteAnimatedPowerActive else: noteImage = self.noteAnimatedNormal if not noteImage: noteImage = self.noteButtons texCoord = self.noteTexCoord[y][fret] else: noteImage = self.noteButtons texCoord = self.noteTexCoord[y][fret] draw3Dtex(noteImage, vertex=vtx, texcoord=texCoord, scale=(1, 1, 1), rot=(self.camAngle, 1, 0, 0), multiples=False, color=color) else: #3d Notes shaders.setVar("Material", color, "notes") self.notepos = self.engine.theme.drumnotepos self.noterot = self.engine.theme.drumnoterot if fret == 0: fret = 4 #fret 4 is angled, get fret 2 :) #fret = 2 #compensating for this in drum. elif fret == 4: fret = 0 if isOpen and self.openMesh is not None: meshObj = self.openMesh elif spNote and self.starMesh is not None: meshObj = self.starMesh else: meshObj = self.noteMesh gl.glPushMatrix() gl.glEnable(gl.GL_DEPTH_TEST) gl.glDepthMask(1) gl.glShadeModel(gl.GL_SMOOTH) if not isOpen: if spNote and self.threeDspin: gl.glRotate(90 + self.time / 3, 0, 1, 0) elif not spNote and self.noterotate: gl.glRotatef(90, 0, 1, 0) gl.glRotatef(-90, 1, 0, 0) if fret >= 0 and fret <= 4: gl.glRotate(self.noterot[fret], 0, 0, 1) gl.glTranslatef(0, self.notepos[fret], 0) texture = None if self.notetex: if isOpen: if self.opentexture_star: texture = self.opentexture_star elif self.opentexture_stara and self.starPowerActive: texture = self.opentexture_stara elif self.opentexture: texture = self.opentexture elif self.startex and spNote: texture = getattr(self, "startex" + chr(97 + fret)) elif self.spActTex and spAct: texture = self.spActTex elif self.staratex and self.starPowerActive: texture = getattr(self, "staratex" + chr(97 + fret)) else: texture = getattr(self, "notetex" + chr(97 + fret)) self.render3DNote(texture, meshObj, color, isTappable) gl.glDepthMask(0) gl.glPopMatrix() gl.glDisable(gl.GL_DEPTH_TEST)
def renderNote(self, length, sustain, color, tailOnly = False, isTappable = False, string = 0, fret = 0, spNote = False, spAct = False): if tailOnly: return #myfingershurt: this should be retrieved once at init, not repeatedly in-game whenever tails are rendered. if self.twoDnote == True: noteImage = self.noteButtons tailOnly = True size = (self.boardWidth/self.strings/2, self.boardWidth/self.strings/2) texSize = (string/float(self.strings),(string+1)/float(self.strings)) if spNote == True: if isTappable: if self.noteAnimatedPowerHOPO: noteImage = self.noteAnimatedPowerHOPO texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (.5, 2.0/3.0) else: if self.noteAnimatedPower: noteImage = self.noteAnimatedPower texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (1.0/3.0, .5) elif self.starPowerActive: if isTappable: if self.noteAnimatedPowerActiveHOPO: noteImage = self.noteAnimatedPowerActiveHOPO texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (5.0/6.0, 1) else: if self.noteAnimatedPowerActive: noteImage = self.noteAnimatedPowerActive texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (2.0/3.0, 5.0/6.0) else: if isTappable: if self.noteAnimatedHOPO: noteImage = self.noteAnimatedHOPO texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (1.0/6.0, 1.0/3.0) else: if self.noteAnimatedNormal: noteImage = self.noteAnimatedNormal texY = (self.noteSpinFrameIndex*.066667, (self.noteSpinFrameIndex - 1)*.066667) else: texY = (0, 1.0/6.0) draw3Dtex(noteImage, vertex = (-size[0],size[1],size[0],-size[1]), texcoord = (texSize[0],texY[0],texSize[1],texY[1]), scale = (1,1,0), rot = (30,1,0,0), multiples = False, color = color, vertscale = .27) #draws the fret number over the note texSize = (string/self.lanenumber,string/self.lanenumber+1/self.lanenumber) texY = (fret/13.0, (fret+1)/13.0) draw3Dtex(self.fretNumbers, vertex = (-size[0],size[1],size[0],-size[1]), texcoord = (texSize[0],texY[0],texSize[1],texY[1]), scale = (1,1,0), rot = (30,1,0,0), multiples = False, color = color, vertscale = .27)