diff --git a/cmd/game/main.go b/cmd/game/main.go index 6a49366..903968e 100644 --- a/cmd/game/main.go +++ b/cmd/game/main.go @@ -94,6 +94,15 @@ Cursus in hac habitasse platea. Aliquet risus feugiat in ante metus dictum. Maec Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Ut tellus elementum sagittis vitae et leo duis ut diam. Elementum curabitur vitae nunc sed velit dignissim. Auctor elit sed vulputate mi sit. Consectetur adipiscing elit ut aliquam purus. Feugiat vivamus at augue eget arcu. Duis ut diam quam nulla porttitor massa id neque. Pharetra magna ac placerat vestibulum lectus mauris ultrices. Non sodales neque sodales ut etiam. Massa ultricies mi quis hendrerit dolor. Est sit amet facilisis magna etiam. Ornare suspendisse sed nisi lacus sed viverra tellus in. `) + menuLayer.WithColor("red").PutWithBackground(40,40,"Ы", "#aa1257d4") + menuLayer.WithColor("white").PutWithBackground(41,40,"Щ", "#cd31ed12") + menuLayer.WithColor("yellow").PutWithBackground(42,40,"Ц", "#efcccccc") + + menuLayer.WithColor("red").PutWithBackground(40,1,"Ы", "#aa1257d4") + menuLayer.WithColor("white").PutWithBackground(41,1,"Щ", "#cd31ed12") + menuLayer.WithColor("yellow").PutWithBackground(42,1,"Ц", "#efcccccc") + + bgLayer.WithColor("#77cfcfcf").NewWindow(45, 5, 40, 40).Splash() menuLayer.WithColor("#aaed26ca").NewWindow(45, 5, 40, 40).DoubleBordered("Transparent BG window test") blt.PrintExt(46, 6, 40, 39, 1, `Lorem mollis aliquam ut porttitor leo a diam sollicitudin tempor. Convallis tellus id interdum velit. Enim nunc faucibus a pellentesque. Tincidunt augue interdum velit euismod in pellentesque massa placerat duis. Leo duis ut diam quam nulla porttitor massa id. Eu feugiat pretium nibh ipsum consequat nisl. Eget est lorem ipsum dolor sit amet. Et sollicitudin ac orci phasellus egestas. Donec adipiscing tristique risus nec. Et molestie ac feugiat sed. Ante in nibh mauris cursus mattis molestie a iaculis at. Neque laoreet suspendisse interdum consectetur. Vitae et leo duis ut diam quam nulla. Sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra. Ornare lectus sit amet est placerat in egestas erat. @@ -105,6 +114,7 @@ Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Ut tellus elementu baseLayer.Print(1, 1, "Hello, [font=bold]world[/font]!") baseLayer.Print(1, 4, "Testing line-[color=orange]spacing[/color]") + blt.Refresh() } diff --git a/ui/mainwindow/layer.go b/ui/mainwindow/layer.go index 47621ec..4157e07 100644 --- a/ui/mainwindow/layer.go +++ b/ui/mainwindow/layer.go @@ -45,11 +45,14 @@ func (layer *Layer) PutWithRawBackground(x,y int, symbol interface{}, bgColor ui func (layer *Layer) PutWithBackground(x,y int, symbol interface{}, bgColorName string) { layer.before() prevColor := uint32(blt.State(blt.TK_COLOR)) + prevCompMode := blt.State(blt.TK_COMPOSITION) c := blt.ColorFromName(bgColorName) blt.Color(c) + blt.Composition(1) layer.Put(x,y,"█") blt.Color(prevColor) layer.Put(x,y, symbol) + blt.Composition(prevCompMode) } func (layer *Layer) after() *Layer { diff --git a/ui/mainwindow/viewport.go b/ui/mainwindow/viewport.go index 93a574a..8d7e273 100644 --- a/ui/mainwindow/viewport.go +++ b/ui/mainwindow/viewport.go @@ -53,49 +53,49 @@ func (vp *ViewPort) ToVPCoords(c *types.Coords) (newCoords *types.Coords, err er } //call only from main thread -func (vp *ViewPort) Render() { - //fixme get these from state chan(s) - var fpsTicker int - var fovRecompute bool - redraw := false - //fixme get player instance - - vp.Move(player.Coords) - //fixme detect fovRecompute - if fovRecompute { - vp.layer.Clear(vp.Rect) - fovRecompute = false - redraw = true - //fixme - vp.level.ComputeFov(FovMap, player.Coords, player.TorchRadius, FovLightWalls, FovAlgo) - } - //increase ticker - fpsTicker++ - - if redraw || fpsTicker % (FPS_LIMIT / 10) == 0 { - fpsTicker := 0 - - for y:=0; y < vp.H; y++ { - for x:=0; x