@@ -55,12 +55,16 @@ CGraphics::CGraphics(CLocalGUI* pGUI)
55
55
m_pRenderItemManager = new CRenderItemManager ();
56
56
m_pTileBatcher = new CTileBatcher ();
57
57
m_pLine3DBatcherPreGUI = new CLine3DBatcher (true );
58
+ m_pLine3DBatcherPostFX = new CLine3DBatcher (true );
58
59
m_pLine3DBatcherPostGUI = new CLine3DBatcher (false );
59
60
m_pMaterialLine3DBatcherPreGUI = new CMaterialLine3DBatcher (true );
61
+ m_pMaterialLine3DBatcherPostFX = new CMaterialLine3DBatcher (true );
60
62
m_pMaterialLine3DBatcherPostGUI = new CMaterialLine3DBatcher (false );
61
63
m_pPrimitive3DBatcherPreGUI = new CPrimitive3DBatcher (true );
64
+ m_pPrimitive3DBatcherPostFX = new CPrimitive3DBatcher (true );
62
65
m_pPrimitive3DBatcherPostGUI = new CPrimitive3DBatcher (false );
63
66
m_pMaterialPrimitive3DBatcherPreGUI = new CMaterialPrimitive3DBatcher (true , this );
67
+ m_pMaterialPrimitive3DBatcherPostFX = new CMaterialPrimitive3DBatcher (true , this );
64
68
m_pMaterialPrimitive3DBatcherPostGUI = new CMaterialPrimitive3DBatcher (false , this );
65
69
m_pPrimitiveBatcher = new CPrimitiveBatcher ();
66
70
m_pPrimitiveMaterialBatcher = new CPrimitiveMaterialBatcher (this );
@@ -83,14 +87,18 @@ CGraphics::~CGraphics()
83
87
SAFE_DELETE (m_pRenderItemManager);
84
88
SAFE_DELETE (m_pTileBatcher);
85
89
SAFE_DELETE (m_pLine3DBatcherPreGUI);
90
+ SAFE_DELETE (m_pLine3DBatcherPostFX);
86
91
SAFE_DELETE (m_pLine3DBatcherPostGUI);
87
92
SAFE_DELETE (m_pMaterialLine3DBatcherPreGUI);
93
+ SAFE_DELETE (m_pMaterialLine3DBatcherPostFX);
88
94
SAFE_DELETE (m_pMaterialLine3DBatcherPostGUI);
89
95
SAFE_DELETE (m_pPrimitiveBatcher);
90
96
SAFE_DELETE (m_pPrimitiveMaterialBatcher);
91
97
SAFE_DELETE (m_pPrimitive3DBatcherPreGUI);
98
+ SAFE_DELETE (m_pPrimitive3DBatcherPostFX);
92
99
SAFE_DELETE (m_pPrimitive3DBatcherPostGUI);
93
100
SAFE_DELETE (m_pMaterialPrimitive3DBatcherPreGUI);
101
+ SAFE_DELETE (m_pMaterialPrimitive3DBatcherPostFX);
94
102
SAFE_DELETE (m_pMaterialPrimitive3DBatcherPostGUI);
95
103
SAFE_DELETE (m_pScreenGrabber);
96
104
SAFE_DELETE (m_pPixelsManager);
@@ -207,7 +215,7 @@ void CGraphics::DrawStringOutline(const RECT& rect, unsigned long ulColor, const
207
215
208
216
void CGraphics::DrawLine3D (const CVector& vecBegin, const CVector& vecEnd, unsigned long ulColor, float fWidth )
209
217
{
210
- DrawLine3DQueued (vecBegin, vecEnd, fWidth , ulColor, true );
218
+ DrawLine3DQueued (vecBegin, vecEnd, fWidth , ulColor, eRenderStage::POST_GUI );
211
219
}
212
220
213
221
void CGraphics::DrawRectangleInternal (float fX , float fY , float fWidth , float fHeight , unsigned long ulColor, bool bSubPixelPositioning)
@@ -831,21 +839,23 @@ void CGraphics::DrawLineQueued(float fX1, float fY1, float fX2, float fY2, float
831
839
AddQueueItem (Item, bPostGUI);
832
840
}
833
841
834
- void CGraphics::DrawLine3DQueued (const CVector& vecBegin, const CVector& vecEnd, float fWidth , unsigned long ulColor, bool bPostGUI )
842
+ void CGraphics::DrawLine3DQueued (const CVector& vecBegin, const CVector& vecEnd, float fWidth , unsigned long ulColor, eRenderStage stage )
835
843
{
836
844
if (g_pCore->IsWindowMinimized ())
837
845
return ;
838
846
839
847
// Add it to the queue
840
- if (bPostGUI && !CCore::GetSingleton ().IsMenuVisible ())
848
+ if (stage == eRenderStage::POST_GUI && !CCore::GetSingleton ().IsMenuVisible ())
841
849
m_pLine3DBatcherPostGUI->AddLine3D (vecBegin, vecEnd, fWidth , ulColor);
842
- else
850
+ else if (stage == eRenderStage::PRE_FX)
843
851
m_pLine3DBatcherPreGUI->AddLine3D (vecBegin, vecEnd, fWidth , ulColor);
852
+ else
853
+ m_pLine3DBatcherPostFX->AddLine3D (vecBegin, vecEnd, fWidth , ulColor);
844
854
}
845
855
846
856
void CGraphics::DrawMaterialLine3DQueued (const CVector& vecBegin, const CVector& vecEnd, float fWidth , unsigned long ulColor, CMaterialItem* pMaterial,
847
857
float fU , float fV , float fSizeU , float fSizeV , bool bRelativeUV, bool bFlipUV, bool bUseFaceToward,
848
- const CVector& vecFaceToward, bool bPostGUI )
858
+ const CVector& vecFaceToward, eRenderStage stage )
849
859
{
850
860
if (g_pCore->IsWindowMinimized ())
851
861
return ;
@@ -857,12 +867,15 @@ void CGraphics::DrawMaterialLine3DQueued(const CVector& vecBegin, const CVector&
857
867
}
858
868
859
869
// Add it to the queue
860
- if (bPostGUI && !CCore::GetSingleton ().IsMenuVisible ())
870
+ if (stage == eRenderStage::POST_GUI && !CCore::GetSingleton ().IsMenuVisible ())
861
871
m_pMaterialLine3DBatcherPostGUI->AddLine3D (vecBegin, vecEnd, fWidth , ulColor, pMaterial, fU , fV , fSizeU , fSizeV , bRelativeUV, bFlipUV, bUseFaceToward,
862
872
vecFaceToward);
863
- else
873
+ else if (stage == eRenderStage::PRE_FX)
864
874
m_pMaterialLine3DBatcherPreGUI->AddLine3D (vecBegin, vecEnd, fWidth , ulColor, pMaterial, fU , fV , fSizeU , fSizeV , bRelativeUV, bFlipUV, bUseFaceToward,
865
875
vecFaceToward);
876
+ else
877
+ m_pMaterialLine3DBatcherPostFX->AddLine3D (vecBegin, vecEnd, fWidth , ulColor, pMaterial, fU , fV , fSizeU , fSizeV , bRelativeUV, bFlipUV, bUseFaceToward,
878
+ vecFaceToward);
866
879
}
867
880
868
881
void CGraphics::DrawRectQueued (float fX , float fY , float fWidth , float fHeight , unsigned long ulColor, bool bPostGUI, bool bSubPixelPositioning)
@@ -939,7 +952,7 @@ void CGraphics::DrawPrimitiveQueued(std::vector<PrimitiveVertice>* pVecVertices,
939
952
AddQueueItem (Item, bPostGUI);
940
953
}
941
954
942
- void CGraphics::DrawPrimitive3DQueued (std::vector<PrimitiveVertice>* pVecVertices, D3DPRIMITIVETYPE eType, bool bPostGUI )
955
+ void CGraphics::DrawPrimitive3DQueued (std::vector<PrimitiveVertice>* pVecVertices, D3DPRIMITIVETYPE eType, eRenderStage stage )
943
956
{
944
957
// Prevent queuing when minimized
945
958
if (g_pCore->IsWindowMinimized ())
@@ -949,14 +962,16 @@ void CGraphics::DrawPrimitive3DQueued(std::vector<PrimitiveVertice>* pVecVertice
949
962
}
950
963
951
964
// Add it to the queue
952
- if (bPostGUI && !CCore::GetSingleton ().IsMenuVisible ())
965
+ if (stage == eRenderStage::POST_GUI && !CCore::GetSingleton ().IsMenuVisible ())
953
966
m_pPrimitive3DBatcherPostGUI->AddPrimitive (eType, pVecVertices);
954
- else
967
+ else if (stage == eRenderStage::PRE_FX)
955
968
m_pPrimitive3DBatcherPreGUI->AddPrimitive (eType, pVecVertices);
969
+ else
970
+ m_pPrimitive3DBatcherPostFX->AddPrimitive (eType, pVecVertices);
956
971
}
957
972
958
973
void CGraphics::DrawMaterialPrimitive3DQueued (std::vector<PrimitiveMaterialVertice>* pVecVertices, D3DPRIMITIVETYPE eType, CMaterialItem* pMaterial,
959
- bool bPostGUI )
974
+ eRenderStage stage )
960
975
{
961
976
// Prevent queuing when minimized
962
977
if (g_pCore->IsWindowMinimized ())
@@ -972,10 +987,13 @@ void CGraphics::DrawMaterialPrimitive3DQueued(std::vector<PrimitiveMaterialVerti
972
987
}
973
988
974
989
// Add it to the queue
975
- if (bPostGUI && !CCore::GetSingleton ().IsMenuVisible ())
990
+ if (stage == eRenderStage::POST_GUI && !CCore::GetSingleton ().IsMenuVisible ())
976
991
m_pMaterialPrimitive3DBatcherPostGUI->AddPrimitive (eType, pMaterial, pVecVertices);
977
- else
992
+ else if (stage == eRenderStage::PRE_FX)
978
993
m_pMaterialPrimitive3DBatcherPreGUI->AddPrimitive (eType, pMaterial, pVecVertices);
994
+ else
995
+ m_pMaterialPrimitive3DBatcherPostFX->AddPrimitive (eType, pMaterial, pVecVertices);
996
+
979
997
}
980
998
981
999
void CGraphics::DrawMaterialPrimitiveQueued (std::vector<PrimitiveMaterialVertice>* pVecVertices, D3DPRIMITIVETYPE eType, CMaterialItem* pMaterial,
@@ -1515,14 +1533,18 @@ void CGraphics::OnDeviceCreate(IDirect3DDevice9* pDevice)
1515
1533
1516
1534
m_pTileBatcher->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1517
1535
m_pLine3DBatcherPreGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1536
+ m_pLine3DBatcherPostFX->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1518
1537
m_pLine3DBatcherPostGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1519
1538
m_pMaterialLine3DBatcherPreGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1539
+ m_pMaterialLine3DBatcherPostFX->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1520
1540
m_pMaterialLine3DBatcherPostGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1521
1541
m_pPrimitiveBatcher->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1522
1542
m_pPrimitiveMaterialBatcher->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1523
1543
m_pPrimitive3DBatcherPreGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1544
+ m_pPrimitive3DBatcherPostFX->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1524
1545
m_pPrimitive3DBatcherPostGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1525
1546
m_pMaterialPrimitive3DBatcherPreGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1547
+ m_pMaterialPrimitive3DBatcherPostFX->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1526
1548
m_pMaterialPrimitive3DBatcherPostGUI->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1527
1549
m_pRenderItemManager->OnDeviceCreate (pDevice, GetViewportWidth (), GetViewportHeight ());
1528
1550
m_pScreenGrabber->OnDeviceCreate (pDevice);
@@ -1612,6 +1634,12 @@ void CGraphics::DrawLine3DPreGUIQueue()
1612
1634
m_pMaterialLine3DBatcherPreGUI->Flush ();
1613
1635
}
1614
1636
1637
+ void CGraphics::DrawLine3DPostFXQueue (void )
1638
+ {
1639
+ m_pLine3DBatcherPostFX->Flush ();
1640
+ m_pMaterialLine3DBatcherPostFX->Flush ();
1641
+ }
1642
+
1615
1643
void CGraphics::DrawPrimitive3DPreGUIQueue (void )
1616
1644
{
1617
1645
m_pPrimitive3DBatcherPreGUI->Flush ();
@@ -1623,6 +1651,12 @@ bool CGraphics::HasLine3DPreGUIQueueItems(void)
1623
1651
return m_pLine3DBatcherPreGUI->HasItems () || m_pMaterialLine3DBatcherPreGUI->HasItems ();
1624
1652
}
1625
1653
1654
+ void CGraphics::DrawPrimitive3DPostFXQueue (void )
1655
+ {
1656
+ m_pPrimitive3DBatcherPostFX->Flush ();
1657
+ m_pMaterialPrimitive3DBatcherPostFX->Flush ();
1658
+ }
1659
+
1626
1660
bool CGraphics::HasPrimitive3DPreGUIQueueItems (void )
1627
1661
{
1628
1662
return m_pMaterialPrimitive3DBatcherPreGUI->HasItems () || m_pPrimitive3DBatcherPreGUI->HasItems ();
@@ -2519,6 +2553,6 @@ void CGraphics::DrawWiredSphere(CVector vecPosition, float fRadius, SColor color
2519
2553
{
2520
2554
const CVector& vecBegin = model.vertexList [i] * fRadius + vecPosition;
2521
2555
const CVector& vecEnd = model.vertexList [i + 1 ] * fRadius + vecPosition;
2522
- DrawLine3DQueued (vecBegin, vecEnd, fLineWidth , color, false );
2556
+ DrawLine3DQueued (vecBegin, vecEnd, fLineWidth , color, eRenderStage::POST_FX );
2523
2557
}
2524
2558
}
0 commit comments