Speed up drawing and experiment with using rotation on the draw operation to get the right coordinates

This commit is contained in:
2018-03-23 01:27:38 +00:00
parent 7111e2e89b
commit c69beafa76
2 changed files with 49 additions and 30 deletions

View File

@@ -19,6 +19,7 @@ type Sprite struct {
Height int
Pic *pixel.PictureData
Spr *pixel.Sprite
}
type Object struct {
@@ -33,10 +34,12 @@ func ConvertObject(rawObj *data.Object, name string) *Object {
}
for i, rawSpr := range rawObj.Sprites {
pic := spriteToPic(rawSpr)
out.Sprites[i] = Sprite{
Width: int(rawSpr.Width),
Height: int(rawSpr.Height),
Pic: spriteToPic(rawSpr),
Pic: pic,
Spr: pixel.NewSprite(pic, pic.Bounds()),
}
}