Skip to content

Commit a43239c

Browse files
committed
Small code formatting to end the day
1 parent 20bdd93 commit a43239c

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

pkg/audio.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ type AudioPlayer struct {
2020
done chan bool
2121
}
2222

23-
// Opens a audio file. It supports two file formats: WAV and MP3. Plays the audio file using Start function. Stop the audio file using Stop function. Close the audio file using Close function.
23+
// Opens a audio file. It supports two file formats: WAV and MP3.
24+
// Plays the audio file using Start function. Stop the audio file using Stop function.
25+
// Close the audio file using Close function.
2426
func OpenAudioFile(filePath string) AudioPlayer {
2527
f, err := os.Open(filePath)
2628
if err != nil {

pkg/draw.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ func (r *Renderer2D) DrawRect(x, y, width, height float32, color [4]int) {
77
gl.Begin(gl.QUADS)
88
defer gl.End()
99

10-
gl.Color4f(float32(color[0]/255), float32(color[1]/255), float32(color[2]/255), float32(color[3]/255))
10+
gl.Color4f(
11+
float32(color[0]/255),
12+
float32(color[1]/255),
13+
float32(color[2]/255),
14+
float32(color[3]/255),
15+
)
1116
gl.Vertex2f(x, y)
1217
gl.Vertex2f(x+width, y)
1318
gl.Vertex2f(x+width, y+height)
@@ -16,7 +21,12 @@ func (r *Renderer2D) DrawRect(x, y, width, height float32, color [4]int) {
1621

1722
// Clears the screen whith the specific color that is provided
1823
func (r *Renderer2D) ClearColor(color [4]int) {
19-
gl.ClearColor(float32(color[0]/255), float32(color[1]/255), float32(color[2]/255), float32(color[3]/255))
24+
gl.ClearColor(
25+
float32(color[0]/255),
26+
float32(color[1]/255),
27+
float32(color[2]/255),
28+
float32(color[3]/255),
29+
)
2030
}
2131

2232
// Draws a new line by the given x1, x2, y1, y2 and color
@@ -26,7 +36,12 @@ func (r *Renderer2D) DrawLine(x1, x2, y1, y2 float32, color [4]int) {
2636
gl.Begin(gl.LINES)
2737
defer gl.End()
2838

29-
gl.Color4f(float32(color[0]/255), float32(color[1]/255), float32(color[2]/255), float32(color[3]/255))
39+
gl.Color4f(
40+
float32(color[0]/255),
41+
float32(color[1]/255),
42+
float32(color[2]/255),
43+
float32(color[3]/255),
44+
)
3045
gl.Vertex2f(x1, y1)
3146
gl.Vertex2f(x2, y2)
3247
}

0 commit comments

Comments
 (0)