Skip to content

Commit

Permalink
Originally just an attempt to stop it from crashing whenever I'd use …
Browse files Browse the repository at this point in the history
…overdrive, now I just made it so if any neck image isn't present (bassgroove, overdrive, etc) it will just not render it and not crash.
  • Loading branch information
erodozer committed Aug 23, 2010
1 parent d7b7436 commit d4dc102
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Neck.py
Expand Up @@ -217,11 +217,12 @@ def __init__(self, engine, instrument, playerObj):
engine.loadImgDrawing(self, "oNeck", os.path.join("themes",themename,"overdriveneck.png"), textureSize = (256, 256))
if self.isBassGuitar:
engine.loadImgDrawing(self, "oNeck", os.path.join("themes",themename,"overdriveneck_bass.png"), textureSize = (256, 256))

engine.loadImgDrawing(self, "oNeckovr", os.path.join("themes",themename,"overdriveneckovr.png"), textureSize = (256, 256))
if not self.oNeck:
engine.loadImgDrawing(self, "oNeck", os.path.join("themes",themename,"overdriveneck.png"), textureSize = (256, 256))

engine.loadImgDrawing(self, "oFlash", os.path.join("themes",themename,"overdrive_string_flash.png"), textureSize = (256, 256))


engine.loadImgDrawing(self, "oNeckovr", os.path.join("themes",themename,"overdriveneckovr.png"), textureSize = (256, 256))
engine.loadImgDrawing(self, "sideBars", os.path.join("themes",themename,"side_bars.png"))
engine.loadImgDrawing(self, "bpm_halfbeat", os.path.join("themes",themename,"bpm_halfbeat.png"))
engine.loadImgDrawing(self, "bpm_beat", os.path.join("themes",themename,"bpm_beat.png"))
Expand Down Expand Up @@ -438,7 +439,8 @@ def project(beat):

if alpha == True:
glBlendFunc(GL_ONE, GL_ONE)
neck.texture.bind()
if neck:
neck.texture.bind()
glEnableClientState(GL_VERTEX_ARRAY)
glEnableClientState(GL_COLOR_ARRAY)
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
Expand Down Expand Up @@ -469,26 +471,26 @@ def renderNeck(self, visibility, song, pos):

#myfingershurt: every theme can have oNeck:

if self.guitarSolo and self.guitarSoloNeck != None and self.guitarSoloNeckMode == 1:
if self.guitarSolo and self.guitarSoloNeck and self.guitarSoloNeckMode == 1:
neck = self.guitarSoloNeck
elif self.scoreMultiplier > 4 and self.bassGrooveNeck != None and self.bassGrooveNeckMode == 1:
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 self.ovrneckoverlay == False:
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.guitarSoloNeck != None and self.guitarSoloNeckMode == 2: #static overlay
if self.guitarSolo and self.guitarSoloNeck and self.guitarSoloNeckMode == 2: #static overlay
self.renderNeckMethod(v*self.neckAlpha[2], 0, self.guitarSoloNeck)

elif self.bgcount > 0 and self.bassGrooveNeck != None and self.bassGrooveNeckMode == 2: #static bass groove overlay
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 != None and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay == True):
if self.oNeckovr and (self.scoreMultiplier > 4 or self.guitarSolo or self.ovrneckoverlay):
neck = self.oNeckovr
alpha = False
else:
Expand All @@ -497,10 +499,8 @@ def renderNeck(self, visibility, song, pos):

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 == True): #static overlay
if self.oNeckovr != None:
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:
Expand Down

0 comments on commit d4dc102

Please sign in to comment.