1
- Include " LimbManager.bmx "
1
+ Import " SettingsManager.bmx "
2
+ Import " LimbManager.bmx "
2
3
3
4
'//// GRAPHICS OUTPUT ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4
5
5
6
Type GraphicsOutput
6
7
'Draw Bools
7
- Global m_RedoLimbTiles:Int = False
8
+ Field m_RedoLimbTiles:Int = False
8
9
'Constants
9
10
Const c_MaxZoom:Int = 11
10
11
Const c_MaxFrameCount:Int = 20
11
- Global c_Magenta:Int [] = [255 , 0 , 255 ]
12
+ Field c_Magenta:Int [] = [255 , 0 , 255 ]
12
13
'Graphic Assets
13
- Global m_SourceImage:TImage
14
- Global m_SourceImageSize:Svec2I
14
+ Field m_SourceImage:TImage
15
+ Field m_SourceImageSize:Svec2I
15
16
'Output Settings
16
- Global m_InputZoom:Int = g_DefaultInputZoom
17
- Global m_TileSize:Int = 24 * m_InputZoom
18
- Global m_FrameCount:Int = g_DefaultFrameCount
19
- Global m_BackgroundColor:Int [] = [g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue]
17
+ Field m_InputZoom:Int = g_DefaultInputZoom
18
+ Field m_TileSize:Int = 24 * m_InputZoom
19
+ Field m_FrameCount:Int = g_DefaultFrameCount
20
+ Field m_BackgroundColor:Int [] = [g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue]
20
21
21
- Global m_DrawOutputFrameBounds:Int
22
+ Field m_DrawOutputFrameBounds:Int
22
23
23
- Global m_LimbManager:LimbManager = New LimbManager ()
24
+ Field m_LimbManager:LimbManager = New LimbManager ()
24
25
25
26
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
26
27
27
- Function InitializeGraphicsOutput ()
28
+ Method New ()
28
29
SetClsColor(m_BackgroundColor[ 0 ] , m_BackgroundColor[ 1 ] , m_BackgroundColor[ 2 ] )
29
30
SetMaskColor(c_Magenta[ 0 ] , c_Magenta[ 1 ] , c_Magenta[ 2 ] )
30
- EndFunction
31
+ EndMethod
31
32
32
33
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
33
34
34
- Function LoadFile (fileToLoad:String )
35
+ Method LoadFile (fileToLoad:String )
35
36
m_SourceImage = LoadImage(fileToLoad, 0 )
36
37
37
38
If m_SourceImage <> Null Then
38
39
m_SourceImageSize = New SVec2I (ImageWidth(m_SourceImage), ImageHeight(m_SourceImage))
39
40
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
40
41
m_LimbManager.CreateLimbParts(m_InputZoom, m_TileSize)
41
42
EndIf
42
- EndFunction
43
+ EndMethod
43
44
44
45
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
45
46
46
- Function SetBackgroundColor :Int [] (rgbValue:Int [] )
47
+ Method SetBackgroundColor :Int [] (rgbValue:Int [] )
47
48
m_BackgroundColor = rgbValue
48
49
ChangeBackgroundColor(m_BackgroundColor)
49
50
Return m_BackgroundColor
50
- EndFunction
51
+ EndMethod
51
52
52
53
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
53
54
54
- Function SetInputZoom :Int (newZoom:Int )
55
+ Method SetInputZoom :Int (newZoom:Int )
55
56
Local clampedNewZoom:Int = Utility.Clamp(newZoom, 1 , c_MaxZoom)
56
57
If m_InputZoom <> clampedNewZoom Then
57
58
m_InputZoom = clampedNewZoom
@@ -60,30 +61,30 @@ Type GraphicsOutput
60
61
m_LimbManager.CreateLimbParts(m_InputZoom, m_TileSize)
61
62
EndIf
62
63
Return m_InputZoom
63
- EndFunction
64
+ EndMethod
64
65
65
66
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
66
67
67
- Function SetFrameCount :Int (newCount:Int )
68
+ Method SetFrameCount :Int (newCount:Int )
68
69
m_FrameCount = Utility.Clamp(newCount, 1 , c_MaxFrameCount)
69
70
Return m_FrameCount
70
- EndFunction
71
+ EndMethod
71
72
72
73
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
73
74
74
- Function ChangeBackgroundColor (rgbValue:Int [] )
75
+ Method ChangeBackgroundColor (rgbValue:Int [] )
75
76
SetClsColor(rgbValue[ 0 ] , rgbValue[ 1 ] , rgbValue[ 2 ] )
76
- EndFunction
77
+ EndMethod
77
78
78
79
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
79
80
80
- Function SetDrawOutputFrameBounds (drawOrNot:Int )
81
+ Method SetDrawOutputFrameBounds (drawOrNot:Int )
81
82
m_DrawOutputFrameBounds = drawOrNot
82
- EndFunction
83
+ EndMethod
83
84
84
85
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
85
86
86
- Function Update ()
87
+ Method Update ()
87
88
'Left mouse to adjust joint markers, click or hold and drag
88
89
If MouseDown(1 ) Then
89
90
Local mousePos:SVec2I = New SVec2I (MouseX(), MouseY())
@@ -92,11 +93,11 @@ Type GraphicsOutput
92
93
EndIf
93
94
EndIf
94
95
ChangeBackgroundColor(m_BackgroundColor)
95
- EndFunction
96
+ EndMethod
96
97
97
98
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98
99
99
- Function Draw ()
100
+ Method Draw ()
100
101
If m_SourceImage = Null Then
101
102
DrawNoSourceImageScreen()
102
103
Else
@@ -131,11 +132,11 @@ Type GraphicsOutput
131
132
EndIf
132
133
Flip(1 )
133
134
EndIf
134
- EndFunction
135
+ EndMethod
135
136
136
137
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
137
138
138
- Function GrabOutputForSaving ()
139
+ Method GrabOutputForSaving ()
139
140
Rem
140
141
141
142
If m_SourceImage = Null Then
@@ -165,17 +166,17 @@ Type GraphicsOutput
165
166
EndIf
166
167
167
168
EndRem
168
- EndFunction
169
+ EndMethod
169
170
170
171
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
171
172
172
- Function DrawNoSourceImageScreen ()
173
+ Method DrawNoSourceImageScreen ()
173
174
Cls()
174
175
SetScale(2 , 2 )
175
176
Local textToDraw:String = " NO IMAGE LOADED!"
176
177
Local drawColor:Int [] = [ 255 , 230 , 80 ]
177
178
Utility.DrawTextWithShadow(textToDraw, New SVec2I ((GraphicsWidth() / 2 ) - TextWidth(textToDraw), (GraphicsHeight() / 2 ) - TextHeight(textToDraw)), drawColor)
178
179
SetScale(1 , 1 )
179
180
Flip(1 )
180
- EndFunction
181
+ EndMethod
181
182
EndType
0 commit comments