Skip to content

Commit 53b5677

Browse files
committed
Add safety to SetInputZoom
1 parent 3b721dc commit 53b5677

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Types/GraphicsOutput.bmx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ Type GraphicsOutput
6363
m_InputZoom = clampedNewZoom
6464
m_TileSize = 24 * m_InputZoom
6565

66-
m_SourceImageSize = New SVec2I(m_SourceImage.Width, m_SourceImage.Height)
67-
DrawImageRect(m_SourceImage, 0, 0, m_SourceImageSize[0] * m_InputZoom, m_SourceImageSize[1] * m_InputZoom) 'Draw the source image to the backbuffer so limb tiles can be created
68-
m_LimbManager.CreateLimbParts(m_InputZoom, m_TileSize)
66+
If m_SourceImage <> Null Then
67+
m_SourceImageSize = New SVec2I(m_SourceImage.Width, m_SourceImage.Height)
68+
DrawImageRect(m_SourceImage, 0, 0, m_SourceImageSize[0] * m_InputZoom, m_SourceImageSize[1] * m_InputZoom) 'Draw the source image to the backbuffer so limb tiles can be created
69+
m_LimbManager.CreateLimbParts(m_InputZoom, m_TileSize)
70+
EndIf
6971
EndIf
7072
Return m_InputZoom
7173
EndMethod

0 commit comments

Comments
 (0)