Refactor Render Texture-Cache Interface
Since SDL2 is using in-memory bitmaps the same as Canvas engine, the function names of the render.Engine interface have been cleaned up: * NewTexture(filename, image) -> StoreTexture(name, image) Create a new cached texture with a given name. * NewBitmap(filename) -> LoadTexture(name) Recall a stored texture with a given name. * level.Chunk.ToBitmap uses simpler names for the textures instead of userdir.CacheFilename file-like paths.menus
ascendente
0efc577fa7
cometimento
90857fdd28
2
image.go
2
image.go
|
@ -55,7 +55,7 @@ func OpenImage(e render.Engine, filename string) (*Image, error) {
|
|||
return nil, fmt.Errorf("OpenImage: %s: not a supported image type", filename)
|
||||
}
|
||||
|
||||
tex, err := e.NewBitmap(filename)
|
||||
tex, err := e.LoadTexture(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Carregando…
Criar uma nova questão referindo esta