doodle/pkg/level/inflate.go
Noah Petherbridge 0a8bce708e Actor Zoom + Experimental Settings GUI
Improvements to the Zoom feature:
* Actor position and size within your level scales up and down
  appropriately. The canvas size of the actor is scaled and its canvas
  is told the Zoom number of the parent so it will render its own
  graphic scaled correctly too.

Other features:
* "Experimental" tab added to the Settings window as a UI version of the
  --experimental CLI option. The option saves persistently to disk.
* The "Replace Palette" experimental feature now works better. Debating
  whether it's a useful feature to even have.
2021-09-11 21:18:22 -07:00

25 lines
690 B
Go

package level
/*
Inflate the level from its compressed JSON form.
This is called as part of the LoadJSON function when the level is read
from disk. In the JSON format, pixels in the level refer to the palette
by its index number.
This function calls the following:
* Chunker.Inflate(Palette) to update references to the level's pixels to point
to the Swatch entry.
* Actors.Inflate()
* Palette.Inflate() to load private instance values for the palette subsystem.
*/
func (l *Level) Inflate() {
// Inflate the chunk metadata to map the pixels to their palette indexes.
l.Chunker.Inflate(l.Palette)
l.Actors.Inflate()
// Inflate the private instance values.
l.Palette.Inflate()
}