doodle/go.mod
Noah Petherbridge c5353df211 LoadUnloadChunk for Memory Optimization
Instead of the loadscreen eager-loading ALL level chunks to Go Images, only
load the chunks within the "LoadingViewport" - which is the on-screen
Viewport plus a margin of chunks off the screen edges.

During gameplay, every few ticks, reevaluate which chunks are inside or
outside the LoadingViewport; for chunks outside, free their SDL2 textures
and free their cached bitmaps to keep overall memory usage down. The
AzulianTag-Forest level now stays under 200 Textures at any given time
and the loadscreen goes faster as it doesn't have to load every chunk's
images up front.

The LoadUnloadChunk feature can be turned on/off with feature flags. If
disabled the old behavior is restored: loadscreen loads all images and
the LoadUnloadChunks function is not run.

Other changes:

* loadscreen: do not free textures in the Hide() function as this runs on
  a different goroutine and may break. The 4 wallpaper textures are OK
  to keep in memory anyway, the loadscreen is reused often!
* Free more leaked textures: on the Inventory frame and when an actor
  calls Self.Destroy()
* Stop leaking goroutines in the PubSub feature of the doodad script
  engine; scripting.Supervisor.Teardown() sends a stop signal to all
  scripts to clean up neatly. Canvas.Destroy() tears down its scripting
  supervisor automatically.
2022-04-10 12:40:25 -07:00

28 lines
1.2 KiB
Modula-2

module git.kirsle.net/apps/doodle
go 1.16
require (
git.kirsle.net/go/audio v0.0.0-20201121073642-65068820cbc0
git.kirsle.net/go/log v0.0.0-20200902035305-70ac2848949b
git.kirsle.net/go/render v0.0.0-20220410192720-c0c2d05619bc
git.kirsle.net/go/ui v0.0.0-20220409211920-3b653e503c5a
github.com/aichaos/rivescript-go v0.3.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dlclark/regexp2 v1.4.1-0.20220402034307-55964957c159 // indirect
github.com/dop251/goja v0.0.0-20220408131256-ffe77e20c6f1
github.com/fsnotify/fsnotify v1.4.9
github.com/gen2brain/dlgs v0.0.0-20211108104213-bade24837f0b
github.com/google/uuid v1.3.0
github.com/gopherjs/gopherjs v0.0.0-20220410123724-9e86199038b0 // indirect
github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f
github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f // indirect
github.com/tomnomnom/xtermcolor v0.0.0-20160428124646-b78803f00a7e // indirect
github.com/urfave/cli/v2 v2.4.0
github.com/veandco/go-sdl2 v0.4.19
golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 // indirect
golang.org/x/image v0.0.0-20220321031419-a8550c1d254a
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
)