fixes to viewport, config tuning
This commit is contained in:
20
engine/types/gamestate.go
Normal file
20
engine/types/gamestate.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user