Beispiel #1
0
func loadWildMin(ls *persist.LoadSaver) Frame {
	return WildMin{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
Beispiel #2
0
func loadFixed(ls *persist.LoadSaver) Frame {
	return Fixed{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
Beispiel #3
0
// Load loads the Pattern, choosing the correct Loader by the leading id byte.
func Load(ls *persist.LoadSaver) Pattern {
	id := ls.LoadByte()
	l := loaders[int(id)]
	if l == nil {
		if ls.Err == nil {
			ls.Err = errors.New("bad pattern loader")
		}
		return nil
	}
	return l(ls)
}
Beispiel #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)
}
Beispiel #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
}
Beispiel #6
0
func loadAnyMask(ls *persist.LoadSaver) Pattern {
	return AnyMask(ls.LoadByte())
}
Beispiel #7
0
func loadInt8(ls *persist.LoadSaver) patterns.Pattern {
	return Int8(ls.LoadByte())
}