|
From: Charles L. <cn...@us...> - 2009-05-08 08:29:54
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5040 Modified Files: MercurySuffixEffects.cpp MercurySuffixEffects.h MercuryDisplay.cpp MercuryDisplay.h Log Message: Enable the suffix effects to be run at the ACTUAL end Index: MercuryDisplay.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryDisplay.cpp,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** MercuryDisplay.cpp 26 Nov 2008 06:48:36 -0000 1.169 --- MercuryDisplay.cpp 8 May 2009 08:29:43 -0000 1.170 *************** *** 396,399 **** --- 396,410 ---- } + void MercuryDisplay::AddTranslucentObjectDepth(MercuryObject* obj, float d) + { + //sort furthest to nearest + TranslucentPair p; + p.dist = d; + p.obj = obj; + m_translucentObjects.push_back(p); + + TSortDrawOrder(m_translucentObjects); + } + MercuryPoint PointToScreenCoord(const MercuryMatrix& proj, const MercuryMatrix& view, const MercuryPoint& p, const DisplayDimensions& bd) { Index: MercuryDisplay.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryDisplay.h,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** MercuryDisplay.h 23 Nov 2008 19:27:37 -0000 1.176 --- MercuryDisplay.h 8 May 2009 08:29:43 -0000 1.177 *************** *** 159,162 **** --- 159,163 ---- void AddTranslucentObject(MercuryObject* obj); + void AddTranslucentObjectDepth(MercuryObject* obj, float d); virtual void RenderTranslucentObject() = 0; Index: MercurySuffixEffects.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySuffixEffects.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MercurySuffixEffects.h 21 Aug 2007 00:33:03 -0000 1.1 --- MercurySuffixEffects.h 8 May 2009 08:29:43 -0000 1.2 *************** *** 11,16 **** --- 11,18 ---- virtual void Init(); virtual void Render(); + virtual void CustomRender(); CLASS_RTTI( MercurySuffixEffects, MercuryObject ); TextureID * m_suffixTexture; + bool bInRender; }; Index: MercurySuffixEffects.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySuffixEffects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MercurySuffixEffects.cpp 11 Sep 2007 15:26:24 -0000 1.2 --- MercurySuffixEffects.cpp 8 May 2009 08:29:42 -0000 1.3 *************** *** 13,16 **** --- 13,21 ---- void MercurySuffixEffects::Render() { + DISPLAY->AddTranslucentObjectDepth(this,100000.); + } + + void MercurySuffixEffects::CustomRender() + { DisplayDimensions d = DISPLAY->GetDimensions(); if( !m_suffixTexture ) *************** *** 18,22 **** if( m_suffixTexture ) DISPLAY->StripFromScreen( m_suffixTexture->m_ID, 0, 0, 0, (int)d.width, (int)d.height ); ! MercuryObject::Render(); } --- 23,34 ---- if( m_suffixTexture ) DISPLAY->StripFromScreen( m_suffixTexture->m_ID, 0, 0, 0, (int)d.width, (int)d.height ); ! ! MDequeIterator<ParentHoldPair> child = m_objects.begin(); ! while (child != m_objects.end()) ! (child++)->pObject->Render(); ! ! MercuryObject::CustomRender(); ! ! // } } |