Files
aego/engine/config.go
T
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

97 lines
1.9 KiB
Go

package engine
import (
"os"
"path/filepath"
"aego/core/clock"
"aego/core/errs"
"aego/core/log"
"aego/platform"
)
var Version = "0.12.5"
type Config struct {
Title string
Width int
Height int
Fullscreen bool
FixedSize bool
Hidden bool
VSync platform.VSyncMode
Headless bool
HeadlessFrameTime float64
// FixedFrameTime makes every windowed frame this long whatever the clock says, so a hidden run with screenshots steps like a headless one.
FixedFrameTime float64
Debug bool
LogLevel log.Level
FixedHz float64
MaxFrameDelta float64
MaxFixedSteps int
Workers int
ResRoot string
UserRoot string
AppID string
Seed uint64
LoopScope SystemScope
Trace bool
}
func (c Config) withDefaults() Config {
if c.Title == "" {
c.Title = "aego"
}
if c.Width <= 0 {
c.Width = 1280
}
if c.Height <= 0 {
c.Height = 720
}
if c.FixedHz <= 0 {
c.FixedHz = 60
}
if c.MaxFrameDelta <= 0 {
c.MaxFrameDelta = clock.DefaultMaxFrameDelta
}
if c.MaxFixedSteps <= 0 {
c.MaxFixedSteps = clock.DefaultMaxSteps
}
if c.ResRoot == "" {
c.ResRoot = "res"
}
if c.AppID == "" {
c.AppID = "aego"
}
if c.LogLevel == 0 && !c.Debug {
c.LogLevel = log.Info
} else if c.Debug && c.LogLevel == 0 {
c.LogLevel = log.Debug
}
if c.LoopScope == 0 {
c.LoopScope = ScopePlay
}
return c
}
func (c Config) validate() error {
if c.FixedHz <= 0 || c.FixedHz > 1000 {
return errs.New(errs.EngineConfig, "FixedHz out of range", log.F("value", c.FixedHz))
}
if c.Width <= 0 || c.Height <= 0 {
return errs.New(errs.EngineConfig, "window size must be positive")
}
return nil
}
func (c Config) userRoot() string {
if c.UserRoot != "" {
return c.UserRoot
}
base, err := os.UserConfigDir()
if err != nil {
base = os.TempDir()
}
return filepath.Join(base, "aego", c.AppID)
}