Skip to content

Commit e3f3cca

Browse files
committed
Initialize all the things
1 parent accd9a5 commit e3f3cca

File tree

9 files changed

+54
-52
lines changed

9 files changed

+54
-52
lines changed

Bender.bmx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Import "Types/GraphicsOutput.bmx"
1717

1818
AppTitle = "CCCP Bender 1.3.0"
1919

20-
Global g_UserInterface:UserInterface
21-
Global g_FileIO:FileIO
22-
Global g_GraphicsOutput:GraphicsOutput
20+
Global g_UserInterface:UserInterface = Null
21+
Global g_FileIO:FileIO = Null
22+
Global g_GraphicsOutput:GraphicsOutput = Null
2323

2424
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2525

types/FileIO.bmx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Type FileIO
99
Field m_SaveAsIndexed:Int = False
1010
Field m_SaveAsFrames:Int = False
1111

12-
Field m_IndexedImageWriter:IndexedImageWriter
12+
Field m_IndexedImageWriter:IndexedImageWriter = Null
1313

1414
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1515

types/GraphicsOutput.bmx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ Type GraphicsOutput
99
Field m_MaxZoom:Int = 5 'Assume 1366px is the lowest resolution because it's not 1999. 1366px - 260px (left column) = 1106 / 192 (source image width) = 5 (floored)
1010
Field m_Magenta:Int[] = [255, 0, 255]
1111

12-
Field m_SourceImage:TImage
13-
Field m_SourceImageSize:SVec2I
12+
Field m_SourceImage:TImage = Null
13+
Field m_SourceImageSize:SVec2I = Null
1414

1515
Field m_InputZoom:Int = g_DefaultInputZoom
1616
Field m_TileSize:Int = 24 * m_InputZoom
1717
Field m_FrameCount:Int = g_DefaultFrameCount
1818
Field m_BackgroundColor:Int[] = [g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue]
1919

20-
Field m_DrawOutputFrameBounds:Int
20+
Field m_DrawOutputFrameBounds:Int = False
2121
Field m_FrameBoundingBoxPosX:Int[c_LimbCount, c_MaxFrameCount]
2222
Field m_FrameBoundingBoxPosY:Int[c_LimbCount, c_MaxFrameCount]
23-
Field m_FrameBoundingBoxSize:SVec2I
23+
Field m_FrameBoundingBoxSize:SVec2I = Null
2424

25-
Field m_LimbManager:LimbManager = New LimbManager()
25+
Field m_LimbManager:LimbManager = Null
2626

2727
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2828

@@ -31,6 +31,8 @@ Type GraphicsOutput
3131
SetMaskColor(m_Magenta[0], m_Magenta[1], m_Magenta[2])
3232

3333
m_MaxZoom = Int(FloorF(maxWorkspaceWidth / 192))
34+
35+
m_LimbManager = New LimbManager()
3436
EndMethod
3537

3638
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

types/IndexedImageWriter.bmx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Import "IndexedPixmap.bmx"
44
'//// RGB COLOR /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55

66
Struct RGBColor
7-
Field m_R:Byte
8-
Field m_G:Byte
9-
Field m_B:Byte
7+
Field m_R:Byte = 0
8+
Field m_G:Byte = 0
9+
Field m_B:Byte = 0
1010
EndStruct
1111

1212
'//// INDEXED IMAGE WRITER //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

types/IndexedPixmap.bmx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
'Since TPixmap does not support RGB332 format gotta set up this custom one
44
'Otherwise indexed PNG output is spaghetti because bad byte alignment (with RGB888/RGBA8888) or incorrect indexing (with I8)
55
Type IndexedPixmap
6-
Field m_Pixels:Byte Ptr
7-
Field m_Width:Int
8-
Field m_Height:Int
9-
Field m_Capacity:Size_T
6+
Field m_Pixels:Byte Ptr = Null
7+
Field m_Width:Int = 0
8+
Field m_Height:Int = 0
9+
Field m_Capacity:Size_T = 0
1010

1111
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1212

types/JointMarker.bmx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'//// JOINT MARKER //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
22

33
Type JointMarker
4-
Field m_ParentTilePosOnCanvas:SVec2I
5-
Field m_PosOnTileX:Int
6-
Field m_PosOnTileY:Int
7-
Field m_PosOnCanvasX:Int
8-
Field m_PosOnCanvasY:Int
9-
Field m_Radius:Int
10-
Field m_Selected:Int
4+
Field m_ParentTilePosOnCanvas:SVec2I = Null
5+
Field m_PosOnTileX:Int = 0
6+
Field m_PosOnTileY:Int = 0
7+
Field m_PosOnCanvasX:Int = 0
8+
Field m_PosOnCanvasY:Int = 0
9+
Field m_Radius:Int = 0
10+
Field m_Selected:Int = False
1111

1212
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1313

types/LimbManager.bmx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Type LimbManager
1111
Const c_MinExtend:Float = 0.30 'Possibly make definable in settings (slider)
1212
Const c_MaxExtend:Float = 0.99 'Possibly make definable in settings (slider)
1313

14-
Field m_InputZoom:Int
15-
Field m_TileSize:Int
14+
Field m_InputZoom:Int = 0
15+
Field m_TileSize:Int = 0
1616

1717
Field m_LimbPartTilePos:SVec2I[c_LimbPartCount]
1818
Field m_LimbPartImage:TImage[c_LimbPartCount]

types/UserInterface.bmx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,58 @@ Import "Utility.bmx"
66
'//// USER INTERFACE ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
77

88
Type UserInterface
9-
Field m_MainWindow:TGadget
9+
Field m_MainWindow:TGadget = Null
1010

11-
Field m_LeftColumn:TGadget
11+
Field m_LeftColumn:TGadget = Null
1212
Field m_LeftColumnSize:SVec2I = New SVec2I(260, 480)
1313

1414
'Canvas for graphics output
15-
Field m_CanvasGraphics:TGadget
15+
Field m_CanvasGraphics:TGadget = Null
1616
Field m_CanvasGraphicsAnchor:SVec2I = New SVec2I(m_LeftColumnSize[0], 0)
1717
Field m_CanvasGraphicsSize:SVec2I = New SVec2I(768, 480)
1818

1919
'Title bar buttons
20-
Field m_HelpMenu:TGadget
20+
Field m_HelpMenu:TGadget = Null
2121
Field m_HelpMenuText:String = LoadText("Incbin::Assets/TextHelp")
2222
Const c_HelpMenuTag:Int = 100
2323

24-
Field m_AboutMenu:TGadget
24+
Field m_AboutMenu:TGadget = Null
2525
Field m_AboutMenuText:String = LoadText("Incbin::Assets/TextAbout")
2626
Const c_AboutMenuTag:Int = 101
2727

28-
Field m_ButtonPanel:TGadget
28+
Field m_ButtonPanel:TGadget = Null
2929
Field m_ButtonPanelAnchor:SVec2I = New SVec2I(10, 5)
3030
Field m_ButtonPanelSize:SVec2I = New SVec2I(m_CanvasGraphicsAnchor[0] - 20, 55)
3131

32-
Field m_LoadButton:TGadget
33-
Field m_SaveButton:TGadget
32+
Field m_LoadButton:TGadget = Null
33+
Field m_SaveButton:TGadget = Null
3434

35-
Field m_SettingsPanel:TGadget
35+
Field m_SettingsPanel:TGadget = Null
3636
Field m_SettingsPanelAnchor:SVec2I = New SVec2I(10, m_ButtonPanelSize[1] + 15)
3737
Field m_SettingsPanelSize:SVec2I = New SVec2I(m_CanvasGraphicsAnchor[0] - 20, 175)
3838

39-
Field m_SettingsZoomLabel:TGadget
40-
Field m_SettingsZoomTextbox:TGadget
39+
Field m_SettingsZoomLabel:TGadget = Null
40+
Field m_SettingsZoomTextbox:TGadget = Null
4141

42-
Field m_SettingsFramesLabel:TGadget
43-
Field m_SettingsFramesTextbox:TGadget
42+
Field m_SettingsFramesLabel:TGadget = Null
43+
Field m_SettingsFramesTextbox:TGadget = Null
4444

45-
Field m_SettingsColorLabel:TGadget
46-
Field m_SettingsColorRLabel:TGadget
47-
Field m_SettingsColorRTextbox:TGadget
48-
Field m_SettingsColorGLabel:TGadget
49-
Field m_SettingsColorGTextbox:TGadget
50-
Field m_SettingsColorBLabel:TGadget
51-
Field m_SettingsColorBTextbox:TGadget
45+
Field m_SettingsColorLabel:TGadget = Null
46+
Field m_SettingsColorRLabel:TGadget = Null
47+
Field m_SettingsColorRTextbox:TGadget = Null
48+
Field m_SettingsColorGLabel:TGadget = Null
49+
Field m_SettingsColorGTextbox:TGadget = Null
50+
Field m_SettingsColorBLabel:TGadget = Null
51+
Field m_SettingsColorBTextbox:TGadget = Null
5252

53-
Field m_SettingsIndexedLabel:TGadget
54-
Field m_SettingsIndexedCheckbox:TGadget
53+
Field m_SettingsIndexedLabel:TGadget = Null
54+
Field m_SettingsIndexedCheckbox:TGadget = Null
5555

56-
Field m_SettingsSaveAsFramesLabel:TGadget
57-
Field m_SettingsSaveAsFramesCheckbox:TGadget
56+
Field m_SettingsSaveAsFramesLabel:TGadget = Null
57+
Field m_SettingsSaveAsFramesCheckbox:TGadget = Null
5858

5959
Field m_LogoImage:TPixmap = LoadPixmap("Incbin::Assets/Logo")
60-
Field m_LogoImagePanel:TGadget
60+
Field m_LogoImagePanel:TGadget = Null
6161
Field m_LogoImagePanelAnchor:SVec2I = New SVec2I(0, m_LeftColumnSize[1] - m_LogoImage.Height)
6262
Field m_LogoImagePanelSize:SVec2I = New SVec2I(m_LogoImage.Width, m_LogoImage.Height)
6363

types/Utility.bmx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Type Utility
55
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
66

77
Function LawOfCosines:Float[](ab:Float, bc:Float, ca:Float)
8-
Local result:Float[] = [0, 0, 0]
8+
Local result:Float[3]
99
result[0] = ACos((ca ^ 2 + ab ^ 2 - bc ^ 2) / (2 * ca * ab))
1010
result[1] = ACos(( bc ^ 2 + ab ^ 2 - ca ^ 2) / (2 * bc * ab))
1111
result[2] = 180 - (result[0] + result[1])
@@ -67,7 +67,7 @@ Type Utility
6767
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6868

6969
Function RotatePixmap:TPixmap(sourcePixmap:TPixmap, angle:Int)
70-
Local outputPixmap:TPixmap
70+
Local outputPixmap:TPixmap = Null
7171

7272
'This is pretty garbage but BlitzMax life is hard
7373
Select angle

0 commit comments

Comments
 (0)