proposal of adding an virtual OnCleanup() for class Game::Property

View: New views
1 Messages — Rating Filter:   Alert me  

proposal of adding an virtual OnCleanup() for class Game::Property

by pangu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the class Game::Property have OnActivate() and OnDeactivate() function currently. It can't meet all situation. For example, when create a dynamic-loaded terrain in whole scene, we wish the basic info of invisible terrain block can keep in general memory for recovery but don't wish put all the data to video memory. In current design, when the Property call OnDeactive(), it lost all infomation.
I proposal to add an OnCleanup() for Game::Property(), so these three functions resigned to response for:
OnActivate(): prepare and loading all data (no change)
OnDeactive(): unload data but keep the basic info, so the Property can be re-activate anytime if need
OnCleanup(): clean up all information, then the class can be delete safely
the changes affect about 16 files, it works fine for me.