From 31e01987e5625465ace599ca7a218a1611df24f7 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 9 Apr 2019 17:47:03 -0700 Subject: [PATCH] Clean up extra log modules --- log.go | 14 -------------- sdl/events.go | 9 +++++++++ sdl/fps.go | 4 ---- sdl/log.go | 17 ----------------- sdl/sdl.go | 1 + 5 files changed, 10 insertions(+), 35 deletions(-) delete mode 100644 log.go delete mode 100644 sdl/log.go diff --git a/log.go b/log.go deleted file mode 100644 index 0891650..0000000 --- a/log.go +++ /dev/null @@ -1,14 +0,0 @@ -package render - -import "github.com/kirsle/golog" - -var log *golog.Logger - -func init() { - log = golog.GetLogger("doodle") - log.Configure(&golog.Config{ - Level: golog.DebugLevel, - Theme: golog.DarkTheme, - Colors: golog.ExtendedColor, - }) -} diff --git a/sdl/events.go b/sdl/events.go index f84b3c3..30f6917 100644 --- a/sdl/events.go +++ b/sdl/events.go @@ -4,9 +4,18 @@ import ( "errors" "git.kirsle.net/apps/doodle/lib/events" + "git.kirsle.net/apps/doodle/pkg/log" "github.com/veandco/go-sdl2/sdl" ) +// Debug certain SDL events +var ( + DebugWindowEvents = false + DebugMouseEvents = false + DebugClickEvents = false + DebugKeyEvents = false +) + // Poll for events. func (r *Renderer) Poll() (*events.State, error) { s := r.events diff --git a/sdl/fps.go b/sdl/fps.go index 31c1c17..cb503cb 100644 --- a/sdl/fps.go +++ b/sdl/fps.go @@ -1,7 +1,5 @@ package sdl -import "git.kirsle.net/apps/doodle/pkg/level" - // Frames to cache for FPS calculation. const ( maxSamples = 100 @@ -16,5 +14,3 @@ var ( fpsSkipped uint32 fpsInterval uint32 = 1000 ) - -var pixelHistory []level.Pixel diff --git a/sdl/log.go b/sdl/log.go deleted file mode 100644 index 00c5fef..0000000 --- a/sdl/log.go +++ /dev/null @@ -1,17 +0,0 @@ -package sdl - -import "github.com/kirsle/golog" - -var log *golog.Logger - -// Verbose debug logging. -var ( - DebugMouseEvents = false - DebugClickEvents = false - DebugKeyEvents = false - DebugWindowEvents = false -) - -func init() { - log = golog.GetLogger("doodle") -} diff --git a/sdl/sdl.go b/sdl/sdl.go index 538c3a1..e10c0de 100644 --- a/sdl/sdl.go +++ b/sdl/sdl.go @@ -6,6 +6,7 @@ import ( "git.kirsle.net/apps/doodle/lib/events" "git.kirsle.net/apps/doodle/lib/render" + "git.kirsle.net/apps/doodle/pkg/log" "github.com/veandco/go-sdl2/sdl" "github.com/veandco/go-sdl2/ttf" )