Skip to content

Commit 0a2d2a0

Browse files
committed
Saved frames are now rotated correctly so no extra manual labor needed
1 parent ec86395 commit 0a2d2a0

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Bender.bmx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Repeat
2727
g_UserInterface = New UserInterface(g_DefaultInputZoom, g_DefaultFrameCount, g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue)
2828
g_FileIO = New FileIO()
2929
g_GraphicsOutput = New GraphicsOutput()
30+
EnablePolledInput()
3031

3132
Repeat
3233
PollEvent()

types/FileIO.bmx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Type FileIO
7878
Notify("Failed to save file: " + filename)
7979
EndIf
8080
EndIf
81-
Return True 'Retrun something to indicate function finished so workspace can be reverted
81+
Return True 'Return something to indicate function finished so workspace can be reverted
8282
EndMethod
8383

8484
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

types/GraphicsOutput.bmx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ Type GraphicsOutput
175175
Flip(1) 'Have to flip again for background color to actually change, not sure why but whatever
176176

177177
Local framesToSave:TPixmap[c_LimbCount, m_FrameCount]
178-
For Local row:Int = 0 To 3
178+
For Local row:Int = 0 Until c_LimbCount
179+
Local rotationAngle:Int = -90
180+
If row >= 2 Then
181+
rotationAngle = 90
182+
EndIf
179183
For Local frame:Int = 0 Until m_FrameCount
180-
'Grab pixmap inside tile bounds for saving
181-
framesToSave[row, frame] = GrabPixmap(63 + (frame * (m_TileSize / m_InputZoom + 8)), 139 + (row * 48), m_TileSize / m_InputZoom, m_TileSize / m_InputZoom)
182-
'HFlip the legs so they're facing right
184+
framesToSave[row, frame] = Utility.RotatePixmap(GrabPixmap(m_FrameBoundingBoxPosX[row, frame] + 1, m_FrameBoundingBoxPosY[row, frame] + 1, m_FrameBoundingBoxSize[0] - 1, m_FrameBoundingBoxSize[1] - 1), rotationAngle)
185+
'HFlip the legs so they're facing the right direction
183186
If row >= 2 Then
184187
framesToSave[row, frame] = XFlipPixmap(framesToSave[row, frame])
185188
EndIf

types/UserInterface.bmx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ Type UserInterface
126126

127127
m_LogoImagePanel = CreatePanel(m_LogoImagePanelAnchor[0], m_LogoImagePanelAnchor[1], m_LogoImagePanelSize[0], m_LogoImagePanelSize[1], m_LeftColumn, Null)
128128
SetPanelPixmap(m_LogoImagePanel, m_LogoImage, PANELPIXMAP_CENTER)
129-
130-
EnablePolledInput()
131129
EndMethod
132130

133131
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)