func cls() { // Colours(col.ScreenF, col.ScreenB) if underX { xker.Clr(0, 0, nX[mode], nY[mode]) return } if !visible { return } B := cc(col.Code(col.ScreenB)) l := int(colourdepth) * int(nX[mode]) a := 0 for y := 0; y < int(nY[mode]); y++ { for x := 0; x < int(nX[mode]); x++ { copy(emptyBackground[a:a+int(colourdepth)], B) a += int(colourdepth) } } a = 0 for y := 0; y < int(nY[mode]); y++ { copy(fbmem[a:a+l], emptyBackground) copy(fbcop[a:a+l], emptyBackground) a += int(XX) * int(colourdepth) } setColours(col.ScreenB) }
func p6Dec(x, y uint, p []byte) []byte { // w, h, fix, n := p6dec(p) if w == 0 || h == 0 || fix != 255 { return nil } i := 4 * clz b := make([]byte, Codelen(w, h)) copy(b[:i], enc(x, y, w, h)) if underX { xker.P6Decode(x, y, w, h, p[n:], b[i:]) } else { j := int(n) di, dj := int(colourdepth), col.P6 var c col.Colour for y := uint(0); y < h; y++ { for x := uint(0); x < w; x++ { col.Decode(&c, p[j:j+dj]) copy(b[i:i+di], cc(col.Code(c))) i += di j += dj } } } return b }
func P6Decode(x, y, w, h uint, p, b []byte) { // var c col.Colour i, j := uint(0), uint(0) di := uint(clz) for y := uint(0); y < h; y++ { for x := uint(0); x < w; x++ { col.Decode(&c, p[j:j+col.P6]) copy(b[i:i+di], obj.Encode(col.Code(c))) i += di j += col.P6 } } }
func cc(c col.Colour) C.ulong { // return C.ulong(col.Code(c)) }