Skip to content

Commit

Permalink
Instrument: convert some comments to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkid committed Feb 25, 2018
1 parent d65134a commit 24d3cc3
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions fofix/game/guitarscene/instruments/Instrument.py
Expand Up @@ -325,19 +325,21 @@ def __init__(self, engine, playerObj, scene, player = 0):
[0,0,0,1]], dtype=np.float32)

self.tail_vtx = np.array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=np.float32)

#this checks to see if there is a "drum" or "bass" folder
#inside the subdirectory for image replacement
def checkPath(self, subdirectory, file, lastResort = False):
# parameters
# @subdirectory the folder in the theme to search
# if the instrument is drum or bass it will extend this
# @file the file to search for
# @lastResort if the file isn't even found in the default path then
# resort to using the file in the data folder
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=np.float32)

def checkPath(self, subdirectory, file, lastResort=False):
"""
Check if there is a "drum" or "bass" folder inside the subdirectory for
image replacement.
:param subdirectory: the folder in the theme to search
if the instrument is drum or bass it will extend this
:param file: the file to search for
:param lastResort: if the file isn't even found in the default path then
resort to using the file in the data folder
"""

#Get theme
themename = self.engine.data.themeLabel
Expand Down Expand Up @@ -672,8 +674,8 @@ def isKillswitchPossible(self):
possible = True
return possible

#Renders the tail glow hitflame
def renderHitTrails(self, controls):
""" Renders the tail glow hitflame """
if self.hitGlowColors[0][0] == -1 or self.disableFlameSFX:
return

Expand Down Expand Up @@ -765,8 +767,8 @@ def renderHitTrails(self, controls):
vertex = (-vtx,-vtx,vtx,vtx), texcoord = (0.0,0.0,1.0,1.0),
multiples = True, alpha = alphaEnabled, color = flamecol)

#renders the flames that appear when a note is struck
def renderAnimatedFlames(self, song, pos):
""" Renders the flames that appear when a note is struck """
if not song or self.flameColors[0][0] == -1:
return

Expand Down Expand Up @@ -834,8 +836,8 @@ def renderAnimatedFlames(self, song, pos):
texcoord = (texX[0],0.0,texX[1],1.0), multiples = True,
alpha = alphaEnabled, color = (1,1,1))

#renders the flames that appear when a note is struck
def renderFlames(self, song, pos):
""" Renders the flames that appear when a note is struck """
if not song or self.flameColors[0][0] == -1:
return

Expand Down Expand Up @@ -941,8 +943,8 @@ def renderFlames(self, song, pos):

event.flameCount += 1

#group rendering of 2D notes into method
def render3DNote(self, texture, model, color, isTappable):
""" Group rendering of 2D notes into method """
if (self.billboardNote):
gl.glRotatef(self.camAngle + 90, 1, 0, 0)
if texture:
Expand Down Expand Up @@ -1413,8 +1415,8 @@ def renderOpenNotes(self, visibility, song, pos):
self.finalStarSeen = False
self.isStarPhrase = False

#group rendering of 3D keys/frets into method
def render3DKey(self, texture, model, x, y, color, fretNum, f):
""" Group rendering of 3D keys/frets into method """
gl.glPushMatrix()
gl.glDepthMask(1)
gl.glEnable(gl.GL_LIGHTING)
Expand Down Expand Up @@ -1540,11 +1542,12 @@ def renderHitGlow(self):
texcoord = (0.0, 0.0, 1.0, 1.0), vertex = (-size * f, -size * f, size * f, size * f),
multiples = True, alpha = True, color = glowcol)

def renderTail(self, song, length, sustain, kill, color, tailOnly = False, isTappable = False, big = False, fret = 0, spNote = False, freestyleTail = 0, pos = 0):

#volshebnyi - if freestyleTail == 0, act normally.
# if freestyleTail == 1, render an freestyle tail
# if freestyleTail == 2, render highlighted freestyle tail
def renderTail(self, song, length, sustain, kill, color, tailOnly=False, isTappable=False, big=False, fret=0, spNote=False, freestyleTail=0, pos=0):
"""
if freestyleTail == 0, act normally.
if freestyleTail == 1, render an freestyle tail
if freestyleTail == 2, render highlighted freestyle tail
"""

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

0 comments on commit 24d3cc3

Please sign in to comment.