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/RenderBin.cpp

Diff revisions: vs.
  @@ -8,10 +8,13 @@
8 8
9 9 namespace Divide {
10 10
11 - RenderBinItem::RenderBinItem(I32 sortKeyA, I32 sortKeyB, F32 distToCamSq, SceneGraphNode* const node) : _node(node),
12 - _sortKeyA( sortKeyA ),
13 - _sortKeyB( sortKeyB ),
14 - _distanceToCameraSq(distToCamSq)
11 + RenderBinItem::RenderBinItem(I32 sortKeyA,
12 + I32 sortKeyB,
13 + F32 distToCamSq,
14 + SceneGraphNode* const node) : _node(node),
15 + _sortKeyA( sortKeyA ),
16 + _sortKeyB( sortKeyB ),
17 + _distanceToCameraSq(distToCamSq)
15 18 {
16 19 _stateHash = 0;
17 20 RenderingComponent* const renderable = _node->getComponent<RenderingComponent>();
  @@ -65,14 +68,17 @@
65 68 return false;
66 69 }
67 70
68 - // If both the shader are the same and the state hashes match, we sort by the secondary key (usually the texture id)
71 + // If both the shader are the same and the state hashes match,
72 + // we sort by the secondary key (usually the texture id)
69 73 return (a._sortKeyB < b._sortKeyB);
70 74 }
71 75 };
72 76
73 - RenderBin::RenderBin(const RenderBinType& rbType,const RenderingOrder::List& renderOrder,D32 drawKey) : _rbType(rbType),
74 - _renderOrder(renderOrder),
75 - _drawKey(drawKey)
77 + RenderBin::RenderBin(const RenderBinType& rbType,
78 + const RenderingOrder::List& renderOrder,
79 + D32 drawKey) : _rbType(rbType),
80 + _renderOrder(renderOrder),
81 + _drawKey(drawKey)
76 82 {
77 83 _renderBinStack.reserve(125);
78 84 renderBinTypeToNameMap[RBT_PLACEHOLDER] = "Invalid Bin";
  @@ -96,22 +102,27 @@
96 102 default :
97 103 case RenderingOrder::BY_STATE : {
98 104 if (GFX_DEVICE.isCurrentRenderStage(DEPTH_STAGE)) {
99 - std::sort(_renderBinStack.begin(), _renderBinStack.end(), RenderQueueDistanceFrontToBack());
105 + std::sort(_renderBinStack.begin(), _renderBinStack.end(),
106 + RenderQueueDistanceFrontToBack());
100 107 } else {
101 - std::sort(_renderBinStack.begin(), _renderBinStack.end(), RenderQueueKeyCompare());
108 + std::sort(_renderBinStack.begin(), _renderBinStack.end(),
109 + RenderQueueKeyCompare());
102 110 }
103 111 } break;
104 112 case RenderingOrder::BACK_TO_FRONT : {
105 - std::sort(_renderBinStack.begin(), _renderBinStack.end(), RenderQueueDistanceBacktoFront());
113 + std::sort(_renderBinStack.begin(), _renderBinStack.end(),
114 + RenderQueueDistanceBacktoFront());
106 115 } break;
107 116 case RenderingOrder::FRONT_TO_BACK : {
108 - std::sort(_renderBinStack.begin(), _renderBinStack.end(), RenderQueueDistanceFrontToBack());
117 + std::sort(_renderBinStack.begin(), _renderBinStack.end(),
118 + RenderQueueDistanceFrontToBack());
109 119 } break;
110 120 case RenderingOrder::NONE : {
111 121 //no need to sort
112 122 } break;
113 123 case RenderingOrder::ORDER_PLACEHOLDER : {
114 - ERROR_FN(Locale::get("ERROR_INVALID_RENDER_BIN_SORT_ORDER"), renderBinTypeToNameMap[_rbType]);
124 + ERROR_FN(Locale::get("ERROR_INVALID_RENDER_BIN_SORT_ORDER"),
125 + renderBinTypeToNameMap[_rbType]);
115 126 } break;
116 127 };
117 128 }
  @@ -132,7 +143,10 @@
132 143 nodeMaterial->getSortKeys(keyA, keyB);
133 144 }
134 145 }
135 - _renderBinStack.push_back(RenderBinItem(keyA, keyB, sgn->getBoundingBoxConst().nearestDistanceFromPointSquared(eyePos), sgn));
146 + _renderBinStack.push_back(RenderBinItem(keyA,
147 + keyB,
148 + sgn->getBoundingBoxConst().nearestDistanceFromPointSquared(eyePos),
149 + sgn));
136 150 }
137 151
138 152 void RenderBin::preRender(const RenderStage& currentRenderStage){