DemandLoad
Defers loading a type's artwork until something first needs to draw it.
Structure shape
- Applies to
- BuildingType
- File
art.ini- Section
[<Image ID>]Image ID: Image= value; ObjectType ID when omitted- Value
- boolean
- When omitted
no
With DemandLoad=yes, a structure type’s main shape is not loaded with the rules. The game records the main-shape filename, resolved for the current theater, and loads the file the first time the shape is needed, usually to draw a structure of the type. A type nothing uses loads nothing, and a shape the game cannot find is not drawn.
The loaded shape is released when any of these happens:
- the type’s rules are read again;
- the type is destroyed;
- a theater is set up and the type is
Theater=yesorNewTheater=yes.
The next use loads it again.
The flag covers only the main shape. The construction animation has its own setting, DemandLoadBuildup. The deploying, door, under-door, bib and special Z overlay shapes are always loaded with the rules.
Animation demand loading
- Applies to
- AnimType
- File
art.ini- Section
[<ObjectType ID>]- Value
- boolean
- When omitted
no
The animation’s shape file is not loaded with the rest of the art when the settings or a saved game are read. The engine loads it the first time the animation needs its artwork, and then fills in any frame count or loop end the section left unset.
The file name is the Image ID with a .SHP extension, or the AnimType ID when no image is set. Theater=yes uses the AnimType ID with the theater’s extension instead, and NewTheater=yes adjusts the ordinary name for the theater.
Once loaded, the shape stays in memory until the next scenario is loaded. FreeAfterPlaying=yes releases it sooner, each time an animation of the type finishes, and the next animation of the type loads it again.
Overlay shape
- Applies to
- OverlayType
- File
art.ini- Section
[<Image ID>]Image ID: Image= value; ObjectType ID when omitted- Value
- boolean
- When omitted
no
[BTIB01]DemandLoad=yesWith DemandLoad=yes, the overlay’s shape is not loaded with the rest of the rules. It is loaded the first time the game needs it, and then kept. Loading a map loads the shape of every overlay type the map places. After a saved game is loaded, the shape is loaded again the first time the game needs it.
A demand-loaded shape is a separate copy for each overlay type. Two overlay types with the same Image ID each load their own copy.
The file name is formed the same way as for any overlay. An ordinary overlay loads its Image ID with a .SHP extension. Theater=yes uses the theater’s extension instead, and NewTheater=yes rewrites the .SHP name for the theater.
The copy is freed when the rules are read again or the type is discarded. An overlay with Theater=yes or NewTheater=yes also frees its copy whenever a map sets up its theater, so the next request loads the artwork for the new theater.
History
- Changed0.2.0In development
Keep demand-loaded artwork under its owner's lifetime —
buildingtype - Changed0.2.0In development
Keep demand-loaded artwork under its owner's lifetime —
animtype - Changed0.2.0In development
Keep demand-loaded artwork under its owner's lifetime —
overlaytype