Example #1
0
func loadWildMin(ls *persist.LoadSaver) Frame {
	return WildMin{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
Example #2
0
func loadFixed(ls *persist.LoadSaver) Frame {
	return Fixed{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
Example #3
0
// Load a frame from a persist.LoadSaver
func Load(ls *persist.LoadSaver) Frame {
	id := ls.LoadByte()
	l := loaders[int(id)]
	if l == nil {
		if ls.Err == nil {
			ls.Err = errors.New("bad frame loader")
		}
		return nil
	}
	return l(ls)
}
Example #4
0
// LoadIdentifier applies the appropriate IdentifierLoader to load an identifier.
func LoadIdentifier(ls *persist.LoadSaver) Identifier {
	id := ls.LoadByte()
	l := loaders[int(id)]
	if l == nil {
		if ls.Err == nil {
			ls.Err = errors.New("bad identifier loader")
		}
		return nil
	}
	return l(ls)
}
Example #5
0
func loadKeyFrames(ls *persist.LoadSaver) [][]keyFrame {
	kfs := make([][]keyFrame, ls.LoadSmallInt())
	for i := range kfs {
		kfs[i] = make([]keyFrame, ls.LoadSmallInt())
		for j := range kfs[i] {
			kfs[i][j].typ = frames.OffType(ls.LoadByte())
			kfs[i][j].seg.pMin = int64(ls.LoadInt())
			kfs[i][j].seg.pMax = int64(ls.LoadInt())
			kfs[i][j].seg.lMin = ls.LoadSmallInt()
			kfs[i][j].seg.lMax = ls.LoadSmallInt()
			kfs[i][j].key.pMin = int64(ls.LoadInt())
			kfs[i][j].key.pMax = int64(ls.LoadInt())
			kfs[i][j].key.lMin = ls.LoadSmallInt()
			kfs[i][j].key.lMax = ls.LoadSmallInt()
		}
	}
	return kfs
}
Example #6
0
func loadAnyMask(ls *persist.LoadSaver) patterns.Pattern {
	return AnyMask(ls.LoadByte())
}