Exemplo n.º 1
0
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)
}
Exemplo n.º 2
0
func clear(L, C, W, H uint) {
	//
	Colours(col.ScreenF, col.ScreenB)
	x := C * actualCharwidth
	y := L * actualCharheight
	if underX {
		xker.Clr(x, y, W*actualCharwidth, H*actualCharheight)
	} else {
		ClearGr(x, y, x+W*actualCharwidth-0 /* 0 ? */, y+H*actualCharheight-1)
	}
}
Exemplo n.º 3
0
func clearGr(x, y, x1, y1 uint) {
	//
	if !rectangleOk(&x, &y, &x1, &y1) {
		return
	}
	if underX {
		xker.Clr(x, y, x1-x+1, y1-y+1)
	} else {
		if !visible {
			return
		}
		dx := int(x1-x) * int(colourdepth)
		dy := int(nX[maxMode]) * int(colourdepth)
		a := int(y*nX[maxMode]+x) * int(colourdepth)
		for z := uint(0); z <= y1-y; z++ {
			copy(fbmem[a:a+dx], emptyBackground[0:dx])
			a += dy
		}
	}
}
Exemplo n.º 4
0
func initX() {
	//
	visible = true
	mode = defaultMode
	XX, YY, colourdepth = xker.Init(nX[mode], nY[mode], col.ScreenF, col.ScreenB)
	maxMode = Mode(0)
	for {
		if XX == nX[maxMode] && YY == nY[maxMode] {
			break
		} else if maxMode+1 < NModes {
			maxMode++
		} else {
			mode = defaultMode
			XX, YY = nX[mode], nY[mode]
			break
		}
	}
	xker.Colours(col.ScreenF, col.ScreenB) // !
	xker.Clr(0, 0, nX[mode], nY[mode])
	swFontsize(font.Normal)
	go blink()
	// ker.InstallTerm (terminateX ())
}