Repository navigation
gameinterop: report precache names the loaded world lacks - #127
Merged
Merged
Conversation
Precache adds names to the next session manifest, but a host had no way to tell whether the world it runs already holds them. A host that starts another mod on the map already loaded could not know whether that mod's precache needs a map reload, so it had to either reload on every switch or risk a world without the mod's models. PrecacheList now holds the hero and resource names, each once, and records whether a name arrived after the last manifest build. The manifest builder marks it built after registering every name, and EngineHost::PrecachePending reports it. Names stay for the life of the process, so once a world has loaded a name, asking for it again never makes the host reload. Cost: Add was already a linear scan of the held names per call; it now also sets a flag. PrecachePending reads one bool. Nothing runs per frame. Signed-off-by: Christian Stewart <christian@aperture.us>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Precache adds names to the next session manifest, but a host could not tell whether the world it runs already holds them. A host that starts another mod on the map already loaded had to either reload the map on every switch, which ends anything running in that world, or risk starting the mod in a world without its models.
PrecacheList holds the hero and resource names, each once, and records whether a name arrived after the last manifest build. The manifest builder marks it built after registering every name, and EngineHost::PrecachePending reports it. Names stay for the life of the process, so a host reloads at most once for each new name. precache_list_test covers the list.
Not for merge until it has been read.