I hope I don't regret doing this so close before I want to do a release, since it's a pretty
major change to ACS's workings. However, I had an epiphany yesterday and just had to do this, since it seems like too big a deal to hold off until a later release: - Dynamically generated strings returned via strparam and get(user)cvar now last as long as they need to. They do not disappear at the end of each tic. You can now safely store them in variables and hold on to them indefinitely. In addition, strings from libraries no longer require you to load the exact same libraries in the exact same order. You can even store a library's string in a world variable and retrieve it on another map that doesn't load the library at all, and it will still be the correct string. - ACS library IDs now only get 12 bits instead of 16 so that each string table can hold up to about a million strings instead of just 65536. This shouldn't be a problem, although it means that save games that had strings with the larger IDs stored in variables are no longer compatible. Since many saves don't involve libraries at all, and even many that do are not actually affected, I'm not bumping the min save version. The worst that can happen is that you get no text at all where some was expected. SVN r4295 (trunk)
This commit is contained in:
parent
493edd2df0
commit
0eb72156ed
4 changed files with 749 additions and 45 deletions
|
|
@ -737,6 +737,9 @@ void G_DoCompleted (void)
|
|||
if (!(level.flags2 & LEVEL2_FORGETSTATE))
|
||||
{
|
||||
G_SnapshotLevel ();
|
||||
// Do not free any global strings this level might reference
|
||||
// while it's not loaded.
|
||||
FBehavior::StaticLockLevelVarStrings();
|
||||
}
|
||||
else
|
||||
{ // Make sure we don't have a snapshot lying around from before.
|
||||
|
|
@ -1575,6 +1578,11 @@ void G_UnSnapshotLevel (bool hubLoad)
|
|||
}
|
||||
// No reason to keep the snapshot around once the level's been entered.
|
||||
level.info->ClearSnapshot();
|
||||
if (hubLoad)
|
||||
{
|
||||
// Unlock ACS global strings that were locked when the snapshot was made.
|
||||
FBehavior::StaticUnlockLevelVarStrings();
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue