diff --git a/d2common/d2interface/renderer.go b/d2common/d2interface/renderer.go index 1843bf0a..a2313ee3 100644 --- a/d2common/d2interface/renderer.go +++ b/d2common/d2interface/renderer.go @@ -1,7 +1,5 @@ package d2interface -import "github.com/hajimehoshi/ebiten/v2" - type renderCallback = func(Surface) error type updateCallback = func() error @@ -21,6 +19,6 @@ type Renderer interface { GetCursorPos() (int, int) CurrentFPS() float64 ShowPanicScreen(message string) - Print(target *ebiten.Image, str string) error - PrintAt(target *ebiten.Image, str string, x, y int) + Print(target interface{}, str string) error + PrintAt(target interface{}, str string, x, y int) } diff --git a/d2common/d2util/debug_print.go b/d2common/d2util/debug_print.go index daa20386..489f28ae 100644 --- a/d2common/d2util/debug_print.go +++ b/d2common/d2util/debug_print.go @@ -37,16 +37,16 @@ type GlyphPrinter struct { // Basic Latin and C1 Controls and Latin-1 Supplement. // // DebugPrint always returns nil as of 1.5.0-alpha. -func (p *GlyphPrinter) Print(target *ebiten.Image, str string) error { - p.PrintAt(target, str, 0, 0) +func (p *GlyphPrinter) Print(target interface{}, str string) error { + p.PrintAt(target.(*ebiten.Image), str, 0, 0) return nil } // PrintAt draws the string str on the image at (x, y) position. // The available runes are in U+0000 to U+00FF, which is C0 Controls and // Basic Latin and C1 Controls and Latin-1 Supplement. -func (p *GlyphPrinter) PrintAt(target *ebiten.Image, str string, x, y int) { - p.drawDebugText(target, str, x, y, false) +func (p *GlyphPrinter) PrintAt(target interface{}, str string, x, y int) { + p.drawDebugText(target.(*ebiten.Image), str, x, y, false) } func (p *GlyphPrinter) drawDebugText(target *ebiten.Image, str string, ox, oy int, shadow bool) {