From 199081591e49707cfd2d94be46d0aa0969c48494 Mon Sep 17 00:00:00 2001 From: weirdpeople Date: Fri, 10 Jun 2011 20:33:48 -0500 Subject: [PATCH] Drums now work with the newer flames --- src/Drum.py | 276 +--------------------------------------------- src/Instrument.py | 11 +- 2 files changed, 10 insertions(+), 277 deletions(-) diff --git a/src/Drum.py b/src/Drum.py index 45826fd3e..99b2667d6 100644 --- a/src/Drum.py +++ b/src/Drum.py @@ -202,283 +202,9 @@ def loadFrets(self): else: engine.loadImgDrawing(self, "keytexopen", get("keytex_open.png")) - def renderFlames(self, visibility, song, pos, controls): - if not song or self.flameColors[0][0][0] == -1: - return - - w = self.boardWidth / self.strings - track = song.track[self.player] - - v = 1.0 - visibility - - - flameLimit = 10.0 - flameLimitHalf = round(flameLimit/2.0) - for time, event in track.getEvents(pos - self.currentPeriod * 2, pos + self.currentPeriod * self.beatsPerBoard): - if isinstance(event, Tempo): - continue - - if not isinstance(event, Note): - continue - - if (event.played or event.hopod) and event.flameCount < flameLimit: - ms = math.sin(self.time) * .25 + 1 - - if event.number == 0: - x = (self.strings / 2 - 2) * w - else: - x = (self.strings / 2 +.5 - event.number) * w - - xlightning = (self.strings / 2 - event.number)*2.2*w - ff = 1 + 0.25 - y = v + ff / 6 - - if self.theme == 2: - y -= 0.5 - - flameSize = self.flameSizes[self.scoreMultiplier - 1][event.number] - 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: - flameColor = self.flameColors[self.scoreMultiplier - 1][event.number] - if flameColor[0] == -2: - flameColor = self.fretColors[event.number] - - ff += 1.5 #ff first time is 2.75 after this - - if self.Hitanim2 == True: - self.HCount2 = self.HCount2 + 1 - self.HCountAni = False - if self.HCount2 > 12: - if event.length <= 130: - self.HCount2 = 0 - else: - self.HCountAni = True - if event.flameCount < flameLimitHalf: - - - HIndex = (self.HCount2 * 13 - (self.HCount2 * 13) % 13) / 13 - if HIndex > 12 and self.HCountAni != True: - HIndex = 0 - - texX = (HIndex*(1/13.0), HIndex*(1/13.0)+(1/13.0)) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflamesAnim, coord = (x, y + .665, 0), rot = (90, 1, 0, 0), scale = (1.6, 1.6, 4.9), - vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff), - texcoord = (texX[0],0.0,texX[1],1.0), multiples = True, alpha = True, color = (1,1,1)) - - else: - flameColorMod0 = 0.1 * (flameLimit - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.7,.7,.7) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: - flamecol = (.4,.4,.4)#Default starcolor (Rockband) - if self.theme != 2 and event.finalStar and self.spEnabled: - wid, hei, = self.engine.view.geometry[2:4] - self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, y, 3.3), rot = (90, 1, 0, 0), - scale = (.15 + .5 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, 2), vertex = (.4,-2,-.4,2), - texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = (1,1,1)) - else: - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x, y + .35, 0), rot = (90, 1, 0, 0), - scale = (.25 + .6 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, event.flameCount / 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.8,.8,.8) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.5,.5,.5) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x - .005, y + .40 + .005, 0), rot = (90, 1, 0, 0), - scale = (.30 + .6 * ms * ff, (event.flameCount + 1)/ 2.5 + .6 * ms * ff, (event.flameCount + 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.9,.9,.9) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.6,.6,.6) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x + .005, y + .35 + .005, 0), rot = (90, 1, 0, 0), - scale = (.35 + .6 * ms * ff, (event.flameCount + 1) / 2.0 + .6 * ms * ff, (event.flameCount + 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (1,1,1) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.7,.7,.7) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x+.005, y +.35 +.005, 0), rot = (90, 1, 0, 0), - scale = (.40 + .6 * ms * ff, (event.flameCount + 1) / 1.7 + .6 * ms * ff, (event.flameCount + 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) - else: - self.HCount2 = 13 - self.HCountAni = True - if event.flameCount < flameLimitHalf: - flamecol = (flameColor[0], flameColor[1], flameColor[2]) - spcolmod = (.3,.3,.3) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.1,.1,.1) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames2Drawing, coord = (x, y + .20, 0), rot = (90, 1, 0, 0), - scale = (.25 + .6 * ms * ff, event.flameCount/6.0 + .6 * ms * ff, event.flameCount / 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]) - spcolmod = (.4,.4,.4) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.1,.1,.1) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames2Drawing, coord = (x-.005, y + .255, 0), rot = (90, 1, 0, 0), - scale = (.30 + .6 * ms * ff, event.flameCount/5.5 + .6 * ms * ff, event.flameCount / 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]) - spcolmod = (.5,.5,.5) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.2,.2,.2) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames2Drawing, coord = (x+.005, y+.255, 0), rot = (90, 1, 0, 0), - scale = (.35 + .6 * ms * ff, event.flameCount/5.0 + .6 * ms * ff, event.flameCount / 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]) - spcolmod = (.6,.6,.6) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.3,.3,.3) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames2Drawing, coord = (x, y+.255, 0), rot = (90, 1, 0, 0), - scale = (.40 + .6 * ms * ff, event.flameCount/4.7 + .6 * ms * ff, event.flameCount / 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.7,.7,.7) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: - flamecol = (.4,.4,.4)#Default starcolor (Rockband) - if self.theme != 2 and event.finalStar and self.spEnabled: - wid, hei, = self.engine.view.geometry[2:4] - self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, y, 3.3), rot = (90, 1, 0, 0), - scale = (.15 + .5 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, 2), vertex = (.4,-2,-.4,2), - texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = (1,1,1)) - else: - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x, y + .35, 0), rot = (90, 1, 0, 0), - scale = (.25 + .6 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, event.flameCount / 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.8,.8,.8) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.5,.5,.5) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x - .005, y + .40 + .005, 0), rot = (90, 1, 0, 0), - scale = (.30 + .6 * ms * ff, (event.flameCount + 1)/ 2.5 + .6 * ms * ff, (event.flameCount + 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (.9,.9,.9) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.6,.6,.6) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x + .005, y + .35 + .005, 0), rot = (90, 1, 0, 0), - scale = (.35 + .6 * ms * ff, (event.flameCount + 1) / 2.0 + .6 * ms * ff, (event.flameCount + 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 - event.flameCount) - flameColorMod1 = 0.1 * (flameLimit - event.flameCount) - flameColorMod2 = 0.1 * (flameLimit - event.flameCount) - - flamecol = (flameColor[0] * flameColorMod0, flameColor[1] * flameColorMod1, flameColor[2] * flameColorMod2) - spcolmod = (1,1,1) - if self.starPowerActive: - if self.theme == 0 or self.theme == 1: #GH3 starcolor - flamecol = (self.spColor[0]*spcolmod[0], self.spColor[1]*spcolmod[1], self.spColor[2]*spcolmod[2]) - else: #Default starcolor (Rockband) - flamecol = (.7,.7,.7) - if self.disableFlameSFX != True: - self.engine.draw3Dtex(self.hitflames1Drawing, coord = (x+.005, y +.35 +.005, 0), rot = (90, 1, 0, 0), - scale = (.40 + .6 * ms * ff, (event.flameCount + 1) / 1.7 + .6 * ms * ff, (event.flameCount + 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) - event.flameCount += 1 - - - def renderFreestyleFlames(self, visibility, controls): - if self.flameColors[0][0][0] == -1: + if self.flameColors[0][0] == -1: return w = self.boardWidth / self.strings diff --git a/src/Instrument.py b/src/Instrument.py index 6058ccba3..1ddf5f1e2 100644 --- a/src/Instrument.py +++ b/src/Instrument.py @@ -825,7 +825,6 @@ def renderFlames(self, visibility, song, pos, controls): return w = self.boardWidth / self.strings - v = 1.0 - visibility flameSize = .075 @@ -848,7 +847,15 @@ def renderFlames(self, visibility, song, pos, controls): if not flameColor == self.spColor: flameColor = self.flameColors[event.number] ms = math.sin(self.time) * .25 + 1 - x = (self.strings / 2 - event.number) * w + + if self.isDrum: + if event.number == 0: + x = (self.strings / 2 - 2) * w + else: + x = (self.strings / 2 +.5 - event.number) * w + else: + x = (self.strings / 2 - event.number) * w + xlightning = (self.strings / 2 - event.number)*2.2*w ff = 1 + 0.25 y = v + ff / 6