来自 MoXiGame developer4 的bug修复

This commit is contained in:
lujun 2023-02-22 18:08:08 +08:00
parent 4d9a0f87e8
commit 918104a057
2 changed files with 3 additions and 2 deletions

View File

@ -383,10 +383,10 @@ void ModelBatcher::flushRendererCache(){
if(_rendererOrder){ if(_rendererOrder){
std::stable_sort(_rendererCache.begin(), _rendererCache.end(), [](NodeProxy* a, NodeProxy* b) { return a->getRenderPriority() < b->getRenderPriority(); }); std::stable_sort(_rendererCache.begin(), _rendererCache.end(), [](NodeProxy* a, NodeProxy* b) { return a->getRenderPriority() < b->getRenderPriority(); });
} }
CCLOGINFO("flushRendererCache : %d", _rendererCache.size()); //CCLOGINFO("flushRendererCache : %d", _rendererCache.size());
for(std::vector<NodeProxy*>::iterator it = _rendererCache.begin(); it != _rendererCache.end(); it++){ for(std::vector<NodeProxy*>::iterator it = _rendererCache.begin(); it != _rendererCache.end(); it++){
NodeProxy* node = *it; NodeProxy* node = *it;
CCLOGINFO("%s %d", node->getName().c_str(), node->getRenderPriority()); //CCLOGINFO("%s %d", node->getName().c_str(), node->getRenderPriority());
node->getAssembler()->handle(node, this, _flow->getRenderScene()); node->getAssembler()->handle(node, this, _flow->getRenderScene());
} }
_rendererCache.clear(); _rendererCache.clear();

View File

@ -362,6 +362,7 @@ void RenderFlow::render(NodeProxy* scene, float deltaTime, Camera *camera)
auto traverseHandle = scene->traverseHandle; auto traverseHandle = scene->traverseHandle;
traverseHandle(scene, _batcher, _scene); traverseHandle(scene, _batcher, _scene);
_batcher->flushRendererCache();
_batcher->terminateBatch(); _batcher->terminateBatch();
if (camera) { if (camera) {