fixes to viewport, config tuning

This commit is contained in:
2019-11-01 15:03:52 +03:00
parent a91351d3dc
commit c6c6b6254d
11 changed files with 228 additions and 173 deletions

20
engine/types/gamestate.go Normal file
View File

@@ -0,0 +1,20 @@
package types
type GameState struct {
Mainfunc chan func()
Exit chan struct{}
Input chan string
RawInput chan int
FovRecompute chan struct{}
Redraw chan struct{}
}
// do runs f on the main thread.
func (g *GameState) Do(f func()) {
done := make(chan struct{}, 1)
g.Mainfunc <- func() {
f()
done <- struct{}{}
}
<-done
}