2023-04-02 11:11:09 +02:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
2023-04-09 11:16:41 +02:00
|
|
|
"git.defalsify.org/festive/cache"
|
2023-04-02 11:11:09 +02:00
|
|
|
"git.defalsify.org/festive/resource"
|
2023-04-09 11:16:41 +02:00
|
|
|
"git.defalsify.org/festive/state"
|
2023-04-02 11:11:09 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func NewDefaultEngine(dir string) Engine {
|
|
|
|
st := state.NewState(0)
|
|
|
|
rs := resource.NewFsResource(dir)
|
2023-04-09 11:16:41 +02:00
|
|
|
ca := cache.NewCache()
|
2023-04-10 17:12:22 +02:00
|
|
|
return NewEngine(Config{}, &st, &rs, ca)
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSizedEngine(dir string, size uint32) Engine {
|
|
|
|
st := state.NewState(0)
|
|
|
|
rs := resource.NewFsResource(dir)
|
|
|
|
ca := cache.NewCache()
|
|
|
|
cfg := Config{
|
|
|
|
OutputSize: size,
|
|
|
|
}
|
|
|
|
return NewEngine(cfg, &st, &rs, ca)
|
2023-04-02 11:11:09 +02:00
|
|
|
}
|