mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Add macros: CC_USE_GEOMETRY_RENDERER and CC_USE_DEBUG_RENDERER to control these debugging features. (#11740)
This commit is contained in:
@@ -60,7 +60,9 @@
|
||||
#include "core/assets/FreeTypeFont.h"
|
||||
#include "network/HttpClient.h"
|
||||
#include "platform/interfaces/modules/ISystemWindow.h"
|
||||
#include "profiler/DebugRenderer.h"
|
||||
#if CC_USE_DEBUG_RENDERER
|
||||
#include "profiler/DebugRenderer.h"
|
||||
#endif
|
||||
#include "profiler/Profiler.h"
|
||||
|
||||
namespace {
|
||||
@@ -107,7 +109,10 @@ int32_t Engine::init() {
|
||||
_programLib = ccnew ProgramLib();
|
||||
_builtinResMgr = ccnew BuiltinResMgr;
|
||||
|
||||
#if CC_USE_DEBUG_RENDERER
|
||||
_debugRenderer = ccnew DebugRenderer();
|
||||
#endif
|
||||
|
||||
#if CC_USE_PROFILER
|
||||
_profiler = ccnew Profiler();
|
||||
#endif
|
||||
@@ -149,11 +154,15 @@ void Engine::destroy() {
|
||||
#endif
|
||||
// Profiler depends on DebugRenderer, should delete it after deleting Profiler,
|
||||
// and delete DebugRenderer after RenderPipeline::destroy which destroy DebugRenderer.
|
||||
#if CC_USE_DEBUG_RENDERER
|
||||
delete _debugRenderer;
|
||||
#endif
|
||||
|
||||
//TODO(): Delete some global objects.
|
||||
|
||||
#if CC_USE_DEBUG_RENDERER
|
||||
// FreeTypeFontFace is only used in DebugRenderer now, so use CC_USE_DEBUG_RENDERER macro temporarily
|
||||
FreeTypeFontFace::destroyFreeType();
|
||||
#endif
|
||||
|
||||
#if CC_USE_DRAGONBONES
|
||||
dragonBones::ArmatureCacheMgr::destroyInstance();
|
||||
@@ -213,7 +222,6 @@ void Engine::close() { // NOLINT
|
||||
_scheduler->unscheduleAll();
|
||||
|
||||
BasePlatform::getPlatform()->setHandleEventCallback(nullptr);
|
||||
|
||||
|
||||
// TODO(timlyeee): The code below is a hack on v3.6, and should be replaced in the future.
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user