Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Rendering/RenderPass/RenderQueue.cpp

Diff revisions: vs.
  @@ -18,10 +18,7 @@
18 18
19 19 RenderQueue::~RenderQueue()
20 20 {
21 - for (RenderBinMap::value_type& renderBins : _renderBins) {
22 - MemoryManager::SAFE_DELETE( renderBins.second );
23 - }
24 - _renderBins.clear();
21 + MemoryManager::DELETE_HASHMAP( _renderBins );
25 22 }
26 23
27 24 U16 RenderQueue::getRenderQueueStackSize() const {
  @@ -63,43 +60,43 @@
63 60 switch(rbType) {
64 61 case RenderBin::RBT_MESH : {
65 62 // By state varies based on the current rendering stage
66 - temp = New RenderBinMesh(RenderBin::RBT_MESH,RenderingOrder::BY_STATE, 0.0f);
63 + temp = MemoryManager_NEW RenderBinMesh(RenderBin::RBT_MESH, RenderingOrder::BY_STATE, 0.0f);
67 64 } break;
68 65 case RenderBin::RBT_TERRAIN : {
69 - temp = New RenderBinDelegate(RenderBin::RBT_TERRAIN,RenderingOrder::FRONT_TO_BACK, 1.0f);
66 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_TERRAIN, RenderingOrder::FRONT_TO_BACK, 1.0f);
70 67 } break;
71 68 case RenderBin::RBT_DELEGATE : {
72 - temp = New RenderBinDelegate(RenderBin::RBT_DELEGATE,RenderingOrder::FRONT_TO_BACK, 2.0f);
69 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_DELEGATE, RenderingOrder::FRONT_TO_BACK, 2.0f);
73 70 } break;
74 71 case RenderBin::RBT_SHADOWS : {
75 - temp = New RenderBinDelegate(RenderBin::RBT_SHADOWS,RenderingOrder::NONE, 3.0f);
72 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_SHADOWS, RenderingOrder::NONE, 3.0f);
76 73 } break;
77 74 case RenderBin::RBT_DECALS : {
78 - temp = New RenderBinMesh(RenderBin::RBT_DECALS,RenderingOrder::FRONT_TO_BACK, 4.0f);
75 + temp = MemoryManager_NEW RenderBinMesh(RenderBin::RBT_DECALS, RenderingOrder::FRONT_TO_BACK, 4.0f);
79 76 } break;
80 77 case RenderBin::RBT_SKY : {
81 - //Draw sky after opaque but before translucent to prevent overdraw
82 - temp = New RenderBinDelegate(RenderBin::RBT_SKY,RenderingOrder::NONE, 5.0f);
78 + // Draw sky after opaque but before translucent to prevent overdraw
79 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_SKY, RenderingOrder::NONE, 5.0f);
83 80 } break;
84 81 case RenderBin::RBT_WATER : {
85 - //Water does not count as translucency, because rendering is very specific
86 - temp = New RenderBinDelegate(RenderBin::RBT_WATER,RenderingOrder::BACK_TO_FRONT, 6.0f);
82 + // Water does not count as translucency, because rendering is very specific
83 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_WATER, RenderingOrder::BACK_TO_FRONT, 6.0f);
87 84 } break;
88 85 case RenderBin::RBT_VEGETATION_GRASS : {
89 - temp = New RenderBinDelegate(RenderBin::RBT_VEGETATION_GRASS,RenderingOrder::BACK_TO_FRONT, 7.0f);
86 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_VEGETATION_GRASS, RenderingOrder::BACK_TO_FRONT, 7.0f);
90 87 } break;
91 88 case RenderBin::RBT_VEGETATION_TREES : {
92 - temp = New RenderBinDelegate(RenderBin::RBT_VEGETATION_TREES,RenderingOrder::BACK_TO_FRONT, 7.5f);
89 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_VEGETATION_TREES, RenderingOrder::BACK_TO_FRONT, 7.5f);
93 90 } break;
94 91 case RenderBin::RBT_PARTICLES : {
95 - temp = New RenderBinParticles(RenderBin::RBT_PARTICLES,RenderingOrder::BACK_TO_FRONT, 8.0f);
92 + temp = MemoryManager_NEW RenderBinParticles(RenderBin::RBT_PARTICLES, RenderingOrder::BACK_TO_FRONT, 8.0f);
96 93 } break;
97 94 case RenderBin::RBT_TRANSLUCENT : {
98 - ///When rendering translucent objects, we should also sort each object's polygons depending on it's distance from the camera
99 - temp = New RenderBinTranslucent(RenderBin::RBT_TRANSLUCENT,RenderingOrder::BACK_TO_FRONT, 9.0f);
95 + // When rendering translucent objects we should sort each object's polygons depending on it's distance to the camera
96 + temp = MemoryManager_NEW RenderBinTranslucent(RenderBin::RBT_TRANSLUCENT, RenderingOrder::BACK_TO_FRONT, 9.0f);
100 97 } break;
101 98 case RenderBin::RBT_IMPOSTOR : {
102 - temp = New RenderBinDelegate(RenderBin::RBT_IMPOSTOR,RenderingOrder::FRONT_TO_BACK, 9.9f);
99 + temp = MemoryManager_NEW RenderBinDelegate(RenderBin::RBT_IMPOSTOR, RenderingOrder::FRONT_TO_BACK, 9.9f);
103 100 } break;
104 101 default:
105 102 case RenderBin::RBT_PLACEHOLDER : {
  @@ -160,7 +157,10 @@
160 157
161 158 void RenderQueue::addNodeToQueue(SceneGraphNode* const sgn, const vec3<F32>& eyePos){
162 159 assert(sgn != nullptr);
163 - RenderBin* rb = getBinForNode(sgn->getNode(), sgn->getComponent<RenderingComponent>() ? sgn->getComponent<RenderingComponent>()->getMaterialInstance() : nullptr);
160 + RenderingComponent* renderingCmp = sgn->getComponent<RenderingComponent>();
161 + RenderBin* rb = getBinForNode(sgn->getNode(),
162 + renderingCmp ? renderingCmp->getMaterialInstance() :
163 + nullptr);
164 164 if (rb) {
165 165 rb->addNodeToBin(sgn, eyePos);
166 166 }