diff --git a/collision/label.go b/collision/label.go index 44061986..633d41b3 100644 --- a/collision/label.go +++ b/collision/label.go @@ -3,7 +3,6 @@ package collision const ( // NilLabel is used internally for spaces that are otherwise not // given labels. - // TODO V3: why is this exported NilLabel Label = -1 ) diff --git a/config.go b/config.go index a6fb14fa..7233308f 100644 --- a/config.go +++ b/config.go @@ -164,8 +164,6 @@ func ReaderConfig(r io.Reader) ConfigOption { } func (c Config) overwriteFrom(c2 Config) Config { - // TODO: is this the right place for these configuration pieces? - // TODO: is there other configuration that should go here? if c2.Assets.AudioPath != "" { c.Assets.AudioPath = c2.Assets.AudioPath } diff --git a/dlog/default.go b/dlog/default.go index b7d58c3d..84511614 100644 --- a/dlog/default.go +++ b/dlog/default.go @@ -43,8 +43,6 @@ func NewLogger() Logger { // containing the logged data separated by spaces, // prepended with file and line information. // It only includes logs which pass the current filters. -// Todo: use io.Multiwriter to simplify the writing to -// both logfiles and stdout func (l *logger) dLog(level Level, in ...interface{}) { //(pc uintptr, file string, line int, ok bool) _, f, line, ok := runtime.Caller(2) diff --git a/event/bus.go b/event/bus.go index 2d27284c..fd40d082 100644 --- a/event/bus.go +++ b/event/bus.go @@ -60,6 +60,11 @@ func NewBus(callerMap *CallerMap) *Bus { } } +// SetCallerMap updates a bus to use a specific set of callers. +func (b *Bus) SetCallerMap(cm *CallerMap) { + b.callerMap = cm +} + // An Event is an event name and an associated caller id type Event struct { Name string diff --git a/event/handler.go b/event/handler.go index 70c31be3..89624e7e 100644 --- a/event/handler.go +++ b/event/handler.go @@ -14,8 +14,6 @@ var ( // Handler represents the necessary exported functions from an event.Bus // for use in oak internally, and thus the functions that need to be replaced // by alternative event handlers. -// TODO V3: consider breaking down the bus into smaller components -// for easier composition for external handler implementations type Handler interface { WaitForEvent(name string) <-chan interface{} // @@ -42,6 +40,11 @@ type Handler interface { UnbindBindable(UnbindOption) } +// A CallerMapper has an internal caller map that can be set. +type CallerMapper interface { + SetCallerMap(*CallerMap) +} + // UpdateLoop is expected to internally call Update() // or do something equivalent at the given frameRate, // sending signals to the sceneCh after each Update(). diff --git a/mouse/mouse.go b/mouse/mouse.go index da12e54f..7fcd47c1 100644 --- a/mouse/mouse.go +++ b/mouse/mouse.go @@ -20,8 +20,6 @@ const ( ButtonNone = mouse.ButtonNone ) -//TODO V3: should event names be strings? - // GetEventName returns a string event name given some mobile/mouse information func GetEventName(d mouse.Direction, b mouse.Button) string { switch d { diff --git a/sceneLoop.go b/sceneLoop.go index 42b3d9e1..e4a31e8c 100644 --- a/sceneLoop.go +++ b/sceneLoop.go @@ -130,6 +130,9 @@ func (w *Window) sceneLoop(first string, trackingInputs bool) { } else { w.CallerMap = event.NewCallerMap() } + if cmr, ok := w.eventHandler.(event.CallerMapper); ok { + cmr.SetCallerMap(w.CallerMap) + } w.DrawStack.Clear() w.DrawStack.PreDraw() diff --git a/viewport_test.go b/viewport_test.go index 3bf26b4c..96a3d113 100644 --- a/viewport_test.go +++ b/viewport_test.go @@ -9,7 +9,7 @@ import ( ) func sleep() { - // TODO V3: test how far we can bring this down and get consistent results + // TODO: test how far we can bring this down and get consistent results time.Sleep(300 * time.Millisecond) }