From a2cb2d03ca758d29450d183f63b05ffec98049b0 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Wed, 20 May 2020 19:45:45 +0200 Subject: [PATCH] Allegro CreateTexture{Go,Path} didn't respect source flag. --- allg5ui/renderer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/allg5ui/renderer.go b/allg5ui/renderer.go index d4c2fea..bd1b8de 100644 --- a/allg5ui/renderer.go +++ b/allg5ui/renderer.go @@ -200,7 +200,7 @@ func (r *Renderer) CreateTexture(source ui.ImageSource) (ui.Texture, error) { } func (r *Renderer) CreateTextureGo(im image.Image, source bool) (ui.Texture, error) { - return r.createTexture(ui.ImageSourceGo{im}, true) + return r.createTexture(ui.ImageSourceGo{Image: im}, source) } func (r *Renderer) CreateTexturePath(path string, source bool) (ui.Texture, error) { @@ -212,6 +212,9 @@ func (r *Renderer) CreateTexturePath(path string, source bool) (ui.Texture, erro if err != nil { return nil, err } + if source { + return &texture{bmp, ui.ImageSourceResource{Resources: r.res, Name: path}}, nil + } return &texture{bmp, nil}, nil }