Skip to content

Commit

Permalink
Prevents crashing when an image is not found for drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
erodozer committed Mar 6, 2011
1 parent ce1c4fd commit eb1a973
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/GameEngine.py
Expand Up @@ -45,7 +45,7 @@
from Resource import Resource
from Data import Data
from World import World
from Svg import SvgContext
from Svg import SvgContext, ImgDrawing
#alarian
#from Song import EAS_DIF, MED_DIF, HAR_DIF, EXP_DIF
from Debug import DebugLayer
Expand Down Expand Up @@ -862,6 +862,9 @@ def drawImage(self, image, scale = (1.0, -1.0), coord = (0, 0), rot = 0, \
on the bottom side (0), center point (1), or top(2) side of the image
"""

if not isinstance(image, ImgDrawing):
return

width, height = scale
x, y = coord
if stretched == 1: # fit to width
Expand Down Expand Up @@ -923,6 +926,10 @@ def draw3Dtex(self, image, vertex, texcoord, coord = None, scale = None, rot = N
only really used by notes
'''


if not isinstance(image, ImgDrawing):
return

if alpha == True:
glBlendFunc(GL_SRC_ALPHA, GL_ONE)

Expand Down

0 comments on commit eb1a973

Please sign in to comment.