diff --git a/native/cocos/core/platform/Macro.h b/native/cocos/core/platform/Macro.h index 8fb127d16b..9f2a456274 100644 --- a/native/cocos/core/platform/Macro.h +++ b/native/cocos/core/platform/Macro.h @@ -219,8 +219,9 @@ enum class KEY { * @en The Delete key * @zh 删除键 * @readonly + * DELETE may be used as platform's macro, such as winnt.h,thus use DELETE_ instead here. */ - DELETE = 46, + DELETE_ = 46,// NOLINT(readability-identifier-naming) /** * @en The a key diff --git a/native/cocos/platform/win32/modules/SystemWindow.cpp b/native/cocos/platform/win32/modules/SystemWindow.cpp index 12ab37e6ed..e37cd24334 100644 --- a/native/cocos/platform/win32/modules/SystemWindow.cpp +++ b/native/cocos/platform/win32/modules/SystemWindow.cpp @@ -71,7 +71,7 @@ void SystemWindow::setCursorEnabled(bool value) { } void SystemWindow::copyTextToClipboard(const std::string &text) { - //TODO + SDL_SetClipboardText(text.c_str()); } SystemWindow::Size SystemWindow::getViewSize() const { diff --git a/native/cocos/primitive/Primitive.cpp b/native/cocos/primitive/Primitive.cpp index 7b82d0cdb8..3d1996c736 100644 --- a/native/cocos/primitive/Primitive.cpp +++ b/native/cocos/primitive/Primitive.cpp @@ -44,23 +44,23 @@ IGeometry createGeometry(PrimitiveType type, const cc::optional(options.value())) : sphere(); break; } case PrimitiveType::CYLINDER: { - return cylinder(); //TODO(xwx): now for test, need to add options usage + return options.has_value() ? cylinder(0.5F, 0.5F, 2, cc::get<4>(options.value())) : cylinder(); break; } case PrimitiveType::CONE: { - return cone(); //TODO(xwx): now for test, need to add options usage + return options.has_value() ? cone(0.5F, 1.0F, cc::get<5>(options.value())) : cone(); break; } case PrimitiveType::CAPSULE: { - return capsule(); //TODO(xwx): now for test, need to add options usage + return options.has_value() ? capsule(0.5F, 0.5F, 2, cc::get(options.value())) : capsule(); break; } case PrimitiveType::TORUS: { - return torus(); //TODO(xwx): now for test, need to add options usage + return options.has_value() ? torus(0.4F, 0.1F, cc::get(options.value())) : torus(); break; } case PrimitiveType::PLANE: { diff --git a/native/cocos/renderer/pipeline/SceneCulling.cpp b/native/cocos/renderer/pipeline/SceneCulling.cpp index a18b1fbbd3..5649d271c3 100644 --- a/native/cocos/renderer/pipeline/SceneCulling.cpp +++ b/native/cocos/renderer/pipeline/SceneCulling.cpp @@ -122,7 +122,6 @@ void updateDirLight(scene::Shadows *shadows, const scene::Light *light, std::arr const auto nx = normal.x; const auto ny = normal.y; const auto nz = normal.z; - // TODO(): how to avoid create Mat4 every time? auto &matLight = shadows->getMatLight(); matLight.m[0] = 1 - nx * lx; matLight.m[1] = -nx * ly; diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp index bb5c5ef8e3..bd0cd4966a 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp @@ -36,10 +36,9 @@ void DeferredPipelineSceneData::initPipelinePassInfo() { _postProcessMaterial = new Material(); _postProcessMaterial->setUuid("builtin-post-process-material"); - //TODO(minggo): - // if (macro.ENABLE_ANTIALIAS_FXAA) { - // _antiAliasing = AntiAliasing::FXAA; - // } +#if ENABLE_ANTIALIAS_FXAA > 0 + _antiAliasing = AntiAliasing::FXAA; +#endif materialInfo.effectName = "post-process"; MacroRecord record{{"ANTIALIAS_TYPE", static_cast(_antiAliasing)}}; materialInfo.defines = record; diff --git a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp index 5a049cffb1..4be9bfb87f 100644 --- a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp @@ -541,7 +541,7 @@ void LightingStage::putTransparentObj2Queue() { for (const auto &subModel : model->getSubModels()) { p = 0; for (const auto &pass : subModel->getPasses()) { - // TODO(xwx): need to fallback unlit and gizmo material. + // TODO(): need to fallback unlit and gizmo material. if (pass->getPhase() != _phaseID) continue; for (k = 0; k < _renderQueues.size(); k++) { if (_renderQueues[k]->insertRenderPass(ro, m, p)) _isTransparentQueueEmpty = false; diff --git a/native/cocos/scene/Ambient.cpp b/native/cocos/scene/Ambient.cpp index d814ae1f0a..c235fae248 100644 --- a/native/cocos/scene/Ambient.cpp +++ b/native/cocos/scene/Ambient.cpp @@ -188,7 +188,7 @@ void Ambient::setSkyIllum(float illum) { * @en Ground color * @zh 地面颜色 */ -Vec4 &Ambient::getGroundAlbedo() { //TODO(xwx): temporary remove const. need jk20012001 refactor in v3.5 +const Vec4 &Ambient::getGroundAlbedo() { const bool isHDR = Root::getInstance()->getPipeline()->getPipelineSceneData()->isHDR(); return isHDR ? _groundAlbedoHDR : _groundAlbedoLDR; } diff --git a/native/cocos/scene/Ambient.h b/native/cocos/scene/Ambient.h index 4e09cd4fb7..38b73053ab 100644 --- a/native/cocos/scene/Ambient.h +++ b/native/cocos/scene/Ambient.h @@ -74,7 +74,7 @@ public: * @en Ground color * @zh 地面颜色 */ - Vec4 &getGroundAlbedo(); + const Vec4 &getGroundAlbedo(); void setGroundAlbedo(const Vec4 &color); protected: diff --git a/native/cocos/scene/Skybox.cpp b/native/cocos/scene/Skybox.cpp index 97f4bfe1ca..bef30a44e5 100644 --- a/native/cocos/scene/Skybox.cpp +++ b/native/cocos/scene/Skybox.cpp @@ -151,10 +151,14 @@ void Skybox::setEnvMaps(TextureCube *envmapHDR, TextureCube *envmapLDR) { const bool isHDR = Root::getInstance()->getPipeline()->getPipelineSceneData()->isHDR(); if (isHDR) { if (envmapHDR) { - Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->getGroundAlbedo().w = static_cast(envmapHDR->mipmapLevel()); + Vec4 groundAlbedo = Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->getGroundAlbedo(); + groundAlbedo.w = static_cast(envmapHDR->mipmapLevel()); + Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->setGroundAlbedo(groundAlbedo); } } else if (envmapLDR) { - Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->getGroundAlbedo().w = static_cast(envmapLDR->mipmapLevel()); + Vec4 groundAlbedo = Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->getGroundAlbedo(); + groundAlbedo.w = static_cast(envmapLDR->mipmapLevel()); + Root::getInstance()->getPipeline()->getPipelineSceneData()->getAmbient()->setGroundAlbedo(groundAlbedo); } updateGlobalBinding();