fond memleak, colordance broken
This commit is contained in:
@ -54,6 +54,22 @@ func (layer *Layer) PutWithBackground(x,y int, symbol interface{}, bgColorName s
|
||||
blt.Composition(prevCompMode)
|
||||
}
|
||||
|
||||
func (Layer *Layer) PutToBase(x,y int, symbol interface{}, fg uint32, bg uint32) {
|
||||
if symbol == nil {
|
||||
return
|
||||
}
|
||||
rnes := []rune(symbol.(string))
|
||||
prevColor := uint32(blt.State(blt.TK_COLOR))
|
||||
prevBgColor := uint32(blt.State(blt.TK_BKCOLOR))
|
||||
blt.BkColor(bg)
|
||||
blt.Color(fg)
|
||||
if (len(rnes)) > 0 {
|
||||
blt.Put(x, y, int(rnes[0]))
|
||||
}
|
||||
blt.Color(prevColor)
|
||||
blt.BkColor(prevBgColor)
|
||||
}
|
||||
|
||||
func (layer *Layer) after() *Layer {
|
||||
blt.Color(layer.defaultColor)
|
||||
blt.Layer(0)
|
||||
|
Reference in New Issue
Block a user