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
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.
72 lines
2.1 KiB
Go
72 lines
2.1 KiB
Go
package editor
|
|
|
|
import (
|
|
"aego/editor/core/artedit"
|
|
"aego/editor/core/context"
|
|
"aego/editor/core/document"
|
|
)
|
|
|
|
type artPreviewStamp struct {
|
|
revision uint64
|
|
attempted uint64
|
|
pipeline uint64
|
|
changed float64
|
|
}
|
|
|
|
// Only completed authoring changes reach the game. A live stroke remains a
|
|
// private canvas draft. Coalesce rapid Undo/Redo into the engine's existing
|
|
// latest-candidate queue; no files, colliders or scene logic are modified here.
|
|
func pollArtSourcePreviews(ed *context.Editor, stamps map[document.ID]artPreviewStamp) {
|
|
if ed == nil || ed.Docs == nil || ed.Pipeline == nil {
|
|
return
|
|
}
|
|
pipelineRevision := ed.Pipeline.Revision()
|
|
live := make(map[document.ID]bool)
|
|
for _, d := range ed.Docs.AssetDocuments() {
|
|
b, ok := d.Binding.Model.(*artedit.Document)
|
|
if !ok {
|
|
continue
|
|
}
|
|
// A PNG draft is not an .aeart source. Publishing its ZIP bytes through
|
|
// the texture importer would be incorrect; wait for explicit linking.
|
|
if b.Draft {
|
|
continue
|
|
}
|
|
live[d.ID] = true
|
|
revision := b.PreviewRevision()
|
|
if revision == 0 {
|
|
continue
|
|
}
|
|
stamp, seen := stamps[d.ID]
|
|
if !seen && !b.Session.Info().Dirty {
|
|
stamps[d.ID] = artPreviewStamp{revision: revision, attempted: revision, pipeline: pipelineRevision}
|
|
continue
|
|
}
|
|
// A persistent import (including saving another open document) may
|
|
// replace runtime resources. Rebuild the complete dirty source snapshot
|
|
// through the same queue, even when this drawing's pixels did not change.
|
|
if stamp.pipeline != pipelineRevision {
|
|
stamp.pipeline = pipelineRevision
|
|
if b.Session.Info().Dirty || d.WorkingPreview.Applied != 0 {
|
|
stamp.attempted, stamp.changed = 0, ed.Now()
|
|
}
|
|
}
|
|
if stamp.revision != revision {
|
|
stamp.revision, stamp.changed = revision, ed.Now()
|
|
}
|
|
if stamp.attempted != revision && !b.Session.Info().Gesture && ed.Now()-stamp.changed >= .05 {
|
|
stamp.attempted = revision
|
|
if err := ed.ApplyMetadataPreview(d.Asset); err != nil {
|
|
d.WorkingPreview.Error = err.Error()
|
|
ed.Notify(context.LevelError, err.Error())
|
|
}
|
|
}
|
|
stamps[d.ID] = stamp
|
|
}
|
|
for id := range stamps {
|
|
if !live[id] {
|
|
delete(stamps, id)
|
|
}
|
|
}
|
|
}
|