From 918104a057089aaefcd35c1aedcc715176abdd51 Mon Sep 17 00:00:00 2001 From: lujun <495904500@qq.com> Date: Wed, 22 Feb 2023 18:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A5=E8=87=AA=20MoXiGame=20developer4=20?= =?UTF-8?q?=E7=9A=84bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cocos2d-x/cocos/renderer/scene/ModelBatcher.cpp | 4 ++-- .../cocos2d-x/cocos/renderer/scene/RenderFlow.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/ModelBatcher.cpp b/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/ModelBatcher.cpp index 30756e2..1d41059 100644 --- a/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/ModelBatcher.cpp +++ b/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/ModelBatcher.cpp @@ -383,10 +383,10 @@ void ModelBatcher::flushRendererCache(){ if(_rendererOrder){ 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::iterator it = _rendererCache.begin(); it != _rendererCache.end(); 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()); } _rendererCache.clear(); diff --git a/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/RenderFlow.cpp b/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/RenderFlow.cpp index 9dd0605..afe8a6d 100644 --- a/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/RenderFlow.cpp +++ b/2.4.11/lcc-ui-sorting-group-native/cocos2d-x/cocos/renderer/scene/RenderFlow.cpp @@ -362,6 +362,7 @@ void RenderFlow::render(NodeProxy* scene, float deltaTime, Camera *camera) auto traverseHandle = scene->traverseHandle; traverseHandle(scene, _batcher, _scene); + _batcher->flushRendererCache(); _batcher->terminateBatch(); if (camera) {