-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
ActorPtr
(RefCountingObjectPtr<Actor>
) everywhere.
This introduces `RefCountingObject` to the codebase. Using it makes it possible to pass object between C++ and AngelScript without worry. See https://github.com/only-a-ptr/RefCountingObject-AngelScript In the case of Actor, the refcounting was dummy and the game would certainly crash if a script kept pointer to an Actor which got removed. Signifficant code changes: - utils/memory/RefCountingObject* - new files. - ForwardDeclarations.h - added ActorPtr - Application.h - updated comments regarding message queue arguments. Instead of sending weak Actor* pointers, a strong ActorPtr* is sent. - main.cpp - updated message handling to cope with new pointers. - SimData.h - new entry in `enum class ActorState`: `DISPOSED` - means the actor was removed from simulation and it's component objects were deleted, but it still lives as an empty shell to satisfy existing pointers. - ActorManager.cpp - DeleteActorInternal() - changed to only dispose, but not delete the actor - the deleting will be done by RefCountingObjectPtr. - ScriptEngine.h/cpp - added function `setEventsEnabled()` which stops the TRIGGER_EVENT() macros from working, as a hack for fast dirty shutdown.
- Loading branch information
Showing
110 changed files
with
1,013 additions
and
415 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
Oops, something went wrong.