precomputed shade algo, viewport basic render

This commit is contained in:
anton.gurov
2019-10-30 17:56:30 +03:00
parent 4a77323aab
commit 3958951cd5
15 changed files with 924 additions and 26 deletions

View File

@ -3,6 +3,8 @@ package main
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"lab.zaar.be/thefish/alchemyst-go/engine/gamemap"
"lab.zaar.be/thefish/alchemyst-go/engine/gamemap/mapgens"
"lab.zaar.be/thefish/alchemyst-go/ui"
"lab.zaar.be/thefish/alchemyst-go/ui/mainwindow"
"lab.zaar.be/thefish/alchemyst-go/util"
@ -94,13 +96,13 @@ 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(20,40,"Ы", "#aa1257d4")
menuLayer.WithColor("white").PutWithBackground(21,40,"Щ", "#cd31ed12")
menuLayer.WithColor("yellow").PutWithBackground(22,40,"Ц", "#efcccccc")
menuLayer.WithColor("red").PutWithBackground(40,1,"Ы", "#aa1257d4")
menuLayer.WithColor("white").PutWithBackground(41,1,"Щ", "#cd31ed12")
menuLayer.WithColor("yellow").PutWithBackground(42,1,"Ц", "#efcccccc")
menuLayer.WithColor("red").PutWithBackground(39,1,"Ы", "#aa1257d4")
menuLayer.WithColor("white").PutWithBackground(40,1,"Щ", "#cd31ed12")
menuLayer.WithColor("yellow").PutWithBackground(41,1,"Ц", "#efcccccc")
bgLayer.WithColor("#77cfcfcf").NewWindow(45, 5, 40, 40).Splash()
@ -120,6 +122,11 @@ Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Ut tellus elementu
State.Do(initRender)
level := gamemap.NewLevel(ctx, "test", 1)
level = mapgens.DefaultGen(level)
vp := mainwindow.NewViewPort(40, 0, 60, 47, level, &baseLayer)
//main loop!
for {
//fresh inputs to chan
@ -158,6 +165,10 @@ Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Ut tellus elementu
baseLayer.Print(1, 5, key)
}
})
State.Do(func(){
vp.Render()
})
//update screen
State.Do(func() {
blt.Refresh()