@@ -18,7 +18,7 @@ Type GraphicsOutput
18
18
Global m_FrameCount:Int = g_DefaultFrameCount
19
19
Global m_BackgroundColor:Int [] = [g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue]
20
20
21
- Global m_PrepForSave :Int
21
+ Global m_DrawOutputFrameBounds :Int
22
22
23
23
Global m_LimbManager:LimbManager = New LimbManager ()
24
24
@@ -27,7 +27,6 @@ Type GraphicsOutput
27
27
Function InitializeGraphicsOutput ()
28
28
SetClsColor(m_BackgroundColor[ 0 ] , m_BackgroundColor[ 1 ] , m_BackgroundColor[ 2 ] )
29
29
SetMaskColor(c_Magenta[ 0 ] , c_Magenta[ 1 ] , c_Magenta[ 2 ] )
30
- DrawNoSourceImageScreen()
31
30
EndFunction
32
31
33
32
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -76,6 +75,12 @@ Type GraphicsOutput
76
75
SetClsColor(rgbValue[ 0 ] , rgbValue[ 1 ] , rgbValue[ 2 ] )
77
76
EndFunction
78
77
78
+ '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
79
+
80
+ Function SetDrawOutputFrameBounds (drawOrNot:Int )
81
+ m_DrawOutputFrameBounds = drawOrNot
82
+ EndFunction
83
+
79
84
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
80
85
81
86
Function Update ()
@@ -86,18 +91,15 @@ Type GraphicsOutput
86
91
m_LimbManager.SetJointMarker(mousePos)
87
92
EndIf
88
93
EndIf
89
-
90
- If m_PrepForSave
91
- ChangeBackgroundColor(c_Magenta)
92
- Else
93
- ChangeBackgroundColor(m_BackgroundColor)
94
- EndIf
94
+ ChangeBackgroundColor(m_BackgroundColor)
95
95
EndFunction
96
96
97
97
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98
98
99
99
Function Draw ()
100
- If m_SourceImage <> Null Then
100
+ If m_SourceImage = Null Then
101
+ DrawNoSourceImageScreen()
102
+ Else
101
103
Cls()
102
104
103
105
SetColor(c_Magenta[ 0 ] , c_Magenta[ 1 ] , c_Magenta[ 2 ] )
@@ -117,27 +119,37 @@ Type GraphicsOutput
117
119
Utility.DrawTextWithShadow(" Leg FG" , New SVec2I (10 , vertOffsetFromSource + (48 * 2 )), drawColor)
118
120
Utility.DrawTextWithShadow(" Leg BG" , New SVec2I (10 , vertOffsetFromSource + (48 * 3 )), drawColor)
119
121
122
+ If m_DrawOutputFrameBounds = True Then
123
+ For Local row:Int = 0 To 3
124
+ For Local frame:Int = 0 To m_FrameCount - 1
125
+ Local tile:TImage = LoadImage(" Incbin::Assets/Tile" )
126
+
127
+ 'Doing this with an image because cba doing the math with DrawLine. Offsets are -1px because tile image is 26x26 for outline and tile is 24x24.
128
+ DrawImage(tile, 62 + (frame * (m_TileSize / m_InputZoom + 8 )), 138 + (row * 48 ))
129
+ Next
130
+ Next
131
+ EndIf
120
132
Flip(1 )
121
133
EndIf
122
134
EndFunction
123
135
124
136
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
125
137
126
138
Function GrabOutputForSaving ()
139
+ Rem
140
+
127
141
If m_SourceImage = Null Then
128
142
Notify("Nothing to save!", False)
129
143
Else
130
- m_PrepForSave = True
144
+ ChangeBackgroundColor(c_Magenta)
145
+ Draw()
131
146
132
147
If Not g_FileIO.m_SaveAsFrames Then
133
148
g_FileIO.SaveFile(GrabPixmap(55, 120, 34 * m_FrameCount, 210))
134
149
Else
135
150
Local framesToSave:TPixmap[c_LimbCount, m_FrameCount]
136
- Local tile:TImage = LoadImage(" Incbin::Assets/Tile" )
137
151
For Local row:Int = 0 To 3
138
152
For Local frame:Int = 0 To m_FrameCount - 1
139
- 'Draw a tile outline around all frames to see we are within bounds
140
- DrawImage(tile, 62 + (frame * (m_TileSize / m_InputZoom + 8 )), 138 + (row * 48 )) 'Doing this with an image because cba doing the math with DrawLine. Offsets are -1px because tile image is 26x26 for outline and tile is 24x24.
141
153
'Grab pixmap inside tile bounds for saving
142
154
framesToSave[row, frame] = GrabPixmap(63 + (frame * (m_TileSize / m_InputZoom + 8)), 139 + (row * 48), m_TileSize / m_InputZoom, m_TileSize / m_InputZoom)
143
155
'HFlip the legs so they're facing right
@@ -148,9 +160,11 @@ Type GraphicsOutput
148
160
Next
149
161
g_FileIO.SaveFileAsFrames(framesToSave, m_FrameCount)
150
162
EndIf
151
- Flip(1 )
163
+
164
+ ChangeBackgroundColor(m_BackgroundColor)
152
165
EndIf
153
- m_PrepForSave = False
166
+
167
+ EndRem
154
168
EndFunction
155
169
156
170
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
0 commit comments