Skip to content

Commit 3d81926

Browse files
committed
mm
1 parent 7ff6c64 commit 3d81926

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

assets/assets.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (loader *Loader) AssertBufferFullyUtilized() {
123123
var buf [100]byte
124124
n := copy(buf[:], "All assets loaded. Total size: ")
125125
n += util.FormatIntInto(buf[n:], loader.used)
126-
firefly.LogDebug(string(buf[:n]))
126+
firefly.LogDebugBytes(buf[:n])
127127

128128
if len(loader.buf) > 0 {
129129
var buf [100]byte
@@ -132,8 +132,7 @@ func (loader *Loader) AssertBufferFullyUtilized() {
132132
n += copy(buf[n:], "]byte, but got [")
133133
n += util.FormatIntInto(buf[n:], loader.used+len(loader.buf))
134134
n += copy(buf[n:], "]byte")
135-
err := string(buf[:n])
136-
firefly.LogError(err)
135+
firefly.LogErrorBytes(buf[:n])
137136
panic("assets.Loader: buffer was not fully utilized")
138137
}
139138
}

pkg/state/state.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package state
22

33
import (
4-
"strconv"
5-
64
"github.com/applejag/epic-wizard-firefly-gladiators/pkg/util"
75
"github.com/applejag/firefly-go-math/ffrand"
86

@@ -80,11 +78,11 @@ func (g *GameState) Save() {
8078
}
8179
firefly.DumpFile("save", save)
8280

83-
var buf [len("saved game, size: ") + 10 + len(" B")]byte
84-
index := copy(buf[0:], "saved game, size: ")
85-
index += util.FormatIntInto(buf[index:], len(save))
86-
index += copy(buf[index:], " B")
87-
util.LogDebugBytes(buf[:index])
81+
var buf [32]byte
82+
n := copy(buf[0:], "saved game, size: ")
83+
n += util.FormatIntInto(buf[n:], len(save))
84+
n += copy(buf[n:], " B")
85+
util.LogDebugBytes(buf[:n])
8886
}
8987

9088
func (g *GameState) HasSave() bool {
@@ -102,7 +100,11 @@ func (g *GameState) LoadSave() bool {
102100
return false
103101
}
104102

105-
firefly.LogDebug("loaded saved game, size: " + strconv.Itoa(len(file)) + " B")
103+
var buf [42]byte
104+
n := copy(buf[0:], "loaded saved game, size: ")
105+
n += util.FormatIntInto(buf[n:], len(file))
106+
n += copy(buf[n:], " B")
107+
firefly.LogDebugBytes(buf[:n])
106108
return true
107109
}
108110

0 commit comments

Comments
 (0)