From: <baz...@us...> - 2008-02-09 12:17:07
|
Revision: 7816 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7816&view=rev Author: bazaarmagetron Date: 2008-02-09 04:15:14 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Moved game end code from DoRemoveFromGame to OnRemoveFromGame. Base class is now eReferencableGameObject. Modified Paths: -------------- armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.cpp armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.h Property Changed: ---------------- armagetronad/branches/0.2.8/armagetronad/ Property changes on: armagetronad/branches/0.2.8/armagetronad ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-02-08 18:02:01.500999928 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: 0.2.8-armagetronad-work + timestamp: 2008-02-09 12:57:51.076999903 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: armagetronad Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 538 z-...@us...-20080207163247-91eo4mrbiind6xrz 540 z-...@us...-20080208122252-nvhak6io6j0ui3aa 541 z-...@us...-20080208123045-76r9p0l7iwpbq1hy 542 z-...@us...-20080208124439-10s870zpb61b8buo 543 z-...@us...-20080208133845-a22a5j0z6vjgfaby 544 z-...@us...-20080208134134-bxi2z09linxnzl63 545 z-...@us...-20080208165812-xabnqfq34666e2z5 546 z-...@us...-20080208170201-jmubp7bm7lrpmw4z + 538 z-...@us...-20080207163247-91eo4mrbiind6xrz 540 z-...@us...-20080208122252-nvhak6io6j0ui3aa 541 z-...@us...-20080208123045-76r9p0l7iwpbq1hy 542 z-...@us...-20080208124439-10s870zpb61b8buo 543 z-...@us...-20080208133845-a22a5j0z6vjgfaby 544 z-...@us...-20080208134134-bxi2z09linxnzl63 545 z-...@us...-20080208165812-xabnqfq34666e2z5 546 z-...@us...-20080208170201-jmubp7bm7lrpmw4z 551 z-...@us...-20080209115751-1w0yo2lwtv1xxmsc Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.cpp 2008-02-09 10:47:41 UTC (rev 7815) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.cpp 2008-02-09 12:15:14 UTC (rev 7816) @@ -136,7 +136,7 @@ */ gExplosion::gExplosion(eGrid *grid, const eCoord &pos,REAL time, gRealColor& color, gCycle * owner ) - :eGameObject(grid, pos, eCoord(0,0), NULL, true), + :eReferencableGameObject(grid, pos, eCoord(0,0), NULL, true), sound(explode), createTime(time), expansion(0), @@ -406,8 +406,12 @@ } #endif -void gExplosion::DoRemoveFromGame() +void gExplosion::OnRemoveFromGame() { + // remove from list to avoid costy checks whenever a new wall appears sg_Explosions.Remove( this, listID ); + + // delegate to base + eReferencableGameObject::OnRemoveFromGame(); } Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.h =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.h 2008-02-09 10:47:41 UTC (rev 7815) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gExplosion.h 2008-02-09 12:15:14 UTC (rev 7816) @@ -35,7 +35,7 @@ class gCycle; struct gRealColor; -class gExplosion: virtual public eGameObject, public tReferencable< gExplosion > +class gExplosion: virtual public eReferencableGameObject { // Boom! public: gExplosion(eGrid *grid, const eCoord &pos,REAL time, gRealColor& color, gCycle * owner ); @@ -65,9 +65,8 @@ return owner_; } - virtual void AddRef(){tReferencable< gExplosion >::AddRef();} - virtual void Release(){tReferencable< gExplosion >::Release();} - virtual void DoRemoveFromGame(); // called last when the object is removed from the game +protected: + virtual void OnRemoveFromGame(); // called last when the object is removed from the game private: eSoundPlayer sound; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |