Skip to content

Commit

Permalink
Working on system to make the frame count for animated hitflames and …
Browse files Browse the repository at this point in the history
…hitglows themeable
  • Loading branch information
erodozer committed Jun 4, 2011
1 parent c8c493e commit 1fefd19
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Instrument.py
Expand Up @@ -787,7 +787,7 @@ def renderHitTrails(self, visibility, song, pos, controls):

v = 1.0 - visibility

if (self.HCountAni == True and self.HCount2 > 12):
if (self.HCountAni == True and self.HCount2 >= self.HFrameLimit2):
for n in range(self.strings):
f = self.fretWeight[n]
if f and (controls.getState(self.actions[0]) or controls.getState(self.actions[1])):
Expand Down Expand Up @@ -823,10 +823,10 @@ def renderHitTrails(self, visibility, song, pos, controls):
self.HCount = self.HCount + 1
if self.HCount > self.Animspeed-1:
self.HCount = 0
HIndex = (self.HCount * 16 - (self.HCount * 16) % self.Animspeed) / self.Animspeed
if HIndex > 15:
HIndex = (self.HCount * self.HFrameLimit - (self.HCount * self.HFrameLimit) % self.Animspeed) / self.Animspeed
if HIndex >= self.HFrameLimit:
HIndex = 0
texX = (HIndex*(1/16.0), HIndex*(1/16.0)+(1/16.0))
texX = (HIndex*(1.0/self.HFrameLimit), HIndex*(1.0/self.HFrameLimit)+(1.0/self.HFrameLimit))

self.engine.draw3Dtex(self.hitglowAnim, coord = (x, y + .225, 0), rot = (90, 1, 0, 0), scale = (2.4, 1, 3.3),
vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff),
Expand Down Expand Up @@ -865,7 +865,7 @@ def renderFlames(self, visibility, song, pos, controls):

v = 1.0 - visibility

if (self.HCountAni == True and self.HCount2 > 12):
if (self.HCountAni == True and self.HCount2 >= self.HFrameLimit2):
for n in range(self.strings):
f = self.fretWeight[n]
if f and (controls.getState(self.actions[0]) or controls.getState(self.actions[1])):
Expand Down Expand Up @@ -908,10 +908,10 @@ def renderFlames(self, visibility, song, pos, controls):
self.HCount = self.HCount + 1
if self.HCount > self.Animspeed-1:
self.HCount = 0
HIndex = (self.HCount * 16 - (self.HCount * 16) % self.Animspeed) / self.Animspeed
if HIndex > 15:
HIndex = (self.HCount * self.HFrameLimit - (self.HCount * self.HFrameLimit) % self.Animspeed) / self.Animspeed
if HIndex >= self.HFrameLimit:
HIndex = 0
texX = (HIndex*(1/16.0), HIndex*(1/16.0)+(1/16.0))
texX = (HIndex*(1.0/self.HFrameLimit), HIndex*(1.0/self.HFrameLimit+1.0/self.HFrameLimit))
if self.disableFlameSFX != True:
self.engine.draw3Dtex(self.hitglowAnim, coord = (x, y + .225, 0), rot = (90, 1, 0, 0), scale = (2.4, 1, 3.3),
vertex = (-flameSize * ff,-flameSize * ff,flameSize * ff,flameSize * ff),
Expand Down Expand Up @@ -968,19 +968,19 @@ def renderFlames(self, visibility, song, pos, controls):
if self.Hitanim2 == True:
self.HCount2 = self.HCount2 + 1
self.HCountAni = False
if self.HCount2 > 12:
if self.HCount2 >= self.HFrameLimit2:
if not event.length > (1.4 * (60000.0 / event.noteBpm) / 4):
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 = (self.HCount2 * self.HFrameLimit2 - (self.HCount2 * self.HFrameLimit2) % self.HFrameLimit2) / self.HFrameLimit2
if HIndex >= self.HFrameLimit2 and self.HCountAni != True:
HIndex = 0

texX = (HIndex*(1/13.0), HIndex*(1/13.0)+(1/13.0))
texX = (HIndex*(1.0/self.HFrameLimit2), HIndex*(1.0/self.HFrameLimit2)+(1.0/self.HFrameLimit2))
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),
Expand Down Expand Up @@ -1021,7 +1021,7 @@ def renderFlames(self, visibility, song, pos, controls):
multiples = True, alpha = True, color = flamecol)

elif self.hitFlamesPresent == True and self.Hitanim2 == False:
self.HCount2 = 13
self.HCount2 = self.HFrameLimit2
self.HCountAni = True
if event.flameCount < flameLimitHalf:

Expand Down
5 changes: 5 additions & 0 deletions src/Theme.py
Expand Up @@ -170,6 +170,11 @@ def get(value, type = str, default = None):
#or the actual color of the tail
self.use_fret_colors = get("use_fret_colors", bool, False)

#themes can define how many frames their hitflames will be.
# Separate variables for hit and hold animation frame counts.
self.HitFlameFrameLimit = get("hit_flame_frame_limit", int, 13)
self.HoldFlameFrameLimit = get("hold_flame_frame_limit", int, 16)

self.fretPress = get("fretPress", bool, False)

#Point of View (x, y, z)
Expand Down

0 comments on commit 1fefd19

Please sign in to comment.