Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor|Plugins: Fixed hidden assumption in plugin ID assignment
The mechanism for tracking the plugin ID for the currently executing plugin hooks was a massive kludge that relied on the order in which Plug_AddHooks() had been called. Now the plugin IDs are tracked in a sensible manner: an ID is assigned to each plugin upon loading, after which the engine is responsible for letting everyone know which plugin execution has been passed to, if any. In practice, whenever Plug_AddHook() is called from a plugin, the engine must make sure that DD_SetActivePluginId() has previously been called. DD_SetActivePluginId() should also be called whenever control is passed to the functions exported from the game (gx). Plugins can now be loaded in any order. Todo: Ditto for Windows (use the same code). Todo for later: Make a nice mechanism for calling a function in gx while automatically setting the active plugin ID.
- Loading branch information
Showing
6 changed files
with
78 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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