From e07bc0821c43aa6a3863caa93f91c3d04547b47e Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 16 Jun 2020 18:10:41 +0800 Subject: [PATCH] use cc::gfx namespace (#2576) --- native/cocos/platform/CCImage.cpp | 90 +- native/cocos/platform/CCImage.h | 112 +- native/cocos/renderer/core/CoreDef.h | 630 +-- native/cocos/renderer/core/TypeDef.h | 23 +- .../renderer/core/gfx/GFXBindingLayout.cc | 4 +- .../renderer/core/gfx/GFXBindingLayout.h | 4 +- native/cocos/renderer/core/gfx/GFXBuffer.cc | 4 +- native/cocos/renderer/core/gfx/GFXBuffer.h | 4 +- native/cocos/renderer/core/gfx/GFXCommand.h | 4 +- .../renderer/core/gfx/GFXCommandAllocator.cc | 4 +- .../renderer/core/gfx/GFXCommandAllocator.h | 4 +- .../renderer/core/gfx/GFXCommandBuffer.cc | 4 +- .../renderer/core/gfx/GFXCommandBuffer.h | 4 +- .../cocos/renderer/core/gfx/GFXCommandPool.h | 4 +- native/cocos/renderer/core/gfx/GFXContext.cc | 4 +- native/cocos/renderer/core/gfx/GFXContext.h | 4 +- native/cocos/renderer/core/gfx/GFXDef.cc | 4 +- native/cocos/renderer/core/gfx/GFXDef.h | 4 +- native/cocos/renderer/core/gfx/GFXDevice.cc | 4 +- native/cocos/renderer/core/gfx/GFXDevice.h | 4 +- native/cocos/renderer/core/gfx/GFXFence.cc | 4 +- native/cocos/renderer/core/gfx/GFXFence.h | 4 +- .../cocos/renderer/core/gfx/GFXFramebuffer.cc | 4 +- .../cocos/renderer/core/gfx/GFXFramebuffer.h | 4 +- .../renderer/core/gfx/GFXInputAssembler.cc | 4 +- .../renderer/core/gfx/GFXInputAssembler.h | 4 +- native/cocos/renderer/core/gfx/GFXObject.cc | 4 +- native/cocos/renderer/core/gfx/GFXObject.h | 4 +- .../renderer/core/gfx/GFXPipelineLayout.cc | 4 +- .../renderer/core/gfx/GFXPipelineLayout.h | 4 +- .../renderer/core/gfx/GFXPipelineState.cc | 4 +- .../renderer/core/gfx/GFXPipelineState.h | 4 +- native/cocos/renderer/core/gfx/GFXQueue.cc | 4 +- native/cocos/renderer/core/gfx/GFXQueue.h | 4 +- .../cocos/renderer/core/gfx/GFXRenderPass.cc | 4 +- .../cocos/renderer/core/gfx/GFXRenderPass.h | 4 +- native/cocos/renderer/core/gfx/GFXSampler.cc | 4 +- native/cocos/renderer/core/gfx/GFXSampler.h | 4 +- native/cocos/renderer/core/gfx/GFXShader.cc | 4 +- native/cocos/renderer/core/gfx/GFXShader.h | 4 +- native/cocos/renderer/core/gfx/GFXTexture.cc | 4 +- native/cocos/renderer/core/gfx/GFXTexture.h | 4 +- .../cocos/renderer/core/kernel/Assertion.cc | 218 +- native/cocos/renderer/core/kernel/Assertion.h | 16 +- .../cocos/renderer/core/kernel/CachedArray.h | 128 +- native/cocos/renderer/core/kernel/Log.cc | 229 +- native/cocos/renderer/core/kernel/Log.h | 69 +- native/cocos/renderer/core/kernel/Object.h | 4 +- .../cocos/renderer/core/kernel/UTFString.cc | 1000 ++-- native/cocos/renderer/core/kernel/UTFString.h | 2737 +++++----- native/cocos/renderer/core/math/CCCoreMath.h | 4 +- .../renderer/core/memory/AllocatedObj.cc | 4 +- .../cocos/renderer/core/memory/AllocatedObj.h | 102 +- native/cocos/renderer/core/memory/JeAlloc.cc | 231 +- native/cocos/renderer/core/memory/JeAlloc.h | 66 +- native/cocos/renderer/core/memory/MemDef.h | 255 +- .../cocos/renderer/core/memory/MemTracker.cc | 366 +- .../cocos/renderer/core/memory/MemTracker.h | 71 +- native/cocos/renderer/core/memory/Memory.cc | 5 +- .../cocos/renderer/core/memory/NedPooling.cc | 333 +- .../cocos/renderer/core/memory/NedPooling.h | 61 +- native/cocos/renderer/core/memory/StdAlloc.h | 226 +- native/cocos/renderer/core/memory/StlAlloc.h | 392 +- native/cocos/renderer/core/util/StringUtil.cc | 144 +- native/cocos/renderer/core/util/StringUtil.h | 14 +- .../renderer/gfx-gles2/GLES2BindingLayout.cc | 4 +- .../renderer/gfx-gles2/GLES2BindingLayout.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Buffer.cc | 4 +- native/cocos/renderer/gfx-gles2/GLES2Buffer.h | 4 +- .../gfx-gles2/GLES2CommandAllocator.cc | 4 +- .../gfx-gles2/GLES2CommandAllocator.h | 4 +- .../renderer/gfx-gles2/GLES2CommandBuffer.cc | 4 +- .../renderer/gfx-gles2/GLES2CommandBuffer.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Commands.cc | 4 +- .../cocos/renderer/gfx-gles2/GLES2Commands.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Context.cc | 194 +- .../cocos/renderer/gfx-gles2/GLES2Context.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Context.mm | 4 +- .../cocos/renderer/gfx-gles2/GLES2Device.cc | 4 +- native/cocos/renderer/gfx-gles2/GLES2Device.h | 4 +- native/cocos/renderer/gfx-gles2/GLES2Fence.cc | 4 +- native/cocos/renderer/gfx-gles2/GLES2Fence.h | 4 +- .../renderer/gfx-gles2/GLES2Framebuffer.cc | 6 +- .../renderer/gfx-gles2/GLES2Framebuffer.h | 4 +- .../renderer/gfx-gles2/GLES2GPUObjects.h | 4 +- .../renderer/gfx-gles2/GLES2InputAssembler.cc | 4 +- .../renderer/gfx-gles2/GLES2InputAssembler.h | 4 +- .../renderer/gfx-gles2/GLES2PipelineLayout.cc | 4 +- .../renderer/gfx-gles2/GLES2PipelineLayout.h | 4 +- .../renderer/gfx-gles2/GLES2PipelineState.cc | 4 +- .../renderer/gfx-gles2/GLES2PipelineState.h | 4 +- native/cocos/renderer/gfx-gles2/GLES2Queue.cc | 4 +- native/cocos/renderer/gfx-gles2/GLES2Queue.h | 4 +- .../renderer/gfx-gles2/GLES2RenderPass.cc | 4 +- .../renderer/gfx-gles2/GLES2RenderPass.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Sampler.cc | 4 +- .../cocos/renderer/gfx-gles2/GLES2Sampler.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Shader.cc | 4 +- native/cocos/renderer/gfx-gles2/GLES2Shader.h | 4 +- .../renderer/gfx-gles2/GLES2StateCache.h | 4 +- .../cocos/renderer/gfx-gles2/GLES2Texture.cc | 4 +- .../cocos/renderer/gfx-gles2/GLES2Texture.h | 4 +- .../renderer/gfx-gles3/GLES3BindingLayout.cc | 6 +- .../renderer/gfx-gles3/GLES3BindingLayout.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Buffer.cc | 4 +- native/cocos/renderer/gfx-gles3/GLES3Buffer.h | 4 +- .../gfx-gles3/GLES3CommandAllocator.cc | 4 +- .../gfx-gles3/GLES3CommandAllocator.h | 4 +- .../renderer/gfx-gles3/GLES3CommandBuffer.cc | 4 +- .../renderer/gfx-gles3/GLES3CommandBuffer.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Commands.cc | 4 +- .../cocos/renderer/gfx-gles3/GLES3Commands.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Context.cc | 4 +- .../cocos/renderer/gfx-gles3/GLES3Context.h | 46 +- .../cocos/renderer/gfx-gles3/GLES3Context.mm | 10 +- .../cocos/renderer/gfx-gles3/GLES3Device.cc | 4 +- native/cocos/renderer/gfx-gles3/GLES3Device.h | 4 +- native/cocos/renderer/gfx-gles3/GLES3Fence.cc | 30 +- native/cocos/renderer/gfx-gles3/GLES3Fence.h | 10 +- .../renderer/gfx-gles3/GLES3Framebuffer.cc | 4 +- .../renderer/gfx-gles3/GLES3Framebuffer.h | 4 +- .../renderer/gfx-gles3/GLES3GPUObjects.h | 4 +- .../renderer/gfx-gles3/GLES3InputAssembler.cc | 4 +- .../renderer/gfx-gles3/GLES3InputAssembler.h | 4 +- .../renderer/gfx-gles3/GLES3PipelineLayout.cc | 4 +- .../renderer/gfx-gles3/GLES3PipelineLayout.h | 4 +- .../renderer/gfx-gles3/GLES3PipelineState.cc | 4 +- .../renderer/gfx-gles3/GLES3PipelineState.h | 4 +- native/cocos/renderer/gfx-gles3/GLES3Queue.cc | 4 +- native/cocos/renderer/gfx-gles3/GLES3Queue.h | 4 +- .../renderer/gfx-gles3/GLES3RenderPass.cc | 4 +- .../renderer/gfx-gles3/GLES3RenderPass.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Sampler.cc | 4 +- .../cocos/renderer/gfx-gles3/GLES3Sampler.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Shader.cc | 4 +- native/cocos/renderer/gfx-gles3/GLES3Shader.h | 4 +- .../renderer/gfx-gles3/GLES3StateCache.h | 4 +- .../cocos/renderer/gfx-gles3/GLES3Texture.cc | 4 +- .../cocos/renderer/gfx-gles3/GLES3Texture.h | 4 +- .../renderer/gfx-metal/MTLBindingLayout.cpp | 4 +- .../renderer/gfx-metal/MTLBindingLayout.h | 4 +- native/cocos/renderer/gfx-metal/MTLBuffer.h | 4 +- native/cocos/renderer/gfx-metal/MTLBuffer.mm | 119 +- .../renderer/gfx-metal/MTLCommandAllocator.h | 4 +- .../renderer/gfx-metal/MTLCommandAllocator.mm | 4 +- .../renderer/gfx-metal/MTLCommandBuffer.h | 4 +- .../renderer/gfx-metal/MTLCommandBuffer.mm | 4 +- native/cocos/renderer/gfx-metal/MTLCommands.h | 4 +- .../cocos/renderer/gfx-metal/MTLCommands.mm | 6 +- native/cocos/renderer/gfx-metal/MTLContext.h | 5 +- native/cocos/renderer/gfx-metal/MTLContext.mm | 5 +- native/cocos/renderer/gfx-metal/MTLDevice.h | 4 +- native/cocos/renderer/gfx-metal/MTLDevice.mm | 12 +- native/cocos/renderer/gfx-metal/MTLFence.h | 4 +- native/cocos/renderer/gfx-metal/MTLFence.mm | 4 +- .../cocos/renderer/gfx-metal/MTLFrameBuffer.h | 4 +- .../renderer/gfx-metal/MTLFramebuffer.mm | 4 +- .../cocos/renderer/gfx-metal/MTLGPUObjects.h | 4 +- .../renderer/gfx-metal/MTLInputAssembler.h | 4 +- .../renderer/gfx-metal/MTLInputAssembler.mm | 4 +- .../renderer/gfx-metal/MTLPipelineLayout.cpp | 4 +- .../renderer/gfx-metal/MTLPipelineLayout.h | 4 +- .../renderer/gfx-metal/MTLPipelineState.h | 4 +- .../renderer/gfx-metal/MTLPipelineState.mm | 4 +- native/cocos/renderer/gfx-metal/MTLQueue.h | 6 +- native/cocos/renderer/gfx-metal/MTLQueue.mm | 4 +- .../cocos/renderer/gfx-metal/MTLRenderPass.h | 4 +- .../cocos/renderer/gfx-metal/MTLRenderPass.mm | 4 +- native/cocos/renderer/gfx-metal/MTLSampler.h | 4 +- native/cocos/renderer/gfx-metal/MTLSampler.mm | 4 +- native/cocos/renderer/gfx-metal/MTLShader.h | 4 +- native/cocos/renderer/gfx-metal/MTLShader.mm | 4 +- .../cocos/renderer/gfx-metal/MTLStateCache.h | 4 +- native/cocos/renderer/gfx-metal/MTLTexture.h | 4 +- native/cocos/renderer/gfx-metal/MTLTexture.mm | 4 +- native/cocos/renderer/gfx-metal/MTLUtils.h | 6 +- native/cocos/renderer/gfx-metal/MTLUtils.mm | 4 +- .../renderer/gfx-vulkan/VKBindingLayout.cc | 4 +- .../renderer/gfx-vulkan/VKBindingLayout.h | 4 +- native/cocos/renderer/gfx-vulkan/VKBuffer.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKBuffer.h | 4 +- .../renderer/gfx-vulkan/VKCommandAllocator.cc | 4 +- .../renderer/gfx-vulkan/VKCommandAllocator.h | 4 +- .../renderer/gfx-vulkan/VKCommandBuffer.cc | 4 +- .../renderer/gfx-vulkan/VKCommandBuffer.h | 4 +- .../cocos/renderer/gfx-vulkan/VKCommands.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKCommands.h | 4 +- native/cocos/renderer/gfx-vulkan/VKContext.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKContext.h | 4 +- native/cocos/renderer/gfx-vulkan/VKDevice.cc | 16 +- native/cocos/renderer/gfx-vulkan/VKDevice.h | 4 +- native/cocos/renderer/gfx-vulkan/VKFence.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKFence.h | 4 +- .../renderer/gfx-vulkan/VKFramebuffer.cc | 4 +- .../cocos/renderer/gfx-vulkan/VKFramebuffer.h | 4 +- .../cocos/renderer/gfx-vulkan/VKGPUObjects.h | 4 +- .../renderer/gfx-vulkan/VKInputAssembler.cc | 4 +- .../renderer/gfx-vulkan/VKInputAssembler.h | 4 +- .../renderer/gfx-vulkan/VKPipelineLayout.cc | 4 +- .../renderer/gfx-vulkan/VKPipelineLayout.h | 4 +- .../renderer/gfx-vulkan/VKPipelineState.cc | 4 +- .../renderer/gfx-vulkan/VKPipelineState.h | 4 +- native/cocos/renderer/gfx-vulkan/VKQueue.cc | 6 +- native/cocos/renderer/gfx-vulkan/VKQueue.h | 4 +- .../cocos/renderer/gfx-vulkan/VKRenderPass.cc | 4 +- .../cocos/renderer/gfx-vulkan/VKRenderPass.h | 4 +- native/cocos/renderer/gfx-vulkan/VKSPIRV.h | 13 +- native/cocos/renderer/gfx-vulkan/VKSampler.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKSampler.h | 4 +- native/cocos/renderer/gfx-vulkan/VKShader.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKShader.h | 4 +- native/cocos/renderer/gfx-vulkan/VKTexture.cc | 4 +- native/cocos/renderer/gfx-vulkan/VKTexture.h | 4 +- native/cocos/renderer/gfx-vulkan/VKUtils.h | 14 +- .../cocos/renderer/pipeline/BatchedBuffer.h | 2 +- native/cocos/renderer/pipeline/Define.h | 26 +- .../cocos/renderer/pipeline/InstancedBuffer.h | 2 +- .../renderer/pipeline/RenderBatchedQueue.h | 8 +- native/cocos/renderer/pipeline/RenderFlow.h | 6 +- .../renderer/pipeline/RenderInstancedQueue.h | 8 +- .../cocos/renderer/pipeline/RenderPipeline.h | 60 +- native/cocos/renderer/pipeline/RenderStage.h | 13 +- native/cocos/renderer/pipeline/RenderView.h | 6 +- .../pipeline/forward/ForwardPipeline.h | 10 +- .../js-bindings/auto/jsb_gfx_auto.cpp | 4434 ++++++++--------- .../js-bindings/auto/jsb_gfx_auto.hpp | 354 +- .../js-bindings/auto/jsb_gles2_auto.cpp | 42 +- .../js-bindings/auto/jsb_gles2_auto.hpp | 6 +- .../js-bindings/auto/jsb_gles3_auto.cpp | 36 +- .../js-bindings/auto/jsb_gles3_auto.hpp | 6 +- .../js-bindings/auto/jsb_mtl_auto.cpp | 42 +- .../js-bindings/auto/jsb_mtl_auto.hpp | 6 +- .../js-bindings/auto/jsb_vk_auto.cpp | 34 +- .../js-bindings/auto/jsb_vk_auto.hpp | 6 +- .../js-bindings/manual/jsb_gfx_manual.cpp | 146 +- .../js-bindings/manual/jsb_global.cpp | 16 +- .../scripting/js-bindings/manual/jsb_global.h | 8 +- native/tools/bindings-generator | 2 +- 238 files changed, 7262 insertions(+), 6733 deletions(-) diff --git a/native/cocos/platform/CCImage.cpp b/native/cocos/platform/CCImage.cpp index d630aa0b0f..1ac9fef415 100644 --- a/native/cocos/platform/CCImage.cpp +++ b/native/cocos/platform/CCImage.cpp @@ -181,47 +181,47 @@ namespace // v2 - typedef const std::map _pixel2_formathash; + typedef const std::map _pixel2_formathash; static const _pixel2_formathash::value_type v2_pixel_formathash_value[] = { - _pixel2_formathash::value_type(PVR2TexturePixelFormat::BGRA8888, GFXFormat::BGRA8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA8888, GFXFormat::RGBA8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA4444, GFXFormat::RGBA4), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA5551, GFXFormat::RGB5A1), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB565, GFXFormat::R5G6B5), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB888, GFXFormat::RGB8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::A8, GFXFormat::A8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::I8, GFXFormat::L8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::AI88, GFXFormat::LA8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::BGRA8888, gfx::GFXFormat::BGRA8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA8888, gfx::GFXFormat::RGBA8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA4444, gfx::GFXFormat::RGBA4), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA5551, gfx::GFXFormat::RGB5A1), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB565, gfx::GFXFormat::R5G6B5), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB888, gfx::GFXFormat::RGB8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::A8, gfx::GFXFormat::A8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::I8, gfx::GFXFormat::L8), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::AI88, gfx::GFXFormat::LA8), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC2BPP_RGBA, GFXFormat::PVRTC_RGBA2), - _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC4BPP_RGBA, GFXFormat::PVRTC_RGBA4), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC2BPP_RGBA, gfx::GFXFormat::PVRTC_RGBA2), + _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC4BPP_RGBA, gfx::GFXFormat::PVRTC_RGBA4), }; static const int PVR2_MAX_TABLE_ELEMENTS = sizeof(v2_pixel_formathash_value) / sizeof(v2_pixel_formathash_value[0]); static const _pixel2_formathash v2_pixel_formathash(v2_pixel_formathash_value, v2_pixel_formathash_value + PVR2_MAX_TABLE_ELEMENTS); // v3 - typedef const std::map _pixel3_formathash; + typedef const std::map _pixel3_formathash; static _pixel3_formathash::value_type v3_pixel_formathash_value[] = { - _pixel3_formathash::value_type(PVR3TexturePixelFormat::BGRA8888, GFXFormat::BGRA8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA8888, GFXFormat::RGBA8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA4444, GFXFormat::RGBA4), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA5551, GFXFormat::RGB5A1), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB565, GFXFormat::R5G6B5), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB888, GFXFormat::RGB8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::A8, GFXFormat::A8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::L8, GFXFormat::L8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::LA88, GFXFormat::LA8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::BGRA8888, gfx::GFXFormat::BGRA8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA8888, gfx::GFXFormat::RGBA8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA4444, gfx::GFXFormat::RGBA4), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA5551, gfx::GFXFormat::RGB5A1), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB565, gfx::GFXFormat::R5G6B5), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB888, gfx::GFXFormat::RGB8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::A8, gfx::GFXFormat::A8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::L8, gfx::GFXFormat::L8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::LA88, gfx::GFXFormat::LA8), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGB, GFXFormat::PVRTC_RGB2), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGBA, GFXFormat::PVRTC_RGBA2), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGB, GFXFormat::PVRTC_RGB4), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGBA, GFXFormat::PVRTC_RGBA4), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGB, gfx::GFXFormat::PVRTC_RGB2), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGBA, gfx::GFXFormat::PVRTC_RGBA2), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGB, gfx::GFXFormat::PVRTC_RGB4), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGBA, gfx::GFXFormat::PVRTC_RGBA4), - _pixel3_formathash::value_type(PVR3TexturePixelFormat::ETC1, GFXFormat::ETC_RGB8), + _pixel3_formathash::value_type(PVR3TexturePixelFormat::ETC1, gfx::GFXFormat::ETC_RGB8), }; static const int PVR3_MAX_TABLE_ELEMENTS = sizeof(v3_pixel_formathash_value) / sizeof(v3_pixel_formathash_value[0]); @@ -303,7 +303,7 @@ namespace ////////////////////////////////////////////////////////////////////////// bool Image::PNG_PREMULTIPLIED_ALPHA_ENABLED = false; -Image::Image(): _renderFormat(GFXFormat::UNKNOWN) +Image::Image(): _renderFormat(gfx::GFXFormat::UNKNOWN) { } @@ -485,12 +485,12 @@ Image::Format Image::detectFormat(const unsigned char * data, ssize_t dataLen) bool Image::hasAlpha() const { - return GFX_FORMAT_INFOS[static_cast(_renderFormat)].hasAlpha; + return gfx::GFX_FORMAT_INFOS[static_cast(_renderFormat)].hasAlpha; } bool Image::isCompressed() const { - return GFX_FORMAT_INFOS[static_cast(_renderFormat)].isCompressed; + return gfx::GFX_FORMAT_INFOS[static_cast(_renderFormat)].isCompressed; } namespace @@ -597,10 +597,10 @@ bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen) // we only support RGB or grayscale if (cinfo.jpeg_color_space == JCS_GRAYSCALE) - _renderFormat = GFXFormat::L8; + _renderFormat = gfx::GFXFormat::L8; else { cinfo.out_color_space = JCS_RGB; - _renderFormat = GFXFormat::RGB8; + _renderFormat = gfx::GFXFormat::RGB8; } /* Start decompression jpeg here */ @@ -723,16 +723,16 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) switch (color_type) { case PNG_COLOR_TYPE_GRAY: - _renderFormat = GFXFormat::L8; + _renderFormat = gfx::GFXFormat::L8; break; case PNG_COLOR_TYPE_GRAY_ALPHA: - _renderFormat = GFXFormat::LA8; + _renderFormat = gfx::GFXFormat::LA8; break; case PNG_COLOR_TYPE_RGB: - _renderFormat = GFXFormat::RGB8; + _renderFormat = gfx::GFXFormat::RGB8; break; case PNG_COLOR_TYPE_RGB_ALPHA: - _renderFormat = GFXFormat::RGBA8; + _renderFormat = gfx::GFXFormat::RGBA8; break; default: break; @@ -829,7 +829,7 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) } _renderFormat = it->second; - int bpp = GFX_FORMAT_INFOS[static_cast(_renderFormat)].size; + int bpp = gfx::GFX_FORMAT_INFOS[static_cast(_renderFormat)].size; //Reset num of mipmaps _numberOfMipmaps = 0; @@ -932,7 +932,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) } _renderFormat = it->second; - int bpp = GFX_FORMAT_INFOS[static_cast(_renderFormat)].size;; + int bpp = gfx::GFX_FORMAT_INFOS[static_cast(_renderFormat)].size;; // flags int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); @@ -1037,7 +1037,7 @@ bool Image::initWithETCData(const unsigned char * data, ssize_t dataLen) return false; } - _renderFormat = GFXFormat::ETC_RGB8; + _renderFormat = gfx::GFXFormat::ETC_RGB8; _dataLen = dataLen - ETC_PKM_HEADER_SIZE; _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); memcpy(_data, static_cast(data) + ETC_PKM_HEADER_SIZE, _dataLen); @@ -1064,9 +1064,9 @@ bool Image::initWithETC2Data(const unsigned char * data, ssize_t dataLen) etc2_uint32 format = etc2_pkm_get_format(header); if (format == ETC2_RGB_NO_MIPMAPS) - _renderFormat = GFXFormat::ETC2_RGB8; + _renderFormat = gfx::GFXFormat::ETC2_RGB8; else - _renderFormat = GFXFormat::ETC2_RGBA8; + _renderFormat = gfx::GFXFormat::ETC2_RGBA8; _dataLen = dataLen - ETC2_PKM_HEADER_SIZE; _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); @@ -1093,7 +1093,7 @@ bool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen) if (config.input.width == 0 || config.input.height == 0) break; config.output.colorspace = config.input.has_alpha?MODE_rgbA:MODE_RGB; - _renderFormat = config.input.has_alpha ? GFXFormat::RGBA8 : GFXFormat::RGB8; + _renderFormat = config.input.has_alpha ? gfx::GFXFormat::RGBA8 : gfx::GFXFormat::RGB8; _width = config.input.width; _height = config.input.height; @@ -1131,7 +1131,7 @@ bool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int wid _height = height; _width = width; _hasPremultipliedAlpha = preMulti; - _renderFormat = GFXFormat::RGBA8; + _renderFormat = gfx::GFXFormat::RGBA8; // only RGBA8888 supported int bytesPerComponent = 4; @@ -1151,7 +1151,7 @@ bool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int wid bool Image::saveToFile(const std::string& filename, bool isToRGB) { //only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data - if (isCompressed() || (_renderFormat != GFXFormat::RGB8 && _renderFormat != GFXFormat::RGBA8)) + if (isCompressed() || (_renderFormat != gfx::GFXFormat::RGB8 && _renderFormat != gfx::GFXFormat::RGBA8)) { CCLOG("saveToFile: Image: saveToFile is only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data for now"); return false; @@ -1405,7 +1405,7 @@ bool Image::saveImageToJPG(const std::string& filePath) void Image::premultipliedAlpha() { - if (PNG_PREMULTIPLIED_ALPHA_ENABLED && _renderFormat == GFXFormat::RGBA8) + if (PNG_PREMULTIPLIED_ALPHA_ENABLED && _renderFormat == gfx::GFXFormat::RGBA8) { unsigned int* fourBytes = (unsigned int*)_data; for(int i = 0; i < _width * _height; i++) diff --git a/native/cocos/platform/CCImage.h b/native/cocos/platform/CCImage.h index 47101d493d..849f276c49 100644 --- a/native/cocos/platform/CCImage.h +++ b/native/cocos/platform/CCImage.h @@ -31,15 +31,17 @@ THE SOFTWARE. // premultiply alpha, or the effect will wrong when want to use other pixel format in Texture2D, // such as RGB888, RGB5A1 -#define CC_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ - (unsigned)(((unsigned)((unsigned char)(vr) * ((unsigned char)(va) + 1)) >> 8) | \ - ((unsigned)((unsigned char)(vg) * ((unsigned char)(va) + 1) >> 8) << 8) | \ - ((unsigned)((unsigned char)(vb) * ((unsigned char)(va) + 1) >> 8) << 16) | \ - ((unsigned)(unsigned char)(va) << 24)) +#define CC_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \ + (unsigned)(((unsigned)((unsigned char)(vr) * ((unsigned char)(va) + 1)) >> 8) | \ + ((unsigned)((unsigned char)(vg) * ((unsigned char)(va) + 1) >> 8) << 8) | \ + ((unsigned)((unsigned char)(vb) * ((unsigned char)(va) + 1) >> 8) << 16) | \ + ((unsigned)(unsigned char)(va) << 24)) namespace cc { +namespace gfx { enum class GFXFormat : unsigned int; +} // namespace gfx /** * @addtogroup platform @@ -49,15 +51,13 @@ enum class GFXFormat : unsigned int; /** @brief Structure which can tell where mipmap begins and how long is it */ -typedef struct _MipmapInfo -{ - unsigned char* address = nullptr; +typedef struct _MipmapInfo { + unsigned char *address = nullptr; int offset = 0; int len = 0; -}MipmapInfo; +} MipmapInfo; -class Image : public Ref -{ +class Image : public Ref { public: /** * @js ctor @@ -65,8 +65,7 @@ public: Image(); /** Supported formats for Image */ - enum class Format - { + enum class Format { //! JPEG JPG, //! PNG @@ -88,17 +87,14 @@ public: struct PixelFormatInfo { PixelFormatInfo(int aBpp, bool aCompressed, bool anAlpha) - : bpp(aBpp) - , compressed(aCompressed) - , alpha(anAlpha) - {} + : bpp(aBpp), compressed(aCompressed), alpha(anAlpha) {} int bpp; bool compressed; bool alpha; }; - typedef std::map PixelFormatInfoMap; + typedef std::map PixelFormatInfoMap; /** * Enables or disables premultiplied alpha for PNG files. @@ -106,7 +102,7 @@ public: * @param enabled (default: true) */ static void setPNGPremultipliedAlphaEnabled(bool enabled) { PNG_PREMULTIPLIED_ALPHA_ENABLED = enabled; } - + /** treats (or not) PVR files as if they have alpha premultiplied. Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is possible load them as if they have (or not) the alpha channel premultiplied. @@ -120,7 +116,7 @@ public: @param path the absolute file path. @return true if loaded correctly. */ - bool initWithImageFile(const std::string& path); + bool initWithImageFile(const std::string &path); /** @brief Load image from stream buffer. @@ -130,25 +126,25 @@ public: * @js NA * @lua NA */ - bool initWithImageData(const unsigned char * data, ssize_t dataLen); + bool initWithImageData(const unsigned char *data, ssize_t dataLen); // @warning kFmtRawData only support RGBA8888 - bool initWithRawData(const unsigned char * data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti = false); + bool initWithRawData(const unsigned char *data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti = false); // Getters - inline unsigned char* getData() const { return _data; } - inline ssize_t getDataLen() const { return _dataLen; } - inline Format getFileType() const { return _fileType; } - inline GFXFormat getRenderFormat() const { return _renderFormat; } - inline int getWidth() const { return _width; } - inline int getHeight() const { return _height; } - inline int getNumberOfMipmaps() const { return _numberOfMipmaps; } - inline const MipmapInfo* getMipmaps() const { return _mipmaps; } - inline bool hasPremultipliedAlpha() const { return _hasPremultipliedAlpha; } - inline std::string getFilePath() const { return _filePath; } + inline unsigned char *getData() const { return _data; } + inline ssize_t getDataLen() const { return _dataLen; } + inline Format getFileType() const { return _fileType; } + inline gfx::GFXFormat getRenderFormat() const { return _renderFormat; } + inline int getWidth() const { return _width; } + inline int getHeight() const { return _height; } + inline int getNumberOfMipmaps() const { return _numberOfMipmaps; } + inline const MipmapInfo *getMipmaps() const { return _mipmaps; } + inline bool hasPremultipliedAlpha() const { return _hasPremultipliedAlpha; } + inline std::string getFilePath() const { return _filePath; } - bool hasAlpha() const; - bool isCompressed() const; + bool hasAlpha() const; + bool isCompressed() const; /** @brief Save Image data to the specified file, with specified format. @@ -158,17 +154,17 @@ public: bool saveToFile(const std::string &filename, bool isToRGB = true); protected: - bool initWithJpgData(const unsigned char * data, ssize_t dataLen); - bool initWithPngData(const unsigned char * data, ssize_t dataLen); - bool initWithWebpData(const unsigned char * data, ssize_t dataLen); - bool initWithPVRData(const unsigned char * data, ssize_t dataLen); - bool initWithPVRv2Data(const unsigned char * data, ssize_t dataLen); - bool initWithPVRv3Data(const unsigned char * data, ssize_t dataLen); - bool initWithETCData(const unsigned char * data, ssize_t dataLen); - bool initWithETC2Data(const unsigned char * data, ssize_t dataLen); + bool initWithJpgData(const unsigned char *data, ssize_t dataLen); + bool initWithPngData(const unsigned char *data, ssize_t dataLen); + bool initWithWebpData(const unsigned char *data, ssize_t dataLen); + bool initWithPVRData(const unsigned char *data, ssize_t dataLen); + bool initWithPVRv2Data(const unsigned char *data, ssize_t dataLen); + bool initWithPVRv3Data(const unsigned char *data, ssize_t dataLen); + bool initWithETCData(const unsigned char *data, ssize_t dataLen); + bool initWithETC2Data(const unsigned char *data, ssize_t dataLen); - bool saveImageToPNG(const std::string& filePath, bool isToRGB = true); - bool saveImageToJPG(const std::string& filePath); + bool saveImageToPNG(const std::string &filePath, bool isToRGB = true); + bool saveImageToJPG(const std::string &filePath); void premultipliedAlpha(); @@ -187,8 +183,8 @@ protected: int _width = 0; int _height = 0; Format _fileType = Format::UNKNOWN; - GFXFormat _renderFormat; - MipmapInfo _mipmaps[MIPMAP_MAX]; // pointer to mipmap images + gfx::GFXFormat _renderFormat; + MipmapInfo _mipmaps[MIPMAP_MAX]; // pointer to mipmap images int _numberOfMipmaps = 0; // false if we can't auto detect the image is premultiplied or not. bool _hasPremultipliedAlpha = false; @@ -196,12 +192,12 @@ protected: protected: // noncopyable - Image(const Image&) = delete; - Image& operator=(const Image&) = delete; + Image(const Image &) = delete; + Image &operator=(const Image &) = delete; // nonmoveable - Image(Image&&) = delete; - Image& operator=(Image&&) = delete; + Image(Image &&) = delete; + Image &operator=(Image &&) = delete; /** * @js NA @@ -209,18 +205,18 @@ protected: */ virtual ~Image(); - Format detectFormat(const unsigned char * data, ssize_t dataLen); - bool isPng(const unsigned char * data, ssize_t dataLen); - bool isJpg(const unsigned char * data, ssize_t dataLen); - bool isWebp(const unsigned char * data, ssize_t dataLen); - bool isPvr(const unsigned char * data, ssize_t dataLen); - bool isEtc(const unsigned char * data, ssize_t dataLen); - bool isEtc2(const unsigned char * data, ssize_t dataLen); + Format detectFormat(const unsigned char *data, ssize_t dataLen); + bool isPng(const unsigned char *data, ssize_t dataLen); + bool isJpg(const unsigned char *data, ssize_t dataLen); + bool isWebp(const unsigned char *data, ssize_t dataLen); + bool isPvr(const unsigned char *data, ssize_t dataLen); + bool isEtc(const unsigned char *data, ssize_t dataLen); + bool isEtc2(const unsigned char *data, ssize_t dataLen); }; // end of platform group /// @} -} +} // namespace cc /// @endcond diff --git a/native/cocos/renderer/core/CoreDef.h b/native/cocos/renderer/core/CoreDef.h index 24a2f55f79..75ca17b1f4 100755 --- a/native/cocos/renderer/core/CoreDef.h +++ b/native/cocos/renderer/core/CoreDef.h @@ -1,257 +1,311 @@ #include "base/ccMacros.h" #ifndef CC_CORE_CORE_DEF_H_ -#define CC_CORE_CORE_DEF_H_ + #define CC_CORE_CORE_DEF_H_ -// Initial compiler-related stuff to set. -#define CC_COMPILER_MSVC 1 -#define CC_COMPILER_CLANG 2 -#define CC_COMPILER_GNUC 3 + // Initial compiler-related stuff to set. + #define CC_COMPILER_MSVC 1 + #define CC_COMPILER_CLANG 2 + #define CC_COMPILER_GNUC 3 -// CPU Architecture -#define CC_CPU_UNKNOWN 0 -#define CC_CPU_X86 1 -#define CC_CPU_PPC 2 -#define CC_CPU_ARM 3 -#define CC_CPU_MIPS 4 + // CPU Architecture + #define CC_CPU_UNKNOWN 0 + #define CC_CPU_X86 1 + #define CC_CPU_PPC 2 + #define CC_CPU_ARM 3 + #define CC_CPU_MIPS 4 -// 32-bits or 64-bits CPU -#define CC_CPU_ARCH_32 1 -#define CC_CPU_ARCH_64 2 + // 32-bits or 64-bits CPU + #define CC_CPU_ARCH_32 1 + #define CC_CPU_ARCH_64 2 -// Endian -#define CC_ENDIAN_LITTLE 1 -#define CC_ENDIAN_BIG 2 + // Endian + #define CC_ENDIAN_LITTLE 1 + #define CC_ENDIAN_BIG 2 -// Charset -#define CC_CHARSET_UNICODE 1 -#define CC_CHARSET_MULTIBYTE 2 + // Charset + #define CC_CHARSET_UNICODE 1 + #define CC_CHARSET_MULTIBYTE 2 -// Precision -#define CC_PRECISION_FLOAT 1 -#define CC_PRECISION_DOUBLE 2 + // Precision + #define CC_PRECISION_FLOAT 1 + #define CC_PRECISION_DOUBLE 2 -// Mode -#define CC_MODE_DEBUG 1 -#define CC_MODE_RELEASE 2 + // Mode + #define CC_MODE_DEBUG 1 + #define CC_MODE_RELEASE 2 -// Memory Allocator -#define CC_MEMORY_ALLOCATOR_STD 0 -#define CC_MEMORY_ALLOCATOR_NEDPOOLING 1 -#define CC_MEMORY_ALLOCATOR_JEMALLOC 2 + // Memory Allocator + #define CC_MEMORY_ALLOCATOR_STD 0 + #define CC_MEMORY_ALLOCATOR_NEDPOOLING 1 + #define CC_MEMORY_ALLOCATOR_JEMALLOC 2 -// STL Memory Allocator -#define CC_STL_MEMORY_ALLOCATOR_STANDARD 1 -#define CC_STL_MEMORY_ALLOCATOR_CUSTOM 2 + // STL Memory Allocator + #define CC_STL_MEMORY_ALLOCATOR_STANDARD 1 + #define CC_STL_MEMORY_ALLOCATOR_CUSTOM 2 -// Compiler type and version recognition -#if defined( _MSC_VER ) -# define CC_COMPILER CC_COMPILER_MSVC -# if _MSC_VER >= 1900 -# define CC_COMPILER_VERSION 130 -# elif _MSC_VER >= 1800 -# define CC_COMPILER_VERSION 120 -# elif _MSC_VER >= 1700 -# define CC_COMPILER_VERSION 110 -# elif _MSC_VER >= 1600 -# define CC_COMPILER_VERSION 100 -# elif _MSC_VER >= 1500 -# define CC_COMPILER_VERSION 90 -# elif _MSC_VER >= 1400 -# define CC_COMPILER_VERSION 80 -# elif _MSC_VER >= 1300 -# define CC_COMPILER_VERSION 70 -# endif -#elif defined( __clang__ ) -# define CC_COMPILER CC_COMPILER_CLANG -# define CC_COMPILER_VERSION (((__clang_major__)*100) + (__clang_minor__*10) + __clang_patchlevel__) -#elif defined( __GNUC__ ) -# define CC_COMPILER CC_COMPILER_GNUC -# define CC_COMPILER_VERSION (((__GNUC__)*100) + (__GNUC_MINOR__*10) + __GNUC_PATCHLEVEL__) -#else -# error "Unknown compiler. Abort!" -#endif + // Compiler type and version recognition + #if defined(_MSC_VER) + #define CC_COMPILER CC_COMPILER_MSVC + #if _MSC_VER >= 1900 + #define CC_COMPILER_VERSION 130 + #elif _MSC_VER >= 1800 + #define CC_COMPILER_VERSION 120 + #elif _MSC_VER >= 1700 + #define CC_COMPILER_VERSION 110 + #elif _MSC_VER >= 1600 + #define CC_COMPILER_VERSION 100 + #elif _MSC_VER >= 1500 + #define CC_COMPILER_VERSION 90 + #elif _MSC_VER >= 1400 + #define CC_COMPILER_VERSION 80 + #elif _MSC_VER >= 1300 + #define CC_COMPILER_VERSION 70 + #endif + #elif defined(__clang__) + #define CC_COMPILER CC_COMPILER_CLANG + #define CC_COMPILER_VERSION (((__clang_major__)*100) + (__clang_minor__ * 10) + __clang_patchlevel__) + #elif defined(__GNUC__) + #define CC_COMPILER CC_COMPILER_GNUC + #define CC_COMPILER_VERSION (((__GNUC__)*100) + (__GNUC_MINOR__ * 10) + __GNUC_PATCHLEVEL__) + #else + #error "Unknown compiler. Abort!" + #endif -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# define CC_ENDIAN CC_ENDIAN_LITTLE -#else -# if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) -# include -# else -# include -# endif // (CC_PLATFORM == CC_PLATFORM_MAC_OSX) -# -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define CC_ENDIAN CC_ENDIAN_LITTLE -# else -# define CC_ENDIAN CC_ENDIAN_BIG -# endif //__BYTE_ORDER == __LITTLE_ENDIAN -#endif + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #define CC_ENDIAN CC_ENDIAN_LITTLE + #else + #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) + #include + #else + #include + #endif // (CC_PLATFORM == CC_PLATFORM_MAC_OSX) + # + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define CC_ENDIAN CC_ENDIAN_LITTLE + #else + #define CC_ENDIAN CC_ENDIAN_BIG + #endif //__BYTE_ORDER == __LITTLE_ENDIAN + #endif -// CPU architecture type recognition -#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) ||(defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) -# define CC_CPU CC_CPU_X86 -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX && CC_ENDIAN == CC_ENDIAN_BIG -# define CC_CPU CC_CPU_PPC -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX -# define COCOS_CPU CC_CPU_X86 -#elif CC_PLATFORM == CC_PLATFORM_MAC_IOS && (defined(__i386__) || defined(__x86_64__)) -# define CC_CPU CC_CPU_X86 -#elif defined(__arm__) || defined(_M_ARM) || defined(__arm64__) || defined(_aarch64_) -# define CC_CPU CC_CPU_ARM -#elif defined(__mips64) || defined(__mips64_) -# define CC_CPU CC_CPU_MIPS -#else -# define CC_CPU CC_CPU_UNKNOWN -#endif + // CPU architecture type recognition + #if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) + #define CC_CPU CC_CPU_X86 + #elif CC_PLATFORM == CC_PLATFORM_MAC_OSX && CC_ENDIAN == CC_ENDIAN_BIG + #define CC_CPU CC_CPU_PPC + #elif CC_PLATFORM == CC_PLATFORM_MAC_OSX + #define COCOS_CPU CC_CPU_X86 + #elif CC_PLATFORM == CC_PLATFORM_MAC_IOS && (defined(__i386__) || defined(__x86_64__)) + #define CC_CPU CC_CPU_X86 + #elif defined(__arm__) || defined(_M_ARM) || defined(__arm64__) || defined(_aarch64_) + #define CC_CPU CC_CPU_ARM + #elif defined(__mips64) || defined(__mips64_) + #define CC_CPU CC_CPU_MIPS + #else + #define CC_CPU CC_CPU_UNKNOWN + #endif -#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) || defined(__arm64__) || defined(_aarch64_) || defined(__mips64) || defined(__mips64_) -# define CC_CPU_ARCH CC_CPU_ARCH_64 -#else -# define CC_CPU_ARCH CC_CPU_ARCH_32 -#endif + #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) || defined(__arm64__) || defined(_aarch64_) || defined(__mips64) || defined(__mips64_) + #define CC_CPU_ARCH CC_CPU_ARCH_64 + #else + #define CC_CPU_ARCH CC_CPU_ARCH_32 + #endif -#if (__cplusplus >= 201103L) -# define CC_C11 -# define register -#endif + #if (__cplusplus >= 201103L) + #define CC_C11 + #define register + #endif -// C11 features -#if (CC_COMPILER == CC_COMPILER_MSVC) -# if (_MSC_VER >= 1700) -# define CC_C11_TYPED_ENUMS -# endif -#elif (CC_COMPILER == CC_COMPILER_GNUC) -# if (__GNUC_MINOR__ >= 4) -# define CC_C11_TYPED_ENUMS -# endif -#endif + // C11 features + #if (CC_COMPILER == CC_COMPILER_MSVC) + #if (_MSC_VER >= 1700) + #define CC_C11_TYPED_ENUMS + #endif + #elif (CC_COMPILER == CC_COMPILER_GNUC) + #if (__GNUC_MINOR__ >= 4) + #define CC_C11_TYPED_ENUMS + #endif + #endif -// Disable MSVC warning -#if (CC_COMPILER == CC_COMPILER_MSVC) -# pragma warning(disable:4251 4275 4819) -# ifndef _CRT_SECURE_NO_DEPRECATE -# define _CRT_SECURE_NO_DEPRECATE -# endif -# ifndef _SCL_SECURE_NO_DEPRECATE -# define _SCL_SECURE_NO_DEPRECATE -# endif -#endif + // Disable MSVC warning + #if (CC_COMPILER == CC_COMPILER_MSVC) + #pragma warning(disable : 4251 4275 4819) + #ifndef _CRT_SECURE_NO_DEPRECATE + #define _CRT_SECURE_NO_DEPRECATE + #endif + #ifndef _SCL_SECURE_NO_DEPRECATE + #define _SCL_SECURE_NO_DEPRECATE + #endif + #endif -// Charset Settings -#if defined(_UNICODE) || defined(UNICODE) -# define CC_CHARSET CC_CHARSET_UNICODE -#else -# define CC_CHARSET CC_CHARSET_MULTIBYTE -#endif + // Charset Settings + #if defined(_UNICODE) || defined(UNICODE) + #define CC_CHARSET CC_CHARSET_UNICODE + #else + #define CC_CHARSET CC_CHARSET_MULTIBYTE + #endif -#if CC_COMPILER == CC_COMPILER_MSVC -# if CC_COMPILER_VERSION >= 120 -# define CC_INLINE __forceinline -# else -# define CC_INLINE inline -# endif -#elif defined(__MINGW32__) -# if !defined(CC_INLINE) -# define CC_INLINE __inline -# endif -#elif !defined(ANDROID) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) -# define CC_INLINE inline __attribute__((always_inline)) -#else -# define CC_INLINE __inline -#endif + #if CC_COMPILER == CC_COMPILER_MSVC + #if CC_COMPILER_VERSION >= 120 + #define CC_INLINE __forceinline + #else + #define CC_INLINE inline + #endif + #elif defined(__MINGW32__) + #if !defined(CC_INLINE) + #define CC_INLINE __inline + #endif + #elif !defined(ANDROID) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) + #define CC_INLINE inline __attribute__((always_inline)) + #else + #define CC_INLINE __inline + #endif -// Asserts expression is true at compile-time -#define CC_COMPILER_ASSERT(x) typedef int COMPILER_ASSERT_[!!(x)] + // Asserts expression is true at compile-time + #define CC_COMPILER_ASSERT(x) typedef int COMPILER_ASSERT_[!!(x)] -#if (CC_COMPILER == CC_COMPILER_MSVC) -# define CC_RESTRICT __restrict //MSVC -#else -# define CC_RESTRICT __restrict__ //GCC... and others? -#endif + #if (CC_COMPILER == CC_COMPILER_MSVC) + #define CC_RESTRICT __restrict //MSVC + #else + #define CC_RESTRICT __restrict__ //GCC... and others? + #endif -#define CC_CACHELINE_SIZE 64 + #define CC_CACHELINE_SIZE 64 -#if (CC_COMPILER == CC_COMPILER_MSVC) -// MSVC ENABLE/DISABLE WARNING DEFINITION -# define CC_DISABLE_WARNINGS() \ - __pragma(warning(push, 0)) + #if (CC_COMPILER == CC_COMPILER_MSVC) + // MSVC ENABLE/DISABLE WARNING DEFINITION + #define CC_DISABLE_WARNINGS() \ + __pragma(warning(push, 0)) -# define CC_ENABLE_WARNINGS() \ - __pragma(warning(pop)) -#elif (CC_COMPILER == CC_COMPILER_GNUC) -// GCC ENABLE/DISABLE WARNING DEFINITION -# define CC_DISABLE_WARNINGS() \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wall\"") \ - _Pragma("clang diagnostic ignored \"-Wextra\"") \ - _Pragma("clang diagnostic ignored \"-Wtautological-compare\"") + #define CC_ENABLE_WARNINGS() \ + __pragma(warning(pop)) + #elif (CC_COMPILER == CC_COMPILER_GNUC) + // GCC ENABLE/DISABLE WARNING DEFINITION + #define CC_DISABLE_WARNINGS() \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wall\"") \ + _Pragma("clang diagnostic ignored \"-Wextra\"") \ + _Pragma("clang diagnostic ignored \"-Wtautological-compare\"") -# define CC_ENABLE_WARNINGS() \ - _Pragma("GCC diagnostic pop") -#elif (CC_COMPILER == CC_COMPILER_CLANG) -// CLANG ENABLE/DISABLE WARNING DEFINITION -# define CC_DISABLE_WARNINGS() \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wall\"") \ - _Pragma("clang diagnostic ignored \"-Wextra\"") \ - _Pragma("clang diagnostic ignored \"-Wtautological-compare\"") + #define CC_ENABLE_WARNINGS() \ + _Pragma("GCC diagnostic pop") + #elif (CC_COMPILER == CC_COMPILER_CLANG) + // CLANG ENABLE/DISABLE WARNING DEFINITION + #define CC_DISABLE_WARNINGS() \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wall\"") \ + _Pragma("clang diagnostic ignored \"-Wextra\"") \ + _Pragma("clang diagnostic ignored \"-Wtautological-compare\"") -# define CC_ENABLE_WARNINGS() \ - _Pragma("clang diagnostic pop") -#endif + #define CC_ENABLE_WARNINGS() \ + _Pragma("clang diagnostic pop") + #endif -#if (CC_COMPILER == CC_COMPILER_MSVC) -# define CC_ALIGN(N) __declspec(align(N)) -# define CC_CACHE_ALIGN __declspec(align(CC_CACHELINE_SIZE)) -# define CC_PACKED_ALIGN(N) __declspec(align(N)) + #if (CC_COMPILER == CC_COMPILER_MSVC) + #define CC_ALIGN(N) __declspec(align(N)) + #define CC_CACHE_ALIGN __declspec(align(CC_CACHELINE_SIZE)) + #define CC_PACKED_ALIGN(N) __declspec(align(N)) -# define CC_ALIGNED_DECL(type, var, alignment) __declspec(align(alignment)) type var + #define CC_ALIGNED_DECL(type, var, alignment) __declspec(align(alignment)) type var -# define CC_READ_COMPILER_BARRIER() _ReadBarrier() -# define CC_WRITE_COMPILER_BARRIER() _WriteBarrier() -# define CC_COMPILER_BARRIER() _ReadWriteBarrier() + #define CC_READ_COMPILER_BARRIER() _ReadBarrier() + #define CC_WRITE_COMPILER_BARRIER() _WriteBarrier() + #define CC_COMPILER_BARRIER() _ReadWriteBarrier() -# define CC_READ_MEMORY_BARRIER() MemoryBarrier() -# define CC_WRITE_MEMORY_BARRIER() MemoryBarrier() -# define CC_MEMORY_BARRIER() MemoryBarrier() + #define CC_READ_MEMORY_BARRIER() MemoryBarrier() + #define CC_WRITE_MEMORY_BARRIER() MemoryBarrier() + #define CC_MEMORY_BARRIER() MemoryBarrier() -# define CC_CPU_READ_MEMORY_BARRIER() do { __asm { lfence } } while (0) -# define CC_CPU_WRITE_MEMORY_BARRIER() do { __asm { sfence } } while (0) -# define CC_CPU_MEMORY_BARRIER() do { __asm { mfence } } while (0) + #define CC_CPU_READ_MEMORY_BARRIER() \ + do { \ + __asm { lfence} \ + } while (0) + #define CC_CPU_WRITE_MEMORY_BARRIER() \ + do { \ + __asm { sfence} \ + } while (0) + #define CC_CPU_MEMORY_BARRIER() \ + do { \ + __asm { mfence} \ + } while (0) -#elif (CC_COMPILER == CC_COMPILER_GNUC) || (CC_COMPILER == CC_COMPILER_CLANG) -# define CC_ALIGN(N) __attribute__((__aligned__((N)))) -# define CC_CACHE_ALIGN __attribute__((__aligned__((CC_CACHELINE_SIZE)))) -# define CC_PACKED_ALIGN(N) __attribute__((packed, aligned(N))) + #elif (CC_COMPILER == CC_COMPILER_GNUC) || (CC_COMPILER == CC_COMPILER_CLANG) + #define CC_ALIGN(N) __attribute__((__aligned__((N)))) + #define CC_CACHE_ALIGN __attribute__((__aligned__((CC_CACHELINE_SIZE)))) + #define CC_PACKED_ALIGN(N) __attribute__((packed, aligned(N))) -# define CC_ALIGNED_DECL(type, var, alignment) type var __attribute__((__aligned__(alignment))) + #define CC_ALIGNED_DECL(type, var, alignment) type var __attribute__((__aligned__(alignment))) -# define CC_READ_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) -# define CC_WRITE_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) -# define CC_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) + #define CC_READ_COMPILER_BARRIER() \ + do { \ + __asm__ __volatile__("" \ + : \ + : \ + : "memory"); \ + } while (0) + #define CC_WRITE_COMPILER_BARRIER() \ + do { \ + __asm__ __volatile__("" \ + : \ + : \ + : "memory"); \ + } while (0) + #define CC_COMPILER_BARRIER() \ + do { \ + __asm__ __volatile__("" \ + : \ + : \ + : "memory"); \ + } while (0) -# define CC_READ_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) -# define CC_WRITE_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) -# define CC_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) + #define CC_READ_MEMORY_BARRIER() \ + do { \ + __sync_synchronize(); \ + } while (0) + #define CC_WRITE_MEMORY_BARRIER() \ + do { \ + __sync_synchronize(); \ + } while (0) + #define CC_MEMORY_BARRIER() \ + do { \ + __sync_synchronize(); \ + } while (0) -# define CC_CPU_READ_MEMORY_BARRIER() do { __asm__ __volatile__ ("lfence" : : : "memory"); } while (0) -# define CC_CPU_WRITE_MEMORY_BARRIER() do { __asm__ __volatile__ ("sfence" : : : "memory"); } while (0) -# define CC_CPU_MEMORY_BARRIER() do { __asm__ __volatile__ ("mfence" : : : "memory"); } while (0) + #define CC_CPU_READ_MEMORY_BARRIER() \ + do { \ + __asm__ __volatile__("lfence" \ + : \ + : \ + : "memory"); \ + } while (0) + #define CC_CPU_WRITE_MEMORY_BARRIER() \ + do { \ + __asm__ __volatile__("sfence" \ + : \ + : \ + : "memory"); \ + } while (0) + #define CC_CPU_MEMORY_BARRIER() \ + do { \ + __asm__ __volatile__("mfence" \ + : \ + : \ + : "memory"); \ + } while (0) -#else -# error "Unsupported compiler!" -#endif + #else + #error "Unsupported compiler!" + #endif -#define CC_SIMD_ALIGNMENT 16 + #define CC_SIMD_ALIGNMENT 16 -#if (CC_COMPILER == CC_COMPILER_MSVC) -# define CC_DECL_MALLOC __declspec(restrict) __declspec(noalias) -#else -# define CC_DECL_MALLOC __attribute__ ((malloc)) -#endif + #if (CC_COMPILER == CC_COMPILER_MSVC) + #define CC_DECL_MALLOC __declspec(restrict) __declspec(noalias) + #else + #define CC_DECL_MALLOC __attribute__((malloc)) + #endif -/* Stack-alignment + /* Stack-alignment If macro __CC_SIMD_ALIGN_STACK defined, means there requests special code to ensure stack align to a 16-bytes boundary. @@ -262,90 +316,90 @@ Note: variables, so you need to wrap those alignment required functions with extra function call. */ -#if defined(__INTEL_COMPILER) -// For intel's compiler, simply calling alloca seems to do the right -// thing. The size of the allocated block seems to be irrelevant. -# define CC_SIMD_ALIGN_STACK() _alloca(16) -# define CC_SIMD_ALIGN_ATTRIBUTE + #if defined(__INTEL_COMPILER) + // For intel's compiler, simply calling alloca seems to do the right + // thing. The size of the allocated block seems to be irrelevant. + #define CC_SIMD_ALIGN_STACK() _alloca(16) + #define CC_SIMD_ALIGN_ATTRIBUTE -#elif (CC_CPU == CC_CPU_X86) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) && (CC_CPU_ARCH != CC_CPU_ARCH_64) -// mark functions with GCC attribute to force stack alignment to 16 bytes -# define CC_SIMD_ALIGN_ATTRIBUTE __attribute__((force_align_arg_pointer)) -#elif (CC_COMPILER == CC_COMPILER_MSVC) -// Fortunately, MSVC will align the stack automatically -# define CC_SIMD_ALIGN_ATTRIBUTE -#else -# define CC_SIMD_ALIGN_ATTRIBUTE -#endif + #elif (CC_CPU == CC_CPU_X86) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) && (CC_CPU_ARCH != CC_CPU_ARCH_64) + // mark functions with GCC attribute to force stack alignment to 16 bytes + #define CC_SIMD_ALIGN_ATTRIBUTE __attribute__((force_align_arg_pointer)) + #elif (CC_COMPILER == CC_COMPILER_MSVC) + // Fortunately, MSVC will align the stack automatically + #define CC_SIMD_ALIGN_ATTRIBUTE + #else + #define CC_SIMD_ALIGN_ATTRIBUTE + #endif -#if defined (__GNUC__) -# define CC_FUNC ((const char*) (__PRETTY_FUNCTION__)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L -# define CC_FUNC ((const char*) (__func__)) -#else -# define CC_FUNC ((const char*) (__FUNCTION__)) -#endif + #if defined(__GNUC__) + #define CC_FUNC ((const char *)(__PRETTY_FUNCTION__)) + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 19901L + #define CC_FUNC ((const char *)(__func__)) + #else + #define CC_FUNC ((const char *)(__FUNCTION__)) + #endif -// mode -#if (defined(_DEBUG) || defined(DEBUG)) && (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# define CC_MODE CC_MODE_DEBUG -#else -# define CC_MODE CC_MODE_RELEASE -#endif + // mode + #if (defined(_DEBUG) || defined(DEBUG)) && (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #define CC_MODE CC_MODE_DEBUG + #else + #define CC_MODE CC_MODE_RELEASE + #endif -// Engine Memory Management -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -#if (CC_MODE == CC_MODE_DEBUG) -# define CC_MEMORY_TRACKER -#endif -#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) -//# define CC_MEMORY_TRACKER -#else -#endif + // Engine Memory Management + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #if (CC_MODE == CC_MODE_DEBUG) + #define CC_MEMORY_TRACKER + #endif + #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + //# define CC_MEMORY_TRACKER + #else + #endif -// use simd -//#define CC_USE_SIMD + // use simd + //#define CC_USE_SIMD -// Memory Allocator -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD -# undef CC_MEMORY_TRACKER -//#if defined(CC_MEMORY_TRACKER) -//# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC -//#else -//# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD -//#endif -#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) -#if defined(CC_MEMORY_TRACKER) -# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC -#else -# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD -#endif -#else -# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD -#endif + // Memory Allocator + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD + #undef CC_MEMORY_TRACKER + //#if defined(CC_MEMORY_TRACKER) + //# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC + //#else + //# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD + //#endif + #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + #if defined(CC_MEMORY_TRACKER) + #define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC + #else + #define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD + #endif + #else + #define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD + #endif -// STL memory allocator -#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) -#define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_STANDARD -#else -#define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_CUSTOM -#endif + // STL memory allocator + #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) + #define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_STANDARD + #else + #define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_CUSTOM + #endif -#define CC_TOSTR(s) #s + #define CC_TOSTR(s) #s -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# ifdef CC_STATIC -# define CC_CORE_API -# else -# ifdef CC_CORE_EXPORTS -# define CC_CORE_API __declspec(dllexport) -# else -# define CC_CORE_API __declspec(dllimport) -# endif -# endif -#else -# define CC_CORE_API -#endif + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #ifdef CC_STATIC + #define CC_CORE_API + #else + #ifdef CC_CORE_EXPORTS + #define CC_CORE_API __declspec(dllexport) + #else + #define CC_CORE_API __declspec(dllimport) + #endif + #endif + #else + #define CC_CORE_API + #endif #endif // CC_CORE_CORE_DEF_H_ diff --git a/native/cocos/renderer/core/TypeDef.h b/native/cocos/renderer/core/TypeDef.h index 125fbb9900..e896fc2bbe 100755 --- a/native/cocos/renderer/core/TypeDef.h +++ b/native/cocos/renderer/core/TypeDef.h @@ -1,19 +1,18 @@ #ifndef CC_CORE_TYPE_DEF_H_ #define CC_CORE_TYPE_DEF_H_ -typedef unsigned int uint; -typedef unsigned short ushort; -typedef unsigned long ulong; +typedef unsigned int uint; +typedef unsigned short ushort; +typedef unsigned long ulong; -typedef unsigned int FlagBits; - -#define CC_ENUM_OPERATORS(type_) \ -CC_INLINE type_ operator | (type_ lhs, type_ rhs) { return (type_)(static_cast::type/**/>(lhs) | static_cast::type/**/>(rhs)); } \ -CC_INLINE void operator |= (type_& lhs, type_ rhs) { lhs = (type_)(static_cast::type/**/>(lhs) | static_cast::type/**/>(rhs)); } \ -CC_INLINE int operator & (type_ lhs, type_ rhs) { return (int)(static_cast::type/**/>(lhs) & static_cast::type/**/>(rhs)); } \ -CC_INLINE void operator &= (type_& lhs, type_ rhs) { lhs = (type_)(static_cast::type/**/>(lhs) & static_cast::type/**/>(rhs)); } \ -CC_INLINE bool operator || (type_ lhs, type_ rhs) { return (static_cast::type/**/>(lhs) || static_cast::type/**/>(rhs)); } \ -CC_INLINE bool operator && (type_ lhs, type_ rhs) { return (static_cast::type/**/>(lhs) && static_cast::type/**/>(rhs)); } +typedef unsigned int FlagBits; +#define CC_ENUM_OPERATORS(type_) \ + CC_INLINE type_ operator|(type_ lhs, type_ rhs) { return (type_)(static_cast::type /**/>(lhs) | static_cast::type /**/>(rhs)); } \ + CC_INLINE void operator|=(type_ &lhs, type_ rhs) { lhs = (type_)(static_cast::type /**/>(lhs) | static_cast::type /**/>(rhs)); } \ + CC_INLINE int operator&(type_ lhs, type_ rhs) { return (int)(static_cast::type /**/>(lhs) & static_cast::type /**/>(rhs)); } \ + CC_INLINE void operator&=(type_ &lhs, type_ rhs) { lhs = (type_)(static_cast::type /**/>(lhs) & static_cast::type /**/>(rhs)); } \ + CC_INLINE bool operator||(type_ lhs, type_ rhs) { return (static_cast::type /**/>(lhs) || static_cast::type /**/>(rhs)); } \ + CC_INLINE bool operator&&(type_ lhs, type_ rhs) { return (static_cast::type /**/>(lhs) && static_cast::type /**/>(rhs)); } #endif // CC_CORE_TYPE_DEF_H_ diff --git a/native/cocos/renderer/core/gfx/GFXBindingLayout.cc b/native/cocos/renderer/core/gfx/GFXBindingLayout.cc index 59e18dab1f..45605741f6 100755 --- a/native/cocos/renderer/core/gfx/GFXBindingLayout.cc +++ b/native/cocos/renderer/core/gfx/GFXBindingLayout.cc @@ -2,6 +2,7 @@ #include "GFXBindingLayout.h" namespace cc { +namespace gfx { GFXBindingLayout::GFXBindingLayout(GFXDevice *device) : GFXObject(GFXObjectType::BINDING_LAYOUT), _device(device) { @@ -61,4 +62,5 @@ void GFXBindingLayout::bindSampler(uint binding, GFXSampler *sampler) { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXBindingLayout.h b/native/cocos/renderer/core/gfx/GFXBindingLayout.h index c4296a72bb..5fbca2fd87 100755 --- a/native/cocos/renderer/core/gfx/GFXBindingLayout.h +++ b/native/cocos/renderer/core/gfx/GFXBindingLayout.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXBindingLayout : public GFXObject { public: @@ -28,6 +29,7 @@ protected: bool _isDirty = false; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_BINDING_LAYOUT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXBuffer.cc b/native/cocos/renderer/core/gfx/GFXBuffer.cc index 4c856b0908..4e1d3d179e 100755 --- a/native/cocos/renderer/core/gfx/GFXBuffer.cc +++ b/native/cocos/renderer/core/gfx/GFXBuffer.cc @@ -2,6 +2,7 @@ #include "GFXBuffer.h" namespace cc { +namespace gfx { GFXBuffer::GFXBuffer(GFXDevice *device) : GFXObject(GFXObjectType::BUFFER), _device(device) { @@ -10,4 +11,5 @@ GFXBuffer::GFXBuffer(GFXDevice *device) GFXBuffer::~GFXBuffer() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXBuffer.h b/native/cocos/renderer/core/gfx/GFXBuffer.h index 382c0ed0e3..907dada188 100755 --- a/native/cocos/renderer/core/gfx/GFXBuffer.h +++ b/native/cocos/renderer/core/gfx/GFXBuffer.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXBuffer : public GFXObject { public: @@ -36,6 +37,7 @@ protected: uint8_t *_buffer = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_BUFFER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXCommand.h b/native/cocos/renderer/core/gfx/GFXCommand.h index b8809112a5..89873de7c2 100644 --- a/native/cocos/renderer/core/gfx/GFXCommand.h +++ b/native/cocos/renderer/core/gfx/GFXCommand.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { enum class GFXCmdType : uint8_t { BEGIN_RENDER_PASS, @@ -23,4 +24,5 @@ public: virtual void clear() = 0; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc b/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc index 3e78ba8a88..3b2df8fd70 100755 --- a/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc +++ b/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc @@ -2,6 +2,7 @@ #include "GFXCommandAllocator.h" namespace cc { +namespace gfx { GFXCommandAllocator::GFXCommandAllocator(GFXDevice *device) : GFXObject(GFXObjectType::COMMAND_ALLOCATOR), _device(device) { @@ -10,4 +11,5 @@ GFXCommandAllocator::GFXCommandAllocator(GFXDevice *device) GFXCommandAllocator::~GFXCommandAllocator() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXCommandAllocator.h b/native/cocos/renderer/core/gfx/GFXCommandAllocator.h index 5ff753bf4a..da18e2ec2c 100755 --- a/native/cocos/renderer/core/gfx/GFXCommandAllocator.h +++ b/native/cocos/renderer/core/gfx/GFXCommandAllocator.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXCommandAllocator : public GFXObject { public: @@ -20,6 +21,7 @@ protected: GFXDevice *_device = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_COMMAND_ALLOCATOR_H_ diff --git a/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc b/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc index 24380b0f19..316e560a51 100755 --- a/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc +++ b/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc @@ -2,6 +2,7 @@ #include "GFXCommandBuffer.h" namespace cc { +namespace gfx { GFXCommandBuffer::GFXCommandBuffer(GFXDevice *device) : GFXObject(GFXObjectType::COMMAND_BUFFER), _device(device) { @@ -10,4 +11,5 @@ GFXCommandBuffer::GFXCommandBuffer(GFXDevice *device) GFXCommandBuffer::~GFXCommandBuffer() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXCommandBuffer.h b/native/cocos/renderer/core/gfx/GFXCommandBuffer.h index 0b45b28126..60bb2a8d22 100755 --- a/native/cocos/renderer/core/gfx/GFXCommandBuffer.h +++ b/native/cocos/renderer/core/gfx/GFXCommandBuffer.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXCommandBuffer : public GFXObject { public: @@ -49,6 +50,7 @@ protected: uint32_t _numTriangles = 0; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_COMMAND_ALLOCATOR_H_ diff --git a/native/cocos/renderer/core/gfx/GFXCommandPool.h b/native/cocos/renderer/core/gfx/GFXCommandPool.h index 3c0bf53694..5635c038f2 100644 --- a/native/cocos/renderer/core/gfx/GFXCommandPool.h +++ b/native/cocos/renderer/core/gfx/GFXCommandPool.h @@ -3,6 +3,7 @@ #include "GFXCommand.h" namespace cc { +namespace gfx { #define INITIAL_CAPACITY 1 @@ -85,4 +86,5 @@ private: int _freeIdx = 0; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXContext.cc b/native/cocos/renderer/core/gfx/GFXContext.cc index 232a230565..5fed32f57c 100755 --- a/native/cocos/renderer/core/gfx/GFXContext.cc +++ b/native/cocos/renderer/core/gfx/GFXContext.cc @@ -2,6 +2,7 @@ #include "GFXContext.h" namespace cc { +namespace gfx { GFXContext::GFXContext(GFXDevice *device) : _device(device) { @@ -10,4 +11,5 @@ GFXContext::GFXContext(GFXDevice *device) GFXContext::~GFXContext() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXContext.h b/native/cocos/renderer/core/gfx/GFXContext.h index eae7645b11..615208d463 100755 --- a/native/cocos/renderer/core/gfx/GFXContext.h +++ b/native/cocos/renderer/core/gfx/GFXContext.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXContext : public Object { public: @@ -30,6 +31,7 @@ protected: GFXFormat _depthStencilFmt = GFXFormat::UNKNOWN; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_CONTEXT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXDef.cc b/native/cocos/renderer/core/gfx/GFXDef.cc index bad3f8f303..9026af87ec 100755 --- a/native/cocos/renderer/core/gfx/GFXDef.cc +++ b/native/cocos/renderer/core/gfx/GFXDef.cc @@ -2,6 +2,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { const GFXFormatInfo GFX_FORMAT_INFOS[] = { {"UNKNOWN", 0, 0, GFXFormatType::NONE, false, false, false, false}, @@ -207,4 +208,5 @@ uint GFXFormatSurfaceSize(GFXFormat format, uint width, uint height, uint depth, return size; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXDef.h b/native/cocos/renderer/core/gfx/GFXDef.h index 7f30ebb28f..e50ed48a9e 100755 --- a/native/cocos/renderer/core/gfx/GFXDef.h +++ b/native/cocos/renderer/core/gfx/GFXDef.h @@ -2,6 +2,7 @@ #define CC_CORE_GFX_DEF_H_ namespace cc { +namespace gfx { class GFXDevice; class GFXBuffer; @@ -1027,6 +1028,7 @@ extern CC_CORE_API uint GFXFormatSize(GFXFormat format, uint width, uint height, extern CC_CORE_API uint GFXFormatSurfaceSize(GFXFormat format, uint width, uint height, uint depth, uint mips); -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_DEF_H_ diff --git a/native/cocos/renderer/core/gfx/GFXDevice.cc b/native/cocos/renderer/core/gfx/GFXDevice.cc index be1700d9b9..ab5d45dbe6 100755 --- a/native/cocos/renderer/core/gfx/GFXDevice.cc +++ b/native/cocos/renderer/core/gfx/GFXDevice.cc @@ -2,6 +2,7 @@ #include "GFXDevice.h" #include "GFXContext.h" namespace cc { +namespace gfx { GFXDevice::GFXDevice() { memset(_features, 0, sizeof(_features)); @@ -18,4 +19,5 @@ GFXFormat GFXDevice::getDepthStencilFormat() const { return _context->getDepthStencilFormat(); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXDevice.h b/native/cocos/renderer/core/gfx/GFXDevice.h index 5a16e7af3d..46fb5ef268 100755 --- a/native/cocos/renderer/core/gfx/GFXDevice.h +++ b/native/cocos/renderer/core/gfx/GFXDevice.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXDevice : public Object { public: @@ -106,6 +107,7 @@ protected: float _projectionSignY = 1.0f; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_DEVICE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXFence.cc b/native/cocos/renderer/core/gfx/GFXFence.cc index 28dcaec3f7..981cb761f4 100644 --- a/native/cocos/renderer/core/gfx/GFXFence.cc +++ b/native/cocos/renderer/core/gfx/GFXFence.cc @@ -2,6 +2,7 @@ #include "GFXFence.h" namespace cc { +namespace gfx { GFXFence::GFXFence(GFXDevice *device) : GFXObject(GFXObjectType::FENCE), _device(device) { @@ -10,4 +11,5 @@ GFXFence::GFXFence(GFXDevice *device) GFXFence::~GFXFence() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXFence.h b/native/cocos/renderer/core/gfx/GFXFence.h index 05014cf630..a4dd59effe 100644 --- a/native/cocos/renderer/core/gfx/GFXFence.h +++ b/native/cocos/renderer/core/gfx/GFXFence.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXFence : public GFXObject { public: @@ -20,6 +21,7 @@ protected: GFXDevice *_device = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_FENCE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXFramebuffer.cc b/native/cocos/renderer/core/gfx/GFXFramebuffer.cc index 73de713d80..873cdfd877 100755 --- a/native/cocos/renderer/core/gfx/GFXFramebuffer.cc +++ b/native/cocos/renderer/core/gfx/GFXFramebuffer.cc @@ -2,6 +2,7 @@ #include "GFXFramebuffer.h" namespace cc { +namespace gfx { GFXFramebuffer::GFXFramebuffer(GFXDevice *device) : GFXObject(GFXObjectType::FRAMEBUFFER), _device(device) { @@ -10,4 +11,5 @@ GFXFramebuffer::GFXFramebuffer(GFXDevice *device) GFXFramebuffer::~GFXFramebuffer() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXFramebuffer.h b/native/cocos/renderer/core/gfx/GFXFramebuffer.h index bc56eb2082..69f87009a0 100755 --- a/native/cocos/renderer/core/gfx/GFXFramebuffer.h +++ b/native/cocos/renderer/core/gfx/GFXFramebuffer.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXFramebuffer : public GFXObject { public: @@ -28,6 +29,7 @@ protected: bool _isOffscreen = true; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_FRAME_BUFFER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXInputAssembler.cc b/native/cocos/renderer/core/gfx/GFXInputAssembler.cc index eebe2d9d18..07e7bdbaaf 100755 --- a/native/cocos/renderer/core/gfx/GFXInputAssembler.cc +++ b/native/cocos/renderer/core/gfx/GFXInputAssembler.cc @@ -2,6 +2,7 @@ #include "GFXInputAssembler.h" namespace cc { +namespace gfx { GFXInputAssembler::GFXInputAssembler(GFXDevice *device) : GFXObject(GFXObjectType::INPUT_ASSEMBLER), _device(device) { @@ -35,4 +36,5 @@ uint GFXInputAssembler::computeAttributesHash() const { return seed; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXInputAssembler.h b/native/cocos/renderer/core/gfx/GFXInputAssembler.h index f67599159a..2dc8ed7e05 100755 --- a/native/cocos/renderer/core/gfx/GFXInputAssembler.h +++ b/native/cocos/renderer/core/gfx/GFXInputAssembler.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXInputAssembler : public GFXObject { public: @@ -56,6 +57,7 @@ protected: uint _attributesHash = 0; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_INPUT_ASSEMBLER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXObject.cc b/native/cocos/renderer/core/gfx/GFXObject.cc index 923ad35fe7..e646c64bc1 100644 --- a/native/cocos/renderer/core/gfx/GFXObject.cc +++ b/native/cocos/renderer/core/gfx/GFXObject.cc @@ -2,8 +2,10 @@ #include "GFXObject.h" namespace cc { +namespace gfx { GFXObject::GFXObject(GFXObjectType gfxType) : _gfxType(gfxType) {} -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXObject.h b/native/cocos/renderer/core/gfx/GFXObject.h index 5a99884ef6..c43f64c14c 100644 --- a/native/cocos/renderer/core/gfx/GFXObject.h +++ b/native/cocos/renderer/core/gfx/GFXObject.h @@ -3,6 +3,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class GFXObject : public Object { public: @@ -17,4 +18,5 @@ protected: GFXStatus _status = GFXStatus::UNREADY; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc b/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc index c43da85e88..10198e9d80 100755 --- a/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc +++ b/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc @@ -2,6 +2,7 @@ #include "GFXPipelineLayout.h" namespace cc { +namespace gfx { GFXPipelineLayout::GFXPipelineLayout(GFXDevice *device) : GFXObject(GFXObjectType::PIPELINE_LAYOUT), _device(device) { @@ -10,4 +11,5 @@ GFXPipelineLayout::GFXPipelineLayout(GFXDevice *device) GFXPipelineLayout::~GFXPipelineLayout() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXPipelineLayout.h b/native/cocos/renderer/core/gfx/GFXPipelineLayout.h index 8b39d81f68..fe93d8cb19 100755 --- a/native/cocos/renderer/core/gfx/GFXPipelineLayout.h +++ b/native/cocos/renderer/core/gfx/GFXPipelineLayout.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXPipelineLayout : public GFXObject { public: @@ -24,6 +25,7 @@ protected: GFXBindingLayoutList _layouts; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_PIPELINE_LAYOUT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXPipelineState.cc b/native/cocos/renderer/core/gfx/GFXPipelineState.cc index 88c857a9b3..0b761c1cf4 100755 --- a/native/cocos/renderer/core/gfx/GFXPipelineState.cc +++ b/native/cocos/renderer/core/gfx/GFXPipelineState.cc @@ -2,6 +2,7 @@ #include "GFXPipelineState.h" namespace cc { +namespace gfx { GFXPipelineState::GFXPipelineState(GFXDevice *device) : GFXObject(GFXObjectType::PIPELINE_STATE), _device(device) { @@ -10,4 +11,5 @@ GFXPipelineState::GFXPipelineState(GFXDevice *device) GFXPipelineState::~GFXPipelineState() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXPipelineState.h b/native/cocos/renderer/core/gfx/GFXPipelineState.h index 942b22696d..aac716b564 100755 --- a/native/cocos/renderer/core/gfx/GFXPipelineState.h +++ b/native/cocos/renderer/core/gfx/GFXPipelineState.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXPipelineState : public GFXObject { public: @@ -38,6 +39,7 @@ protected: GFXRenderPass *_renderPass = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_PIPELINE_STATE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXQueue.cc b/native/cocos/renderer/core/gfx/GFXQueue.cc index 6b0e52cbcc..57a4e2979d 100755 --- a/native/cocos/renderer/core/gfx/GFXQueue.cc +++ b/native/cocos/renderer/core/gfx/GFXQueue.cc @@ -2,6 +2,7 @@ #include "GFXQueue.h" namespace cc { +namespace gfx { GFXQueue::GFXQueue(GFXDevice *device) : GFXObject(GFXObjectType::QUEUE), _device(device) { @@ -10,4 +11,5 @@ GFXQueue::GFXQueue(GFXDevice *device) GFXQueue::~GFXQueue() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXQueue.h b/native/cocos/renderer/core/gfx/GFXQueue.h index 1bc3fcaa38..f6fd776210 100755 --- a/native/cocos/renderer/core/gfx/GFXQueue.h +++ b/native/cocos/renderer/core/gfx/GFXQueue.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXQueue : public GFXObject { public: @@ -24,6 +25,7 @@ protected: GFXQueueType _type = GFXQueueType::GRAPHICS; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_QUEUE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXRenderPass.cc b/native/cocos/renderer/core/gfx/GFXRenderPass.cc index bf35a92cc2..8ff21592fb 100755 --- a/native/cocos/renderer/core/gfx/GFXRenderPass.cc +++ b/native/cocos/renderer/core/gfx/GFXRenderPass.cc @@ -2,6 +2,7 @@ #include "GFXRenderPass.h" namespace cc { +namespace gfx { GFXRenderPass::GFXRenderPass(GFXDevice *device) : GFXObject(GFXObjectType::RENDER_PASS), _device(device) { @@ -36,4 +37,5 @@ uint GFXRenderPass::computeHash() const { return seed; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXRenderPass.h b/native/cocos/renderer/core/gfx/GFXRenderPass.h index c1f3eca8e5..1c646f61ce 100755 --- a/native/cocos/renderer/core/gfx/GFXRenderPass.h +++ b/native/cocos/renderer/core/gfx/GFXRenderPass.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXRenderPass : public GFXObject { public: @@ -30,6 +31,7 @@ protected: uint _hash = 0; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_RENDER_PASS_H_ diff --git a/native/cocos/renderer/core/gfx/GFXSampler.cc b/native/cocos/renderer/core/gfx/GFXSampler.cc index b0e787741b..dac66e9650 100755 --- a/native/cocos/renderer/core/gfx/GFXSampler.cc +++ b/native/cocos/renderer/core/gfx/GFXSampler.cc @@ -2,6 +2,7 @@ #include "GFXSampler.h" namespace cc { +namespace gfx { GFXSampler::GFXSampler(GFXDevice *device) : GFXObject(GFXObjectType::SAMPLER), _device(device) { @@ -14,4 +15,5 @@ GFXSampler::GFXSampler(GFXDevice *device) GFXSampler::~GFXSampler() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXSampler.h b/native/cocos/renderer/core/gfx/GFXSampler.h index 790963479c..dd38ef034e 100755 --- a/native/cocos/renderer/core/gfx/GFXSampler.h +++ b/native/cocos/renderer/core/gfx/GFXSampler.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXSampler : public GFXObject { public: @@ -46,6 +47,7 @@ protected: float _mipLODBias = 0.0f; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_SAMPLER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXShader.cc b/native/cocos/renderer/core/gfx/GFXShader.cc index 9dbd16e833..19e08758e3 100755 --- a/native/cocos/renderer/core/gfx/GFXShader.cc +++ b/native/cocos/renderer/core/gfx/GFXShader.cc @@ -2,6 +2,7 @@ #include "GFXShader.h" namespace cc { +namespace gfx { GFXShader::GFXShader(GFXDevice *device) : GFXObject(GFXObjectType::SHADER), _device(device) { @@ -10,4 +11,5 @@ GFXShader::GFXShader(GFXDevice *device) GFXShader::~GFXShader() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXShader.h b/native/cocos/renderer/core/gfx/GFXShader.h index 5bc4bce592..8cab1b8aaf 100755 --- a/native/cocos/renderer/core/gfx/GFXShader.h +++ b/native/cocos/renderer/core/gfx/GFXShader.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXShader : public GFXObject { public: @@ -33,6 +34,7 @@ protected: GFXUniformSamplerList _samplers; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_TEXTURE_VIEW_H_ diff --git a/native/cocos/renderer/core/gfx/GFXTexture.cc b/native/cocos/renderer/core/gfx/GFXTexture.cc index f4affcf169..4762787aca 100755 --- a/native/cocos/renderer/core/gfx/GFXTexture.cc +++ b/native/cocos/renderer/core/gfx/GFXTexture.cc @@ -2,6 +2,7 @@ #include "GFXTexture.h" namespace cc { +namespace gfx { GFXTexture::GFXTexture(GFXDevice *device) : GFXObject(GFXObjectType::TEXTURE), _device(device) { @@ -10,4 +11,5 @@ GFXTexture::GFXTexture(GFXDevice *device) GFXTexture::~GFXTexture() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/gfx/GFXTexture.h b/native/cocos/renderer/core/gfx/GFXTexture.h index 2bdfe433cd..4de459938a 100755 --- a/native/cocos/renderer/core/gfx/GFXTexture.h +++ b/native/cocos/renderer/core/gfx/GFXTexture.h @@ -4,6 +4,7 @@ #include "GFXDef.h" namespace cc { +namespace gfx { class CC_CORE_API GFXTexture : public GFXObject { public: @@ -45,6 +46,7 @@ protected: uint8_t *_buffer = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_GFX_TEXTURE_H_ diff --git a/native/cocos/renderer/core/kernel/Assertion.cc b/native/cocos/renderer/core/kernel/Assertion.cc index 339e870c55..9dc863b452 100755 --- a/native/cocos/renderer/core/kernel/Assertion.cc +++ b/native/cocos/renderer/core/kernel/Assertion.cc @@ -3,148 +3,140 @@ // Platform head file including #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -#include -# undef _T -# include -#define snprintf _snprintf_s + #include + #undef _T + #include + #define snprintf _snprintf_s #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) -# include + #include #endif namespace cc { +namespace gfx { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) enum ErrRet { - ERRRET_IGNORE = 0, - ERRRET_BREAKPOINT, - ERRRET_EXIT + ERRRET_IGNORE = 0, + ERRRET_BREAKPOINT, + ERRRET_EXIT }; LRESULT __stdcall CBTHookProc(long nCode, WPARAM wParam, LPARAM lParam) { - if (nCode == HCBT_ACTIVATE) { - SetDlgItemTextA((HWND)wParam, IDRETRY, "&Debug"); - SetDlgItemTextA((HWND)wParam, IDIGNORE, "&Ignore"); - SetDlgItemTextA((HWND)wParam, IDABORT, "&Exit"); - } - return 0; + if (nCode == HCBT_ACTIVATE) { + SetDlgItemTextA((HWND)wParam, IDRETRY, "&Debug"); + SetDlgItemTextA((HWND)wParam, IDIGNORE, "&Ignore"); + SetDlgItemTextA((HWND)wParam, IDABORT, "&Exit"); + } + return 0; } -ErrRet _DisplayError(const char* title, const char* content, const char* desc, const char* fileName, int lineNum) { - const int MODULE_NAME_SIZE = 255; - char moduleName[MODULE_NAME_SIZE]; - - // attempt to get the module name - if (!GetModuleFileNameA(NULL, moduleName, MODULE_NAME_SIZE)) - { - char *msg = ""; - strcpy_s(moduleName, strlen(msg), msg); - } - - // build a collosal string containing the entire asster message - const int MAX_BUFFER_SIZE = 4096; - char buffer[MAX_BUFFER_SIZE]; - - snprintf(buffer, - MAX_BUFFER_SIZE, - "%s\n\nProgram : %s\nFile : %s\nLine : %d\nError: %s\nComment: %s\n", - title, - moduleName, - fileName, - lineNum, - content, - desc); - - - // place a copy of the message into the clipboard - if (OpenClipboard(NULL)) { - size_t bufferLength = strlen(buffer); - HGLOBAL hMem = GlobalAlloc(GHND|GMEM_DDESHARE, bufferLength+1); - - if (hMem) { - uint8_t* pMem = (uint8_t*)GlobalLock(hMem); - memcpy(pMem, buffer, bufferLength); - GlobalUnlock(hMem); - EmptyClipboard(); - SetClipboardData(CF_TEXT, hMem); - } - - CloseClipboard(); - } - - // find the top most window of the current application - HWND hWndParent = GetActiveWindow(); - if (NULL != hWndParent) { - hWndParent = GetLastActivePopup(hWndParent); - } +ErrRet _DisplayError(const char *title, const char *content, const char *desc, const char *fileName, int lineNum) { + const int MODULE_NAME_SIZE = 255; + char moduleName[MODULE_NAME_SIZE]; - HHOOK hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHookProc, GetModuleHandle(NULL), GetCurrentThreadId()); - // put up a message box with the error - int iRet = MessageBoxA ( hWndParent, - buffer, - "ERROR NOTIFICATION...", - MB_TASKMODAL|MB_SETFOREGROUND|MB_ABORTRETRYIGNORE|MB_ICONERROR); - UnhookWindowsHookEx(hHook); + // attempt to get the module name + if (!GetModuleFileNameA(NULL, moduleName, MODULE_NAME_SIZE)) { + char *msg = ""; + strcpy_s(moduleName, strlen(msg), msg); + } - if (iRet == IDRETRY) - { - // ignore this error and continue - return ERRRET_BREAKPOINT; - } - else if (iRet == IDIGNORE) - { - // ignore this error and continue, - // plus never stop on this error again (handled by the caller) - return (ERRRET_IGNORE); - } - else - { - return ERRRET_EXIT; - } + // build a collosal string containing the entire asster message + const int MAX_BUFFER_SIZE = 4096; + char buffer[MAX_BUFFER_SIZE]; + + snprintf(buffer, + MAX_BUFFER_SIZE, + "%s\n\nProgram : %s\nFile : %s\nLine : %d\nError: %s\nComment: %s\n", + title, + moduleName, + fileName, + lineNum, + content, + desc); + + // place a copy of the message into the clipboard + if (OpenClipboard(NULL)) { + size_t bufferLength = strlen(buffer); + HGLOBAL hMem = GlobalAlloc(GHND | GMEM_DDESHARE, bufferLength + 1); + + if (hMem) { + uint8_t *pMem = (uint8_t *)GlobalLock(hMem); + memcpy(pMem, buffer, bufferLength); + GlobalUnlock(hMem); + EmptyClipboard(); + SetClipboardData(CF_TEXT, hMem); + } + + CloseClipboard(); + } + + // find the top most window of the current application + HWND hWndParent = GetActiveWindow(); + if (NULL != hWndParent) { + hWndParent = GetLastActivePopup(hWndParent); + } + + HHOOK hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHookProc, GetModuleHandle(NULL), GetCurrentThreadId()); + // put up a message box with the error + int iRet = MessageBoxA(hWndParent, + buffer, + "ERROR NOTIFICATION...", + MB_TASKMODAL | MB_SETFOREGROUND | MB_ABORTRETRYIGNORE | MB_ICONERROR); + UnhookWindowsHookEx(hHook); + + if (iRet == IDRETRY) { + // ignore this error and continue + return ERRRET_BREAKPOINT; + } else if (iRet == IDIGNORE) { + // ignore this error and continue, + // plus never stop on this error again (handled by the caller) + return (ERRRET_IGNORE); + } else { + return ERRRET_EXIT; + } } -int _ExecAssert(const char* condition, const char* filename, int line, const char* formats, ...) -{ - char buffer[4096]; - va_list args; - va_start(args, formats); - vsnprintf(buffer, sizeof(buffer) - 1, formats, args); - va_end(args); +int _ExecAssert(const char *condition, const char *filename, int line, const char *formats, ...) { + char buffer[4096]; + va_list args; + va_start(args, formats); + vsnprintf(buffer, sizeof(buffer) - 1, formats, args); + va_end(args); - ErrRet ret = _DisplayError("Assert Failed!", condition, buffer, filename, line); - if (ret == ERRRET_BREAKPOINT) { - return 1; - } - else if (ret == ERRRET_EXIT) { - ExitProcess((UINT)-1); - } - return 0; + ErrRet ret = _DisplayError("Assert Failed!", condition, buffer, filename, line); + if (ret == ERRRET_BREAKPOINT) { + return 1; + } else if (ret == ERRRET_EXIT) { + ExitProcess((UINT)-1); + } + return 0; } #else -int _ExecAssert(const char* condition, const char* filename, int line, const char* formats, ...) -{ - char buffer[4096]; - va_list args; - va_start(args, formats); +int _ExecAssert(const char *condition, const char *filename, int line, const char *formats, ...) { + char buffer[4096]; + va_list args; + va_start(args, formats); vsnprintf(buffer, sizeof(buffer) - 1, formats, args); - va_end(args); + va_end(args); - _ExecAssertOutput(condition, filename, line, buffer); - return 0; + _ExecAssertOutput(condition, filename, line, buffer); + return 0; } #endif -void _ExecAssertOutput(const char* condition, const char* filename, int line, const char* msg) { - char buffer[4096]; - snprintf(buffer, sizeof(buffer) - 1, "[ASSERT] %s (%s:%d) %s", condition, filename, line, msg); +void _ExecAssertOutput(const char *condition, const char *filename, int line, const char *msg) { + char buffer[4096]; + snprintf(buffer, sizeof(buffer) - 1, "[ASSERT] %s (%s:%d) %s", condition, filename, line, msg); #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) - OutputDebugStringA(buffer); + OutputDebugStringA(buffer); #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) - __android_log_write(ANDROID_LOG_FATAL, "Cocos", buffer); + __android_log_write(ANDROID_LOG_FATAL, "Cocos", buffer); #else - fputs(buffer, stdout); + fputs(buffer, stdout); #endif } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/kernel/Assertion.h b/native/cocos/renderer/core/kernel/Assertion.h index f08e2b721f..daaf7d3e27 100755 --- a/native/cocos/renderer/core/kernel/Assertion.h +++ b/native/cocos/renderer/core/kernel/Assertion.h @@ -2,18 +2,19 @@ #define CC_CORE_KERNEL_ASSERTION_H_ namespace cc { +namespace gfx { //#if defined(__GNUC__) #if 0 -#define LIKELY(x) (__builtin_expect(!!(x), 1)) -#define UNLIKELY(x) (__builtin_expect(!!(x), 0)) + #define LIKELY(x) (__builtin_expect(!!(x), 1)) + #define UNLIKELY(x) (__builtin_expect(!!(x), 0)) #else -#define LIKELY(x) (x) -#define UNLIKELY(x) (x) + #define LIKELY(x) (x) + #define UNLIKELY(x) (x) #endif -CC_CORE_API int _ExecAssert(const char *condition, const char *fileName, int lineNumber, const char *formats, ...); -CC_CORE_API void _ExecAssertOutput(const char *condition, const char *fileName, int lineNumber, const char* msg); +CC_CORE_API int _ExecAssert(const char *condition, const char *fileName, int lineNumber, const char *formats, ...); +CC_CORE_API void _ExecAssertOutput(const char *condition, const char *fileName, int lineNumber, const char *msg); //#if (CC_MODE == CC_MODE_DEBUG) //# if (CC_PLATFORM == CC_PLATFORM_WINDOWS) @@ -27,6 +28,7 @@ CC_CORE_API void _ExecAssertOutput(const char *condition, const char *fileName, //#define CCASSERT(x) CCASSERT(x, "%s", "") -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_KERNEL_ASSERTION_H_ diff --git a/native/cocos/renderer/core/kernel/CachedArray.h b/native/cocos/renderer/core/kernel/CachedArray.h index 31f4c632e0..fd098cb059 100755 --- a/native/cocos/renderer/core/kernel/CachedArray.h +++ b/native/cocos/renderer/core/kernel/CachedArray.h @@ -2,76 +2,78 @@ #define CC_CORE_KERNEL_CACHED_ARRAY_H_ namespace cc { +namespace gfx { template class CachedArray { - public: - CachedArray(uint size = 1) { - _size = 0; - _capacity = std::max(size, 1U); - _array = new T[_capacity]; - } - - ~CachedArray() { - delete [] (_array); - } - - T& operator [] (int index) { - return _array[index]; - } - - const T& operator [] (int index) const { - return _array[index]; - } - - void clear() { - // memset(_array, 0, _size * sizeof(T)); - _size = 0; - } - - void push(T item) { - if (_size >= _capacity) { - T* temp = _array; - _array = new T[_capacity*2]; - for (uint i = 0; i < _capacity; ++i) { - _array[i] = temp[i]; - } - _capacity *= 2; - delete [] (temp); +public: + CachedArray(uint size = 1) { + _size = 0; + _capacity = std::max(size, 1U); + _array = new T[_capacity]; } - _array[_size++] = item; - } - - T pop() { - return _array[--_size]; - } - - uint size() const { - return _size; - } - - void concat(const CachedArray& array) { - if (_size + array.size() >= _capacity) { - T* temp = _array; - uint size = std::max(_capacity*2, _size + array.size()); - _array = new T[size]; - for (uint i = 0; i < _capacity; ++i) { - _array[i] = temp[i]; - } - _capacity = size; - delete [] (temp); + + ~CachedArray() { + delete[](_array); } - for (uint i = 0; i < array.size(); ++i) { - _array[_size++] = array[i]; + + T &operator[](int index) { + return _array[index]; } - } - - private: - uint _size = 0; - uint _capacity = 0; - T* _array = nullptr; + + const T &operator[](int index) const { + return _array[index]; + } + + void clear() { + // memset(_array, 0, _size * sizeof(T)); + _size = 0; + } + + void push(T item) { + if (_size >= _capacity) { + T *temp = _array; + _array = new T[_capacity * 2]; + for (uint i = 0; i < _capacity; ++i) { + _array[i] = temp[i]; + } + _capacity *= 2; + delete[](temp); + } + _array[_size++] = item; + } + + T pop() { + return _array[--_size]; + } + + uint size() const { + return _size; + } + + void concat(const CachedArray &array) { + if (_size + array.size() >= _capacity) { + T *temp = _array; + uint size = std::max(_capacity * 2, _size + array.size()); + _array = new T[size]; + for (uint i = 0; i < _capacity; ++i) { + _array[i] = temp[i]; + } + _capacity = size; + delete[](temp); + } + for (uint i = 0; i < array.size(); ++i) { + _array[_size++] = array[i]; + } + } + +private: + uint _size = 0; + uint _capacity = 0; + T *_array = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_KERNEL_CACHED_ARRAY_H_ diff --git a/native/cocos/renderer/core/kernel/Log.cc b/native/cocos/renderer/core/kernel/Log.cc index fa5cdece9c..9de7ffdb04 100755 --- a/native/cocos/renderer/core/kernel/Log.cc +++ b/native/cocos/renderer/core/kernel/Log.cc @@ -4,142 +4,143 @@ #include "util/StringUtil.h" #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include -#define COLOR_FATAL FOREGROUND_INTENSITY | FOREGROUND_RED -#define COLOR_ERROR FOREGROUND_RED -#define COLOR_WARN 6 -#define COLOR_INFO FOREGROUND_GREEN | FOREGROUND_BLUE -#define COLOR_DEBUG 7 -#define COLOR_NORMAL 8 -#define SET_CONSOLE_TEXT_COLOR(color) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color) + #define COLOR_FATAL FOREGROUND_INTENSITY | FOREGROUND_RED + #define COLOR_ERROR FOREGROUND_RED + #define COLOR_WARN 6 + #define COLOR_INFO FOREGROUND_GREEN | FOREGROUND_BLUE + #define COLOR_DEBUG 7 + #define COLOR_NORMAL 8 + #define SET_CONSOLE_TEXT_COLOR(color) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color) #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) -# include + #include #endif namespace cc { +namespace gfx { #define LOG_USE_TIMESTAMP LogLevel Log::log_level = LogLevel::DEBUG; -FILE* Log::log_file_ = nullptr; -const char* LOG_LEVEL_DESCS[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG" }; +FILE *Log::log_file_ = nullptr; +const char *LOG_LEVEL_DESCS[] = {"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}; -void Log::set_log_file(const std::string& filename) { +void Log::set_log_file(const std::string &filename) { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) - if (log_file_) { - fclose(log_file_); - } - - log_file_ = fopen(filename.c_str(), "w"); - - if (log_file_) { - String msg; - msg += "------------------------------------------------------\n"; - - struct tm* tm_time; - time_t ct_time; - time(&ct_time); - tm_time = localtime(&ct_time); - - msg += StringUtil::Format("LOG DATE: %04d-%02d-%02d %02d:%02d:%02d\n", - tm_time->tm_year + 1900, - tm_time->tm_mon + 1, - tm_time->tm_mday, - tm_time->tm_hour, - tm_time->tm_min, - tm_time->tm_sec); - - msg += "------------------------------------------------------\n"; - - fputs(msg.c_str(), log_file_); - fflush(log_file_); - } + if (log_file_) { + fclose(log_file_); + } + + log_file_ = fopen(filename.c_str(), "w"); + + if (log_file_) { + String msg; + msg += "------------------------------------------------------\n"; + + struct tm *tm_time; + time_t ct_time; + time(&ct_time); + tm_time = localtime(&ct_time); + + msg += StringUtil::Format("LOG DATE: %04d-%02d-%02d %02d:%02d:%02d\n", + tm_time->tm_year + 1900, + tm_time->tm_mon + 1, + tm_time->tm_mday, + tm_time->tm_hour, + tm_time->tm_min, + tm_time->tm_sec); + + msg += "------------------------------------------------------\n"; + + fputs(msg.c_str(), log_file_); + fflush(log_file_); + } #endif } void Log::Close() { - if (log_file_) { - fclose(log_file_); - log_file_ = nullptr; - } + if (log_file_) { + fclose(log_file_); + log_file_ = nullptr; + } } -void Log::LogMessage(LogType type, LogLevel level, const char* formats, ...) { - char buff[4096]; - char* p = buff; - char* last = buff + sizeof(buff) - 3; - +void Log::LogMessage(LogType type, LogLevel level, const char *formats, ...) { + char buff[4096]; + char *p = buff; + char *last = buff + sizeof(buff) - 3; + #if defined(LOG_USE_TIMESTAMP) - struct tm* tm_time; - time_t ct_time; - time(&ct_time); - tm_time = localtime(&ct_time); - - p += sprintf(p, "%02d:%02d:%02d ", tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); + struct tm *tm_time; + time_t ct_time; + time(&ct_time); + tm_time = localtime(&ct_time); + + p += sprintf(p, "%02d:%02d:%02d ", tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); #endif - - p += sprintf(p, "[%s]: ", LOG_LEVEL_DESCS[(int)level]); - - va_list args; - va_start(args, formats); - // p += StringUtil::VPrintf(p, last, formats, args); - - int count = (int)(last - p); - int ret = vsnprintf(p, count, formats, args); - if (ret >= count - 1) { - p += (count - 1); - } else if (ret >= 0) { - p += ret; - } - - va_end(args); - - *p++ = '\n'; - *p = 0; - - if (log_file_) - { - fputs(buff, log_file_); - fflush(log_file_); - } - + + p += sprintf(p, "[%s]: ", LOG_LEVEL_DESCS[(int)level]); + + va_list args; + va_start(args, formats); + // p += StringUtil::VPrintf(p, last, formats, args); + + int count = (int)(last - p); + int ret = vsnprintf(p, count, formats, args); + if (ret >= count - 1) { + p += (count - 1); + } else if (ret >= 0) { + p += ret; + } + + va_end(args); + + *p++ = '\n'; + *p = 0; + + if (log_file_) { + fputs(buff, log_file_); + fflush(log_file_); + } + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) - UTFString utfstr(buff); - const wchar_t* ustr = utfstr.asWStr_c_str(); - - WORD color; - switch (level) { - case LogLevel::DEBUG: color = COLOR_DEBUG; break; - case LogLevel::INFO: color = COLOR_INFO; break; - case LogLevel::WARN: color = COLOR_WARN; break; - case LogLevel::ERR: color = COLOR_ERROR; break; - case LogLevel::FATAL: color = COLOR_FATAL; break; - default: color = COLOR_INFO; - } - SET_CONSOLE_TEXT_COLOR(color); - wprintf(L"%s", ustr); - SET_CONSOLE_TEXT_COLOR(COLOR_NORMAL); - - OutputDebugStringW(ustr); + UTFString utfstr(buff); + const wchar_t *ustr = utfstr.asWStr_c_str(); + + WORD color; + switch (level) { + case LogLevel::DEBUG: color = COLOR_DEBUG; break; + case LogLevel::INFO: color = COLOR_INFO; break; + case LogLevel::WARN: color = COLOR_WARN; break; + case LogLevel::ERR: color = COLOR_ERROR; break; + case LogLevel::FATAL: color = COLOR_FATAL; break; + default: color = COLOR_INFO; + } + SET_CONSOLE_TEXT_COLOR(color); + wprintf(L"%s", ustr); + SET_CONSOLE_TEXT_COLOR(COLOR_NORMAL); + + OutputDebugStringW(ustr); #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) - android_LogPriority priority; - switch (level) { - case LogLevel::DEBUG: priority = ANDROID_LOG_DEBUG; break; - case LogLevel::INFO: priority = ANDROID_LOG_INFO; break; - case LogLevel::WARN: priority = ANDROID_LOG_WARN; break; - case LogLevel::ERR: priority = ANDROID_LOG_ERROR; break; - case LogLevel::FATAL: priority = ANDROID_LOG_FATAL; break; - default: priority = ANDROID_LOG_INFO; - } - - __android_log_write(priority, (type == LogType::KERNEL? "Cocos" : "CocosScript"), buff); + android_LogPriority priority; + switch (level) { + case LogLevel::DEBUG: priority = ANDROID_LOG_DEBUG; break; + case LogLevel::INFO: priority = ANDROID_LOG_INFO; break; + case LogLevel::WARN: priority = ANDROID_LOG_WARN; break; + case LogLevel::ERR: priority = ANDROID_LOG_ERROR; break; + case LogLevel::FATAL: priority = ANDROID_LOG_FATAL; break; + default: priority = ANDROID_LOG_INFO; + } + + __android_log_write(priority, (type == LogType::KERNEL ? "Cocos" : "CocosScript"), buff); #else - fputs(buff, stdout); + fputs(buff, stdout); #endif } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/kernel/Log.h b/native/cocos/renderer/core/kernel/Log.h index e6d3a3640f..2531fee053 100755 --- a/native/cocos/renderer/core/kernel/Log.h +++ b/native/cocos/renderer/core/kernel/Log.h @@ -4,44 +4,55 @@ #include namespace cc { +namespace gfx { -enum class LogType: uint8_t { - KERNEL, - SCRIPT, - COUNT, +enum class LogType : uint8_t { + KERNEL, + SCRIPT, + COUNT, }; -enum class LogLevel: uint8_t { - FATAL, - ERR, - WARN, - INFO, - DEBUG, - COUNT, +enum class LogLevel : uint8_t { + FATAL, + ERR, + WARN, + INFO, + DEBUG, + COUNT, }; class CC_CORE_API Log { - public: - static LogLevel log_level; // for read only - - static CC_INLINE void set_log_level(LogLevel level) { log_level = level; } - static CC_INLINE FILE* log_file() { return log_file_; } - static void set_log_file(const std::string& filename); - static void Close(); - static void LogMessage(LogType type, LogLevel level, const char* formats, ...); - - private: - static FILE* log_file_; +public: + static LogLevel log_level; // for read only + + static CC_INLINE void set_log_level(LogLevel level) { log_level = level; } + static CC_INLINE FILE *log_file() { return log_file_; } + static void set_log_file(const std::string &filename); + static void Close(); + static void LogMessage(LogType type, LogLevel level, const char *formats, ...); + +private: + static FILE *log_file_; }; -} +} // namespace gfx +} // namespace cc -#define CC_LOG_DEBUG(formats, ...) if(cc::Log::log_level >= cc::LogLevel::DEBUG) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::DEBUG, formats, ##__VA_ARGS__) -#define CC_LOG_INFO(formats, ...) if(cc::Log::log_level >= cc::LogLevel::INFO) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::INFO, formats, ##__VA_ARGS__) -#define CC_LOG_WARNING(formats, ...) if(cc::Log::log_level >= cc::LogLevel::WARN) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::WARN, formats, ##__VA_ARGS__) -#define CC_LOG_ERROR_(formats, ...) if(cc::Log::log_level >= cc::LogLevel::ERR) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::ERR, formats, ##__VA_ARGS__) -#define CC_LOG_FATAL(formats, ...) if(cc::Log::logLevel >= cc::LogLevel::FATAL) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::FATAL, formats, ##__VA_ARGS__) +#define CC_LOG_DEBUG(formats, ...) \ + if (cc::gfx::Log::log_level >= cc::gfx::LogLevel::DEBUG) cc::gfx::Log::LogMessage(cc::gfx::LogType::KERNEL, cc::gfx::LogLevel::DEBUG, formats, ##__VA_ARGS__) +#define CC_LOG_INFO(formats, ...) \ + if (cc::gfx::Log::log_level >= cc::gfx::LogLevel::INFO) cc::gfx::Log::LogMessage(cc::gfx::LogType::KERNEL, cc::gfx::LogLevel::INFO, formats, ##__VA_ARGS__) +#define CC_LOG_WARNING(formats, ...) \ + if (cc::gfx::Log::log_level >= cc::gfx::LogLevel::WARN) cc::gfx::Log::LogMessage(cc::gfx::LogType::KERNEL, cc::gfx::LogLevel::WARN, formats, ##__VA_ARGS__) +#define CC_LOG_ERROR_(formats, ...) \ + if (cc::gfx::Log::log_level >= cc::gfx::LogLevel::ERR) cc::gfx::Log::LogMessage(cc::gfx::LogType::KERNEL, cc::gfx::LogLevel::ERR, formats, ##__VA_ARGS__) +#define CC_LOG_FATAL(formats, ...) \ + if (cc::gfx::Log::logLevel >= cc::gfx::LogLevel::FATAL) cc::gfx::Log::LogMessage(cc::gfx::LogType::KERNEL, cc::gfx::LogLevel::FATAL, formats, ##__VA_ARGS__) -#define CC_LOG_ERROR(formats, ...) do {CC_LOG_ERROR_("[ERROR] file %s: line %d ", __FILE__, __LINE__); CC_LOG_ERROR_(formats, ##__VA_ARGS__); } while(0) +#define CC_LOG_ERROR(formats, ...) \ + do { \ + CC_LOG_ERROR_("[ERROR] file %s: line %d ", __FILE__, __LINE__); \ + CC_LOG_ERROR_(formats, ##__VA_ARGS__); \ + } while (0) #endif // CC_CORE_KERNEL_LOG_H_ diff --git a/native/cocos/renderer/core/kernel/Object.h b/native/cocos/renderer/core/kernel/Object.h index 5b310ed329..e2ec141950 100755 --- a/native/cocos/renderer/core/kernel/Object.h +++ b/native/cocos/renderer/core/kernel/Object.h @@ -2,10 +2,12 @@ #define CC_CORE_KERNEL_OBJECT_H_ namespace cc { +namespace gfx { // Now define all the base classes for each allocation typedef AllocatedObject Object; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_KERNEL_OBJECT_H_ diff --git a/native/cocos/renderer/core/kernel/UTFString.cc b/native/cocos/renderer/core/kernel/UTFString.cc index fc3c5f2f81..8378ce4119 100755 --- a/native/cocos/renderer/core/kernel/UTFString.cc +++ b/native/cocos/renderer/core/kernel/UTFString.cc @@ -2,335 +2,321 @@ #include "UTFString.h" namespace cc { +namespace gfx { UTFString::unicode_char UTFString::_base_iterator::_getCharacter() const { - return string_->getChar(_get_index()); + return string_->getChar(_get_index()); } int UTFString::_base_iterator::_setCharacter(unicode_char uc) { - size_type current_index = _get_index(); - int change = string_->setChar( current_index, uc ); - _jump_to( current_index ); - return change; + size_type current_index = _get_index(); + int change = string_->setChar(current_index, uc); + _jump_to(current_index); + return change; } void UTFString::_base_iterator::_moveNext() { - _seekFwd( 1 ); // move 1 code point forward - if ( _test_end() ) return; // exit if we hit the end - if ( _utf16_surrogate_follow( iter_[0] ) ) { - // landing on a follow code point means we might be part of a bigger character - // so we test for that - code_point lead_half = 0; - //NB: we can't possibly be at the beginning here, so no need to test - lead_half = iter_[-1]; // check the previous code point to see if we're part of a surrogate pair - if ( _utf16_surrogate_lead( lead_half ) ) { - _seekFwd( 1 ); // if so, then advance 1 more code point + _seekFwd(1); // move 1 code point forward + if (_test_end()) return; // exit if we hit the end + if (_utf16_surrogate_follow(iter_[0])) { + // landing on a follow code point means we might be part of a bigger character + // so we test for that + code_point lead_half = 0; + //NB: we can't possibly be at the beginning here, so no need to test + lead_half = iter_[-1]; // check the previous code point to see if we're part of a surrogate pair + if (_utf16_surrogate_lead(lead_half)) { + _seekFwd(1); // if so, then advance 1 more code point + } } - } } void UTFString::_base_iterator::_movePrev() { - _seekRev( 1 ); // move 1 code point backwards - if ( _test_begin() ) return; // exit if we hit the beginning - if ( _utf16_surrogate_follow( iter_[0] ) ) { - // landing on a follow code point means we might be part of a bigger character - // so we test for that - code_point lead_half = 0; - lead_half = iter_[-1]; // check the previous character to see if we're part of a surrogate pair - if ( _utf16_surrogate_lead( lead_half ) ) { - _seekRev( 1 ); // if so, then rewind 1 more code point + _seekRev(1); // move 1 code point backwards + if (_test_begin()) return; // exit if we hit the beginning + if (_utf16_surrogate_follow(iter_[0])) { + // landing on a follow code point means we might be part of a bigger character + // so we test for that + code_point lead_half = 0; + lead_half = iter_[-1]; // check the previous character to see if we're part of a surrogate pair + if (_utf16_surrogate_lead(lead_half)) { + _seekRev(1); // if so, then rewind 1 more code point + } } - } } ////////////////////////////////////////////////////////////////////////// -UTFString::unicode_char UTFString::getChar( size_type loc ) const { - const code_point* ptr = c_str(); - unicode_char uc; - size_t l = _utf16_char_length( ptr[loc] ); - code_point cp[2] = { /* blame the code beautifier */ - 0, 0 - }; - cp[0] = ptr[loc]; - - if ( l == 2 && ( loc + 1 ) < m_data.length() ) { - cp[1] = ptr[loc+1]; - } - _utf16_to_utf32( cp, uc ); - return uc; +UTFString::unicode_char UTFString::getChar(size_type loc) const { + const code_point *ptr = c_str(); + unicode_char uc; + size_t l = _utf16_char_length(ptr[loc]); + code_point cp[2] = {/* blame the code beautifier */ + 0, 0}; + cp[0] = ptr[loc]; + + if (l == 2 && (loc + 1) < m_data.length()) { + cp[1] = ptr[loc + 1]; + } + _utf16_to_utf32(cp, uc); + return uc; } -int UTFString::setChar( size_type loc, unicode_char ch ) { - code_point cp[2] = { /* blame the code beautifier */ - 0, 0 - }; - size_t l = _utf32_to_utf16( ch, cp ); - unicode_char existingChar = getChar( loc ); - size_t existingSize = _utf16_char_length( existingChar ); - size_t newSize = _utf16_char_length( ch ); - - if ( newSize > existingSize ) { - at( loc ) = cp[0]; - insert( loc + 1, 1, cp[1] ); - return 1; - } - if ( newSize < existingSize ) { - erase( loc, 1 ); - at( loc ) = cp[0]; - return -1; - } - - // newSize == existingSize - at( loc ) = cp[0]; - if ( l == 2 ) at( loc + 1 ) = cp[1]; - return 0; +int UTFString::setChar(size_type loc, unicode_char ch) { + code_point cp[2] = {/* blame the code beautifier */ + 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + unicode_char existingChar = getChar(loc); + size_t existingSize = _utf16_char_length(existingChar); + size_t newSize = _utf16_char_length(ch); + + if (newSize > existingSize) { + at(loc) = cp[0]; + insert(loc + 1, 1, cp[1]); + return 1; + } + if (newSize < existingSize) { + erase(loc, 1); + at(loc) = cp[0]; + return -1; + } + + // newSize == existingSize + at(loc) = cp[0]; + if (l == 2) at(loc + 1) = cp[1]; + return 0; } +UTFString &UTFString::assign(const String &str) { + size_type len = _verifyUTF8(str); + clear(); // empty our contents, if there are any + if (len == 0) { + return *this; + } -UTFString& UTFString::assign( const String& str ) { - size_type len = _verifyUTF8( str ); - clear(); // empty our contents, if there are any - if (len == 0) - { + reserve(len); // best guess bulk capacity growth + + // This is a 3 step process, converting each byte in the UTF-8 stream to UTF-32, + // then converting it to UTF-16, then finally appending the data buffer + + unicode_char uc = 0; // temporary Unicode character buffer + unsigned char utf8buf[7]; // temporary UTF-8 buffer + utf8buf[6] = 0; + size_t utf8len; // UTF-8 length + code_point utf16buff[3]; // temporary UTF-16 buffer + utf16buff[2] = 0; + size_t utf16len; // UTF-16 length + + String::const_iterator i, ie = str.end(); + for (i = str.begin(); i != ie; i++) { + utf8len = _utf8_char_length(static_cast(*i)); // estimate bytes to load + for (size_t j = 0; j < utf8len; j++) { // load the needed UTF-8 bytes + utf8buf[j] = (static_cast(*(i + j))); // we don't increment 'i' here just in case the estimate is wrong (shouldn't happen, but we're being careful) + } + utf8buf[utf8len] = 0; // nul terminate so we throw an exception before running off the end of the buffer + utf8len = _utf8_to_utf32(utf8buf, uc); // do the UTF-8 -> UTF-32 conversion + i += utf8len - 1; // we subtract 1 for the increment of the 'for' loop + + utf16len = _utf32_to_utf16(uc, utf16buff); // UTF-32 -> UTF-16 conversion + append(utf16buff, utf16len); // append the characters to the string + } return *this; - } - - reserve( len ); // best guess bulk capacity growth - - // This is a 3 step process, converting each byte in the UTF-8 stream to UTF-32, - // then converting it to UTF-16, then finally appending the data buffer - - unicode_char uc = 0; // temporary Unicode character buffer - unsigned char utf8buf[7]; // temporary UTF-8 buffer - utf8buf[6] = 0; - size_t utf8len; // UTF-8 length - code_point utf16buff[3]; // temporary UTF-16 buffer - utf16buff[2] = 0; - size_t utf16len; // UTF-16 length - - String::const_iterator i, ie = str.end(); - for ( i = str.begin(); i != ie; i++ ) { - utf8len = _utf8_char_length( static_cast( *i ) ); // estimate bytes to load - for ( size_t j = 0; j < utf8len; j++ ) { // load the needed UTF-8 bytes - utf8buf[j] = ( static_cast( *( i + j ) ) ); // we don't increment 'i' here just in case the estimate is wrong (shouldn't happen, but we're being careful) - } - utf8buf[utf8len] = 0; // nul terminate so we throw an exception before running off the end of the buffer - utf8len = _utf8_to_utf32( utf8buf, uc ); // do the UTF-8 -> UTF-32 conversion - i += utf8len - 1; // we subtract 1 for the increment of the 'for' loop - - utf16len = _utf32_to_utf16( uc, utf16buff ); // UTF-32 -> UTF-16 conversion - append( utf16buff, utf16len ); // append the characters to the string - } - return *this; } -UTFString& UTFString::assign( const WString& wstr ) -{ - m_data.clear(); - m_data.reserve( wstr.length() ); // best guess bulk allocate -#ifdef WCHAR_UTF16 // if we're already working in UTF-16, this is easy - code_point tmp; - WString::const_iterator i, ie = wstr.end(); - for ( i = wstr.begin(); i != ie; i++ ) { - tmp = static_cast( *i ); - m_data.push_back( tmp ); - } +UTFString &UTFString::assign(const WString &wstr) { + m_data.clear(); + m_data.reserve(wstr.length()); // best guess bulk allocate +#ifdef WCHAR_UTF16 // if we're already working in UTF-16, this is easy + code_point tmp; + WString::const_iterator i, ie = wstr.end(); + for (i = wstr.begin(); i != ie; i++) { + tmp = static_cast(*i); + m_data.push_back(tmp); + } #else // otherwise we do it the safe way (which is still 100% safe to pass UTF-16 through, just slower) - code_point cp[3] = {0, 0, 0}; - unicode_char tmp; - WString::const_iterator i, ie = wstr.end(); - for ( i = wstr.begin(); i != ie; i++ ) { - tmp = static_cast( *i ); - size_t l = _utf32_to_utf16( tmp, cp ); - if ( l > 0 ) m_data.push_back( cp[0] ); - if ( l > 1 ) m_data.push_back( cp[1] ); - } + code_point cp[3] = {0, 0, 0}; + unicode_char tmp; + WString::const_iterator i, ie = wstr.end(); + for (i = wstr.begin(); i != ie; i++) { + tmp = static_cast(*i); + size_t l = _utf32_to_utf16(tmp, cp); + if (l > 0) m_data.push_back(cp[0]); + if (l > 1) m_data.push_back(cp[1]); + } #endif - return *this; + return *this; } -UTFString& UTFString::append( size_type num, unicode_char ch ) -{ - code_point cp[2] = {0, 0}; - if ( _utf32_to_utf16( ch, cp ) == 2 ) { - for ( size_type i = 0; i < num; i++ ) { - append( 1, cp[0] ); - append( 1, cp[1] ); +UTFString &UTFString::append(size_type num, unicode_char ch) { + code_point cp[2] = {0, 0}; + if (_utf32_to_utf16(ch, cp) == 2) { + for (size_type i = 0; i < num; i++) { + append(1, cp[0]); + append(1, cp[1]); + } + } else { + for (size_type i = 0; i < num; i++) { + append(1, cp[0]); + } } - } else { - for ( size_type i = 0; i < num; i++ ) { - append( 1, cp[0] ); + return *this; +} + +UTFString &UTFString::insert(size_type index, size_type num, unicode_char ch) { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + if (l == 1) { + return insert(index, num, cp[0]); } - } - return *this; -} - -UTFString& UTFString::insert( size_type index, size_type num, unicode_char ch ) -{ - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - if ( l == 1 ) { - return insert( index, num, cp[0] ); - } - for ( size_type c = 0; c < num; c++ ) { - // insert in reverse order to preserve ordering after insert - insert( index, 1, cp[1] ); - insert( index, 1, cp[0] ); - } - return *this; -} - -void UTFString::insert( iterator i, size_type num, const unicode_char& ch ) -{ - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - if ( l == 1 ) { - insert( i, num, cp[0] ); - } else { - for ( size_type c = 0; c < num; c++ ) { - // insert in reverse order to preserve ordering after insert - insert( i, 1, cp[1] ); - insert( i, 1, cp[0] ); + for (size_type c = 0; c < num; c++) { + // insert in reverse order to preserve ordering after insert + insert(index, 1, cp[1]); + insert(index, 1, cp[0]); } - } + return *this; } -UTFString::size_type UTFString::find_first_of( const UTFString &str, size_type index /*= 0*/, size_type num /*= npos */ ) const -{ - size_type i = 0; - const size_type len = length(); - while ( i < num && ( index + i ) < len ) { - unicode_char ch = getChar( index + i ); - if ( str.inString( ch ) ) - return index + i; - i += _utf16_char_length( ch ); // increment by the Unicode character length - } - return npos; -} - -UTFString::size_type UTFString::find_first_not_of( const UTFString& str, size_type index /*= 0*/, size_type num /*= npos */ ) const -{ - size_type i = 0; - const size_type len = length(); - while ( i < num && ( index + i ) < len ) { - unicode_char ch = getChar( index + i ); - if ( !str.inString( ch ) ) - return index + i; - i += _utf16_char_length( ch ); // increment by the Unicode character length - } - return npos; -} - -UTFString::size_type UTFString::find_last_of( const UTFString& str, size_type index /*= npos*/, size_type num /*= npos */ ) const -{ - size_type i = 0; - const size_type len = length(); - if ( index > len ) index = len - 1; - - while ( i < num && ( index - i ) != npos ) { - size_type j = index - i; - // careful to step full Unicode characters - if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) { - j = index - ++i; +void UTFString::insert(iterator i, size_type num, const unicode_char &ch) { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + if (l == 1) { + insert(i, num, cp[0]); + } else { + for (size_type c = 0; c < num; c++) { + // insert in reverse order to preserve ordering after insert + insert(i, 1, cp[1]); + insert(i, 1, cp[0]); + } } - // and back to the usual dull test - unicode_char ch = getChar( j ); - if ( str.inString( ch ) ) - return j; - i++; - } - return npos; } -UTFString::size_type UTFString::find_last_not_of( const UTFString& str, size_type index /*= npos*/, size_type num /*= npos */ ) const -{ - size_type i = 0; - const size_type len = length(); - if ( index > len ) index = len - 1; - - while ( i < num && ( index - i ) != npos ) { - size_type j = index - i; - // careful to step full Unicode characters - if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) { - j = index - ++i; +UTFString::size_type UTFString::find_first_of(const UTFString &str, size_type index /*= 0*/, size_type num /*= npos */) const { + size_type i = 0; + const size_type len = length(); + while (i < num && (index + i) < len) { + unicode_char ch = getChar(index + i); + if (str.inString(ch)) + return index + i; + i += _utf16_char_length(ch); // increment by the Unicode character length } - // and back to the usual dull test - unicode_char ch = getChar( j ); - if ( !str.inString( ch ) ) - return j; - i++; - } - return npos; + return npos; } -size_t UTFString::_utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ) -{ - const code_point& cp1 = in_cp[0]; - const code_point& cp2 = in_cp[1]; - bool wordPair = false; - - // does it look like a surrogate pair? - if ( 0xD800 <= cp1 && cp1 <= 0xDBFF ) { - // looks like one, but does the other half match the algorithm as well? - if ( 0xDC00 <= cp2 && cp2 <= 0xDFFF ) - wordPair = true; // yep! - } - - if ( !wordPair ) { // if we aren't a 100% authentic surrogate pair, then just copy the value - out_uc = cp1; +UTFString::size_type UTFString::find_first_not_of(const UTFString &str, size_type index /*= 0*/, size_type num /*= npos */) const { + size_type i = 0; + const size_type len = length(); + while (i < num && (index + i) < len) { + unicode_char ch = getChar(index + i); + if (!str.inString(ch)) + return index + i; + i += _utf16_char_length(ch); // increment by the Unicode character length + } + return npos; +} + +UTFString::size_type UTFString::find_last_of(const UTFString &str, size_type index /*= npos*/, size_type num /*= npos */) const { + size_type i = 0; + const size_type len = length(); + if (index > len) index = len - 1; + + while (i < num && (index - i) != npos) { + size_type j = index - i; + // careful to step full Unicode characters + if (j != 0 && _utf16_surrogate_follow(at(j)) && _utf16_surrogate_lead(at(j - 1))) { + j = index - ++i; + } + // and back to the usual dull test + unicode_char ch = getChar(j); + if (str.inString(ch)) + return j; + i++; + } + return npos; +} + +UTFString::size_type UTFString::find_last_not_of(const UTFString &str, size_type index /*= npos*/, size_type num /*= npos */) const { + size_type i = 0; + const size_type len = length(); + if (index > len) index = len - 1; + + while (i < num && (index - i) != npos) { + size_type j = index - i; + // careful to step full Unicode characters + if (j != 0 && _utf16_surrogate_follow(at(j)) && _utf16_surrogate_lead(at(j - 1))) { + j = index - ++i; + } + // and back to the usual dull test + unicode_char ch = getChar(j); + if (!str.inString(ch)) + return j; + i++; + } + return npos; +} + +size_t UTFString::_utf16_to_utf32(const code_point in_cp[2], unicode_char &out_uc) { + const code_point &cp1 = in_cp[0]; + const code_point &cp2 = in_cp[1]; + bool wordPair = false; + + // does it look like a surrogate pair? + if (0xD800 <= cp1 && cp1 <= 0xDBFF) { + // looks like one, but does the other half match the algorithm as well? + if (0xDC00 <= cp2 && cp2 <= 0xDFFF) + wordPair = true; // yep! + } + + if (!wordPair) { // if we aren't a 100% authentic surrogate pair, then just copy the value + out_uc = cp1; + return 1; + } + + unsigned short cU = cp1, cL = cp2; // copy upper and lower words of surrogate pair to writable buffers + cU -= 0xD800; // remove the encoding markers + cL -= 0xDC00; + + out_uc = (cU & 0x03FF) << 10; // grab the 10 upper bits and set them in their proper location + out_uc |= (cL & 0x03FF); // combine in the lower 10 bits + out_uc += 0x10000; // add back in the value offset + + return 2; // this whole operation takes to words, so that's what we'll return +} + +size_t UTFString::_utf32_to_utf16(const unicode_char &in_uc, code_point out_cp[2]) { + if (in_uc <= 0xFFFF) { // we blindly preserve sentinel values because our decoder understands them + out_cp[0] = static_cast(in_uc); + return 1; + } + unicode_char uc = in_uc; // copy to writable buffer + unsigned short tmp; // single code point buffer + uc -= 0x10000; // subtract value offset + + //process upper word + tmp = static_cast((uc >> 10) & 0x03FF); // grab the upper 10 bits + tmp += 0xD800; // add encoding offset + out_cp[0] = tmp; // write + + // process lower word + tmp = static_cast(uc & 0x03FF); // grab the lower 10 bits + tmp += 0xDC00; // add encoding offset + out_cp[1] = tmp; // write + + return 2; // return used word count (2 for surrogate pairs) +} + +size_t UTFString::_utf8_char_length(unsigned char cp) { + if (!(cp & 0x80)) return 1; + if ((cp & ~_lead1_mask) == _lead1) return 2; + if ((cp & ~_lead2_mask) == _lead2) return 3; + if ((cp & ~_lead3_mask) == _lead3) return 4; + if ((cp & ~_lead4_mask) == _lead4) return 5; + if ((cp & ~_lead5_mask) == _lead5) return 6; + + CCASSERT(0, "invalid UTF-8 sequence header value"); return 1; - } - - unsigned short cU = cp1, cL = cp2; // copy upper and lower words of surrogate pair to writable buffers - cU -= 0xD800; // remove the encoding markers - cL -= 0xDC00; - - out_uc = ( cU & 0x03FF ) << 10; // grab the 10 upper bits and set them in their proper location - out_uc |= ( cL & 0x03FF ); // combine in the lower 10 bits - out_uc += 0x10000; // add back in the value offset - - return 2; // this whole operation takes to words, so that's what we'll return } -size_t UTFString::_utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ) -{ - if ( in_uc <= 0xFFFF ) { // we blindly preserve sentinel values because our decoder understands them - out_cp[0] = static_cast(in_uc); - return 1; - } - unicode_char uc = in_uc; // copy to writable buffer - unsigned short tmp; // single code point buffer - uc -= 0x10000; // subtract value offset - - //process upper word - tmp = static_cast(( uc >> 10 ) & 0x03FF); // grab the upper 10 bits - tmp += 0xD800; // add encoding offset - out_cp[0] = tmp; // write - - // process lower word - tmp = static_cast(uc & 0x03FF); // grab the lower 10 bits - tmp += 0xDC00; // add encoding offset - out_cp[1] = tmp; // write - - return 2; // return used word count (2 for surrogate pairs) -} - -size_t UTFString::_utf8_char_length( unsigned char cp ) -{ - if ( !( cp & 0x80 ) ) return 1; - if (( cp & ~_lead1_mask ) == _lead1 ) return 2; - if (( cp & ~_lead2_mask ) == _lead2 ) return 3; - if (( cp & ~_lead3_mask ) == _lead3 ) return 4; - if (( cp & ~_lead4_mask ) == _lead4 ) return 5; - if (( cp & ~_lead5_mask ) == _lead5 ) return 6; - - CCASSERT(0, "invalid UTF-8 sequence header value"); - return 1; -} - -size_t UTFString::_utf8_char_length( unicode_char uc ) { - /* +size_t UTFString::_utf8_char_length(unicode_char uc) { + /* 7 bit: U-00000000 - U-0000007F: 0xxxxxxx 11 bit: U-00000080 - U-000007FF: 110xxxxx 10xxxxxx 16 bit: U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx @@ -338,254 +324,248 @@ size_t UTFString::_utf8_char_length( unicode_char uc ) { 26 bit: U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 31 bit: U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ - if ( !( uc & ~0x0000007F ) ) return 1; - if ( !( uc & ~0x000007FF ) ) return 2; - if ( !( uc & ~0x0000FFFF ) ) return 3; - if ( !( uc & ~0x001FFFFF ) ) return 4; - if ( !( uc & ~0x03FFFFFF ) ) return 5; - if ( !( uc & ~0x7FFFFFFF ) ) return 6; - - CCASSERT(0, "invalid UTF-32 value"); - return 1; -} + if (!(uc & ~0x0000007F)) return 1; + if (!(uc & ~0x000007FF)) return 2; + if (!(uc & ~0x0000FFFF)) return 3; + if (!(uc & ~0x001FFFFF)) return 4; + if (!(uc & ~0x03FFFFFF)) return 5; + if (!(uc & ~0x7FFFFFFF)) return 6; -size_t UTFString::_utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ) -{ - size_t len = _utf8_char_length( in_cp[0] ); - if ( len == 1 ) { // if we are only 1 byte long, then just grab it and exit - out_uc = in_cp[0]; + CCASSERT(0, "invalid UTF-32 value"); return 1; - } - - unicode_char c = 0; // temporary buffer - size_t i = 0; - switch ( len ) { // load header byte - case 6: - c = in_cp[i] & _lead5_mask; - break; - case 5: - c = in_cp[i] & _lead4_mask; - break; - case 4: - c = in_cp[i] & _lead3_mask; - break; - case 3: - c = in_cp[i] & _lead2_mask; - break; - case 2: - c = in_cp[i] & _lead1_mask; - break; - } - - for ( ++i; i < len; i++ ) { // load each continuation byte - if ((in_cp[i] & ~_cont_mask) != _cont) { - CCASSERT(0, "bad UTF-8 continuation byte"); - break; - } - c <<= 6; - c |= ( in_cp[i] & _cont_mask ); - } - - out_uc = c; // write the final value and return the used byte length - return len; } -size_t UTFString::_utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ) { - size_t len = _utf8_char_length( in_uc ); // predict byte length of sequence - unicode_char c = in_uc; // copy to temp buffer - - //stuff all of the lower bits - for ( size_t i = len - 1; i > 0; i-- ) { - out_cp[i] = static_cast((( c ) & _cont_mask ) | _cont); - c >>= 6; - } - - //now write the header byte - switch ( len ) { - case 6: - out_cp[0] = static_cast((( c ) & _lead5_mask ) | _lead5); - break; - case 5: - out_cp[0] = static_cast((( c ) & _lead4_mask ) | _lead4); - break; - case 4: - out_cp[0] = static_cast((( c ) & _lead3_mask ) | _lead3); - break; - case 3: - out_cp[0] = static_cast((( c ) & _lead2_mask ) | _lead2); - break; - case 2: - out_cp[0] = static_cast((( c ) & _lead1_mask ) | _lead1); - break; - case 1: - default: - out_cp[0] = static_cast(( c ) & 0x7F); - break; - } - - // return the byte length of the sequence - return len; +size_t UTFString::_utf8_to_utf32(const unsigned char in_cp[6], unicode_char &out_uc) { + size_t len = _utf8_char_length(in_cp[0]); + if (len == 1) { // if we are only 1 byte long, then just grab it and exit + out_uc = in_cp[0]; + return 1; + } + + unicode_char c = 0; // temporary buffer + size_t i = 0; + switch (len) { // load header byte + case 6: + c = in_cp[i] & _lead5_mask; + break; + case 5: + c = in_cp[i] & _lead4_mask; + break; + case 4: + c = in_cp[i] & _lead3_mask; + break; + case 3: + c = in_cp[i] & _lead2_mask; + break; + case 2: + c = in_cp[i] & _lead1_mask; + break; + } + + for (++i; i < len; i++) { // load each continuation byte + if ((in_cp[i] & ~_cont_mask) != _cont) { + CCASSERT(0, "bad UTF-8 continuation byte"); + break; + } + c <<= 6; + c |= (in_cp[i] & _cont_mask); + } + + out_uc = c; // write the final value and return the used byte length + return len; } -UTFString::size_type UTFString::_verifyUTF8(const String& str) { - String::const_iterator i, ie = str.end(); - i = str.begin(); - size_type length = 0; - - while ( i != ie ) { - // characters pass until we find an extended sequence - if (( *i ) & 0x80 ) { - unsigned char c = ( *i ); - size_t contBytes = 0; - - // get continuation byte count and test for overlong sequences - if (( c & ~_lead1_mask ) == _lead1 ) { // 1 additional byte - if (c == _lead1) - { - CCASSERT(0, "overlong UTF-8 sequence"); - return 0; - } - contBytes = 1; - - } else if (( c & ~_lead2_mask ) == _lead2 ) { // 2 additional bytes - contBytes = 2; - if ( c == _lead2 ) { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead2 ) == _cont ) - { - CCASSERT(0, "overlong UTF-8 sequence"); - return 0; - } - } - - } else if (( c & ~_lead3_mask ) == _lead3 ) { // 3 additional bytes - contBytes = 3; - if ( c == _lead3 ) { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead3 ) == _cont ) - { - CCASSERT(0, "overlong UTF-8 sequence"); - return 0; - } - } - - } else if (( c & ~_lead4_mask ) == _lead4 ) { // 4 additional bytes - contBytes = 4; - if ( c == _lead4 ) { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead4 ) == _cont ) - { - CCASSERT(0, "overlong UTF-8 sequence"); - return 0; - } - } - - } else if (( c & ~_lead5_mask ) == _lead5 ) { // 5 additional bytes - contBytes = 5; - if ( c == _lead5 ) { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead5 ) == _cont ) - { - CCASSERT(0, "overlong UTF-8 sequence"); - return 0; - } - } - } - - // check remaining continuation bytes for - while ( contBytes-- ) { - c = ( *( ++i ) ); // get next byte in sequence - if (( c & ~_cont_mask ) != _cont ) { - CCASSERT(0, "bad UTF-8 continuation byte"); - return 0; - } - } +size_t UTFString::_utf32_to_utf8(const unicode_char &in_uc, unsigned char out_cp[6]) { + size_t len = _utf8_char_length(in_uc); // predict byte length of sequence + unicode_char c = in_uc; // copy to temp buffer + + //stuff all of the lower bits + for (size_t i = len - 1; i > 0; i--) { + out_cp[i] = static_cast(((c)&_cont_mask) | _cont); + c >>= 6; } - length++; - i++; - } - return length; + + //now write the header byte + switch (len) { + case 6: + out_cp[0] = static_cast(((c)&_lead5_mask) | _lead5); + break; + case 5: + out_cp[0] = static_cast(((c)&_lead4_mask) | _lead4); + break; + case 4: + out_cp[0] = static_cast(((c)&_lead3_mask) | _lead3); + break; + case 3: + out_cp[0] = static_cast(((c)&_lead2_mask) | _lead2); + break; + case 2: + out_cp[0] = static_cast(((c)&_lead1_mask) | _lead1); + break; + case 1: + default: + out_cp[0] = static_cast((c)&0x7F); + break; + } + + // return the byte length of the sequence + return len; +} + +UTFString::size_type UTFString::_verifyUTF8(const String &str) { + String::const_iterator i, ie = str.end(); + i = str.begin(); + size_type length = 0; + + while (i != ie) { + // characters pass until we find an extended sequence + if ((*i) & 0x80) { + unsigned char c = (*i); + size_t contBytes = 0; + + // get continuation byte count and test for overlong sequences + if ((c & ~_lead1_mask) == _lead1) { // 1 additional byte + if (c == _lead1) { + CCASSERT(0, "overlong UTF-8 sequence"); + return 0; + } + contBytes = 1; + + } else if ((c & ~_lead2_mask) == _lead2) { // 2 additional bytes + contBytes = 2; + if (c == _lead2) { // possible overlong UTF-8 sequence + c = (*(i + 1)); // look ahead to next byte in sequence + if ((c & _lead2) == _cont) { + CCASSERT(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if ((c & ~_lead3_mask) == _lead3) { // 3 additional bytes + contBytes = 3; + if (c == _lead3) { // possible overlong UTF-8 sequence + c = (*(i + 1)); // look ahead to next byte in sequence + if ((c & _lead3) == _cont) { + CCASSERT(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if ((c & ~_lead4_mask) == _lead4) { // 4 additional bytes + contBytes = 4; + if (c == _lead4) { // possible overlong UTF-8 sequence + c = (*(i + 1)); // look ahead to next byte in sequence + if ((c & _lead4) == _cont) { + CCASSERT(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if ((c & ~_lead5_mask) == _lead5) { // 5 additional bytes + contBytes = 5; + if (c == _lead5) { // possible overlong UTF-8 sequence + c = (*(i + 1)); // look ahead to next byte in sequence + if ((c & _lead5) == _cont) { + CCASSERT(0, "overlong UTF-8 sequence"); + return 0; + } + } + } + + // check remaining continuation bytes for + while (contBytes--) { + c = (*(++i)); // get next byte in sequence + if ((c & ~_cont_mask) != _cont) { + CCASSERT(0, "bad UTF-8 continuation byte"); + return 0; + } + } + } + length++; + i++; + } + return length; } void UTFString::_cleanBuffer() const { - if ( m_buff.m_voidBuff != 0 ) { - switch ( m_buffType ) { - case BT_STR: - CC_DELETE_T(m_buff.m_strBuff, String); - break; - case BT_WSTR: - CC_DELETE_T(m_buff.m_wstrBuff, WString); - break; - case BT_NONE: // under the worse of circumstances, this is all we can do, and hope it works out - default: - //delete mBuffer.mVoidBuffer; - // delete void* is undefined, don't do that - CCASSERT(0, "This should never happen - mVoidBuffer should never contain something if we " - "don't know the type"); - break; + if (m_buff.m_voidBuff != 0) { + switch (m_buffType) { + case BT_STR: + CC_DELETE_T(m_buff.m_strBuff, String); + break; + case BT_WSTR: + CC_DELETE_T(m_buff.m_wstrBuff, WString); + break; + case BT_NONE: // under the worse of circumstances, this is all we can do, and hope it works out + default: + //delete mBuffer.mVoidBuffer; + // delete void* is undefined, don't do that + CCASSERT(0, "This should never happen - mVoidBuffer should never contain something if we " + "don't know the type"); + break; + } + m_buff.m_voidBuff = 0; + m_buffSize = 0; + m_buffType = BT_NONE; } - m_buff.m_voidBuff = 0; - m_buffSize = 0; - m_buffType = BT_NONE; - } } void UTFString::_getBufferStr() const { - if ( m_buffType != BT_STR ) { - _cleanBuffer(); - m_buff.m_strBuff = CC_NEW_T(String); - m_buffType = BT_STR; - } - m_buff.m_strBuff->clear(); + if (m_buffType != BT_STR) { + _cleanBuffer(); + m_buff.m_strBuff = CC_NEW_T(String); + m_buffType = BT_STR; + } + m_buff.m_strBuff->clear(); } void UTFString::_getBufferWStr() const { - if ( m_buffType != BT_WSTR ) { - _cleanBuffer(); - m_buff.m_wstrBuff = CC_NEW_T(WString); - m_buffType = BT_WSTR; - } - m_buff.m_wstrBuff->clear(); + if (m_buffType != BT_WSTR) { + _cleanBuffer(); + m_buff.m_wstrBuff = CC_NEW_T(WString); + m_buffType = BT_WSTR; + } + m_buff.m_wstrBuff->clear(); } void UTFString::_load_buffer_UTF8() const { - _getBufferStr(); - String& buffer = ( *m_buff.m_strBuff ); - buffer.reserve( length() ); - - unsigned char utf8buf[6] = ""; - char* charbuf = ( char* )utf8buf; - unicode_char c; - size_t len; - - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) - { - c = i.getCharacter(); - len = _utf32_to_utf8( c, utf8buf ); - size_t j = 0; - while ( j < len ) - buffer.push_back( charbuf[j++] ); - } + _getBufferStr(); + String &buffer = (*m_buff.m_strBuff); + buffer.reserve(length()); + + unsigned char utf8buf[6] = ""; + char *charbuf = (char *)utf8buf; + unicode_char c; + size_t len; + + const_iterator i, ie = end(); + for (i = begin(); i != ie; i.moveNext()) { + c = i.getCharacter(); + len = _utf32_to_utf8(c, utf8buf); + size_t j = 0; + while (j < len) + buffer.push_back(charbuf[j++]); + } } void UTFString::_load_buffer_WStr() const { - _getBufferWStr(); - WString& buffer = ( *m_buff.m_wstrBuff ); - buffer.reserve( length() ); // may over reserve, but should be close enough -#ifdef WCHAR_UTF16 // wchar_t matches UTF-16 - const_iterator i, ie = end(); - for ( i = begin(); i != ie; ++i ) { - buffer.push_back(( wchar_t )( *i ) ); - } + _getBufferWStr(); + WString &buffer = (*m_buff.m_wstrBuff); + buffer.reserve(length()); // may over reserve, but should be close enough +#ifdef WCHAR_UTF16 // wchar_t matches UTF-16 + const_iterator i, ie = end(); + for (i = begin(); i != ie; ++i) { + buffer.push_back((wchar_t)(*i)); + } #else // wchar_t fits UTF-32 - unicode_char c; - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) { - c = i.getCharacter(); - buffer.push_back(( wchar_t )c ); - } + unicode_char c; + const_iterator i, ie = end(); + for (i = begin(); i != ie; i.moveNext()) { + c = i.getCharacter(); + buffer.push_back((wchar_t)c); + } #endif } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/kernel/UTFString.h b/native/cocos/renderer/core/kernel/UTFString.h index 320ea0fea3..e85b91b892 100755 --- a/native/cocos/renderer/core/kernel/UTFString.h +++ b/native/cocos/renderer/core/kernel/UTFString.h @@ -3,21 +3,22 @@ #if (CC_COMPILER == CC_COMPILER_MSVC && (CC_COMPILER_VERSION >= 70 && CC_COMPILER_VERSION < 100)) -# if defined(_DLL_CPPLIB) + #if defined(_DLL_CPPLIB) namespace std { - template class _CRTIMP2 basic_string, - allocator >; - - template class _CRTIMP2 basic_string<__wchar_t, char_traits<__wchar_t>, - allocator<__wchar_t> >; -} -# endif // defined(_DLL_CPPLIB) +template class _CRTIMP2 basic_string, + allocator>; + +template class _CRTIMP2 basic_string<__wchar_t, char_traits<__wchar_t>, + allocator<__wchar_t>>; +} // namespace std + #endif // defined(_DLL_CPPLIB) #endif #include "memory/StlAlloc.h" namespace cc { +namespace gfx { /* READ THIS NOTICE BEFORE USING IN YOUR OWN APPLICATIONS =NOTICE= @@ -56,28 +57,28 @@ namespace cc { // for any compiler that provides this, wchar_t is guaranteed to hold any Unicode value with a single code point (32-bit or larger) // so we can safely skip the rest of the testing #else // #ifdef __STDC_ISO_10646__ -# if (CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM != CC_PLATFORM_ANDROID) -# define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t -# endif + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM != CC_PLATFORM_ANDROID) + #define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t + #endif #endif // #ifdef __STDC_ISO_10646__ // OGRE_IS_NATIVE_WCHAR_T means that wchar_t isn't a typedef of // uint16 or uint32. #if CC_COMPILER == CC_COMPILER_MSVC -// Don't define wchar_t related functions since it'll duplicate -// with UTFString::code_point related functions when compile -// without /Zc:wchar_t, because in this case both of them are -// a typedef of uint16. -# if defined(_NATIVE_WCHAR_T_DEFINED) -# define CC_IS_NATIVE_WCHAR_T 0 -# else -# define CC_IS_NATIVE_WCHAR_T 0 -# endif + // Don't define wchar_t related functions since it'll duplicate + // with UTFString::code_point related functions when compile + // without /Zc:wchar_t, because in this case both of them are + // a typedef of uint16. + #if defined(_NATIVE_WCHAR_T_DEFINED) + #define CC_IS_NATIVE_WCHAR_T 0 + #else + #define CC_IS_NATIVE_WCHAR_T 0 + #endif #else -// Assumed wchar_t is natively for other compilers -# define CC_IS_NATIVE_WCHAR_T 1 -#endif // CC_COMPILER == CC_COMPILER_MSVC + // Assumed wchar_t is natively for other compilers + #define CC_IS_NATIVE_WCHAR_T 1 +#endif // CC_COMPILER == CC_COMPILER_MSVC //! A UTF-16 string with implicit conversion to/from std::string and std::wstring /*! This class provides a complete 1 to 1 map of most std::string functions (at least to my @@ -106,674 +107,664 @@ namespace cc { - For additional information on UTF-32 encoding: http://en.wikipedia.org/wiki/UTF-32 */ -class CC_CORE_API UTFString -{ - // constants used in UTF-8 conversions - static const unsigned char _lead1 = 0xC0; //110xxxxx - static const unsigned char _lead1_mask = 0x1F; //00011111 - static const unsigned char _lead2 = 0xE0; //1110xxxx - static const unsigned char _lead2_mask = 0x0F; //00001111 - static const unsigned char _lead3 = 0xF0; //11110xxx - static const unsigned char _lead3_mask = 0x07; //00000111 - static const unsigned char _lead4 = 0xF8; //111110xx - static const unsigned char _lead4_mask = 0x03; //00000011 - static const unsigned char _lead5 = 0xFC; //1111110x - static const unsigned char _lead5_mask = 0x01; //00000001 - static const unsigned char _cont = 0x80; //10xxxxxx - static const unsigned char _cont_mask = 0x3F; //00111111 - +class CC_CORE_API UTFString { + // constants used in UTF-8 conversions + static const unsigned char _lead1 = 0xC0; //110xxxxx + static const unsigned char _lead1_mask = 0x1F; //00011111 + static const unsigned char _lead2 = 0xE0; //1110xxxx + static const unsigned char _lead2_mask = 0x0F; //00001111 + static const unsigned char _lead3 = 0xF0; //11110xxx + static const unsigned char _lead3_mask = 0x07; //00000111 + static const unsigned char _lead4 = 0xF8; //111110xx + static const unsigned char _lead4_mask = 0x03; //00000011 + static const unsigned char _lead5 = 0xFC; //1111110x + static const unsigned char _lead5_mask = 0x01; //00000001 + static const unsigned char _cont = 0x80; //10xxxxxx + static const unsigned char _cont_mask = 0x3F; //00111111 + public: - //! size type used to indicate string size and character positions within the string - typedef size_t size_type; - //! the usual constant representing: not found, no limit, etc - static const size_type npos = static_cast(~0); - - //! a single 32-bit Unicode character - typedef uint32_t unicode_char; - - //! a single UTF-16 code point - typedef char16_t code_point; - - //! value type typedef for use in iterators - typedef code_point value_type; - + //! size type used to indicate string size and character positions within the string + typedef size_t size_type; + //! the usual constant representing: not found, no limit, etc + static const size_type npos = static_cast(~0); + + //! a single 32-bit Unicode character + typedef uint32_t unicode_char; + + //! a single UTF-16 code point + typedef char16_t code_point; + + //! value type typedef for use in iterators + typedef code_point value_type; + #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef std::basic_string, SA > dstring; // data string + typedef std::basic_string, SA> dstring; // data string #else - typedef std::basic_string dstring; // data string + typedef std::basic_string dstring; // data string #endif - //! base iterator class for UTFString - class CC_CORE_API _base_iterator: public std::iterator { - friend class UTFString; - protected: - _base_iterator() { string_ = 0; } - - inline void _seekFwd( size_type c ) { iter_ += c; } - inline void _seekRev( size_type c ) { iter_ -= c; } - inline void _become( const _base_iterator& i ) { iter_ = i.iter_; string_ = i.string_; } - inline bool _test_begin() const { return iter_ == string_->m_data.begin(); } - inline bool _test_end() const { return iter_ == string_->m_data.end(); } - inline size_type _get_index() const { return iter_ - string_->m_data.begin(); } - inline void _jump_to( size_type index ) { iter_ = string_->m_data.begin() + index; } - - unicode_char _getCharacter() const; - int _setCharacter( unicode_char uc ); - void _moveNext(); - void _movePrev(); - - dstring::iterator iter_; - UTFString* string_; - }; - - ////////////////////////////////////////////////////////////////////////// - // FORWARD ITERATORS - - class _const_fwd_iterator; // forward declaration - - //! forward iterator for UTFString - class CC_CORE_API _fwd_iterator: public _base_iterator - { - friend class _const_fwd_iterator; - public: - _fwd_iterator() {} - _fwd_iterator( const _fwd_iterator& i ) { _become( i ); } - - //! pre-increment - inline _fwd_iterator& operator++() - { - _seekFwd( 1 ); - return *this; + //! base iterator class for UTFString + class CC_CORE_API _base_iterator : public std::iterator { + friend class UTFString; + + protected: + _base_iterator() { string_ = 0; } + + inline void _seekFwd(size_type c) { iter_ += c; } + inline void _seekRev(size_type c) { iter_ -= c; } + inline void _become(const _base_iterator &i) { + iter_ = i.iter_; + string_ = i.string_; + } + inline bool _test_begin() const { return iter_ == string_->m_data.begin(); } + inline bool _test_end() const { return iter_ == string_->m_data.end(); } + inline size_type _get_index() const { return iter_ - string_->m_data.begin(); } + inline void _jump_to(size_type index) { iter_ = string_->m_data.begin() + index; } + + unicode_char _getCharacter() const; + int _setCharacter(unicode_char uc); + void _moveNext(); + void _movePrev(); + + dstring::iterator iter_; + UTFString *string_; + }; + + ////////////////////////////////////////////////////////////////////////// + // FORWARD ITERATORS + + class _const_fwd_iterator; // forward declaration + + //! forward iterator for UTFString + class CC_CORE_API _fwd_iterator : public _base_iterator { + friend class _const_fwd_iterator; + + public: + _fwd_iterator() {} + _fwd_iterator(const _fwd_iterator &i) { _become(i); } + + //! pre-increment + inline _fwd_iterator &operator++() { + _seekFwd(1); + return *this; + } + + //! post-increment + inline _fwd_iterator operator++(int) { + _fwd_iterator tmp(*this); + _seekFwd(1); + return tmp; + } + + //! pre-decrement + inline _fwd_iterator &operator--() { + _seekRev(1); + return *this; + } + + //! post-decrement + inline _fwd_iterator operator--(int) { + _fwd_iterator tmp(*this); + _seekRev(1); + return tmp; + } + + //! addition operator + inline _fwd_iterator operator+(difference_type n) { + _fwd_iterator tmp(*this); + if (n < 0) + tmp._seekRev(-n); + else + tmp._seekFwd(n); + return tmp; + } + + //! subtraction operator + inline _fwd_iterator operator-(difference_type n) { + _fwd_iterator tmp(*this); + if (n < 0) + tmp._seekFwd(-n); + else + tmp._seekRev(n); + return tmp; + } + + //! addition assignment operator + inline _fwd_iterator &operator+=(difference_type n) { + if (n < 0) + _seekRev(-n); + else + _seekFwd(n); + return *this; + } + + //! subtraction assignment operator + inline _fwd_iterator &operator-=(difference_type n) { + if (n < 0) + _seekFwd(-n); + else + _seekRev(n); + return *this; + } + + //! dereference operator + inline value_type &operator*() const { return *iter_; } + + //! dereference at offset operator + inline value_type &operator[](difference_type n) const { + _fwd_iterator tmp(*this); + tmp += n; + return *tmp; + } + + //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _fwd_iterator &moveNext() { + _moveNext(); + return *this; + } + + //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _fwd_iterator &movePrev() { + _movePrev(); + return *this; + } + + //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) + inline unicode_char getCharacter() const { return _getCharacter(); } + //! Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); returns the amount of string length change caused by the operation + inline int setCharacter(unicode_char uc) { return _setCharacter(uc); } + }; + + ////////////////////////////////////////////////////////////////////////// + //! const forward iterator for UTFString + class CC_CORE_API _const_fwd_iterator : public _base_iterator { + public: + _const_fwd_iterator() {} + _const_fwd_iterator(const _const_fwd_iterator &i) { _become(i); } + _const_fwd_iterator(const _fwd_iterator &i) { _become(i); } + + //! pre-increment + inline _const_fwd_iterator &operator++() { + _seekFwd(1); + return *this; + } + + //! post-increment + inline _const_fwd_iterator operator++(int) { + _const_fwd_iterator tmp(*this); + _seekFwd(1); + return tmp; + } + + //! pre-decrement + inline _const_fwd_iterator &operator--() { + _seekRev(1); + return *this; + } + + //! post-decrement + inline _const_fwd_iterator operator--(int) { + _const_fwd_iterator tmp(*this); + _seekRev(1); + return tmp; + } + + //! addition operator + inline _const_fwd_iterator operator+(difference_type n) { + _const_fwd_iterator tmp(*this); + if (n < 0) + tmp._seekRev(-n); + else + tmp._seekFwd(n); + return tmp; + } + + //! subtraction operator + inline _const_fwd_iterator operator-(difference_type n) { + _const_fwd_iterator tmp(*this); + if (n < 0) + tmp._seekFwd(-n); + else + tmp._seekRev(n); + return tmp; + } + + //! addition assignment operator + inline _const_fwd_iterator &operator+=(difference_type n) { + if (n < 0) + _seekRev(-n); + else + _seekFwd(n); + return *this; + } + + //! subtraction assignment operator + inline _const_fwd_iterator &operator-=(difference_type n) { + if (n < 0) + _seekFwd(-n); + else + _seekRev(n); + return *this; + } + + //! dereference operator + inline const value_type &operator*() const { return *iter_; } + + //! dereference at offset operator + inline const value_type &operator[](difference_type n) const { + _const_fwd_iterator tmp(*this); + tmp += n; + return *tmp; + } + + //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _const_fwd_iterator &moveNext() { + _moveNext(); + return *this; + } + + //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _const_fwd_iterator &movePrev() { + _movePrev(); + return *this; + } + + //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) + inline unicode_char getCharacter() const { return _getCharacter(); } + + //! difference operator + friend size_type operator-(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! equality operator + friend bool operator==(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! inequality operator + friend bool operator!=(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! less than + friend bool operator<(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! less than or equal + friend bool operator<=(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! greater than + friend bool operator>(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + //! greater than or equal + friend bool operator>=(const _const_fwd_iterator &left, const _const_fwd_iterator &right); + }; + + ////////////////////////////////////////////////////////////////////////// + // REVERSE ITERATORS + + class _const_rev_iterator; // forward declaration + //! forward iterator for UTFString + class CC_CORE_API _rev_iterator : public _base_iterator { + friend class _const_rev_iterator; + + public: + _rev_iterator() {} + _rev_iterator(const _rev_iterator &i) { _become(i); } + + //! pre-increment + inline _rev_iterator &operator++() { + _seekRev(1); + return *this; + } + + //! post-increment + inline _rev_iterator operator++(int) { + _rev_iterator tmp(*this); + _seekRev(1); + return tmp; + } + + //! pre-decrement + inline _rev_iterator &operator--() { + _seekFwd(1); + return *this; + } + + //! post-decrement + inline _rev_iterator operator--(int) { + _rev_iterator tmp(*this); + _seekFwd(1); + return tmp; + } + + //! addition operator + inline _rev_iterator operator+(difference_type n) { + _rev_iterator tmp(*this); + if (n < 0) + tmp._seekFwd(-n); + else + tmp._seekRev(n); + return tmp; + } + + //! subtraction operator + inline _rev_iterator operator-(difference_type n) { + _rev_iterator tmp(*this); + if (n < 0) + tmp._seekRev(-n); + else + tmp._seekFwd(n); + return tmp; + } + + //! addition assignment operator + inline _rev_iterator &operator+=(difference_type n) { + if (n < 0) + _seekFwd(-n); + else + _seekRev(n); + return *this; + } + + //! subtraction assignment operator + inline _rev_iterator &operator-=(difference_type n) { + if (n < 0) + _seekRev(-n); + else + _seekFwd(n); + return *this; + } + + //! dereference operator + inline value_type &operator*() const { return iter_[-1]; } + + //! dereference at offset operator + inline value_type &operator[](difference_type n) const { + _rev_iterator tmp(*this); + tmp -= n; + return *tmp; + } + }; + + ////////////////////////////////////////////////////////////////////////// + //! const reverse iterator for UTFString + + class CC_CORE_API _const_rev_iterator : public _base_iterator { + public: + _const_rev_iterator() {} + _const_rev_iterator(const _const_rev_iterator &i) { _become(i); } + _const_rev_iterator(const _rev_iterator &i) { _become(i); } + + //! pre-increment + inline _const_rev_iterator &operator++() { + _seekRev(1); + return *this; + } + + //! post-increment + inline _const_rev_iterator operator++(int) { + _const_rev_iterator tmp(*this); + _seekRev(1); + return tmp; + } + + //! pre-decrement + inline _const_rev_iterator &operator--() { + _seekFwd(1); + return *this; + } + + //! post-decrement + inline _const_rev_iterator operator--(int) { + _const_rev_iterator tmp(*this); + _seekFwd(1); + return tmp; + } + + //! addition operator + inline _const_rev_iterator operator+(difference_type n) { + _const_rev_iterator tmp(*this); + if (n < 0) + tmp._seekFwd(-n); + else + tmp._seekRev(n); + return tmp; + } + + //! subtraction operator + inline _const_rev_iterator operator-(difference_type n) { + _const_rev_iterator tmp(*this); + if (n < 0) + tmp._seekRev(-n); + else + tmp._seekFwd(n); + return tmp; + } + + //! addition assignment operator + inline _const_rev_iterator &operator+=(difference_type n) { + if (n < 0) + _seekFwd(-n); + else + _seekRev(n); + return *this; + } + + //! subtraction assignment operator + inline _const_rev_iterator &operator-=(difference_type n) { + if (n < 0) + _seekRev(-n); + else + _seekFwd(n); + return *this; + } + + //! dereference operator + inline const value_type &operator*() const { return iter_[-1]; } + + //! dereference at offset operator + inline const value_type &operator[](difference_type n) const { + _const_rev_iterator tmp(*this); + tmp -= n; + return *tmp; + } + + //! difference operator + friend size_type operator-(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! equality operator + friend bool operator==(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! inequality operator + friend bool operator!=(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! less than + friend bool operator<(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! less than or equal + friend bool operator<=(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! greater than + friend bool operator>(const _const_rev_iterator &left, const _const_rev_iterator &right); + //! greater than or equal + friend bool operator>=(const _const_rev_iterator &left, const _const_rev_iterator &right); + }; + + ////////////////////////////////////////////////////////////////////////// + + typedef _fwd_iterator iterator; //!< iterator + typedef _rev_iterator reverse_iterator; //!< reverse iterator + typedef _const_fwd_iterator const_iterator; //!< const iterator + typedef _const_rev_iterator const_reverse_iterator; //!< const reverse iterator + + //!\name Constructors/Destructor + //@{ + //! default constructor, creates an empty string + UTFString() { _init(); } + //! copy constructor + UTFString(const UTFString ©) { + _init(); + m_data = copy.m_data; } - - //! post-increment - inline _fwd_iterator operator++( int ) - { - _fwd_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; + //! \a length copies of \a ch + UTFString(size_type length, const code_point &ch) { + _init(); + assign(length, ch); } - - //! pre-decrement - inline _fwd_iterator& operator--() - { - _seekRev( 1 ); - return *this; + //! duplicate of nul-terminated sequence \a str + UTFString(const code_point *str) { + _init(); + assign(str); } - - //! post-decrement - inline _fwd_iterator operator--( int ) - { - _fwd_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; + //! duplicate of \a str, \a length code points long + UTFString(const code_point *str, size_type length) { + _init(); + assign(str, length); } - - //! addition operator - inline _fwd_iterator operator+( difference_type n ) - { - _fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; + //! substring of \a str starting at \a index and \a length code points long + UTFString(const UTFString &str, size_type index, size_type length) { + _init(); + assign(str, index, length); } - - //! subtraction operator - inline _fwd_iterator operator-( difference_type n ) - { - _fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! addition assignment operator - inline _fwd_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! subtraction assignment operator - inline _fwd_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! dereference operator - inline value_type& operator*() const { return *iter_; } - - //! dereference at offset operator - inline value_type& operator[]( difference_type n ) const - { - _fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - - //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream - inline _fwd_iterator& moveNext() - { - _moveNext(); - return *this; - } - - //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream - inline _fwd_iterator& movePrev() - { - _movePrev(); - return *this; - } - - //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) - inline unicode_char getCharacter() const { return _getCharacter(); } - //! Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); returns the amount of string length change caused by the operation - inline int setCharacter( unicode_char uc ) { return _setCharacter( uc ); } - }; - - ////////////////////////////////////////////////////////////////////////// - //! const forward iterator for UTFString - class CC_CORE_API _const_fwd_iterator: public _base_iterator - { - public: - _const_fwd_iterator() {} - _const_fwd_iterator( const _const_fwd_iterator& i ) { _become( i ); } - _const_fwd_iterator( const _fwd_iterator& i ) { _become( i ); } - - //! pre-increment - inline _const_fwd_iterator& operator++() - { - _seekFwd( 1 ); - return *this; - } - - //! post-increment - inline _const_fwd_iterator operator++( int ) - { - _const_fwd_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! pre-decrement - inline _const_fwd_iterator& operator--() - { - _seekRev( 1 ); - return *this; - } - - //! post-decrement - inline _const_fwd_iterator operator--( int ) - { - _const_fwd_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! addition operator - inline _const_fwd_iterator operator+( difference_type n ) - { - _const_fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - - //! subtraction operator - inline _const_fwd_iterator operator-( difference_type n ) - { - _const_fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! addition assignment operator - inline _const_fwd_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! subtraction assignment operator - inline _const_fwd_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! dereference operator - inline const value_type& operator*() const { return *iter_; } - - //! dereference at offset operator - inline const value_type& operator[]( difference_type n ) const - { - _const_fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - - //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream - inline _const_fwd_iterator& moveNext() - { - _moveNext(); - return *this; - } - - //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream - inline _const_fwd_iterator& movePrev() - { - _movePrev(); - return *this; - } - - //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) - inline unicode_char getCharacter() const { return _getCharacter(); } - - //! difference operator - friend size_type operator-( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! equality operator - friend bool operator==( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! inequality operator - friend bool operator!=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! less than - friend bool operator<( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! less than or equal - friend bool operator<=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! greater than - friend bool operator>( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! greater than or equal - friend bool operator>=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - }; - - ////////////////////////////////////////////////////////////////////////// - // REVERSE ITERATORS - - class _const_rev_iterator; // forward declaration - //! forward iterator for UTFString - class CC_CORE_API _rev_iterator: public _base_iterator - { - friend class _const_rev_iterator; - public: - _rev_iterator() {} - _rev_iterator( const _rev_iterator& i ) { _become( i ); } - - //! pre-increment - inline _rev_iterator& operator++() - { - _seekRev( 1 ); - return *this; - } - - //! post-increment - inline _rev_iterator operator++( int ) - { - _rev_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! pre-decrement - inline _rev_iterator& operator--() - { - _seekFwd( 1 ); - return *this; - } - - //! post-decrement - inline _rev_iterator operator--( int ) - { - _rev_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! addition operator - inline _rev_iterator operator+( difference_type n ) - { - _rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! subtraction operator - inline _rev_iterator operator-( difference_type n ) - { - _rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - - //! addition assignment operator - inline _rev_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! subtraction assignment operator - inline _rev_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! dereference operator - inline value_type& operator*() const { return iter_[-1]; } - - //! dereference at offset operator - inline value_type& operator[]( difference_type n ) const - { - _rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - }; - - ////////////////////////////////////////////////////////////////////////// - //! const reverse iterator for UTFString - - class CC_CORE_API _const_rev_iterator: public _base_iterator - { - public: - _const_rev_iterator() {} - _const_rev_iterator( const _const_rev_iterator& i ) { _become( i ); } - _const_rev_iterator( const _rev_iterator& i ) { _become( i ); } - - //! pre-increment - inline _const_rev_iterator& operator++() - { - _seekRev( 1 ); - return *this; - } - - //! post-increment - inline _const_rev_iterator operator++( int ) - { - _const_rev_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! pre-decrement - inline _const_rev_iterator& operator--() - { - _seekFwd( 1 ); - return *this; - } - - //! post-decrement - inline _const_rev_iterator operator--( int ) - { - _const_rev_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! addition operator - inline _const_rev_iterator operator+( difference_type n ) - { - _const_rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! subtraction operator - inline _const_rev_iterator operator-( difference_type n ) - { - _const_rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - - //! addition assignment operator - inline _const_rev_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! subtraction assignment operator - inline _const_rev_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! dereference operator - inline const value_type& operator*() const { return iter_[-1]; } - - //! dereference at offset operator - inline const value_type& operator[]( difference_type n ) const - { - _const_rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - - //! difference operator - friend size_type operator-( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! equality operator - friend bool operator==( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! inequality operator - friend bool operator!=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! less than - friend bool operator<( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! less than or equal - friend bool operator<=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! greater than - friend bool operator>( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! greater than or equal - friend bool operator>=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - }; - - ////////////////////////////////////////////////////////////////////////// - - typedef _fwd_iterator iterator; //!< iterator - typedef _rev_iterator reverse_iterator; //!< reverse iterator - typedef _const_fwd_iterator const_iterator; //!< const iterator - typedef _const_rev_iterator const_reverse_iterator; //!< const reverse iterator - - //!\name Constructors/Destructor - //@{ - //! default constructor, creates an empty string - UTFString() { _init(); } - //! copy constructor - UTFString(const UTFString& copy) { _init(); m_data = copy.m_data; } - //! \a length copies of \a ch - UTFString(size_type length, const code_point& ch) { _init(); assign( length, ch ); } - //! duplicate of nul-terminated sequence \a str - UTFString(const code_point* str) { _init(); assign( str ); } - //! duplicate of \a str, \a length code points long - UTFString(const code_point* str, size_type length) { _init(); assign( str, length ); } - //! substring of \a str starting at \a index and \a length code points long - UTFString(const UTFString& str, size_type index, size_type length) { _init(); assign( str, index, length ); } #if CC_IS_NATIVE_WCHAR_T - //! duplicate of nul-terminated \c wchar_t array - UTFString(const wchar_t* w_str) { _init(); assign( w_str ); } - //! duplicate of \a w_str, \a length characters long - UTFString(const wchar_t* w_str, size_type length) { _init(); assign( w_str, length ); } -#endif - - //! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding) - UTFString(const char* c_str) { _init(); assign( c_str ); } - //! duplicate of \a c_str, \a length characters long (UTF-8 encoding) - UTFString(const char* c_str, size_type length) { _init(); assign( c_str, length ); } - //! duplicate of \a str (UTF-8 encoding) - UTFString(const String& str) { _init(); assign(str); } - //! duplicate of \a wstr - UTFString(const WString& wstr) { _init(); assign(wstr); } - - //! destructor - ~UTFString() { _cleanBuffer(); } - - ////////////////////////////////////////////////////////////////////////// - // Utility functions - - //! Returns the number of code points in the current string - inline size_type size() const { return m_data.size(); } - //! Returns the number of code points in the current string - inline size_type length() const { return size(); } - //! Returns the number of Unicode characters in the string - /*! Executes in linear time. */ - inline size_type length_Characters() const { - const_iterator i = begin(), ie = end(); - size_type c = 0; - while ( i != ie ) { - i.moveNext(); - ++c; + //! duplicate of nul-terminated \c wchar_t array + UTFString(const wchar_t *w_str) { + _init(); + assign(w_str); + } + //! duplicate of \a w_str, \a length characters long + UTFString(const wchar_t *w_str, size_type length) { + _init(); + assign(w_str, length); } - return c; - } - //! returns the maximum number of UTF-16 code points that the string can hold - inline size_type max_size() const { return m_data.max_size(); } - //! sets the capacity of the string to at least \a size code points - inline void reserve( size_type size ) { m_data.reserve( size ); } - //! changes the size of the string to \a size, filling in any new area with \a val - inline void resize( size_type num, const code_point& val = 0 ) { m_data.resize( num, val ); } - //! exchanges the elements of the current string with those of \a from - inline void swap( UTFString& from ) { m_data.swap( from.m_data ); } - //! returns \c true if the string has no elements, \c false otherwise - inline bool empty() const { return m_data.empty(); } - //! returns a pointer to the first character in the current string - inline const code_point* c_str() const { return m_data.c_str(); } - //! returns a pointer to the first character in the current string - inline const code_point* data() const { return c_str(); } - //! returns the number of elements that the string can hold before it will need to allocate more space - inline size_type capacity() const { return m_data.capacity(); } - //! deletes all of the elements in the string - inline void clear() { m_data.clear(); } - //! returns a substring of the current string, starting at \a index, and \a num characters long. - /*! If \a num is omitted, it will default to \c UTFString::npos, and the substr() function will simply return the remainder of the string starting at \a index. */ - inline UTFString substr(size_type index, size_type num = npos) const { - // this could avoid the extra copy if we used a private specialty constructor - dstring tmpData = m_data.substr( index, num ); - UTFString tmp; - tmp.m_data.swap( tmpData ); - return tmp; - } - //! appends \a val to the end of the string - inline void push_back(unicode_char val) { - code_point cp[2] = { 0, 0 }; - size_t c = _utf32_to_utf16( val, cp ); - if ( c > 0 ) push_back( cp[0] ); - if ( c > 1 ) push_back( cp[1] ); - } -#if CC_IS_NATIVE_WCHAR_T - //! appends \a val to the end of the string - inline void push_back(wchar_t val) { - // we do this because the Unicode method still preserves UTF-16 code points - m_data.push_back(static_cast(val)); - } #endif - //! appends \a val to the end of the string - /*! This can be used to push surrogate pair code points, you'll just need to push them + + //! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding) + UTFString(const char *c_str) { + _init(); + assign(c_str); + } + //! duplicate of \a c_str, \a length characters long (UTF-8 encoding) + UTFString(const char *c_str, size_type length) { + _init(); + assign(c_str, length); + } + //! duplicate of \a str (UTF-8 encoding) + UTFString(const String &str) { + _init(); + assign(str); + } + //! duplicate of \a wstr + UTFString(const WString &wstr) { + _init(); + assign(wstr); + } + + //! destructor + ~UTFString() { _cleanBuffer(); } + + ////////////////////////////////////////////////////////////////////////// + // Utility functions + + //! Returns the number of code points in the current string + inline size_type size() const { return m_data.size(); } + //! Returns the number of code points in the current string + inline size_type length() const { return size(); } + //! Returns the number of Unicode characters in the string + /*! Executes in linear time. */ + inline size_type length_Characters() const { + const_iterator i = begin(), ie = end(); + size_type c = 0; + while (i != ie) { + i.moveNext(); + ++c; + } + return c; + } + //! returns the maximum number of UTF-16 code points that the string can hold + inline size_type max_size() const { return m_data.max_size(); } + //! sets the capacity of the string to at least \a size code points + inline void reserve(size_type size) { m_data.reserve(size); } + //! changes the size of the string to \a size, filling in any new area with \a val + inline void resize(size_type num, const code_point &val = 0) { m_data.resize(num, val); } + //! exchanges the elements of the current string with those of \a from + inline void swap(UTFString &from) { m_data.swap(from.m_data); } + //! returns \c true if the string has no elements, \c false otherwise + inline bool empty() const { return m_data.empty(); } + //! returns a pointer to the first character in the current string + inline const code_point *c_str() const { return m_data.c_str(); } + //! returns a pointer to the first character in the current string + inline const code_point *data() const { return c_str(); } + //! returns the number of elements that the string can hold before it will need to allocate more space + inline size_type capacity() const { return m_data.capacity(); } + //! deletes all of the elements in the string + inline void clear() { m_data.clear(); } + //! returns a substring of the current string, starting at \a index, and \a num characters long. + /*! If \a num is omitted, it will default to \c UTFString::npos, and the substr() function will simply return the remainder of the string starting at \a index. */ + inline UTFString substr(size_type index, size_type num = npos) const { + // this could avoid the extra copy if we used a private specialty constructor + dstring tmpData = m_data.substr(index, num); + UTFString tmp; + tmp.m_data.swap(tmpData); + return tmp; + } + //! appends \a val to the end of the string + inline void push_back(unicode_char val) { + code_point cp[2] = {0, 0}; + size_t c = _utf32_to_utf16(val, cp); + if (c > 0) push_back(cp[0]); + if (c > 1) push_back(cp[1]); + } +#if CC_IS_NATIVE_WCHAR_T + //! appends \a val to the end of the string + inline void push_back(wchar_t val) { + // we do this because the Unicode method still preserves UTF-16 code points + m_data.push_back(static_cast(val)); + } +#endif + //! appends \a val to the end of the string + /*! This can be used to push surrogate pair code points, you'll just need to push them one after the other. */ - inline void push_back(code_point val) { m_data.push_back( val ); } - //! appends \a val to the end of the string - /*! Limited to characters under the 127 value barrier. */ - inline void push_back(char val) { m_data.push_back( static_cast( val ) ); } - //! returns \c true if the given Unicode character \a ch is in this string - inline bool inString(unicode_char ch) const { - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) { - if ( i.getCharacter() == ch ) - return true; + inline void push_back(code_point val) { m_data.push_back(val); } + //! appends \a val to the end of the string + /*! Limited to characters under the 127 value barrier. */ + inline void push_back(char val) { m_data.push_back(static_cast(val)); } + //! returns \c true if the given Unicode character \a ch is in this string + inline bool inString(unicode_char ch) const { + const_iterator i, ie = end(); + for (i = begin(); i != ie; i.moveNext()) { + if (i.getCharacter() == ch) + return true; + } + return false; } - return false; - } - - ////////////////////////////////////////////////////////////////////////// - // Stream variations - - //! returns the current string in UTF-8 form within a std::string - inline const String& asUTF8() const - { - _load_buffer_UTF8(); - return *m_buff.m_strBuff; - } - - //! returns the current string in UTF-8 form as a nul-terminated char array - inline const char* asUTF8_c_str() const - { - _load_buffer_UTF8(); - return m_buff.m_strBuff->c_str(); - } - - //! returns the current string in the native form of std::wstring - inline const WString& asWStr() const - { - _load_buffer_WStr(); - return *m_buff.m_wstrBuff; - } - - //! returns the current string in the native form of a nul-terminated wchar_t array - inline const wchar_t* asWStr_c_str() const - { - _load_buffer_WStr(); - return m_buff.m_wstrBuff->c_str(); - } - - ////////////////////////////////////////////////////////////////////////// - // Single Character Access - - //! returns a reference to the element in the string at index \c loc - inline code_point& at( size_type loc ) { return m_data.at( loc ); } - //! returns a reference to the element in the string at index \c loc - inline const code_point& at( size_type loc ) const { return m_data.at( loc ); } - //! returns the data point \a loc evaluated as a UTF-32 value - /*! This function will will only properly decode surrogate pairs when \a loc points to the index + + ////////////////////////////////////////////////////////////////////////// + // Stream variations + + //! returns the current string in UTF-8 form within a std::string + inline const String &asUTF8() const { + _load_buffer_UTF8(); + return *m_buff.m_strBuff; + } + + //! returns the current string in UTF-8 form as a nul-terminated char array + inline const char *asUTF8_c_str() const { + _load_buffer_UTF8(); + return m_buff.m_strBuff->c_str(); + } + + //! returns the current string in the native form of std::wstring + inline const WString &asWStr() const { + _load_buffer_WStr(); + return *m_buff.m_wstrBuff; + } + + //! returns the current string in the native form of a nul-terminated wchar_t array + inline const wchar_t *asWStr_c_str() const { + _load_buffer_WStr(); + return m_buff.m_wstrBuff->c_str(); + } + + ////////////////////////////////////////////////////////////////////////// + // Single Character Access + + //! returns a reference to the element in the string at index \c loc + inline code_point &at(size_type loc) { return m_data.at(loc); } + //! returns a reference to the element in the string at index \c loc + inline const code_point &at(size_type loc) const { return m_data.at(loc); } + //! returns the data point \a loc evaluated as a UTF-32 value + /*! This function will will only properly decode surrogate pairs when \a loc points to the index of a lead code point that is followed by a trailing code point. Evaluating the trailing code point itself, or pointing to a code point that is a sentinel value (part of a broken pair) will return the value of just that code point (not a valid Unicode value, but useful as a sentinel value). */ - unicode_char getChar( size_type loc ) const; - - //! sets the value of the character at \a loc to the Unicode value \a ch (UTF-32) - /*! Providing sentinel values (values between U+D800-U+DFFF) are accepted, but you should be aware + unicode_char getChar(size_type loc) const; + + //! sets the value of the character at \a loc to the Unicode value \a ch (UTF-32) + /*! Providing sentinel values (values between U+D800-U+DFFF) are accepted, but you should be aware that you can also unwittingly create a valid surrogate pair if you don't pay attention to what you are doing. @note This operation may also lengthen the string if a surrogate pair is needed to represent the value given, but one is not available to replace; or alternatively shorten the string @@ -781,785 +772,791 @@ public: pair. The return value will signify any lengthening or shortening performed, returning 0 if no change was made, -1 if the string was shortened, or 1 if the string was lengthened. Any single call can only change the string length by + or - 1. */ - int setChar( size_type loc, unicode_char ch ); - - ////////////////////////////////////////////////////////////////////////// - // iterator acquisition - - //! returns an iterator to the first element of the string - inline iterator begin() - { - iterator i; - i.iter_ = m_data.begin(); - i.string_ = this; - return i; - } - //! returns an iterator to the first element of the string - inline const_iterator begin() const - { - const_iterator i; - i.iter_ = const_cast(this)->m_data.begin(); - i.string_ = const_cast(this); - return i; - } - //! returns an iterator just past the end of the string - inline iterator end() - { - iterator i; - i.iter_ = m_data.end(); - i.string_ = this; - return i; - } - //! returns an iterator just past the end of the string - inline const_iterator end() const - { - const_iterator i; - i.iter_ = const_cast(this)->m_data.end(); - i.string_ = const_cast(this); - return i; - } - //! returns a reverse iterator to the last element of the string - inline reverse_iterator rbegin() - { - reverse_iterator i; - i.iter_ = m_data.end(); - i.string_ = this; - return i; - } - //! returns a reverse iterator to the last element of the string - inline const_reverse_iterator rbegin() const - { - const_reverse_iterator i; - i.iter_ = const_cast(this)->m_data.end(); - i.string_ = const_cast(this); - return i; - } - //! returns a reverse iterator just past the beginning of the string - inline reverse_iterator rend() - { - reverse_iterator i; - i.iter_ = m_data.begin(); - i.string_ = this; - return i; - } - //! returns a reverse iterator just past the beginning of the string - inline const_reverse_iterator rend() const { - const_reverse_iterator i; - i.iter_ = const_cast(this)->m_data.begin(); - i.string_ = const_cast(this); - return i; - } - - ////////////////////////////////////////////////////////////////////////// - // assign - - //! gives the current string the values from \a start to \a end - inline UTFString& assign( iterator start, iterator end ) { - m_data.assign(start.iter_, end.iter_); - return *this; - } - - //! assign \a str to the current string - inline UTFString& assign( const UTFString& str ) { - m_data.assign(str.m_data); - return *this; - } - - //! assign the nul-terminated \a str to the current string - inline UTFString& assign( const code_point* str ) { - m_data.assign( str ); - return *this; - } - - //! assign the first \a num characters of \a str to the current string - inline UTFString& assign( const code_point* str, size_type num ) { - m_data.assign( str, num ); - return *this; - } - - //! assign \a len entries from \a str to the current string, starting at \a index - inline UTFString& assign( const UTFString& str, size_type index, size_type len ) { - m_data.assign( str.m_data, index, len ); - return *this; - } - - //! assign \a num copies of \a ch to the current string - inline UTFString& assign(size_type num, const code_point& ch) { - m_data.assign(num, ch); - return *this; - } - - //! assign \a str to the current string (\a str is treated as a UTF-8 stream) - UTFString& assign(const String& str); - //! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream) - UTFString& assign(const WString& wstr); - + int setChar(size_type loc, unicode_char ch); + + ////////////////////////////////////////////////////////////////////////// + // iterator acquisition + + //! returns an iterator to the first element of the string + inline iterator begin() { + iterator i; + i.iter_ = m_data.begin(); + i.string_ = this; + return i; + } + //! returns an iterator to the first element of the string + inline const_iterator begin() const { + const_iterator i; + i.iter_ = const_cast(this)->m_data.begin(); + i.string_ = const_cast(this); + return i; + } + //! returns an iterator just past the end of the string + inline iterator end() { + iterator i; + i.iter_ = m_data.end(); + i.string_ = this; + return i; + } + //! returns an iterator just past the end of the string + inline const_iterator end() const { + const_iterator i; + i.iter_ = const_cast(this)->m_data.end(); + i.string_ = const_cast(this); + return i; + } + //! returns a reverse iterator to the last element of the string + inline reverse_iterator rbegin() { + reverse_iterator i; + i.iter_ = m_data.end(); + i.string_ = this; + return i; + } + //! returns a reverse iterator to the last element of the string + inline const_reverse_iterator rbegin() const { + const_reverse_iterator i; + i.iter_ = const_cast(this)->m_data.end(); + i.string_ = const_cast(this); + return i; + } + //! returns a reverse iterator just past the beginning of the string + inline reverse_iterator rend() { + reverse_iterator i; + i.iter_ = m_data.begin(); + i.string_ = this; + return i; + } + //! returns a reverse iterator just past the beginning of the string + inline const_reverse_iterator rend() const { + const_reverse_iterator i; + i.iter_ = const_cast(this)->m_data.begin(); + i.string_ = const_cast(this); + return i; + } + + ////////////////////////////////////////////////////////////////////////// + // assign + + //! gives the current string the values from \a start to \a end + inline UTFString &assign(iterator start, iterator end) { + m_data.assign(start.iter_, end.iter_); + return *this; + } + + //! assign \a str to the current string + inline UTFString &assign(const UTFString &str) { + m_data.assign(str.m_data); + return *this; + } + + //! assign the nul-terminated \a str to the current string + inline UTFString &assign(const code_point *str) { + m_data.assign(str); + return *this; + } + + //! assign the first \a num characters of \a str to the current string + inline UTFString &assign(const code_point *str, size_type num) { + m_data.assign(str, num); + return *this; + } + + //! assign \a len entries from \a str to the current string, starting at \a index + inline UTFString &assign(const UTFString &str, size_type index, size_type len) { + m_data.assign(str.m_data, index, len); + return *this; + } + + //! assign \a num copies of \a ch to the current string + inline UTFString &assign(size_type num, const code_point &ch) { + m_data.assign(num, ch); + return *this; + } + + //! assign \a str to the current string (\a str is treated as a UTF-8 stream) + UTFString &assign(const String &str); + //! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream) + UTFString &assign(const WString &wstr); + #if CC_IS_NATIVE_WCHAR_T - //! assign \a w_str to the current string - inline UTFString& assign(const wchar_t* w_str) { - WString tmp(w_str); - return assign( tmp ); - } - - //! assign the first \a num characters of \a w_str to the current string - inline UTFString& assign(const wchar_t* w_str, size_type num) { - WString tmp(w_str, num); - return assign( tmp ); - } + //! assign \a w_str to the current string + inline UTFString &assign(const wchar_t *w_str) { + WString tmp(w_str); + return assign(tmp); + } + + //! assign the first \a num characters of \a w_str to the current string + inline UTFString &assign(const wchar_t *w_str, size_type num) { + WString tmp(w_str, num); + return assign(tmp); + } #endif - - //! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream) - inline UTFString& assign( const char* c_str ) { - String tmp( c_str ); - return assign( tmp ); - } - - //! assign the first \a num characters of \a c_str to the current string (\a c_str is treated as a UTF-8 stream) - inline UTFString& assign( const char* c_str, size_type num ) { - String tmp(c_str, num); - return assign( tmp ); - } - - ////////////////////////////////////////////////////////////////////////// - // append - - //! appends \a str on to the end of the current string - inline UTFString& append(const UTFString& str) { m_data.append(str.m_data); return *this; } - //! appends \a str on to the end of the current string - inline UTFString& append(const code_point* str) { m_data.append(str); return *this; } - //! appends a substring of \a str starting at \a index that is \a len characters long on to the end of the current string - inline UTFString& append(const UTFString& str, size_type index, size_type len) { m_data.append( str.m_data, index, len ); return *this; } - //! appends \a num characters of \a str on to the end of the current string - inline UTFString& append(const code_point* str, size_type num) { m_data.append( str, num ); return *this; } - //! appends \a num repetitions of \a ch on to the end of the current string - inline UTFString& append(size_type num, code_point ch) { m_data.append( num, ch ); return *this; } - //! appends the sequence denoted by \a start and \a end on to the end of the current string - inline UTFString& append(iterator start, iterator end) { m_data.append( start.iter_, end.iter_ ); return *this; } + + //! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream) + inline UTFString &assign(const char *c_str) { + String tmp(c_str); + return assign(tmp); + } + + //! assign the first \a num characters of \a c_str to the current string (\a c_str is treated as a UTF-8 stream) + inline UTFString &assign(const char *c_str, size_type num) { + String tmp(c_str, num); + return assign(tmp); + } + + ////////////////////////////////////////////////////////////////////////// + // append + + //! appends \a str on to the end of the current string + inline UTFString &append(const UTFString &str) { + m_data.append(str.m_data); + return *this; + } + //! appends \a str on to the end of the current string + inline UTFString &append(const code_point *str) { + m_data.append(str); + return *this; + } + //! appends a substring of \a str starting at \a index that is \a len characters long on to the end of the current string + inline UTFString &append(const UTFString &str, size_type index, size_type len) { + m_data.append(str.m_data, index, len); + return *this; + } + //! appends \a num characters of \a str on to the end of the current string + inline UTFString &append(const code_point *str, size_type num) { + m_data.append(str, num); + return *this; + } + //! appends \a num repetitions of \a ch on to the end of the current string + inline UTFString &append(size_type num, code_point ch) { + m_data.append(num, ch); + return *this; + } + //! appends the sequence denoted by \a start and \a end on to the end of the current string + inline UTFString &append(iterator start, iterator end) { + m_data.append(start.iter_, end.iter_); + return *this; + } #if CC_IS_NATIVE_WCHAR_T - //! appends \a num characters of \a str on to the end of the current string - inline UTFString& append(const wchar_t* w_str, size_type num) { WString tmp( w_str, num ); return append( tmp ); } - //! appends \a num repetitions of \a ch on to the end of the current string - inline UTFString& append(size_type num, wchar_t ch) { return append( num, static_cast( ch ) ); } + //! appends \a num characters of \a str on to the end of the current string + inline UTFString &append(const wchar_t *w_str, size_type num) { + WString tmp(w_str, num); + return append(tmp); + } + //! appends \a num repetitions of \a ch on to the end of the current string + inline UTFString &append(size_type num, wchar_t ch) { return append(num, static_cast(ch)); } #endif - //! appends \a num characters of \a str on to the end of the current string (UTF-8 encoding) - inline UTFString& append(const char* c_str, size_type num) { - UTFString tmp( c_str, num ); - append( tmp ); - return *this; - } - - //! appends \a num repetitions of \a ch on to the end of the current string (Unicode values less than 128) - inline UTFString& append(size_type num, char ch) { - append( num, static_cast( ch ) ); - return *this; - } - - //! appends \a num repetitions of \a ch on to the end of the current string (Full Unicode spectrum) - UTFString& append( size_type num, unicode_char ch ); - - ////////////////////////////////////////////////////////////////////////// - // insert - - //! inserts \a ch before the code point denoted by \a i - inline iterator insert(iterator i, const code_point& ch) { - iterator ret; - ret.iter_ = m_data.insert(i.iter_, ch); - ret.string_ = this; - return ret; - } - - //! inserts \a str into the current string, at location \a index - inline UTFString& insert(size_type index, const UTFString& str) { - m_data.insert( index, str.m_data ); - return *this; - } - - //! inserts \a str into the current string, at location \a index - inline UTFString& insert(size_type index, const code_point* str) { - m_data.insert( index, str ); - return *this; - } - //! inserts a substring of \a str (starting at \a index2 and \a num code points long) into the current string, at location \a index1 - inline UTFString& insert(size_type index1, const UTFString& str, size_type index2, size_type num) { - m_data.insert( index1, str.m_data, index2, num ); - return *this; - } - - //! inserts the code points denoted by \a start and \a end into the current string, before the code point specified by \a i - inline void insert(iterator i, iterator start, iterator end) { m_data.insert( i.iter_, start.iter_, end.iter_ ); } - - //! inserts \a num code points of \a str into the current string, at location \a index - inline UTFString& insert(size_type index, const code_point* str, size_type num) { - m_data.insert(index, str, num); - return *this; - } - + //! appends \a num characters of \a str on to the end of the current string (UTF-8 encoding) + inline UTFString &append(const char *c_str, size_type num) { + UTFString tmp(c_str, num); + append(tmp); + return *this; + } + + //! appends \a num repetitions of \a ch on to the end of the current string (Unicode values less than 128) + inline UTFString &append(size_type num, char ch) { + append(num, static_cast(ch)); + return *this; + } + + //! appends \a num repetitions of \a ch on to the end of the current string (Full Unicode spectrum) + UTFString &append(size_type num, unicode_char ch); + + ////////////////////////////////////////////////////////////////////////// + // insert + + //! inserts \a ch before the code point denoted by \a i + inline iterator insert(iterator i, const code_point &ch) { + iterator ret; + ret.iter_ = m_data.insert(i.iter_, ch); + ret.string_ = this; + return ret; + } + + //! inserts \a str into the current string, at location \a index + inline UTFString &insert(size_type index, const UTFString &str) { + m_data.insert(index, str.m_data); + return *this; + } + + //! inserts \a str into the current string, at location \a index + inline UTFString &insert(size_type index, const code_point *str) { + m_data.insert(index, str); + return *this; + } + //! inserts a substring of \a str (starting at \a index2 and \a num code points long) into the current string, at location \a index1 + inline UTFString &insert(size_type index1, const UTFString &str, size_type index2, size_type num) { + m_data.insert(index1, str.m_data, index2, num); + return *this; + } + + //! inserts the code points denoted by \a start and \a end into the current string, before the code point specified by \a i + inline void insert(iterator i, iterator start, iterator end) { m_data.insert(i.iter_, start.iter_, end.iter_); } + + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString &insert(size_type index, const code_point *str, size_type num) { + m_data.insert(index, str, num); + return *this; + } + #if CC_IS_NATIVE_WCHAR_T - //! inserts \a num code points of \a str into the current string, at location \a index - inline UTFString& insert(size_type index, const wchar_t* w_str, size_type num) { - UTFString tmp(w_str, num); - insert(index, tmp); - return *this; - } + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString &insert(size_type index, const wchar_t *w_str, size_type num) { + UTFString tmp(w_str, num); + insert(index, tmp); + return *this; + } #endif - //! inserts \a num code points of \a str into the current string, at location \a index - inline UTFString& insert(size_type index, const char* c_str, size_type num) { - UTFString tmp(c_str, num); - insert(index, tmp); - return *this; - } - - //! inserts \a num copies of \a ch into the current string, at location \a index - inline UTFString& insert(size_type index, size_type num, code_point ch) { - m_data.insert( index, num, ch ); - return *this; - } - + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString &insert(size_type index, const char *c_str, size_type num) { + UTFString tmp(c_str, num); + insert(index, tmp); + return *this; + } + + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString &insert(size_type index, size_type num, code_point ch) { + m_data.insert(index, num, ch); + return *this; + } + #if CC_IS_NATIVE_WCHAR_T - //! inserts \a num copies of \a ch into the current string, at location \a index - inline UTFString& insert(size_type index, size_type num, wchar_t ch) { - insert( index, num, static_cast( ch ) ); - return *this; - } + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString &insert(size_type index, size_type num, wchar_t ch) { + insert(index, num, static_cast(ch)); + return *this; + } #endif - //! inserts \a num copies of \a ch into the current string, at location \a index - inline UTFString& insert( size_type index, size_type num, char ch ) - { - insert( index, num, static_cast( ch ) ); - return *this; - } - - //! inserts \a num copies of \a ch into the current string, at location \a index - UTFString& insert( size_type index, size_type num, unicode_char ch ); - - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - inline void insert(iterator i, size_type num, const code_point& ch) { m_data.insert(i.iter_, num, ch ); } - + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString &insert(size_type index, size_type num, char ch) { + insert(index, num, static_cast(ch)); + return *this; + } + + //! inserts \a num copies of \a ch into the current string, at location \a index + UTFString &insert(size_type index, size_type num, unicode_char ch); + + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const code_point &ch) { m_data.insert(i.iter_, num, ch); } + #if CC_IS_NATIVE_WCHAR_T - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - inline void insert(iterator i, size_type num, const wchar_t& ch) { insert(i, num, static_cast(ch)); } + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const wchar_t &ch) { insert(i, num, static_cast(ch)); } #endif - - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - inline void insert(iterator i, size_type num, const char& ch) { insert( i, num, static_cast(ch)); } - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - void insert(iterator i, size_type num, const unicode_char& ch); - - ////////////////////////////////////////////////////////////////////////// - // erase - - //! removes the code point pointed to by \a loc, returning an iterator to the next character - inline iterator erase( iterator loc ) { - iterator ret; - ret.iter_ = m_data.erase(loc.iter_); - ret.string_ = this; - return ret; - } - //! removes the code points between \a start and \a end (including the one at \a start but not the one at \a end), returning an iterator to the code point after the last code point removed - inline iterator erase(iterator start, iterator last) { - iterator ret; - ret.iter_ = m_data.erase(start.iter_, last.iter_); - ret.string_ = this; - return ret; - } - //! removes \a num code points from the current string, starting at \a index - inline UTFString& erase(size_type index = 0, size_type num = npos) { - if (num == npos) - m_data.erase(index); - else - m_data.erase(index, num); - return *this; - } - - ////////////////////////////////////////////////////////////////////////// - // replace - - //! replaces up to \a num1 code points of the current string (starting at \a index1) with \a str - inline UTFString& replace(size_type index1, size_type num1, const UTFString& str) { - m_data.replace(index1, num1, str.m_data, 0, npos); - return *this; - } - - //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str - inline UTFString& replace(size_type index1, size_type num1, const UTFString& str, size_type num2) { - m_data.replace(index1, num1, str.m_data, 0, num2); - return *this; - } - - //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str beginning at \a index2 - inline UTFString& replace(size_type index1, size_type num1, const UTFString& str, size_type index2, size_type num2) { - m_data.replace(index1, num1, str.m_data, index2, num2); - return *this; - } - - //! replaces code points in the current string from \a start to \a end with \a num code points from \a str - inline UTFString& replace(iterator start, iterator end, const UTFString& str, size_type num = npos) { - _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload - - size_type index1 = begin() - st; - size_type num1 = end - st; - return replace( index1, num1, str, 0, num ); - } - - //! replaces up to \a num1 code points in the current string (beginning at \a index) with \c num2 copies of \c ch - inline UTFString& replace(size_type index, size_type num1, size_type num2, code_point ch) { - m_data.replace( index, num1, num2, ch ); - return *this; - } - - //! replaces the code points in the current string from \a start to \a end with \a num copies of \a ch - inline UTFString& replace(iterator start, iterator end, size_type num, code_point ch) { - _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload - size_type index1 = begin() - st; - size_type num1 = end - st; - return replace( index1, num1, num, ch ); - } - - ////////////////////////////////////////////////////////////////////////// - // compare - - //! compare \a str to the current string - inline int compare(const UTFString& str) const { return m_data.compare( str.m_data ); } - //! compare \a str to the current string - inline int compare(const code_point* str) const { return m_data.compare( str ); } - //! compare \a str to a substring of the current string, starting at \a index for \a length characters - inline int compare(size_type index, size_type length, const UTFString& str) const { return m_data.compare( index, length, str.m_data ); } - //! compare a substring of \a str to a substring of the current string, where \a index2 and \a length2 refer to \a str and \a index and \a length refer to the current string - inline int compare(size_type index, size_type length, const UTFString& str, size_type index2, size_type length2) const { return m_data.compare( index, length, str.m_data, index2, length2 ); } - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 characters long, and the substring of the current string begins at \a index and is \a length characters long - inline int compare(size_type index, size_type length, const code_point* str, size_type length2) const { return m_data.compare( index, length, str, length2 ); } + + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const char &ch) { insert(i, num, static_cast(ch)); } + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + void insert(iterator i, size_type num, const unicode_char &ch); + + ////////////////////////////////////////////////////////////////////////// + // erase + + //! removes the code point pointed to by \a loc, returning an iterator to the next character + inline iterator erase(iterator loc) { + iterator ret; + ret.iter_ = m_data.erase(loc.iter_); + ret.string_ = this; + return ret; + } + //! removes the code points between \a start and \a end (including the one at \a start but not the one at \a end), returning an iterator to the code point after the last code point removed + inline iterator erase(iterator start, iterator last) { + iterator ret; + ret.iter_ = m_data.erase(start.iter_, last.iter_); + ret.string_ = this; + return ret; + } + //! removes \a num code points from the current string, starting at \a index + inline UTFString &erase(size_type index = 0, size_type num = npos) { + if (num == npos) + m_data.erase(index); + else + m_data.erase(index, num); + return *this; + } + + ////////////////////////////////////////////////////////////////////////// + // replace + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with \a str + inline UTFString &replace(size_type index1, size_type num1, const UTFString &str) { + m_data.replace(index1, num1, str.m_data, 0, npos); + return *this; + } + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str + inline UTFString &replace(size_type index1, size_type num1, const UTFString &str, size_type num2) { + m_data.replace(index1, num1, str.m_data, 0, num2); + return *this; + } + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str beginning at \a index2 + inline UTFString &replace(size_type index1, size_type num1, const UTFString &str, size_type index2, size_type num2) { + m_data.replace(index1, num1, str.m_data, index2, num2); + return *this; + } + + //! replaces code points in the current string from \a start to \a end with \a num code points from \a str + inline UTFString &replace(iterator start, iterator end, const UTFString &str, size_type num = npos) { + _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload + + size_type index1 = begin() - st; + size_type num1 = end - st; + return replace(index1, num1, str, 0, num); + } + + //! replaces up to \a num1 code points in the current string (beginning at \a index) with \c num2 copies of \c ch + inline UTFString &replace(size_type index, size_type num1, size_type num2, code_point ch) { + m_data.replace(index, num1, num2, ch); + return *this; + } + + //! replaces the code points in the current string from \a start to \a end with \a num copies of \a ch + inline UTFString &replace(iterator start, iterator end, size_type num, code_point ch) { + _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload + size_type index1 = begin() - st; + size_type num1 = end - st; + return replace(index1, num1, num, ch); + } + + ////////////////////////////////////////////////////////////////////////// + // compare + + //! compare \a str to the current string + inline int compare(const UTFString &str) const { return m_data.compare(str.m_data); } + //! compare \a str to the current string + inline int compare(const code_point *str) const { return m_data.compare(str); } + //! compare \a str to a substring of the current string, starting at \a index for \a length characters + inline int compare(size_type index, size_type length, const UTFString &str) const { return m_data.compare(index, length, str.m_data); } + //! compare a substring of \a str to a substring of the current string, where \a index2 and \a length2 refer to \a str and \a index and \a length refer to the current string + inline int compare(size_type index, size_type length, const UTFString &str, size_type index2, size_type length2) const { return m_data.compare(index, length, str.m_data, index2, length2); } + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 characters long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const code_point *str, size_type length2) const { return m_data.compare(index, length, str, length2); } #if CC_IS_NATIVE_WCHAR_T - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 elements long, and the substring of the current string begins at \a index and is \a length characters long - inline int compare(size_type index, size_type length, const wchar_t* w_str, size_type length2) const { - UTFString tmp(w_str, length2); - return compare( index, length, tmp ); - } + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 elements long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const wchar_t *w_str, size_type length2) const { + UTFString tmp(w_str, length2); + return compare(index, length, tmp); + } #endif - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 UTF-8 code points long, and the substring of the current string begins at \a index and is \a length characters long - inline int compare(size_type index, size_type length, const char* c_str, size_type length2) const { - UTFString tmp(c_str, length2); - return compare(index, length, tmp); - } - - ////////////////////////////////////////////////////////////////////////// - // find & rfind - - //! returns the index of the first occurrence of \a str within the current string, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a str is a UTF-16 encoded string, but through implicit casting can also be a UTF-8 encoded string (const char* or std::string) */ - inline size_type find(const UTFString& str, size_type index = 0) const { return m_data.find(str.c_str(), index); } - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a cp_str is a UTF-16 encoded string */ - inline size_type find(const code_point* cp_str, size_type index, size_type length) const { - UTFString tmp( cp_str ); - return m_data.find( tmp.c_str(), index, length ); - } - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a cp_str is a UTF-8 encoded string */ - inline size_type find(const char* c_str, size_type index, size_type length) const { - UTFString tmp( c_str ); - return m_data.find( tmp.c_str(), index, length ); - } + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 UTF-8 code points long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const char *c_str, size_type length2) const { + UTFString tmp(c_str, length2); + return compare(index, length, tmp); + } + + ////////////////////////////////////////////////////////////////////////// + // find & rfind + + //! returns the index of the first occurrence of \a str within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a str is a UTF-16 encoded string, but through implicit casting can also be a UTF-8 encoded string (const char* or std::string) */ + inline size_type find(const UTFString &str, size_type index = 0) const { return m_data.find(str.c_str(), index); } + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-16 encoded string */ + inline size_type find(const code_point *cp_str, size_type index, size_type length) const { + UTFString tmp(cp_str); + return m_data.find(tmp.c_str(), index, length); + } + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-8 encoded string */ + inline size_type find(const char *c_str, size_type index, size_type length) const { + UTFString tmp(c_str); + return m_data.find(tmp.c_str(), index, length); + } #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a cp_str is a UTF-16 encoded string */ - inline size_type find(const wchar_t* w_str, size_type index, size_type length) const { - UTFString tmp( w_str ); - return m_data.find( tmp.c_str(), index, length ); - } + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-16 encoded string */ + inline size_type find(const wchar_t *w_str, size_type index, size_type length) const { + UTFString tmp(w_str); + return m_data.find(tmp.c_str(), index, length); + } #endif - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+007F (127) */ - inline size_type find( char ch, size_type index = 0 ) const { return find( static_cast( ch ), index ); } - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ - inline size_type find(code_point ch, size_type index = 0) const { return m_data.find( ch, index ); } + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+007F (127) */ + inline size_type find(char ch, size_type index = 0) const { return find(static_cast(ch), index); } + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ + inline size_type find(code_point ch, size_type index = 0) const { return m_data.find(ch, index); } #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ - inline size_type find(wchar_t ch, size_type index = 0) const { return find( static_cast( ch ), index ); } + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ + inline size_type find(wchar_t ch, size_type index = 0) const { return find(static_cast(ch), index); } #endif - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found - /*! \a ch can fully represent any Unicode character */ - inline size_type find(unicode_char ch, size_type index = 0) const { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return find( UTFString( cp, l ), index ); - } - - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type rfind(const UTFString& str, size_type index = 0) const { return m_data.rfind( str.c_str(), index ); } - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found - inline size_type rfind(const code_point* cp_str, size_type index, size_type num) const { - UTFString tmp( cp_str ); - return m_data.rfind( tmp.c_str(), index, num ); - } - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found - inline size_type rfind(const char* c_str, size_type index, size_type num) const { - UTFString tmp(c_str); - return m_data.rfind(tmp.c_str(), index, num); - } + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch can fully represent any Unicode character */ + inline size_type find(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return find(UTFString(cp, l), index); + } + + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(const UTFString &str, size_type index = 0) const { return m_data.rfind(str.c_str(), index); } + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const code_point *cp_str, size_type index, size_type num) const { + UTFString tmp(cp_str); + return m_data.rfind(tmp.c_str(), index, num); + } + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const char *c_str, size_type index, size_type num) const { + UTFString tmp(c_str); + return m_data.rfind(tmp.c_str(), index, num); + } #if CC_IS_NATIVE_WCHAR_T - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found - inline size_type rfind(const wchar_t* w_str, size_type index, size_type num) const { - UTFString tmp( w_str ); - return m_data.rfind( tmp.c_str(), index, num ); - } + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const wchar_t *w_str, size_type index, size_type num) const { + UTFString tmp(w_str); + return m_data.rfind(tmp.c_str(), index, num); + } #endif - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type rfind(char ch, size_type index = 0) const { return rfind( static_cast(ch), index); } - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type rfind(code_point ch, size_type index) const { return m_data.rfind(ch, index); } + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(char ch, size_type index = 0) const { return rfind(static_cast(ch), index); } + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(code_point ch, size_type index) const { return m_data.rfind(ch, index); } #if CC_IS_NATIVE_WCHAR_T - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type rfind(wchar_t ch, size_type index = 0) const { return rfind( static_cast( ch ), index ); } + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(wchar_t ch, size_type index = 0) const { return rfind(static_cast(ch), index); } #endif - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type rfind(unicode_char ch, size_type index = 0) const { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return rfind( UTFString( cp, l ), index ); - } - - ////////////////////////////////////////////////////////////////////////// - //! find_first/last_(not)_of - - //! Returns the index of the first character within the current string that matches \b any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found - size_type find_first_of(const UTFString &str, size_type index = 0, size_type num = npos) const; - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_of(code_point ch, size_type index = 0) const { - UTFString tmp; - tmp.assign( 1, ch ); - return find_first_of( tmp, index ); - } - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_of(char ch, size_type index = 0) const { return find_first_of( static_cast( ch ), index ); } + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return rfind(UTFString(cp, l), index); + } + + ////////////////////////////////////////////////////////////////////////// + //! find_first/last_(not)_of + + //! Returns the index of the first character within the current string that matches \b any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_first_of(const UTFString &str, size_type index = 0, size_type num = npos) const; + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(code_point ch, size_type index = 0) const { + UTFString tmp; + tmp.assign(1, ch); + return find_first_of(tmp, index); + } + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(char ch, size_type index = 0) const { return find_first_of(static_cast(ch), index); } #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_of(wchar_t ch, size_type index = 0) const { return find_first_of( static_cast( ch ), index ); } + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(wchar_t ch, size_type index = 0) const { return find_first_of(static_cast(ch), index); } #endif - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_of( unicode_char ch, size_type index = 0 ) const - { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return find_first_of( UTFString( cp, l ), index ); - } - - //! returns the index of the first character within the current string that does not match any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found - size_type find_first_not_of(const UTFString& str, size_type index = 0, size_type num = npos) const; - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_not_of(code_point ch, size_type index = 0) const - { - UTFString tmp; - tmp.assign( 1, ch ); - return find_first_not_of(tmp, index); - } - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_not_of(char ch, size_type index = 0) const { return find_first_not_of( static_cast( ch ), index ); } + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return find_first_of(UTFString(cp, l), index); + } + + //! returns the index of the first character within the current string that does not match any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_first_not_of(const UTFString &str, size_type index = 0, size_type num = npos) const; + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(code_point ch, size_type index = 0) const { + UTFString tmp; + tmp.assign(1, ch); + return find_first_not_of(tmp, index); + } + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(char ch, size_type index = 0) const { return find_first_not_of(static_cast(ch), index); } #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_not_of(wchar_t ch, size_type index = 0) const { return find_first_not_of( static_cast( ch ), index ); } + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(wchar_t ch, size_type index = 0) const { return find_first_not_of(static_cast(ch), index); } #endif - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found - inline size_type find_first_not_of(unicode_char ch, size_type index = 0) const - { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return find_first_not_of( UTFString( cp, l ), index ); - } - - //! returns the index of the first character within the current string that matches any character in \a str, doing a reverse search from \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found - size_type find_last_of(const UTFString& str, size_type index = npos, size_type num = npos) const; - - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_of(code_point ch, size_type index = npos) const - { - UTFString tmp; - tmp.assign( 1, ch ); - return find_last_of(tmp, index); - } - - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_of(char ch, size_type index = npos) const { return find_last_of( static_cast( ch ), index ); } - + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return find_first_not_of(UTFString(cp, l), index); + } + + //! returns the index of the first character within the current string that matches any character in \a str, doing a reverse search from \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_last_of(const UTFString &str, size_type index = npos, size_type num = npos) const; + + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(code_point ch, size_type index = npos) const { + UTFString tmp; + tmp.assign(1, ch); + return find_last_of(tmp, index); + } + + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(char ch, size_type index = npos) const { return find_last_of(static_cast(ch), index); } + #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_of( wchar_t ch, size_type index = npos ) const { return find_last_of( static_cast( ch ), index ); } + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(wchar_t ch, size_type index = npos) const { return find_last_of(static_cast(ch), index); } #endif - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_of( unicode_char ch, size_type index = npos ) const { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return find_last_of( UTFString( cp, l ), index ); - } - - //! returns the index of the last character within the current string that does not match any character in \a str, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - size_type find_last_not_of(const UTFString& str, size_type index = npos, size_type num = npos) const; - - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_not_of(code_point ch, size_type index = npos) const { - UTFString tmp; - tmp.assign( 1, ch ); - return find_last_not_of( tmp, index ); - } - - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_not_of(char ch, size_type index = npos) const { return find_last_not_of( static_cast( ch ), index ); } - + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(unicode_char ch, size_type index = npos) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return find_last_of(UTFString(cp, l), index); + } + + //! returns the index of the last character within the current string that does not match any character in \a str, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + size_type find_last_not_of(const UTFString &str, size_type index = npos, size_type num = npos) const; + + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(code_point ch, size_type index = npos) const { + UTFString tmp; + tmp.assign(1, ch); + return find_last_not_of(tmp, index); + } + + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(char ch, size_type index = npos) const { return find_last_not_of(static_cast(ch), index); } + #if CC_IS_NATIVE_WCHAR_T - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_not_of(wchar_t ch, size_type index = npos) const { return find_last_not_of( static_cast( ch ), index ); } + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(wchar_t ch, size_type index = npos) const { return find_last_not_of(static_cast(ch), index); } #endif - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found - inline size_type find_last_not_of(unicode_char ch, size_type index = npos) const { - code_point cp[3] = {0, 0, 0}; - size_t l = _utf32_to_utf16( ch, cp ); - return find_last_not_of( UTFString( cp, l ), index ); - } - - ////////////////////////////////////////////////////////////////////////// - // Operators - - //! less than operator - inline bool operator<( const UTFString& right ) const { return compare( right ) < 0; } - //! less than or equal operator - inline bool operator<=( const UTFString& right ) const { return compare( right ) <= 0; } - //! greater than operator - inline bool operator>( const UTFString& right ) const { return compare( right ) > 0; } - //! greater than or equal operator - inline bool operator>=( const UTFString& right ) const { return compare( right ) >= 0; } - //! equality operator - inline bool operator==( const UTFString& right ) const { return compare( right ) == 0; } - //! inequality operator - inline bool operator!=( const UTFString& right ) const { return !operator==( right ); } - //! assignment operator, implicitly casts all compatible types - inline UTFString& operator=( const UTFString& s ) { return assign( s ); } - //! assignment operator - inline UTFString& operator=( code_point ch ) { - clear(); - return append( 1, ch ); - } - //! assignment operator - inline UTFString& operator=( char ch ) { - clear(); - return append( 1, ch ); - } + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(unicode_char ch, size_type index = npos) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16(ch, cp); + return find_last_not_of(UTFString(cp, l), index); + } + + ////////////////////////////////////////////////////////////////////////// + // Operators + + //! less than operator + inline bool operator<(const UTFString &right) const { return compare(right) < 0; } + //! less than or equal operator + inline bool operator<=(const UTFString &right) const { return compare(right) <= 0; } + //! greater than operator + inline bool operator>(const UTFString &right) const { return compare(right) > 0; } + //! greater than or equal operator + inline bool operator>=(const UTFString &right) const { return compare(right) >= 0; } + //! equality operator + inline bool operator==(const UTFString &right) const { return compare(right) == 0; } + //! inequality operator + inline bool operator!=(const UTFString &right) const { return !operator==(right); } + //! assignment operator, implicitly casts all compatible types + inline UTFString &operator=(const UTFString &s) { return assign(s); } + //! assignment operator + inline UTFString &operator=(code_point ch) { + clear(); + return append(1, ch); + } + //! assignment operator + inline UTFString &operator=(char ch) { + clear(); + return append(1, ch); + } #if CC_IS_NATIVE_WCHAR_T - //! assignment operator - inline UTFString& operator=( wchar_t ch ) { - clear(); - return append( 1, ch ); - } + //! assignment operator + inline UTFString &operator=(wchar_t ch) { + clear(); + return append(1, ch); + } #endif - //! assignment operator - inline UTFString& operator=( unicode_char ch ) { - clear(); - return append( 1, ch ); - } - //! code point dereference operator - inline code_point& operator[]( size_type index ) { return at( index ); } - //! code point dereference operator - inline const code_point& operator[]( size_type index ) const{ return at( index ); } - - ////////////////////////////////////////////////////////////////////////// - // Implicit Cast Operators - - //! implicit cast to string - inline operator String() const { return String(asUTF8()); } - //! implicit cast to wstring - inline operator WString() const { return WString(asWStr()); } - - ////////////////////////////////////////////////////////////////////////// - // UTF-16 character encoding/decoding - - //! returns \c true if \a cp does not match the signature for the lead of follow code point of a surrogate pair in a UTF-16 sequence - inline static bool _utf16_independent_char( code_point cp ) { - /* + //! assignment operator + inline UTFString &operator=(unicode_char ch) { + clear(); + return append(1, ch); + } + //! code point dereference operator + inline code_point &operator[](size_type index) { return at(index); } + //! code point dereference operator + inline const code_point &operator[](size_type index) const { return at(index); } + + ////////////////////////////////////////////////////////////////////////// + // Implicit Cast Operators + + //! implicit cast to string + inline operator String() const { return String(asUTF8()); } + //! implicit cast to wstring + inline operator WString() const { return WString(asWStr()); } + + ////////////////////////////////////////////////////////////////////////// + // UTF-16 character encoding/decoding + + //! returns \c true if \a cp does not match the signature for the lead of follow code point of a surrogate pair in a UTF-16 sequence + inline static bool _utf16_independent_char(code_point cp) { + /* if ( 0xD800 <= cp && cp <= 0xDFFF ) // tests if the cp is within the surrogate pair range return false; // it matches a surrogate pair signature return true; // everything else is a standalone code point */ - return ( 0xD800 > cp || cp > 0xDFFF ); - } - - //! returns \c true if \a cp matches the signature of a surrogate pair lead character - inline static bool _utf16_surrogate_lead( code_point cp ) { - /* + return (0xD800 > cp || cp > 0xDFFF); + } + + //! returns \c true if \a cp matches the signature of a surrogate pair lead character + inline static bool _utf16_surrogate_lead(code_point cp) { + /* if ( 0xD800 <= cp && cp <= 0xDBFF ) // tests if the cp is within the 2nd word of a surrogate pair return true; // it is a 1st word return false; // it isn't */ - - return ( 0xD800 <= cp && cp <= 0xDBFF ); - } - - //! returns \c true if \a cp matches the signature of a surrogate pair following character - inline static bool _utf16_surrogate_follow( code_point cp ) { - /* + + return (0xD800 <= cp && cp <= 0xDBFF); + } + + //! returns \c true if \a cp matches the signature of a surrogate pair following character + inline static bool _utf16_surrogate_follow(code_point cp) { + /* if ( 0xDC00 <= cp && cp <= 0xDFFF ) // tests if the cp is within the 2nd word of a surrogate pair return true; // it is a 2nd word return false; // everything else isn't */ - - return ( 0xDC00 <= cp && cp <= 0xDFFF ); - } - - //! estimates the number of UTF-16 code points in the sequence starting with \a cp - inline static size_t _utf16_char_length( code_point cp ) { - /* + + return (0xDC00 <= cp && cp <= 0xDFFF); + } + + //! estimates the number of UTF-16 code points in the sequence starting with \a cp + inline static size_t _utf16_char_length(code_point cp) { + /* if ( 0xD800 <= cp && cp <= 0xDBFF ) // test if cp is the beginning of a surrogate pair return 2; // if it is, then we are 2 words long return 1; // otherwise we are only 1 word long */ - - return ( 0xD800 <= cp && cp <= 0xDBFF )? 2 : 1; - } - - //! returns the number of UTF-16 code points needed to represent the given UTF-32 character \a cp - inline static size_t _utf16_char_length( unicode_char uc ) { - /* + + return (0xD800 <= cp && cp <= 0xDBFF) ? 2 : 1; + } + + //! returns the number of UTF-16 code points needed to represent the given UTF-32 character \a cp + inline static size_t _utf16_char_length(unicode_char uc) { + /* if ( uc > 0xFFFF ) // test if uc is greater than the single word maximum return 2; // if so, we need a surrogate pair return 1; // otherwise we can stuff it into a single word */ - - return ( uc > 0xFFFF ? 2 : 1); - } - - //! converts the given UTF-16 character buffer \a in_cp to a single UTF-32 Unicode character \a out_uc, returns the number of code points used to create the output character (2 for surrogate pairs, otherwise 1) - /*! This function does it's best to prevent error conditions, verifying complete + + return (uc > 0xFFFF ? 2 : 1); + } + + //! converts the given UTF-16 character buffer \a in_cp to a single UTF-32 Unicode character \a out_uc, returns the number of code points used to create the output character (2 for surrogate pairs, otherwise 1) + /*! This function does it's best to prevent error conditions, verifying complete surrogate pairs before applying the algorithm. In the event that half of a pair is found it will happily generate a value in the 0xD800 - 0xDFFF range, which is normally an invalid Unicode value but we preserve them for use as sentinel values. */ - static size_t _utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ); - - //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-16 encoding, returns the number of code points used to encode the input (always 1 or 2) - /*! This function, like its counterpart, will happily create invalid UTF-16 surrogate pairs. These + static size_t _utf16_to_utf32(const code_point in_cp[2], unicode_char &out_uc); + + //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-16 encoding, returns the number of code points used to encode the input (always 1 or 2) + /*! This function, like its counterpart, will happily create invalid UTF-16 surrogate pairs. These invalid entries will be created for any value of \c in_uc that falls in the range U+D800 - U+DFFF. These are generally useful as sentinel values to represent various program specific conditions. @note This function will also pass through any single UTF-16 code point without modification, making it a safe method of ensuring a stream that is unknown UTF-32 or UTF-16 is truly UTF-16.*/ - static size_t _utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ); - - ////////////////////////////////////////////////////////////////////////// - // UTF-8 character encoding/decoding - - //! returns \c true if \a cp is the beginning of a UTF-8 sequence - inline static bool _utf8_start_char( unsigned char cp ) { return ( cp & ~_cont_mask ) != _cont; } - - //! estimates the number of UTF-8 code points in the sequence starting with \a cp - static size_t _utf8_char_length( unsigned char cp ); - //! returns the number of UTF-8 code points needed to represent the given UTF-32 character \a cp - static size_t _utf8_char_length( unicode_char uc ); - - //! converts the given UTF-8 character buffer to a single UTF-32 Unicode character, returns the number of bytes used to create the output character (maximum of 6) - static size_t _utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ); - //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-8 encoding, returns the number of bytes used to encode the input - static size_t _utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ); - - //! verifies a UTF-8 stream, returning the total number of Unicode characters found - inline static size_type _verifyUTF8( const unsigned char* c_str ) - { - String tmp( reinterpret_cast( c_str ) ); - return _verifyUTF8( tmp ); - } - - //! verifies a UTF-8 stream, returning the total number of Unicode characters found - static size_type _verifyUTF8( const String& str ); - + static size_t _utf32_to_utf16(const unicode_char &in_uc, code_point out_cp[2]); + + ////////////////////////////////////////////////////////////////////////// + // UTF-8 character encoding/decoding + + //! returns \c true if \a cp is the beginning of a UTF-8 sequence + inline static bool _utf8_start_char(unsigned char cp) { return (cp & ~_cont_mask) != _cont; } + + //! estimates the number of UTF-8 code points in the sequence starting with \a cp + static size_t _utf8_char_length(unsigned char cp); + //! returns the number of UTF-8 code points needed to represent the given UTF-32 character \a cp + static size_t _utf8_char_length(unicode_char uc); + + //! converts the given UTF-8 character buffer to a single UTF-32 Unicode character, returns the number of bytes used to create the output character (maximum of 6) + static size_t _utf8_to_utf32(const unsigned char in_cp[6], unicode_char &out_uc); + //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-8 encoding, returns the number of bytes used to encode the input + static size_t _utf32_to_utf8(const unicode_char &in_uc, unsigned char out_cp[6]); + + //! verifies a UTF-8 stream, returning the total number of Unicode characters found + inline static size_type _verifyUTF8(const unsigned char *c_str) { + String tmp(reinterpret_cast(c_str)); + return _verifyUTF8(tmp); + } + + //! verifies a UTF-8 stream, returning the total number of Unicode characters found + static size_type _verifyUTF8(const String &str); + private: - //template friend class _iterator; - dstring m_data; - - //! buffer data type identifier - enum BufferType - { - BT_NONE, - BT_STR, - BT_WSTR, - }; - - //! common constructor operations - inline void _init() - { - m_buff.m_voidBuff = 0; - m_buffType = BT_NONE; - m_buffSize = 0; - } - - /////////////////////////////////////////////////////////////////////// - // Scratch buffer - //! auto cleans the scratch buffer using the proper delete for the stored type - void _cleanBuffer() const; - - //! create a std::string in the scratch buffer area - void _getBufferStr() const; - //! create a std::wstring in the scratch buffer area - void _getBufferWStr() const; - - void _load_buffer_UTF8() const; - void _load_buffer_WStr() const; - void _load_buffer_UTF32() const; - - mutable BufferType m_buffType; // identifies the data type held in mBuffer - mutable size_t m_buffSize; // size of the CString buffer - - // multi-purpose buffer used everywhere we need a throw-away buffer - union - { - mutable void* m_voidBuff; - mutable String* m_strBuff; - mutable WString* m_wstrBuff; - } m_buff; + //template friend class _iterator; + dstring m_data; + + //! buffer data type identifier + enum BufferType { + BT_NONE, + BT_STR, + BT_WSTR, + }; + + //! common constructor operations + inline void _init() { + m_buff.m_voidBuff = 0; + m_buffType = BT_NONE; + m_buffSize = 0; + } + + /////////////////////////////////////////////////////////////////////// + // Scratch buffer + //! auto cleans the scratch buffer using the proper delete for the stored type + void _cleanBuffer() const; + + //! create a std::string in the scratch buffer area + void _getBufferStr() const; + //! create a std::wstring in the scratch buffer area + void _getBufferWStr() const; + + void _load_buffer_UTF8() const; + void _load_buffer_WStr() const; + void _load_buffer_UTF32() const; + + mutable BufferType m_buffType; // identifies the data type held in mBuffer + mutable size_t m_buffSize; // size of the CString buffer + + // multi-purpose buffer used everywhere we need a throw-away buffer + union { + mutable void *m_voidBuff; + mutable String *m_strBuff; + mutable WString *m_wstrBuff; + } m_buff; }; ////////////////////////////////////////////////////////////////////////// //! string addition operator \relates UTFString -inline UTFString operator+( const UTFString& s1, const UTFString& s2 ) { return UTFString( s1 ).append( s2 ); } +inline UTFString operator+(const UTFString &s1, const UTFString &s2) { return UTFString(s1).append(s2); } //! string addition operator \relates UTFString -inline UTFString operator+( const UTFString& s1, UTFString::code_point c ) { return UTFString( s1 ).append( 1, c ); } +inline UTFString operator+(const UTFString &s1, UTFString::code_point c) { return UTFString(s1).append(1, c); } //! string addition operator \relates UTFString -inline UTFString operator+( const UTFString& s1, UTFString::unicode_char c ) { return UTFString( s1 ).append( 1, c ); } +inline UTFString operator+(const UTFString &s1, UTFString::unicode_char c) { return UTFString(s1).append(1, c); } //! string addition operator \relates UTFString -inline UTFString operator+( const UTFString& s1, char c ) { return UTFString( s1 ).append( 1, c ); } +inline UTFString operator+(const UTFString &s1, char c) { return UTFString(s1).append(1, c); } #if CC_IS_NATIVE_WCHAR_T //! string addition operator \relates UTFString -inline UTFString operator+( const UTFString& s1, wchar_t c ) { return UTFString( s1 ).append( 1, c ); } +inline UTFString operator+(const UTFString &s1, wchar_t c) { return UTFString(s1).append(1, c); } #endif //! string addition operator \relates UTFString -inline UTFString operator+( UTFString::code_point c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +inline UTFString operator+(UTFString::code_point c, const UTFString &s2) { return UTFString().append(1, c).append(s2); } //! string addition operator \relates UTFString -inline UTFString operator+( UTFString::unicode_char c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +inline UTFString operator+(UTFString::unicode_char c, const UTFString &s2) { return UTFString().append(1, c).append(s2); } //! string addition operator \relates UTFString -inline UTFString operator+( char c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +inline UTFString operator+(char c, const UTFString &s2) { return UTFString().append(1, c).append(s2); } #if CC_IS_NATIVE_WCHAR_T //! string addition operator \relates UTFString -inline UTFString operator+( wchar_t c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +inline UTFString operator+(wchar_t c, const UTFString &s2) { return UTFString().append(1, c).append(s2); } #endif // (const) forward iterator common operators -inline UTFString::size_type operator-( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return ( left.iter_ - right.iter_ ); } -inline bool operator==( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ == right.iter_; } -inline bool operator!=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ != right.iter_; } -inline bool operator<( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ < right.iter_; } -inline bool operator<=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ <= right.iter_; } -inline bool operator>( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ > right.iter_; } -inline bool operator>=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ >= right.iter_; } +inline UTFString::size_type operator-(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return (left.iter_ - right.iter_); } +inline bool operator==(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ == right.iter_; } +inline bool operator!=(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ != right.iter_; } +inline bool operator<(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ < right.iter_; } +inline bool operator<=(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ <= right.iter_; } +inline bool operator>(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ > right.iter_; } +inline bool operator>=(const UTFString::_const_fwd_iterator &left, const UTFString::_const_fwd_iterator &right) { return left.iter_ >= right.iter_; } // (const) reverse iterator common operators // NB: many of these operations are evaluated in reverse because this is a reverse iterator wrapping a forward iterator -inline UTFString::size_type operator-( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return ( right.iter_ - left.iter_ ); } -inline bool operator==( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return left.iter_ == right.iter_; } -inline bool operator!=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return left.iter_ != right.iter_; } -inline bool operator<( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ < left.iter_; } -inline bool operator<=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ <= left.iter_; } -inline bool operator>( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ > left.iter_; } -inline bool operator>=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ >= left.iter_; } +inline UTFString::size_type operator-(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return (right.iter_ - left.iter_); } +inline bool operator==(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return left.iter_ == right.iter_; } +inline bool operator!=(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return left.iter_ != right.iter_; } +inline bool operator<(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return right.iter_ < left.iter_; } +inline bool operator<=(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return right.iter_ <= left.iter_; } +inline bool operator>(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return right.iter_ > left.iter_; } +inline bool operator>=(const UTFString::_const_rev_iterator &left, const UTFString::_const_rev_iterator &right) { return right.iter_ >= left.iter_; } -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_KERNEL_UTF_STRING_H_ diff --git a/native/cocos/renderer/core/math/CCCoreMath.h b/native/cocos/renderer/core/math/CCCoreMath.h index 16c4aa9f75..cfe68fc0af 100755 --- a/native/cocos/renderer/core/math/CCCoreMath.h +++ b/native/cocos/renderer/core/math/CCCoreMath.h @@ -1,8 +1,8 @@ #ifndef CC_CORE_MATH_CC_MATH_H_ #define CC_CORE_MATH_CC_MATH_H_ -#define CC_MATH_NAMESPACE_BEGIN namespace cc { namespace math { -#define CC_MATH_NAMESPACE_END }} +#define CC_MATH_NAMESPACE_BEGIN namespace cc { namespace gfx { namespace math { +#define CC_MATH_NAMESPACE_END }}} CC_MATH_NAMESPACE_BEGIN diff --git a/native/cocos/renderer/core/memory/AllocatedObj.cc b/native/cocos/renderer/core/memory/AllocatedObj.cc index 2241667f50..e845453064 100755 --- a/native/cocos/renderer/core/memory/AllocatedObj.cc +++ b/native/cocos/renderer/core/memory/AllocatedObj.cc @@ -3,6 +3,7 @@ #include "AllocatedObj.h" namespace cc { +namespace gfx { /* The problem is that operator new/delete are *implicitly* static. We have to @@ -12,4 +13,5 @@ namespace cc { template class AllocatedObject; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/memory/AllocatedObj.h b/native/cocos/renderer/core/memory/AllocatedObj.h index 4feda48291..20ffbc9527 100755 --- a/native/cocos/renderer/core/memory/AllocatedObj.h +++ b/native/cocos/renderer/core/memory/AllocatedObj.h @@ -4,15 +4,16 @@ // Anything that has done a #define new will screw operator new definitions up // so undefine #ifdef new -# undef new + #undef new #endif #ifdef delete -# undef delete + #undef delete #endif #include "core/CoreDef.h" namespace cc { +namespace gfx { /** Superclass for all objects that wish to use custom memory allocators when their new / delete operators are called. @@ -20,62 +21,61 @@ namespace cc { to use (e.g. see StdAllocPolicy). */ template -class CC_CORE_API AllocatedObject -{ - public: - explicit AllocatedObject() {} - ~AllocatedObject() {} - - // operator new, with debug line info - void* operator new(size_t sz, const char *file, int line, const char *func) { - return Alloc::AllocateBytes(sz, file, line, func); - } - - /// array operator new, with debug line info - void* operator new[] ( size_t sz, const char *file, int line, const char *func ) { - return Alloc::AllocateBytes(sz, file, line, func); - } +class CC_CORE_API AllocatedObject { +public: + explicit AllocatedObject() {} + ~AllocatedObject() {} - /// placement operator new - void* operator new(size_t sz, void *ptr) { - (void)sz; - return ptr; - } + // operator new, with debug line info + void *operator new(size_t sz, const char *file, int line, const char *func) { + return Alloc::AllocateBytes(sz, file, line, func); + } + + /// array operator new, with debug line info + void *operator new[](size_t sz, const char *file, int line, const char *func) { + return Alloc::AllocateBytes(sz, file, line, func); + } + + /// placement operator new + void *operator new(size_t sz, void *ptr) { + (void)sz; + return ptr; + } #if 1 - void* operator new(size_t sz) { - return Alloc::AllocateBytes(sz); - } + void *operator new(size_t sz) { + return Alloc::AllocateBytes(sz); + } - void* operator new[]( size_t sz ) { - return Alloc::AllocateBytes(sz); - } + void *operator new[](size_t sz) { + return Alloc::AllocateBytes(sz); + } #endif - void operator delete(void* ptr) { - Alloc::DeallocateBytes(ptr); - } - - // Corresponding operator for placement delete (second param same as the first) - void operator delete(void* ptr, void*) { - Alloc::DeallocateBytes(ptr); - } - - // only called if there is an exception in corresponding 'new' - void operator delete(void* ptr, const char*, int , const char*) { - Alloc::DeallocateBytes(ptr); - } - - void operator delete[](void *ptr) { - Alloc::DeallocateBytes(ptr); - } - - - void operator delete[](void* ptr, const char*, int, const char*) { - Alloc::DeallocateBytes(ptr); - } + void operator delete(void *ptr) { + Alloc::DeallocateBytes(ptr); + } + + // Corresponding operator for placement delete (second param same as the first) + void operator delete(void *ptr, void *) { + Alloc::DeallocateBytes(ptr); + } + + // only called if there is an exception in corresponding 'new' + void operator delete(void *ptr, const char *, int, const char *) { + Alloc::DeallocateBytes(ptr); + } + + void operator delete[](void *ptr) { + Alloc::DeallocateBytes(ptr); + } + + void operator delete[](void *ptr, const char *, int, const char *) { + Alloc::DeallocateBytes(ptr); + } }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_ALLOCATED_OBJ_H_ diff --git a/native/cocos/renderer/core/memory/JeAlloc.cc b/native/cocos/renderer/core/memory/JeAlloc.cc index 1130d48275..5688ef06cc 100755 --- a/native/cocos/renderer/core/memory/JeAlloc.cc +++ b/native/cocos/renderer/core/memory/JeAlloc.cc @@ -4,150 +4,151 @@ #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_JEMALLOC) -#include "jemalloc/jemalloc.h" -extern const char* je_malloc_conf = "narenas:4"; + #include "jemalloc/jemalloc.h" +extern const char *je_malloc_conf = "narenas:4"; namespace cc { +namespace gfx { -#ifdef CC_MEMORY_TRACKER -#define MEM_CHECKTAG_SIZE 4 -#define MEM_CHECKTAG 0x20170719 + #ifdef CC_MEMORY_TRACKER + #define MEM_CHECKTAG_SIZE 4 + #define MEM_CHECKTAG 0x20170719 -CC_INLINE static void CheckOverflowAlloc(void* ptr) { - size_t size = je_malloc_usable_size(ptr); - char* p = (char*)ptr + size - MEM_CHECKTAG_SIZE; - uint tag = MEM_CHECKTAG; - memcpy(p, &tag, MEM_CHECKTAG_SIZE); +CC_INLINE static void CheckOverflowAlloc(void *ptr) { + size_t size = je_malloc_usable_size(ptr); + char *p = (char *)ptr + size - MEM_CHECKTAG_SIZE; + uint tag = MEM_CHECKTAG; + memcpy(p, &tag, MEM_CHECKTAG_SIZE); } -CC_INLINE static void CheckOverflowFree(void* ptr) { - size_t size = je_malloc_usable_size(ptr); - char* p = (char*)ptr + size - MEM_CHECKTAG_SIZE; - uint tag; - memcpy(&tag, p, MEM_CHECKTAG_SIZE); - CCASSERT(tag == MEM_CHECKTAG); +CC_INLINE static void CheckOverflowFree(void *ptr) { + size_t size = je_malloc_usable_size(ptr); + char *p = (char *)ptr + size - MEM_CHECKTAG_SIZE; + uint tag; + memcpy(&tag, p, MEM_CHECKTAG_SIZE); + CCASSERT(tag == MEM_CHECKTAG); } -#else -#define MEM_CHECKTAG_SIZE 0 -#endif + #else + #define MEM_CHECKTAG_SIZE 0 + #endif -CC_DECL_MALLOC void* JeAllocImpl::AllocBytes(size_t count, const char* file, int line, const char* func) { - void* ptr = je_malloc(count + MEM_CHECKTAG_SIZE); -#ifdef CC_MEMORY_TRACKER - CheckOverflowAlloc(ptr); - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#else - // avoid unused params warning - (void)file; - (void)line; - (void)func; -#endif - return ptr; +CC_DECL_MALLOC void *JeAllocImpl::AllocBytes(size_t count, const char *file, int line, const char *func) { + void *ptr = je_malloc(count + MEM_CHECKTAG_SIZE); + #ifdef CC_MEMORY_TRACKER + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + #endif + return ptr; } -CC_DECL_MALLOC void* JeAllocImpl::ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func) { -#ifdef CC_MEMORY_TRACKER - if (ptr) - { - if(count == 0) { - CheckOverflowFree(ptr); - MemTracker::Instance()->RecordFree(ptr); - je_free(ptr); - return nullptr; - } else { - size_t oldsz = je_malloc_usable_size(ptr) - MEM_CHECKTAG_SIZE; - if (oldsz > count) oldsz = count; +CC_DECL_MALLOC void *JeAllocImpl::ReallocBytes(void *ptr, size_t count, const char *file, int line, const char *func) { + #ifdef CC_MEMORY_TRACKER + if (ptr) { + if (count == 0) { + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); + je_free(ptr); + return nullptr; + } else { + size_t oldsz = je_malloc_usable_size(ptr) - MEM_CHECKTAG_SIZE; + if (oldsz > count) oldsz = count; - void* nptr = je_malloc(count + MEM_CHECKTAG_SIZE); - memcpy(nptr, ptr, oldsz); - CheckOverflowAlloc(nptr); - MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + void *nptr = je_malloc(count + MEM_CHECKTAG_SIZE); + memcpy(nptr, ptr, oldsz); + CheckOverflowAlloc(nptr); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); - CheckOverflowFree(ptr); - MemTracker::Instance()->RecordFree(ptr); - je_free(ptr); - return nptr; - } - } else { - if (count) { - ptr = je_malloc(count + MEM_CHECKTAG_SIZE); - CheckOverflowAlloc(ptr); - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); - return ptr; - } else { - return nullptr; - } - } -#else - // avoid unused params warning - (void)file; - (void)line; - (void)func; - return je_realloc(ptr, count); -#endif + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); + je_free(ptr); + return nptr; + } + } else { + if (count) { + ptr = je_malloc(count + MEM_CHECKTAG_SIZE); + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } + #else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + return je_realloc(ptr, count); + #endif } -CC_DECL_MALLOC void* JeAllocImpl::AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func) { - // default to platform SIMD alignment if none specified - void* ptr = je_aligned_alloc(align, count + MEM_CHECKTAG_SIZE); -#ifdef COCOS_MEMORY_TRACKER - CheckOverflowAlloc(ptr); - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#else - // avoid unused params warning - (void)file; - (void)line; - (void)func; -#endif - return ptr; +CC_DECL_MALLOC void *JeAllocImpl::AllocBytesAligned(size_t align, size_t count, const char *file, int line, const char *func) { + // default to platform SIMD alignment if none specified + void *ptr = je_aligned_alloc(align, count + MEM_CHECKTAG_SIZE); + #ifdef COCOS_MEMORY_TRACKER + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + #endif + return ptr; } -void JeAllocImpl::DeallocBytes(void* ptr) { - // deal with null - if (!ptr) - return; -#ifdef CC_MEMORY_TRACKER - CheckOverflowFree(ptr); - MemTracker::Instance()->RecordFree(ptr); -#endif - je_free(ptr); +void JeAllocImpl::DeallocBytes(void *ptr) { + // deal with null + if (!ptr) + return; + #ifdef CC_MEMORY_TRACKER + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); + #endif + je_free(ptr); } struct JeDumpData { - char* buf; - int size; + char *buf; + int size; }; -static void JeStatsPrint(void* param, const char* msg) { - JeDumpData* jd = (JeDumpData*)param; - if (jd->size == 0) return; +static void JeStatsPrint(void *param, const char *msg) { + JeDumpData *jd = (JeDumpData *)param; + if (jd->size == 0) return; - int len = (int)strlen(msg); - if (len > jd->size) len = jd->size; - memcpy(jd->buf, msg, len); - jd->buf[len] = 0; - jd->buf += len; - jd->size -= len; + int len = (int)strlen(msg); + if (len > jd->size) len = jd->size; + memcpy(jd->buf, msg, len); + jd->buf[len] = 0; + jd->buf += len; + jd->size -= len; } -void JeAllocImpl::DumpStats(char* buf, int bufsize) { - JeDumpData jd; - jd.buf = buf; - jd.size = bufsize - 1; - je_malloc_stats_print(JeStatsPrint, &jd, "ma"); +void JeAllocImpl::DumpStats(char *buf, int bufsize) { + JeDumpData jd; + jd.buf = buf; + jd.size = bufsize - 1; + je_malloc_stats_print(JeStatsPrint, &jd, "ma"); } void JeAllocImpl::TrimAlloc() { - int narenas = 0; - size_t sz = sizeof(narenas); - je_mallctl("arenas.narenas", (void *)&narenas, &sz, nullptr, 0); - char buf[24]; - sprintf(buf, "arena.%d.purge", narenas); - printf("jemalloc trim: %s\n", buf); - je_mallctl(buf, NULL, NULL, NULL, 0); + int narenas = 0; + size_t sz = sizeof(narenas); + je_mallctl("arenas.narenas", (void *)&narenas, &sz, nullptr, 0); + char buf[24]; + sprintf(buf, "arena.%d.purge", narenas); + printf("jemalloc trim: %s\n", buf); + je_mallctl(buf, NULL, NULL, NULL, 0); } -} +} // namespace gfx +} // namespace cc #endif // end - #ifdef CC_MEMORY_ALLOCATOR_JEMALLOC diff --git a/native/cocos/renderer/core/memory/JeAlloc.h b/native/cocos/renderer/core/memory/JeAlloc.h index e40e8bcc90..b93b6af7da 100755 --- a/native/cocos/renderer/core/memory/JeAlloc.h +++ b/native/cocos/renderer/core/memory/JeAlloc.h @@ -4,16 +4,17 @@ #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_JEMALLOC) namespace cc { +namespace gfx { //Non-templated utility class just to hide jemalloc. class CC_CORE_API JeAllocImpl { - public: - static CC_DECL_MALLOC void* AllocBytes(size_t count, const char* file, int line, const char* func); - static CC_DECL_MALLOC void* ReallocBytes(void* ptr, size_t count, const char* file, int line, const char *func); - static CC_DECL_MALLOC void* AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func); - static void DeallocBytes(void* ptr); - static void DumpStats(char* buf, int bufsize); - static void TrimAlloc(); +public: + static CC_DECL_MALLOC void *AllocBytes(size_t count, const char *file, int line, const char *func); + static CC_DECL_MALLOC void *ReallocBytes(void *ptr, size_t count, const char *file, int line, const char *func); + static CC_DECL_MALLOC void *AllocBytesAligned(size_t align, size_t count, const char *file, int line, const char *func); + static void DeallocBytes(void *ptr); + static void DumpStats(char *buf, int bufsize); + static void TrimAlloc(); }; /** An allocation policy for use with AllocatedObject and @@ -22,38 +23,39 @@ class CC_CORE_API JeAllocImpl { provide a custom version of if you wish to change how memory is allocated. */ class CC_CORE_API JeAllocPolicy { - public: - static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { - return JeAllocImpl::AllocBytes(count, file, line, func); - } +public: + static CC_INLINE CC_DECL_MALLOC void *AllocateBytes(size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return JeAllocImpl::AllocBytes(count, file, line, func); + } - static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { - return JeAllocImpl::ReallocBytes(ptr, count, file, line, func); - } + static CC_INLINE CC_DECL_MALLOC void *ReallocateBytes(void *ptr, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return JeAllocImpl::ReallocBytes(ptr, count, file, line, func); + } - static CC_INLINE void DeallocateBytes(void* ptr) { - JeAllocImpl::DeallocBytes(ptr); - } + static CC_INLINE void DeallocateBytes(void *ptr) { + JeAllocImpl::DeallocBytes(ptr); + } - static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { - return JeAllocImpl::AllocBytesAligned(alignment, count, file, line, func); - } + static CC_INLINE CC_DECL_MALLOC void *AllocateBytesAligned(size_t alignment, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return JeAllocImpl::AllocBytesAligned(alignment, count, file, line, func); + } - static CC_INLINE void DeallocateBytesAligned(void* ptr) { - JeAllocImpl::DeallocBytes(ptr); - } + static CC_INLINE void DeallocateBytesAligned(void *ptr) { + JeAllocImpl::DeallocBytes(ptr); + } - // Get the maximum size of a single allocation - static CC_INLINE size_t GetMaxAllocationSize() { - return (std::numeric_limits::max)(); - } - - private: - // No instantiation - JeAllocPolicy() {} + // Get the maximum size of a single allocation + static CC_INLINE size_t GetMaxAllocationSize() { + return (std::numeric_limits::max)(); + } + +private: + // No instantiation + JeAllocPolicy() {} }; -} +} // namespace gfx +} // namespace cc #endif // end - #ifdef COCOS_MEMORY_ALLOCATOR_JEMALLOC diff --git a/native/cocos/renderer/core/memory/MemDef.h b/native/cocos/renderer/core/memory/MemDef.h index 94d36daa41..3a955a6713 100755 --- a/native/cocos/renderer/core/memory/MemDef.h +++ b/native/cocos/renderer/core/memory/MemDef.h @@ -7,6 +7,7 @@ #include "JeAlloc.h" namespace cc { +namespace gfx { #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) @@ -34,7 +35,6 @@ class CategorisedAllocPolicy : public JeAllocPolicy {}; #endif - // Useful shortcuts typedef CategorisedAllocPolicy GAP; typedef CategorisedAllocPolicy STLAP; @@ -42,7 +42,7 @@ typedef CategorisedAllocPolicy STLAP; // Containers (by-value only) // Will be of the form: // typedef STLAllocator TAlloc; -// for use in vector::type +// for use in vector::type ////////////////////////////////////////////////////////////////////////// @@ -50,127 +50,168 @@ typedef CategorisedAllocPolicy STLAP; without using new[] (which allocates an undocumented amount of extra memory and so isn't appropriate for custom allocators). */ -template -T* ConstructN(T* basePtr, size_t count) { - for (size_t i = 0; i < count; ++i) { - new ((void*)(basePtr+i)) T(); - } - return basePtr; +template +T *ConstructN(T *basePtr, size_t count) { + for (size_t i = 0; i < count; ++i) { + new ((void *)(basePtr + i)) T(); + } + return basePtr; } -} +} // namespace gfx +} // namespace cc #ifdef CC_MEMORY_TRACKER -/// Allocate a block of raw memory. -# define _CC_MALLOC(bytes) ::cc::CategorisedAllocPolicy::AllocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__) -/// Reallocate a block of raw memory. -# define _CC_REALLOC(ptr, bytes) ::cc::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes, __FILE__, __LINE__, __FUNCTION__) -/// Allocate a block of memory for a primitive type. -# define _CC_ALLOC_T(T, count) static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)) -/// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. -# define _CC_FREE(ptr) ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr) + /// Allocate a block of raw memory. + #define _CC_MALLOC(bytes) ::cc::gfx::CategorisedAllocPolicy::AllocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__) + /// Reallocate a block of raw memory. + #define _CC_REALLOC(ptr, bytes) ::cc::gfx::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes, __FILE__, __LINE__, __FUNCTION__) + /// Allocate a block of memory for a primitive type. + #define _CC_ALLOC_T(T, count) static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T) * (count), __FILE__, __LINE__, __FUNCTION__)) + /// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. + #define _CC_FREE(ptr) ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr) -/// Allocate space for one primitive type, external type or non-virtual type with constructor parameters -# define _CC_NEW_T(T) new (::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T -/// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T(T, count) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) -/// Free the memory allocated with _CC_NEW_T. -# define _CC_DELETE_T(ptr, T) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} -/// Free the memory allocated with _CC_NEW_ARRAY_T. -# define _CC_DELETE_ARRAY_T(ptr, T, count) if(ptr){for (size_t b = 0; b < (size_t)count; ++b) {(ptr)[b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} + /// Allocate space for one primitive type, external type or non-virtual type with constructor parameters + #define _CC_NEW_T(T) new (::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T + /// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T(T, count) ::cc::gfx::ConstructN(static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T) * (count), __FILE__, __LINE__, __FUNCTION__)), count) + /// Free the memory allocated with _CC_NEW_T. + #define _CC_DELETE_T(ptr, T) \ + if (ptr) { \ + (ptr)->~T(); \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr); \ + } + /// Free the memory allocated with _CC_NEW_ARRAY_T. + #define _CC_DELETE_ARRAY_T(ptr, T, count) \ + if (ptr) { \ + for (size_t b = 0; b < (size_t)count; ++b) { \ + (ptr)[b].~T(); \ + } \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr); \ + } -// aligned allocation -/// Allocate a block of raw memory aligned to user defined boundaries. -# define _CC_MALLOC_ALIGN(bytes, align) ::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes, __FILE__, __LINE__, __FUNCTION__) -/// Allocate a block of memory for a primitive type aligned to user defined boundaries. -# define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)) -/// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. -# define _CC_FREE_ALIGN(ptr, align) ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr) -/// Allocate a block of raw memory aligned to SIMD boundaries. -# define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) -/// Allocate a block of memory for a primitive type aligned to SIMD boundaries. -# define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. -# define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) + // aligned allocation + /// Allocate a block of raw memory aligned to user defined boundaries. + #define _CC_MALLOC_ALIGN(bytes, align) ::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes, __FILE__, __LINE__, __FUNCTION__) + /// Allocate a block of memory for a primitive type aligned to user defined boundaries. + #define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T) * (count), __FILE__, __LINE__, __FUNCTION__)) + /// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. + #define _CC_FREE_ALIGN(ptr, align) ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned(ptr) + /// Allocate a block of raw memory aligned to SIMD boundaries. + #define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) + /// Allocate a block of memory for a primitive type aligned to SIMD boundaries. + #define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. + #define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) -/// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries -# define _CC_NEW_T_ALIGN(T, align) new (::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T -/// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) -/// Free the memory allocated with _CC_NEW_T_ALIGN. -# define _CC_DELETE_T_ALIGN(ptr, T, align) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr);} -/// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. -# define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) if(ptr){for (size_t _b = 0; _b < (size_t)count; ++_b) {(ptr)[_b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr);} -/// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries -# define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) -/// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with _CC_NEW_T_SIMD. -# define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. -# define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) + /// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries + #define _CC_NEW_T_ALIGN(T, align) new (::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T + /// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::gfx::ConstructN(static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T) * (count), __FILE__, __LINE__, __FUNCTION__)), count) + /// Free the memory allocated with _CC_NEW_T_ALIGN. + #define _CC_DELETE_T_ALIGN(ptr, T, align) \ + if (ptr) { \ + (ptr)->~T(); \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned(ptr); \ + } + /// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. + #define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) \ + if (ptr) { \ + for (size_t _b = 0; _b < (size_t)count; ++_b) { \ + (ptr)[_b].~T(); \ + } \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned(ptr); \ + } + /// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries + #define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) + /// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with _CC_NEW_T_SIMD. + #define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. + #define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) -// new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) -// Also hooks up the file/line/function params -// Can only be used with classes that derive from AllocatedObject since customized new/delete needed -# define _CC_NEW new (__FILE__, __LINE__, __FUNCTION__) -# define _CC_DELETE delete + // new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) + // Also hooks up the file/line/function params + // Can only be used with classes that derive from AllocatedObject since customized new/delete needed + #define _CC_NEW new (__FILE__, __LINE__, __FUNCTION__) + #define _CC_DELETE delete #else -/// Allocate a block of raw memory. -# define _CC_MALLOC(bytes) ::cc::CategorisedAllocPolicy::AllocateBytes(bytes) -/// Reallocate a block of raw memory. -# define _CC_REALLOC(ptr, bytes) ::cc::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes) -/// Allocate a block of memory for a primitive type. -# define _CC_ALLOC_T(T, count) static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count))) -/// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. Category is required to be restated to ensure the matching policy is used -# define _CC_FREE(ptr) ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr) + /// Allocate a block of raw memory. + #define _CC_MALLOC(bytes) ::cc::gfx::CategorisedAllocPolicy::AllocateBytes(bytes) + /// Reallocate a block of raw memory. + #define _CC_REALLOC(ptr, bytes) ::cc::gfx::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes) + /// Allocate a block of memory for a primitive type. + #define _CC_ALLOC_T(T, count) static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T) * (count))) + /// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. Category is required to be restated to ensure the matching policy is used + #define _CC_FREE(ptr) ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr) -/// Allocate space for one primitive type, external type or non-virtual type with constructor parameters -# define _CC_NEW_T(T) new (::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T))) T -/// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T(T, count) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count))), count) -/// Free the memory allocated with _CC_NEW_T. -# define _CC_DELETE_T(ptr, T) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} -/// Free the memory allocated with _CC_NEW_ARRAY_T. -# define _CC_DELETE_ARRAY_T(ptr, T, count) if(ptr){for (size_t b = 0; b < (size_t)count; ++b) {(ptr)[b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} + /// Allocate space for one primitive type, external type or non-virtual type with constructor parameters + #define _CC_NEW_T(T) new (::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T))) T + /// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T(T, count) ::cc::gfx::ConstructN(static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytes(sizeof(T) * (count))), count) + /// Free the memory allocated with _CC_NEW_T. + #define _CC_DELETE_T(ptr, T) \ + if (ptr) { \ + (ptr)->~T(); \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr); \ + } + /// Free the memory allocated with _CC_NEW_ARRAY_T. + #define _CC_DELETE_ARRAY_T(ptr, T, count) \ + if (ptr) { \ + for (size_t b = 0; b < (size_t)count; ++b) { \ + (ptr)[b].~T(); \ + } \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytes((void *)ptr); \ + } -// aligned allocation -/// Allocate a block of raw memory aligned to user defined boundaries. -# define _CC_MALLOC_ALIGN(bytes, align) ::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes) -/// Allocate a block of memory for a primitive type aligned to user defined boundaries. -# define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count))) -/// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. -# define _CC_FREE_ALIGN(ptr, align) ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr) -/// Allocate a block of raw memory aligned to SIMD boundaries. -# define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) -/// Allocate a block of memory for a primitive type aligned to SIMD boundaries. -# define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. -# define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) + // aligned allocation + /// Allocate a block of raw memory aligned to user defined boundaries. + #define _CC_MALLOC_ALIGN(bytes, align) ::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes) + /// Allocate a block of memory for a primitive type aligned to user defined boundaries. + #define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T) * (count))) + /// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. + #define _CC_FREE_ALIGN(ptr, align) ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned((void *)ptr) + /// Allocate a block of raw memory aligned to SIMD boundaries. + #define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) + /// Allocate a block of memory for a primitive type aligned to SIMD boundaries. + #define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. + #define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) -/// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries -# define _CC_NEW_T_ALIGN(T, align) new (::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T))) T -/// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count))), count) -/// Free the memory allocated with _CC_NEW_T_ALIGN. -# define _CC_DELETE_T_ALIGN(ptr, T, align) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr);} -/// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. -# define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) if(ptr){for (size_t _b = 0; _b < (size_t)count; ++_b) { (ptr)[_b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr);} -/// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries -# define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) -/// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject -# define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with _CC_NEW_T_SIMD. -# define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) -/// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. -# define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, CC_SIMD_ALIGNMENT) + /// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries + #define _CC_NEW_T_ALIGN(T, align) new (::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T))) T + /// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::gfx::ConstructN(static_cast(::cc::gfx::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T) * (count))), count) + /// Free the memory allocated with _CC_NEW_T_ALIGN. + #define _CC_DELETE_T_ALIGN(ptr, T, align) \ + if (ptr) { \ + (ptr)->~T(); \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned((void *)ptr); \ + } + /// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. + #define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) \ + if (ptr) { \ + for (size_t _b = 0; _b < (size_t)count; ++_b) { \ + (ptr)[_b].~T(); \ + } \ + ::cc::gfx::CategorisedAllocPolicy::DeallocateBytesAligned((void *)ptr); \ + } + /// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries + #define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) + /// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject + #define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with _CC_NEW_T_SIMD. + #define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) + /// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. + #define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, CC_SIMD_ALIGNMENT) -// new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) -# define _CC_NEW new -# define _CC_DELETE delete + // new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) + #define _CC_NEW new + #define _CC_DELETE delete #endif diff --git a/native/cocos/renderer/core/memory/MemTracker.cc b/native/cocos/renderer/core/memory/MemTracker.cc index 3eb3dbc633..e8671641c1 100755 --- a/native/cocos/renderer/core/memory/MemTracker.cc +++ b/native/cocos/renderer/core/memory/MemTracker.cc @@ -3,266 +3,264 @@ #include "util/StringUtil.h" #if (CC_PLATFORM == CC_PLATFORM_ANDROID) -# include + #include #endif #ifdef CC_MEMORY_TRACKER -extern "C" -{ -#include +extern "C" { + #include } -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif -#if !defined(NOMINMAX) && defined(_MSC_VER) -# define NOMINMAX // required to stop windows.h messing up std::min -#endif -# include + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #if !defined(NOMINMAX) && defined(_MSC_VER) + #define NOMINMAX // required to stop windows.h messing up std::min + #endif + #include -# define CC_OUTPUT_STR(str) ::OutputDebugStringA(str) -#else -# define CC_OUTPUT_STR(str) fputs(str, stdout) -#endif + #define CC_OUTPUT_STR(str) ::OutputDebugStringA(str) + #else + #define CC_OUTPUT_STR(str) fputs(str, stdout) + #endif -#define LEAK_FILENAME "MemoryLeaks.log" + #define LEAK_FILENAME "MemoryLeaks.log" namespace cc { +namespace gfx { struct AllocHashNode { - tommy_hashdyn_node node; - void* key; - unsigned int bytes; - const char* filename; - const char* function; - unsigned int line; + tommy_hashdyn_node node; + void *key; + unsigned int bytes; + const char *filename; + const char *function; + unsigned int line; }; struct AllocListParam { - char* buf; - char* last; + char *buf; + char *last; }; struct AllocDumpParam { - std::map allocMap; + std::map allocMap; }; CC_INLINE static void FreeHashNode(AllocHashNode *n) { - free(n); + free(n); } -static int HashNodeCompare(const void* arg, const void* obj) { - return ((AllocHashNode*)obj)->key != (void*)arg; +static int HashNodeCompare(const void *arg, const void *obj) { + return ((AllocHashNode *)obj)->key != (void *)arg; } static void HashNodeListAndFree(void *arg, void *obj) { - AllocHashNode* node = (AllocHashNode*)obj; - AllocListParam* param = (AllocListParam*)arg; - int len = StringUtil::Printf(param->buf, param->last, "%s(%u): {%u bytes} functions: %s\n", (node->filename ? node->filename : "(unknown source)"), - node->line, node->bytes, (node->function ? node->function : "")); - param->buf += len; - FreeHashNode(node); + AllocHashNode *node = (AllocHashNode *)obj; + AllocListParam *param = (AllocListParam *)arg; + int len = StringUtil::Printf(param->buf, param->last, "%s(%u): {%u bytes} functions: %s\n", (node->filename ? node->filename : "(unknown source)"), + node->line, node->bytes, (node->function ? node->function : "")); + param->buf += len; + FreeHashNode(node); } static void HashNodeListAndDump(void *arg, void *obj) { - AllocHashNode* node = (AllocHashNode*)obj; - AllocDumpParam* param = (AllocDumpParam*)arg; - const char* key = node->filename ? node->filename : "null"; - std::map::iterator ptr = param->allocMap.find(key); - if (ptr == param->allocMap.end()) { - param->allocMap[key] = node->bytes; - } else { - ptr->second += node->bytes; - } - //char tmpbuf[1024]; - //sprintf(tmpbuf, "%s|%s|%u\n", node->filename, node->function, node->bytes); - //fputs(tmpbuf, param); + AllocHashNode *node = (AllocHashNode *)obj; + AllocDumpParam *param = (AllocDumpParam *)arg; + const char *key = node->filename ? node->filename : "null"; + std::map::iterator ptr = param->allocMap.find(key); + if (ptr == param->allocMap.end()) { + param->allocMap[key] = node->bytes; + } else { + ptr->second += node->bytes; + } + //char tmpbuf[1024]; + //sprintf(tmpbuf, "%s|%s|%u\n", node->filename, node->function, node->bytes); + //fputs(tmpbuf, param); } ///////////////////////////////////////////////////////// MemTracker::MemTracker() - : total_memory_allocated_(0) { - allocations_ = malloc(sizeof(tommy_hashdyn)); - tommy_hashdyn_init((tommy_hashdyn*)allocations_); +: total_memory_allocated_(0) { + allocations_ = malloc(sizeof(tommy_hashdyn)); + tommy_hashdyn_init((tommy_hashdyn *)allocations_); } MemTracker::~MemTracker() { - ReportLeaks(); - tommy_hashdyn_done((tommy_hashdyn*)allocations_); - free(allocations_); + ReportLeaks(); + tommy_hashdyn_done((tommy_hashdyn *)allocations_); + free(allocations_); } void MemTracker::RecordAlloc(void *ptr, size_t sz, const char *file, size_t ln, const char *func) { - tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t) reinterpret_cast(ptr)); - mutex_.lock(); + mutex_.lock(); - AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); - if (node) { - CCASSERT(0, "Double allocation with same address - this probably means you have a mismatched allocation / deallocation style."); - } else { - node = (AllocHashNode*)malloc(sizeof(AllocHashNode)); - node->key = ptr; - node->bytes = (unsigned int)sz; - node->filename = file; - node->function = func; - node->line = (unsigned int)ln; - tommy_hashdyn_insert((tommy_hashdyn*)allocations_, &node->node, node, hash); - total_memory_allocated_ += sz; - } + AllocHashNode *node = (AllocHashNode *)tommy_hashdyn_search((tommy_hashdyn *)allocations_, HashNodeCompare, ptr, hash); + if (node) { + CCASSERT(0, "Double allocation with same address - this probably means you have a mismatched allocation / deallocation style."); + } else { + node = (AllocHashNode *)malloc(sizeof(AllocHashNode)); + node->key = ptr; + node->bytes = (unsigned int)sz; + node->filename = file; + node->function = func; + node->line = (unsigned int)ln; + tommy_hashdyn_insert((tommy_hashdyn *)allocations_, &node->node, node, hash); + total_memory_allocated_ += sz; + } - mutex_.unlock(); + mutex_.unlock(); } -void MemTracker::RecordReAlloc(void* oldptr, void* ptr, size_t sz, const char* file, size_t ln, const char* func) { - if (oldptr != ptr) { - if (oldptr) RecordFree(oldptr); - RecordAlloc(ptr, sz, file, ln, func); - return; - } +void MemTracker::RecordReAlloc(void *oldptr, void *ptr, size_t sz, const char *file, size_t ln, const char *func) { + if (oldptr != ptr) { + if (oldptr) RecordFree(oldptr); + RecordAlloc(ptr, sz, file, ln, func); + return; + } - if (sz == 0) { - RecordFree(oldptr); - return; - } + if (sz == 0) { + RecordFree(oldptr); + return; + } - tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t) reinterpret_cast(ptr)); - mutex_.lock(); + mutex_.lock(); - AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); - if (node) { - int oldsize = (int)node->bytes; - node->bytes = (unsigned int)sz; - node->filename = file; - node->function = func; - node->line = (unsigned int)ln; - total_memory_allocated_ += ((int)sz - oldsize); - } else { - CCASSERT(0, "Reallocation address not found."); - } + AllocHashNode *node = (AllocHashNode *)tommy_hashdyn_search((tommy_hashdyn *)allocations_, HashNodeCompare, ptr, hash); + if (node) { + int oldsize = (int)node->bytes; + node->bytes = (unsigned int)sz; + node->filename = file; + node->function = func; + node->line = (unsigned int)ln; + total_memory_allocated_ += ((int)sz - oldsize); + } else { + CCASSERT(0, "Reallocation address not found."); + } - mutex_.unlock(); + mutex_.unlock(); } -void MemTracker::RecordFree(void* ptr) -{ - // deal cleanly with null pointers - if (!ptr) - return; +void MemTracker::RecordFree(void *ptr) { + // deal cleanly with null pointers + if (!ptr) + return; - tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t) reinterpret_cast(ptr)); - mutex_.lock(); + mutex_.lock(); - AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_remove((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); - if (node) - { - total_memory_allocated_ -= node->bytes; - FreeHashNode(node); - } - else - { - CCASSERT(0, "Unable to locate allocation unit - this probably means you have a mismatched allocation / deallocation style."); - } + AllocHashNode *node = (AllocHashNode *)tommy_hashdyn_remove((tommy_hashdyn *)allocations_, HashNodeCompare, ptr, hash); + if (node) { + total_memory_allocated_ -= node->bytes; + FreeHashNode(node); + } else { + CCASSERT(0, "Unable to locate allocation unit - this probably means you have a mismatched allocation / deallocation style."); + } - mutex_.unlock(); + mutex_.unlock(); } -int MemTracker::GetAllocSize(void* ptr) { - int sz = -1; - tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); +int MemTracker::GetAllocSize(void *ptr) { + int sz = -1; + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t) reinterpret_cast(ptr)); - mutex_.lock(); - AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); - if (node) { - sz = (int)node->bytes; - } - mutex_.unlock(); - return sz; + mutex_.lock(); + AllocHashNode *node = (AllocHashNode *)tommy_hashdyn_search((tommy_hashdyn *)allocations_, HashNodeCompare, ptr, hash); + if (node) { + sz = (int)node->bytes; + } + mutex_.unlock(); + return sz; } void MemTracker::ReportLeaks() { - char* buffer; + char *buffer; - unsigned int count = (unsigned int)tommy_hashdyn_count((tommy_hashdyn*)allocations_); - if (count == 0) { - buffer = (char*)malloc(256); - strcpy(buffer, "MemoryTracker: No memory leaks.\n"); - } else { - int len = 768 * 1024; - buffer = (char*)malloc(len); - char* last = buffer + len - 3; - char* buf = buffer; - buf += sprintf(buffer, "MemoryTracker: Detected memory leaks !!!\n" - "MemoryTracker: (%u) Allocation(s) with total %u bytes.\n" - "MemoryTracker: Dumping allocations ->\n", count, (unsigned int)total_memory_allocated_); + unsigned int count = (unsigned int)tommy_hashdyn_count((tommy_hashdyn *)allocations_); + if (count == 0) { + buffer = (char *)malloc(256); + strcpy(buffer, "MemoryTracker: No memory leaks.\n"); + } else { + int len = 768 * 1024; + buffer = (char *)malloc(len); + char *last = buffer + len - 3; + char *buf = buffer; + buf += sprintf(buffer, "MemoryTracker: Detected memory leaks !!!\n" + "MemoryTracker: (%u) Allocation(s) with total %u bytes.\n" + "MemoryTracker: Dumping allocations ->\n", + count, (unsigned int)total_memory_allocated_); - AllocListParam param; - param.buf = buf; - param.last = last; - tommy_hashdyn_foreach_arg((tommy_hashdyn*)allocations_, HashNodeListAndFree, ¶m); - } + AllocListParam param; + param.buf = buf; + param.last = last; + tommy_hashdyn_foreach_arg((tommy_hashdyn *)allocations_, HashNodeListAndFree, ¶m); + } - FILE* f = fopen(LEAK_FILENAME, "w"); - if (f) { - fputs(buffer, f); - fclose(f); - } - CC_OUTPUT_STR(buffer); - free(buffer); + FILE *f = fopen(LEAK_FILENAME, "w"); + if (f) { + fputs(buffer, f); + fclose(f); + } + CC_OUTPUT_STR(buffer); + free(buffer); } struct AllocDumpNode { - std::string name; - unsigned int bytes; + std::string name; + unsigned int bytes; }; -bool operator < (const AllocDumpNode& a, const AllocDumpNode& b) { - return a.bytes < b.bytes; +bool operator<(const AllocDumpNode &a, const AllocDumpNode &b) { + return a.bytes < b.bytes; } void MemTracker::DumpMemoryAllocation() { - AllocDumpParam param; - tommy_hashdyn_foreach_arg((tommy_hashdyn*)allocations_, HashNodeListAndDump, ¶m); - std::priority_queue q; - for (std::map::iterator ptr = param.allocMap.begin(); ptr != param.allocMap.end(); ++ptr) { - AllocDumpNode node; - node.name = ptr->first; - node.bytes = ptr->second; - q.push(std::move(node)); - } + AllocDumpParam param; + tommy_hashdyn_foreach_arg((tommy_hashdyn *)allocations_, HashNodeListAndDump, ¶m); + std::priority_queue q; + for (std::map::iterator ptr = param.allocMap.begin(); ptr != param.allocMap.end(); ++ptr) { + AllocDumpNode node; + node.name = ptr->first; + node.bytes = ptr->second; + q.push(std::move(node)); + } - unsigned int total = 0; - char tmpbuf[1024]; - sprintf(tmpbuf, "total memory: %u\n", (unsigned int)total_memory_allocated_); - std::string str = tmpbuf; - while (!q.empty()) { - const AllocDumpNode& n = q.top(); - sprintf(tmpbuf, "%s:%u\n", n.name.c_str(), n.bytes); - str += tmpbuf; - total += n.bytes; - q.pop(); - } - sprintf(tmpbuf, "calc total memory: %u\n", total); - str += tmpbuf; + unsigned int total = 0; + char tmpbuf[1024]; + sprintf(tmpbuf, "total memory: %u\n", (unsigned int)total_memory_allocated_); + std::string str = tmpbuf; + while (!q.empty()) { + const AllocDumpNode &n = q.top(); + sprintf(tmpbuf, "%s:%u\n", n.name.c_str(), n.bytes); + str += tmpbuf; + total += n.bytes; + q.pop(); + } + sprintf(tmpbuf, "calc total memory: %u\n", total); + str += tmpbuf; -#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) - FILE* f = fopen("MemDump.txt", "w"); - if (f) { - fputs(str.c_str(), f); - fclose(f); - } -#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) - __android_log_write(ANDROID_LOG_WARN, "Tao", str.c_str()); -#else - fputs(str.c_str(), stdout); -#endif + #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + FILE *f = fopen("MemDump.txt", "w"); + if (f) { + fputs(str.c_str(), f); + fclose(f); + } + #elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + __android_log_write(ANDROID_LOG_WARN, "Tao", str.c_str()); + #else + fputs(str.c_str(), stdout); + #endif } -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/core/memory/MemTracker.h b/native/cocos/renderer/core/memory/MemTracker.h index 8f8fbcda55..53a4e6bec4 100755 --- a/native/cocos/renderer/core/memory/MemTracker.h +++ b/native/cocos/renderer/core/memory/MemTracker.h @@ -4,6 +4,7 @@ #ifdef CC_MEMORY_TRACKER namespace cc { +namespace gfx { /** This class tracks the allocations and deallocations made, and is able to report memory statistics and leaks. @@ -11,19 +12,20 @@ is able to report memory statistics and leaks. This class is only available in debug builds. */ class CC_CORE_API MemTracker { - public: - ~MemTracker(); - private: - // protected ctor - MemTracker(); - - public: - // Get the total amount of memory allocated currently. - CC_INLINE size_t total_memory_allocated() const { return total_memory_allocated_; } +public: + ~MemTracker(); - void DumpMemoryAllocation(); +private: + // protected ctor + MemTracker(); - /** Record an allocation that has been made. Only to be called by +public: + // Get the total amount of memory allocated currently. + CC_INLINE size_t total_memory_allocated() const { return total_memory_allocated_; } + + void DumpMemoryAllocation(); + + /** Record an allocation that has been made. Only to be called by the memory management subsystem. @param ptr The pointer to the memory @param sz The size of the memory in bytes @@ -31,33 +33,34 @@ class CC_CORE_API MemTracker { @param file The file in which the allocation is being made @param ln The line on which the allocation is being made @param func The function in which the allocation is being made - */ - void RecordAlloc(void* ptr, size_t sz, - const char* file = nullptr, size_t ln = 0, const char* func = nullptr); - // Record the deallocation of memory. - void RecordFree(void* ptr); - void RecordReAlloc(void* oldptr, void* ptr, size_t sz, - const char *file = nullptr, size_t ln = 0, const char *func = nullptr); + */ + void RecordAlloc(void *ptr, size_t sz, + const char *file = nullptr, size_t ln = 0, const char *func = nullptr); + // Record the deallocation of memory. + void RecordFree(void *ptr); + void RecordReAlloc(void *oldptr, void *ptr, size_t sz, + const char *file = nullptr, size_t ln = 0, const char *func = nullptr); - int GetAllocSize(void *ptr); + int GetAllocSize(void *ptr); - // Static utility method to get the memory tracker instance - CC_INLINE static MemTracker* Instance() { - static MemTracker tracker; - return &tracker; - } - - private: - void ReportLeaks(); - - private: - std::mutex mutex_; - size_t total_memory_allocated_; - //tommy_hashdyn m_allocations; - void* allocations_; + // Static utility method to get the memory tracker instance + CC_INLINE static MemTracker *Instance() { + static MemTracker tracker; + return &tracker; + } + +private: + void ReportLeaks(); + +private: + std::mutex mutex_; + size_t total_memory_allocated_; + //tommy_hashdyn m_allocations; + void *allocations_; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/core/memory/Memory.cc b/native/cocos/renderer/core/memory/Memory.cc index 07accfa833..299629e135 100755 --- a/native/cocos/renderer/core/memory/Memory.cc +++ b/native/cocos/renderer/core/memory/Memory.cc @@ -3,11 +3,14 @@ #include "StlAlloc.h" namespace cc { +namespace gfx { CC_CORE_API SA stl_char_allocator; -} #if 0 CC_CORE_API void* BareNewErroneouslyCalled(size_t sz) { return malloc(sz); } #endif + +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/memory/NedPooling.cc b/native/cocos/renderer/core/memory/NedPooling.cc index 2bb6a520b6..52793f14dd 100755 --- a/native/cocos/renderer/core/memory/NedPooling.cc +++ b/native/cocos/renderer/core/memory/NedPooling.cc @@ -4,200 +4,201 @@ #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_NEDPOOLING) -// include Ned implementation -#if (CC_COMPILER == CC_COMPILER_MSVC) -# pragma warning(disable: 4005 4189 4267 4565 4702 4706) -#endif + // include Ned implementation + #if (CC_COMPILER == CC_COMPILER_MSVC) + #pragma warning(disable : 4005 4189 4267 4565 4702 4706) + #endif -#define USE_LOCKS 1 -#define INSECURE 1 -#include + #define USE_LOCKS 1 + #define INSECURE 1 + #include namespace cc { +namespace gfx { namespace nedPoolingIntern { - + const size_t ned_poolCount = 14; // Needs to be greater than 4 -#if (CC_CPU_ARCH == CC_CPU_ARCH_32) - void* ned_poolFootprint = reinterpret_cast(0xBB1AA45A); -#else - void* ned_poolFootprint = reinterpret_cast((ui64)0xBB1AA45A); -#endif -nedalloc::nedpool *ned_pools[ned_poolCount + 1] = { 0 }; -nedalloc::nedpool *ned_poolsAligned[ned_poolCount + 1] = { 0 }; - + #if (CC_CPU_ARCH == CC_CPU_ARCH_32) +void *ned_poolFootprint = reinterpret_cast(0xBB1AA45A); + #else +void *ned_poolFootprint = reinterpret_cast((ui64)0xBB1AA45A); + #endif +nedalloc::nedpool *ned_pools[ned_poolCount + 1] = {0}; +nedalloc::nedpool *ned_poolsAligned[ned_poolCount + 1] = {0}; + size_t PoolIDFromSize(size_t a_reqSize) { - // Requests size 16 or smaller are allocated at a 4 byte granularity. - // Requests size 17 or larger are allocated at a 16 byte granularity. - // With a ned_poolCount of 14, requests size 177 or larger go in the default pool. - - // spreadsheet style =IF(B35<=16; FLOOR((B35-1)/4;1); MIN(FLOOR((B35-1)/16; 1) + 3; 14)) - - size_t poolID = 0; - - if (a_reqSize > 0) { - if (a_reqSize <= 16) { - poolID = (a_reqSize - 1) >> 2; - } else { - poolID = std::min(((a_reqSize - 1) >> 4) + 3, ned_poolCount); + // Requests size 16 or smaller are allocated at a 4 byte granularity. + // Requests size 17 or larger are allocated at a 16 byte granularity. + // With a ned_poolCount of 14, requests size 177 or larger go in the default pool. + + // spreadsheet style =IF(B35<=16; FLOOR((B35-1)/4;1); MIN(FLOOR((B35-1)/16; 1) + 3; 14)) + + size_t poolID = 0; + + if (a_reqSize > 0) { + if (a_reqSize <= 16) { + poolID = (a_reqSize - 1) >> 2; + } else { + poolID = std::min(((a_reqSize - 1) >> 4) + 3, ned_poolCount); + } } - } - - return poolID; -} - -CC_DECL_MALLOC void* InternalAlloc(size_t a_reqSize) { - size_t poolID = PoolIDFromSize(a_reqSize); - nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. - - if (poolID < ned_poolCount) { - if (ned_pools[poolID] == 0) { - // Init pool if first use - - ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); - nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint - } - - pool = ned_pools[poolID]; - } - - return nedalloc::nedpmalloc(pool, a_reqSize); + + return poolID; } - CC_DECL_MALLOC void* InternalRealloc(void* ptr, size_t a_reqSize) { - size_t poolID = PoolIDFromSize(a_reqSize); - nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. +CC_DECL_MALLOC void *InternalAlloc(size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool *pool(0); // A pool pointer of 0 means the default pool. - if (poolID < ned_poolCount) { - if (ned_pools[poolID] == 0) { - // Init pool if first use + if (poolID < ned_poolCount) { + if (ned_pools[poolID] == 0) { + // Init pool if first use - ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); - nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint - } + ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } - pool = ned_pools[poolID]; - } - - return nedalloc::nedprealloc(pool, ptr, a_reqSize); - } - -CC_DECL_MALLOC void* InternalAllocAligned(size_t a_align, size_t a_reqSize) { - size_t poolID = PoolIDFromSize(a_reqSize); - nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. - - if (poolID < ned_poolCount) { - if (ned_poolsAligned[poolID] == 0) { - // Init pool if first use - - ned_poolsAligned[poolID] = nedalloc::nedcreatepool(0, 8); - nedalloc::nedpsetvalue(ned_poolsAligned[poolID], ned_poolFootprint); // All pools are stamped with a footprint + pool = ned_pools[poolID]; } - - pool = ned_poolsAligned[poolID]; - } - - return nedalloc::nedpmemalign(pool, a_align, a_reqSize); + + return nedalloc::nedpmalloc(pool, a_reqSize); } - -void InternalFree(void* a_mem) { - if (a_mem) { - nedalloc::nedpool* pool(0); - - // nedalloc lets us get the pool pointer from the memory pointer - void* footprint = nedalloc::nedgetvalue(&pool, a_mem); - - // Check footprint - if (footprint == ned_poolFootprint) { - // If we allocated the pool, deallocate from this pool... - nedalloc::nedpfree(pool, a_mem); - } else { - // ...otherwise let nedalloc handle it. - nedalloc::nedfree(a_mem); + +CC_DECL_MALLOC void *InternalRealloc(void *ptr, size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool *pool(0); // A pool pointer of 0 means the default pool. + + if (poolID < ned_poolCount) { + if (ned_pools[poolID] == 0) { + // Init pool if first use + + ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } + + pool = ned_pools[poolID]; } - } + + return nedalloc::nedprealloc(pool, ptr, a_reqSize); } - -} // end - namespace:nedPoolingIntern + +CC_DECL_MALLOC void *InternalAllocAligned(size_t a_align, size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool *pool(0); // A pool pointer of 0 means the default pool. + + if (poolID < ned_poolCount) { + if (ned_poolsAligned[poolID] == 0) { + // Init pool if first use + + ned_poolsAligned[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_poolsAligned[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } + + pool = ned_poolsAligned[poolID]; + } + + return nedalloc::nedpmemalign(pool, a_align, a_reqSize); +} + +void InternalFree(void *a_mem) { + if (a_mem) { + nedalloc::nedpool *pool(0); + + // nedalloc lets us get the pool pointer from the memory pointer + void *footprint = nedalloc::nedgetvalue(&pool, a_mem); + + // Check footprint + if (footprint == ned_poolFootprint) { + // If we allocated the pool, deallocate from this pool... + nedalloc::nedpfree(pool, a_mem); + } else { + // ...otherwise let nedalloc handle it. + nedalloc::nedfree(a_mem); + } + } +} + +} // namespace nedPoolingIntern ////////////////////////////////////////////////////////////////////////// -CC_DECL_MALLOC void* NedPoolingImpl::AllocBytes(size_t count, const char* file, int line, const char* func) -{ - void* ptr = nedPoolingIntern::InternalAlloc(count); -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#else - // avoid unused params warning - (void)file; - (void)line; - (void)func; -#endif - return ptr; +CC_DECL_MALLOC void *NedPoolingImpl::AllocBytes(size_t count, const char *file, int line, const char *func) { + void *ptr = nedPoolingIntern::InternalAlloc(count); + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + #endif + return ptr; } -CC_DECL_MALLOC void* NedPoolingImpl::ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func) { -#ifdef CC_MEMORY_TRACKER - if (ptr) { - if (count == 0) { - MemTracker::Instance()->RecordFree(ptr); - nedPoolingIntern::InternalFree(ptr); - return nullptr; - } else { - int oldsz = MemTracker::Instance()->GetAllocSize(ptr); - if (oldsz < 0) { - CCASSERT(false, "ned realloc: get old size of ptr fail!"); - return realloc(ptr, count); - } else { - if (oldsz >(int)count) oldsz = (int)count; - } +CC_DECL_MALLOC void *NedPoolingImpl::ReallocBytes(void *ptr, size_t count, const char *file, int line, const char *func) { + #ifdef CC_MEMORY_TRACKER + if (ptr) { + if (count == 0) { + MemTracker::Instance()->RecordFree(ptr); + nedPoolingIntern::InternalFree(ptr); + return nullptr; + } else { + int oldsz = MemTracker::Instance()->GetAllocSize(ptr); + if (oldsz < 0) { + CCASSERT(false, "ned realloc: get old size of ptr fail!"); + return realloc(ptr, count); + } else { + if (oldsz > (int)count) oldsz = (int)count; + } - void* nptr = nedPoolingIntern::InternalAlloc(count); - memcpy(nptr, ptr, oldsz); - MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); - MemTracker::Instance()->RecordFree(ptr); - nedPoolingIntern::InternalFree(ptr); - return nptr; - } - } else { - if (count) { - ptr = nedPoolingIntern::InternalAlloc(count); - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); - return ptr; - } else { - return nullptr; - } - } -#else - return nedPoolingIntern::InternalRealloc(ptr, count); -#endif + void *nptr = nedPoolingIntern::InternalAlloc(count); + memcpy(nptr, ptr, oldsz); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + MemTracker::Instance()->RecordFree(ptr); + nedPoolingIntern::InternalFree(ptr); + return nptr; + } + } else { + if (count) { + ptr = nedPoolingIntern::InternalAlloc(count); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } + #else + return nedPoolingIntern::InternalRealloc(ptr, count); + #endif } -CC_DECL_MALLOC void* NedPoolingImpl::AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func) { - // default to platform SIMD alignment if none specified - void* ptr = nedPoolingIntern::InternalAllocAligned(align, count); -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#else - // avoid unused params warning - (void)file; - (void)line; - (void)func; -#endif - return ptr; +CC_DECL_MALLOC void *NedPoolingImpl::AllocBytesAligned(size_t align, size_t count, const char *file, int line, const char *func) { + // default to platform SIMD alignment if none specified + void *ptr = nedPoolingIntern::InternalAllocAligned(align, count); + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + #endif + return ptr; } -void NedPoolingImpl::DeallocBytes(void* ptr) { - // deal with null - if (!ptr) { - return; - } -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordFree(ptr); -#endif - nedPoolingIntern::InternalFree(ptr); +void NedPoolingImpl::DeallocBytes(void *ptr) { + // deal with null + if (!ptr) { + return; + } + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); + #endif + nedPoolingIntern::InternalFree(ptr); } -} +} // namespace gfx +} // namespace cc #endif // end - #ifdef CC_MEMORY_ALLOCATOR_NEDPOOLING diff --git a/native/cocos/renderer/core/memory/NedPooling.h b/native/cocos/renderer/core/memory/NedPooling.h index 3147ea77c2..2af50dc557 100755 --- a/native/cocos/renderer/core/memory/NedPooling.h +++ b/native/cocos/renderer/core/memory/NedPooling.h @@ -4,15 +4,15 @@ #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_NEDPOOLING) namespace cc { +namespace gfx { //Non-templated utility class just to hide nedmalloc. -class CC_CORE_API NedPoolingImpl -{ +class CC_CORE_API NedPoolingImpl { public: - static CC_DECL_MALLOC void* AllocBytes(size_t count, const char* file, int line, const char* func); - static CC_DECL_MALLOC void* ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func); - static CC_DECL_MALLOC void* AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func); - static void DeallocBytes(void* ptr); + static CC_DECL_MALLOC void *AllocBytes(size_t count, const char *file, int line, const char *func); + static CC_DECL_MALLOC void *ReallocBytes(void *ptr, size_t count, const char *file, int line, const char *func); + static CC_DECL_MALLOC void *AllocBytesAligned(size_t align, size_t count, const char *file, int line, const char *func); + static void DeallocBytes(void *ptr); }; /** An allocation policy for use with AllocatedObject and @@ -23,34 +23,35 @@ public: This allocation policy uses nedmalloc (http://nedprod.com/programs/portable/nedmalloc/index.html). */ class CC_CORE_API NedPoolingAllocPolicy { - public: - static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { - return NedPoolingImpl::AllocBytes(count, file, line, func); - } - static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { - return NedPoolingImpl::ReallocBytes(ptr, count, file, line, func); - } - static CC_INLINE void DeallocateBytes(void* ptr) { - NedPoolingImpl::DeallocBytes(ptr); - } - static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { - return NedPoolingImpl::AllocBytesAligned(alignment, count, file, line, func); - } - static CC_INLINE void DeallocateBytesAligned(void *ptr) { - NedPoolingImpl::DeallocBytes(ptr); - } +public: + static CC_INLINE CC_DECL_MALLOC void *AllocateBytes(size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return NedPoolingImpl::AllocBytes(count, file, line, func); + } + static CC_INLINE CC_DECL_MALLOC void *ReallocateBytes(void *ptr, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return NedPoolingImpl::ReallocBytes(ptr, count, file, line, func); + } + static CC_INLINE void DeallocateBytes(void *ptr) { + NedPoolingImpl::DeallocBytes(ptr); + } + static CC_INLINE CC_DECL_MALLOC void *AllocateBytesAligned(size_t alignment, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return NedPoolingImpl::AllocBytesAligned(alignment, count, file, line, func); + } + static CC_INLINE void DeallocateBytesAligned(void *ptr) { + NedPoolingImpl::DeallocBytes(ptr); + } + + // Get the maximum size of a single allocation + static CC_INLINE size_t getMaxAllocationSize() { + return (std::numeric_limits::max)(); + } - // Get the maximum size of a single allocation - static CC_INLINE size_t getMaxAllocationSize() { - return (std::numeric_limits::max)(); - } - private: - // No instantiation - NedPoolingAllocPolicy() {} + // No instantiation + NedPoolingAllocPolicy() {} }; -} +} // namespace gfx +} // namespace cc #endif // end - #ifdef CC_MEMORY_ALLOCATOR_NEDPOOLING diff --git a/native/cocos/renderer/core/memory/StdAlloc.h b/native/cocos/renderer/core/memory/StdAlloc.h index 137d23ba9f..9970ae40e8 100755 --- a/native/cocos/renderer/core/memory/StdAlloc.h +++ b/native/cocos/renderer/core/memory/StdAlloc.h @@ -4,6 +4,7 @@ #if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) namespace cc { +namespace gfx { /** A "standard" allocation policy for use with AllocatedObject and STLAllocator. This is the class that actually does the allocation @@ -13,129 +14,128 @@ namespace cc { This class just delegates to the global malloc/free. */ class CC_CORE_API StdAllocPolicy { - public: - static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, -#ifdef CC_MEMORY_TRACKER - const char* file = nullptr, int line = 0, const char* func = nullptr -#else - const char* = nullptr, int = 0, const char* = nullptr -#endif - ) { - void* ptr = malloc(count); -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#endif - return ptr; - } +public: + static CC_INLINE CC_DECL_MALLOC void *AllocateBytes(size_t count, + #ifdef CC_MEMORY_TRACKER + const char *file = nullptr, int line = 0, const char *func = nullptr + #else + const char * = nullptr, int = 0, const char * = nullptr + #endif + ) { + void *ptr = malloc(count); + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #endif + return ptr; + } - static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, -#ifdef CC_MEMORY_TRACKER - const char* file = nullptr, int line = 0, const char* func = nullptr -#else - const char* = nullptr, int = 0, const char* = nullptr -#endif - ) { -#ifdef CC_MEMORY_TRACKER - if (ptr) { - if (count == 0) { - MemTracker::Instance()->RecordFree(ptr); - free(ptr); - return NULL; - } else { - int oldsz = MemTracker::Instance()->GetAllocSize(ptr); - if (oldsz < 0) { - printf("realloc: get old size of ptr fail!\n"); - assert(0); - return realloc(ptr, count); - } else { - if (oldsz >(int)count) oldsz = (int)count; - } + static CC_INLINE CC_DECL_MALLOC void *ReallocateBytes(void *ptr, size_t count, + #ifdef CC_MEMORY_TRACKER + const char *file = nullptr, int line = 0, const char *func = nullptr + #else + const char * = nullptr, int = 0, const char * = nullptr + #endif + ) { + #ifdef CC_MEMORY_TRACKER + if (ptr) { + if (count == 0) { + MemTracker::Instance()->RecordFree(ptr); + free(ptr); + return NULL; + } else { + int oldsz = MemTracker::Instance()->GetAllocSize(ptr); + if (oldsz < 0) { + printf("realloc: get old size of ptr fail!\n"); + assert(0); + return realloc(ptr, count); + } else { + if (oldsz > (int)count) oldsz = (int)count; + } - void* nptr = malloc(count); - memcpy(nptr, ptr, oldsz); - MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); - MemTracker::Instance()->RecordFree(ptr); - free(ptr); - return nptr; - } - } else { - if (count) { - ptr = malloc(count); - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); - return ptr; - } else { - return nullptr; - } - } -#else - return realloc(ptr, count); -#endif - } + void *nptr = malloc(count); + memcpy(nptr, ptr, oldsz); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + MemTracker::Instance()->RecordFree(ptr); + free(ptr); + return nptr; + } + } else { + if (count) { + ptr = malloc(count); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } + #else + return realloc(ptr, count); + #endif + } - static CC_INLINE void DeallocateBytes(void* ptr) { -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordFree(ptr); -#endif - free(ptr); - } + static CC_INLINE void DeallocateBytes(void *ptr) { + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); + #endif + free(ptr); + } - static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, -#ifdef CC_MEMORY_TRACKER - const char* file = NULL, int line = 0, const char* func = NULL -#else - const char* = NULL, int = 0, const char* = NULL -#endif - ) { -#ifdef _MSC_VER - void* ptr = _aligned_malloc(count, alignment); -#elif defined(__ANDROID__) - //void* ptr = memalign(alignment, count); - unsigned char* p = (unsigned char*)malloc(count + alignment); - size_t offset = alignment - (size_t(p) & (alignment - 1)); - unsigned char* ptr = p + offset; - ptr[-1] = (unsigned char)offset; -#else - void* ptr = NULL; - posix_memalign(&ptr, alignment, count); -#endif + static CC_INLINE CC_DECL_MALLOC void *AllocateBytesAligned(size_t alignment, size_t count, + #ifdef CC_MEMORY_TRACKER + const char *file = NULL, int line = 0, const char *func = NULL + #else + const char * = NULL, int = 0, const char * = NULL + #endif + ) { + #ifdef _MSC_VER + void *ptr = _aligned_malloc(count, alignment); + #elif defined(__ANDROID__) + //void* ptr = memalign(alignment, count); + unsigned char *p = (unsigned char *)malloc(count + alignment); + size_t offset = alignment - (size_t(p) & (alignment - 1)); + unsigned char *ptr = p + offset; + ptr[-1] = (unsigned char)offset; + #else + void *ptr = NULL; + posix_memalign(&ptr, alignment, count); + #endif -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); -#endif - return ptr; - } + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + #endif + return ptr; + } - static CC_INLINE void DeallocateBytesAligned(void *ptr) - { -#ifdef CC_MEMORY_TRACKER - MemTracker::Instance()->RecordFree(ptr); -#endif + static CC_INLINE void DeallocateBytesAligned(void *ptr) { + #ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); + #endif -#ifdef _MSC_VER - _aligned_free(ptr); -#elif defined(__ANDROID__) - if (ptr) - { - unsigned char* mem = (unsigned char*)ptr; - mem = mem - mem[-1]; - free(mem); - } -#else - free(ptr); -#endif - } + #ifdef _MSC_VER + _aligned_free(ptr); + #elif defined(__ANDROID__) + if (ptr) { + unsigned char *mem = (unsigned char *)ptr; + mem = mem - mem[-1]; + free(mem); + } + #else + free(ptr); + #endif + } - // Get the maximum size of a single allocation - static CC_INLINE size_t getMaxAllocationSize() { - return (std::numeric_limits::max)(); - } - - private: - // No instantiation - StdAllocPolicy() {} + // Get the maximum size of a single allocation + static CC_INLINE size_t getMaxAllocationSize() { + return (std::numeric_limits::max)(); + } + +private: + // No instantiation + StdAllocPolicy() {} }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/core/memory/StlAlloc.h b/native/cocos/renderer/core/memory/StlAlloc.h index c8173a5d68..6a88da651d 100755 --- a/native/cocos/renderer/core/memory/StlAlloc.h +++ b/native/cocos/renderer/core/memory/StlAlloc.h @@ -6,133 +6,133 @@ #include namespace cc { +namespace gfx { // Base STL allocator class. -template +template struct STLAllocatorBase { - // base class for generic allocators - typedef T value_type; + // base class for generic allocators + typedef T value_type; }; // Base STL allocator class. (const T version). -template +template struct STLAllocatorBase { - // base class for generic allocators for const T - typedef T value_type; + // base class for generic allocators for const T + typedef T value_type; }; -template +template class SA : public STLAllocatorBase { - public: - /// define our types, as per ISO C++ - typedef STLAllocatorBase Base; - typedef typename Base::value_type value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; +public: + /// define our types, as per ISO C++ + typedef STLAllocatorBase Base; + typedef typename Base::value_type value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef value_type &reference; + typedef const value_type &const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + /// the standard rebind mechanism + template + struct rebind { + typedef SA other; + }; - /// the standard rebind mechanism - template - struct rebind { - typedef SA other; - }; + /// ctor + inline explicit SA() {} - /// ctor - inline explicit SA() {} + /// dtor + virtual ~SA() {} - /// dtor - virtual ~SA() {} + /// copy ctor - done component wise + inline SA(SA const &) {} - /// copy ctor - done component wise - inline SA(SA const&) {} + /// cast + template + inline SA(SA const &) {} - /// cast - template - inline SA(SA const&) {} + /// cast + template + inline SA(SA const &) {} - /// cast - template - inline SA(SA const&) {} + inline pointer allocate(size_type count, typename std::allocator::const_pointer ptr = 0) { + (void)ptr; - inline pointer allocate(size_type count, typename std::allocator::const_pointer ptr = 0) { - (void)ptr; + // convert request to bytes + register size_type sz = count * sizeof(T); + return static_cast(AllocPolicy::AllocateBytes(sz)); + } - // convert request to bytes - register size_type sz = count * sizeof(T); - return static_cast(AllocPolicy::AllocateBytes(sz)); - } + inline void deallocate(pointer ptr, size_type) { + AllocPolicy::DeallocateBytes(ptr); + } - inline void deallocate(pointer ptr, size_type) { - AllocPolicy::DeallocateBytes(ptr); - } + pointer address(reference x) const { + return &x; + } - pointer address(reference x) const { - return &x; - } + const_pointer address(const_reference x) const { + return &x; + } - const_pointer address(const_reference x) const { - return &x; - } - - size_type max_size() const throw() { - return size_t(-1) / sizeof(T); - } + size_type max_size() const throw() { + return size_t(-1) / sizeof(T); + } #if __cplusplus >= 201103L - template - void construct(Up* p, Args&&... args) { - ::new((void *)p) Up(std::forward(args)...); - } + template + void construct(Up *p, Args &&... args) { + ::new ((void *)p) Up(std::forward(args)...); + } - template - void destroy(Up* p) { - p->~Up(); - } + template + void destroy(Up *p) { + p->~Up(); + } #else - void construct(pointer p, const T& val) { - // call placement new - ::new((void *)p) T(val); - } + void construct(pointer p, const T &val) { + // call placement new + ::new ((void *)p) T(val); + } - void destroy(pointer p) { - // do we have to protect against non-classes here? - // some articles suggest yes, some no - p->~T(); - } + void destroy(pointer p) { + // do we have to protect against non-classes here? + // some articles suggest yes, some no + p->~T(); + } #endif }; /// determine equality, can memory from another allocator /// be released by this allocator, (ISO C++) -template -inline bool operator ==(SA const&, SA const&) { - // same alloc policy (P), memory can be freed - return true; +template +inline bool operator==(SA const &, SA const &) { + // same alloc policy (P), memory can be freed + return true; } /// determine equality, can memory from another allocator /// be released by this allocator, (ISO C++) -template -inline bool operator ==(SA const&, OtherAllocator const&) { - return false; +template +inline bool operator==(SA const &, OtherAllocator const &) { + return false; } /// determine equality, can memory from another allocator /// be released by this allocator, (ISO C++) -template -inline bool operator!=(SA const&, SA const&) { - // same alloc policy (P), memory can be freed - return false; +template +inline bool operator!=(SA const &, SA const &) { + // same alloc policy (P), memory can be freed + return false; } /// determine equality, can memory from another allocator /// be released by this allocator, (ISO C++) -template -inline bool operator!=(SA const&, OtherAllocator const&) { - return true; +template +inline bool operator!=(SA const &, OtherAllocator const &) { + return true; } //////////////////////////////////////////////////////////////////// @@ -142,191 +142,192 @@ extern CC_CORE_API SA stl_char_allocator; template > struct vector { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::vector type; - typedef typename std::vector::iterator iterator; - typedef typename std::vector::const_iterator const_iterator; + typedef typename std::vector type; + typedef typename std::vector::iterator iterator; + typedef typename std::vector::const_iterator const_iterator; #else - typedef typename std::vector type; - typedef typename std::vector::iterator iterator; - typedef typename std::vector::const_iterator const_iterator; + typedef typename std::vector type; + typedef typename std::vector::iterator iterator; + typedef typename std::vector::const_iterator const_iterator; #endif }; -template > +template > struct list { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::list type; - typedef typename std::list::iterator iterator; - typedef typename std::list::const_iterator const_iterator; + typedef typename std::list type; + typedef typename std::list::iterator iterator; + typedef typename std::list::const_iterator const_iterator; #else - typedef typename std::list type; - typedef typename std::list::iterator iterator; - typedef typename std::list::const_iterator const_iterator; + typedef typename std::list type; + typedef typename std::list::iterator iterator; + typedef typename std::list::const_iterator const_iterator; #endif }; -template > +template > struct queue { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::queue type; - typedef typename std::queue::iterator iterator; - typedef typename std::queue::const_iterator const_iterator; + typedef typename std::queue type; + typedef typename std::queue::iterator iterator; + typedef typename std::queue::const_iterator const_iterator; #else - typedef typename std::queue type; - typedef typename std::queue::iterator iterator; - typedef typename std::queue::const_iterator const_iterator; + typedef typename std::queue type; + typedef typename std::queue::iterator iterator; + typedef typename std::queue::const_iterator const_iterator; #endif }; template ::type, typename P = std::less> struct priority_queue { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::priority_queue type; + typedef typename std::priority_queue type; #else - typedef typename std::priority_queue type; + typedef typename std::priority_queue type; #endif }; -template > +template > struct deque { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::deque type; - typedef typename std::deque::iterator iterator; - typedef typename std::deque::const_iterator const_iterator; + typedef typename std::deque type; + typedef typename std::deque::iterator iterator; + typedef typename std::deque::const_iterator const_iterator; #else - typedef typename std::deque type; - typedef typename std::deque::iterator iterator; - typedef typename std::deque::const_iterator const_iterator; + typedef typename std::deque type; + typedef typename std::deque::iterator iterator; + typedef typename std::deque::const_iterator const_iterator; #endif }; template , typename A = SA> struct set { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::set type; - typedef typename std::set::iterator iterator; - typedef typename std::set::const_iterator const_iterator; + typedef typename std::set type; + typedef typename std::set::iterator iterator; + typedef typename std::set::const_iterator const_iterator; #else - typedef typename std::set type; - typedef typename std::set::iterator iterator; - typedef typename std::set::const_iterator const_iterator; + typedef typename std::set type; + typedef typename std::set::iterator iterator; + typedef typename std::set::const_iterator const_iterator; #endif }; -template , typename A = SA, STLAP> > +template , typename A = SA, STLAP>> struct map { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::map type; - typedef typename std::map::iterator iterator; - typedef typename std::map::const_iterator const_iterator; + typedef typename std::map type; + typedef typename std::map::iterator iterator; + typedef typename std::map::const_iterator const_iterator; #else - typedef typename std::map type; - typedef typename std::map::iterator iterator; - typedef typename std::map::const_iterator const_iterator; + typedef typename std::map type; + typedef typename std::map::iterator iterator; + typedef typename std::map::const_iterator const_iterator; #endif }; -template , typename A = SA, STLAP> > +template , typename A = SA, STLAP>> struct multimap { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::multimap type; - typedef typename std::multimap::iterator iterator; - typedef typename std::multimap::const_iterator const_iterator; + typedef typename std::multimap type; + typedef typename std::multimap::iterator iterator; + typedef typename std::multimap::const_iterator const_iterator; #else - typedef typename std::multimap type; - typedef typename std::multimap::iterator iterator; - typedef typename std::multimap::const_iterator const_iterator; + typedef typename std::multimap type; + typedef typename std::multimap::iterator iterator; + typedef typename std::multimap::const_iterator const_iterator; #endif }; template , typename P = std::equal_to, typename A = SA, STLAP>> struct unordered_map { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) - typedef typename std::unordered_map type; - typedef typename std::unordered_map::iterator iterator; - typedef typename std::unordered_map::const_iterator const_iterator; + typedef typename std::unordered_map type; + typedef typename std::unordered_map::iterator iterator; + typedef typename std::unordered_map::const_iterator const_iterator; #else - typedef typename std::unordered_map type; - typedef typename std::unordered_map::iterator iterator; - typedef typename std::unordered_map::const_iterator const_iterator; + typedef typename std::unordered_map type; + typedef typename std::unordered_map::iterator iterator; + typedef typename std::unordered_map::const_iterator const_iterator; #endif }; -#define StdStringT(T) std::basic_string, std::allocator > -#define CustomMemoryStringT(T) std::basic_string, SA > +#define StdStringT(T) std::basic_string, std::allocator> +#define CustomMemoryStringT(T) std::basic_string, SA> -template -bool operator <(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0,l.length(), o.c_str(), o.length()) < 0; +template +bool operator<(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) < 0; } -template -bool operator <(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0,l.length(), o.c_str(), o.length()) < 0; +template +bool operator<(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) < 0; } -template -bool operator <=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(),o.length()) <= 0; +template +bool operator<=(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) <= 0; } -template -bool operator <=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) <= 0; +template +bool operator<=(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) <= 0; } -template -bool operator >(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) > 0; +template +bool operator>(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) > 0; } -template -bool operator >(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) > 0; +template +bool operator>(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) > 0; } -template -bool operator >=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; +template +bool operator>=(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; } -template -bool operator >=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; +template +bool operator>=(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; } -template -bool operator ==(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) == 0; +template +bool operator==(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) == 0; } -template bool operator ==(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) == 0; +template +bool operator==(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) == 0; } -template -bool operator !=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length())!=0; +template +bool operator!=(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) != 0; } -template -bool operator !=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return l.compare(0, l.length(), o.c_str(), o.length()) != 0; +template +bool operator!=(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return l.compare(0, l.length(), o.c_str(), o.length()) != 0; } -template -CustomMemoryStringT(T) operator +=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return CustomMemoryStringT(T)(l) += o.c_str(); +template +CustomMemoryStringT(T) operator+=(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return CustomMemoryStringT(T)(l) += o.c_str(); } -template -CustomMemoryStringT(T) operator +=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); +template +CustomMemoryStringT(T) operator+=(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); } -template -CustomMemoryStringT(T) operator +(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { - return CustomMemoryStringT(T)(l) += o.c_str(); +template +CustomMemoryStringT(T) operator+(const CustomMemoryStringT(T) & l, const StdStringT(T) & o) { + return CustomMemoryStringT(T)(l) += o.c_str(); } -template -CustomMemoryStringT(T) operator +(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { - return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); +template +CustomMemoryStringT(T) operator+(const StdStringT(T) & l, const CustomMemoryStringT(T) & o) { + return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); } -template -CustomMemoryStringT(T) operator +(const T* l, const CustomMemoryStringT(T)& o) { - return CustomMemoryStringT(T)(l) += o; +template +CustomMemoryStringT(T) operator+(const T *l, const CustomMemoryStringT(T) & o) { + return CustomMemoryStringT(T)(l) += o; } #undef StdStringT @@ -334,14 +335,15 @@ CustomMemoryStringT(T) operator +(const T* l, const CustomMemoryStringT(T)& o) { #if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) typedef std::basic_string, SA> String; -typedef std::basic_string, SA> WString; +typedef std::basic_string, SA> WString; #else -typedef std::string String; +typedef std::string String; typedef std::wstring WString; #endif -typedef vector::type StringArray; +typedef vector::type StringArray; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_STL_ALLOC_H_ diff --git a/native/cocos/renderer/core/util/StringUtil.cc b/native/cocos/renderer/core/util/StringUtil.cc index fc2930f023..26f6f8fd0e 100755 --- a/native/cocos/renderer/core/util/StringUtil.cc +++ b/native/cocos/renderer/core/util/StringUtil.cc @@ -2,95 +2,97 @@ #include "StringUtil.h" #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include #endif namespace cc { +namespace gfx { #if defined(_WIN32) -int StringUtil::VPrintf(char* buf, char* last, const char* fmt, va_list args) { - if (last <= buf) return 0; - - int count = (int)(last - buf); - int ret = _vsnprintf_s(buf, count, _TRUNCATE, fmt, args); - if (ret < 0) { - if (errno == 0) { - return count - 1; +int StringUtil::VPrintf(char *buf, char *last, const char *fmt, va_list args) { + if (last <= buf) return 0; + + int count = (int)(last - buf); + int ret = _vsnprintf_s(buf, count, _TRUNCATE, fmt, args); + if (ret < 0) { + if (errno == 0) { + return count - 1; + } else { + return 0; + } } else { - return 0; + return ret; } - } else { - return ret; - } } #else -int StringUtil::VPrintf(char* buf, char* last, const char* fmt, va_list args) { - if (last <= buf) return 0; +int StringUtil::VPrintf(char *buf, char *last, const char *fmt, va_list args) { + if (last <= buf) return 0; - int count = (int)(last - buf); - int ret = vsnprintf(buf, count, fmt, args); - if (ret >= count - 1) { - return count - 1; - } else if (ret < 0) { - return 0; - } - return ret; + int count = (int)(last - buf); + int ret = vsnprintf(buf, count, fmt, args); + if (ret >= count - 1) { + return count - 1; + } else if (ret < 0) { + return 0; + } + return ret; } #endif -int StringUtil::Printf(char* buf, char* last, const char* fmt, ...) { - va_list args; - va_start(args, fmt); - int ret = VPrintf(buf, last, fmt, args); - va_end(args); - return ret; +int StringUtil::Printf(char *buf, char *last, const char *fmt, ...) { + va_list args; + va_start(args, fmt); + int ret = VPrintf(buf, last, fmt, args); + va_end(args); + return ret; } -String StringUtil::Format(const char* fmt, ...) { - char sz[4096]; - va_list args; - va_start(args, fmt); - VPrintf(sz, sz + sizeof(sz) - 1, fmt, args); - va_end(args); - return sz; +String StringUtil::Format(const char *fmt, ...) { + char sz[4096]; + va_list args; + va_start(args, fmt); + VPrintf(sz, sz + sizeof(sz) - 1, fmt, args); + va_end(args); + return sz; } StringArray StringUtil::Split(const String &str, const String &delims, uint max_splits) { - StringArray strs; - if (str.empty()) + StringArray strs; + if (str.empty()) + return strs; + + // Pre-allocate some space for performance + strs.reserve(max_splits ? max_splits + 1 : 16); // 16 is guessed capacity for most case + + uint num_splits = 0; + + // Use STL methods + size_t start, pos; + start = 0; + do { + pos = str.find_first_of(delims, start); + if (pos == start) { + // Do nothing + start = pos + 1; + } else if (pos == String::npos || (max_splits && num_splits == max_splits)) { + // Copy the rest of the string + strs.push_back(str.substr(start)); + break; + } else { + // Copy up to delimiter + strs.push_back(str.substr(start, pos - start)); + start = pos + 1; + } + // parse up to next real data + start = str.find_first_not_of(delims, start); + ++num_splits; + } while (pos != String::npos); + return strs; - - // Pre-allocate some space for performance - strs.reserve(max_splits ? max_splits + 1 : 16); // 16 is guessed capacity for most case - - uint num_splits = 0; - - // Use STL methods - size_t start, pos; - start = 0; - do { - pos = str.find_first_of(delims, start); - if (pos == start) { - // Do nothing - start = pos + 1; - } else if (pos == String::npos || (max_splits && num_splits == max_splits)) { - // Copy the rest of the string - strs.push_back(str.substr(start)); - break; - } else { - // Copy up to delimiter - strs.push_back(str.substr(start, pos - start)); - start = pos + 1; - } - // parse up to next real data - start = str.find_first_not_of(delims, start); - ++num_splits; - } while (pos != String::npos); - - return strs; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/core/util/StringUtil.h b/native/cocos/renderer/core/util/StringUtil.h index 76a0495c7d..8d3444fddd 100755 --- a/native/cocos/renderer/core/util/StringUtil.h +++ b/native/cocos/renderer/core/util/StringUtil.h @@ -2,15 +2,17 @@ #define CC_CORE_KERNEL_UTIL_STRING_UTIL_H_ namespace cc { +namespace gfx { class CC_CORE_API StringUtil { - public: - static int VPrintf(char* buf, char* last, const char* fmt, va_list args); - static int Printf(char* buf, char* last, const char* fmt, ...); - static String Format(const char* fmt, ...); - static StringArray Split(const String &str, const String &delims, uint max_splits = 0); +public: + static int VPrintf(char *buf, char *last, const char *fmt, va_list args); + static int Printf(char *buf, char *last, const char *fmt, ...); + static String Format(const char *fmt, ...); + static StringArray Split(const String &str, const String &delims, uint max_splits = 0); }; -} +} // namespace gfx +} // namespace cc #endif // CC_CORE_KERNEL_UTIL_STRING_UTIL_H_ diff --git a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc index 9ca1c43633..6cef283252 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc @@ -6,6 +6,7 @@ #include "GLES2Texture.h" namespace cc { +namespace gfx { GLES2BindingLayout::GLES2BindingLayout(GFXDevice *device) : GFXBindingLayout(device) { @@ -78,4 +79,5 @@ void GLES2BindingLayout::update() { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h index cc4a5a26a4..9294a05f9f 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h +++ b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_BINDING_LAYOUT_H_ namespace cc { +namespace gfx { class GLES2GPUBindingLayout; @@ -21,6 +22,7 @@ private: GLES2GPUBindingLayout *_gpuBindingLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc b/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc index 461fdaaa17..5d381d1884 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2Buffer::GLES2Buffer(GFXDevice *device) : GFXBuffer(device) { @@ -113,4 +114,5 @@ void GLES2Buffer::update(void *buffer, uint offset, uint size) { GLES2CmdFuncUpdateBuffer((GLES2Device *)_device, _gpuBuffer, buffer, offset, size); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Buffer.h b/native/cocos/renderer/gfx-gles2/GLES2Buffer.h index ae06987814..1509f510c4 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Buffer.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Buffer.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_BUFFER_H_ namespace cc { +namespace gfx { class GLES2GPUBuffer; @@ -22,6 +23,7 @@ private: GLES2GPUBuffer *_gpuBuffer = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc index 5b91087d84..a8a71357d5 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc @@ -2,6 +2,7 @@ #include "GLES2CommandAllocator.h" namespace cc { +namespace gfx { GLES2CommandAllocator::GLES2CommandAllocator(GFXDevice *device) : GFXCommandAllocator(device) { @@ -39,4 +40,5 @@ void GLES2CommandAllocator::clearCmds(GLES2CmdPackage *cmd_package) { cmd_package->cmds.clear(); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h index 078e0d1874..75b863a041 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h @@ -5,6 +5,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { class CC_GLES2_API GLES2CommandAllocator : public GFXCommandAllocator { public: @@ -32,6 +33,7 @@ public: } }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc index 1108b3ebad..2e0d771e11 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc @@ -9,6 +9,7 @@ #include "GLES2Texture.h" namespace cc { +namespace gfx { GLES2CommandBuffer::GLES2CommandBuffer(GFXDevice *device) : GFXCommandBuffer(device) { @@ -320,4 +321,5 @@ void GLES2CommandBuffer::BindStates() { _isStateInvalid = false; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h index d2c50a4dea..697512b19d 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h @@ -4,6 +4,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { class GLES2CommandAllocator; @@ -59,6 +60,7 @@ private: bool _isStateInvalid = false; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.cc b/native/cocos/renderer/gfx-gles2/GLES2Commands.cc index b3c4ecfebc..2cf0feca4b 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Commands.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.cc @@ -7,6 +7,7 @@ #define BUFFER_OFFSET(idx) (static_cast(0) + (idx)) namespace cc { +namespace gfx { namespace { GLenum MapGLInternalFormat(GFXFormat format) { @@ -2250,4 +2251,5 @@ void GLES2CmdFuncCopyBuffersToTexture(GLES2Device *device, uint8_t *const *buffe } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.h b/native/cocos/renderer/gfx-gles2/GLES2Commands.h index 422be537b0..be261ec722 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Commands.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.h @@ -4,6 +4,7 @@ #include "GLES2GPUObjects.h" namespace cc { +namespace gfx { class GLES2Device; @@ -168,6 +169,7 @@ CC_GLES2_API void GLES2CmdFuncDestroyFramebuffer(GLES2Device *device, GLES2GPUFr CC_GLES2_API void GLES2CmdFuncExecuteCmds(GLES2Device *device, GLES2CmdPackage *cmd_package); CC_GLES2_API void GLES2CmdFuncCopyBuffersToTexture(GLES2Device *device, uint8_t *const *buffers, GLES2GPUTexture *gpuTexture, const GFXBufferTextureCopyList ®ions); -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Context.cc b/native/cocos/renderer/gfx-gles2/GLES2Context.cc index e5bf42bb0e..2daeab87aa 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Context.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Context.cc @@ -12,52 +12,104 @@ // #define CC_GFX_DEBUG namespace cc { +namespace gfx { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) -void APIENTRY GLES2EGLDebugProc(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam) { +void APIENTRY +GLES2EGLDebugProc(GLenum + source, + GLenum type, GLuint id, + GLenum severity, GLsizei length, + const GLchar *message, + const void *userParam) { String source_desc; switch (source) { - case GL_DEBUG_SOURCE_API_KHR: source_desc = "API"; break; - case GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: source_desc = "SHADER_COMPILER"; break; - case GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR: source_desc = "WINDOW_SYSTEM"; break; - case GL_DEBUG_SOURCE_THIRD_PARTY_KHR: source_desc = "THIRD_PARTY"; break; - case GL_DEBUG_SOURCE_APPLICATION_KHR: source_desc = "APPLICATION"; break; - default: source_desc = "OTHER"; + case GL_DEBUG_SOURCE_API_KHR: + source_desc = "API"; + break; + case GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: + source_desc = "SHADER_COMPILER"; + break; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR: + source_desc = "WINDOW_SYSTEM"; + break; + case GL_DEBUG_SOURCE_THIRD_PARTY_KHR: + source_desc = "THIRD_PARTY"; + break; + case GL_DEBUG_SOURCE_APPLICATION_KHR: + source_desc = "APPLICATION"; + break; + default: + source_desc = "OTHER"; } String type_desc; switch (severity) { - case GL_DEBUG_TYPE_ERROR_KHR: type_desc = "ERROR"; break; - case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: type_desc = "PEPRECATED_BEHAVIOR"; break; - case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: type_desc = "UNDEFINED_BEHAVIOR"; break; - case GL_DEBUG_TYPE_PERFORMANCE_KHR: type_desc = "PERFORMANCE"; break; - case GL_DEBUG_TYPE_PORTABILITY_KHR: type_desc = "PORTABILITY"; break; - case GL_DEBUG_TYPE_MARKER_KHR: type_desc = "MARKER"; break; - case GL_DEBUG_TYPE_PUSH_GROUP_KHR: type_desc = "PUSH_GROUP"; break; - case GL_DEBUG_TYPE_POP_GROUP_KHR: type_desc = "POP_GROUP"; break; - default: type_desc = "OTHER"; + case GL_DEBUG_TYPE_ERROR_KHR: + type_desc = "ERROR"; + break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: + type_desc = "PEPRECATED_BEHAVIOR"; + break; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: + type_desc = "UNDEFINED_BEHAVIOR"; + break; + case GL_DEBUG_TYPE_PERFORMANCE_KHR: + type_desc = "PERFORMANCE"; + break; + case GL_DEBUG_TYPE_PORTABILITY_KHR: + type_desc = "PORTABILITY"; + break; + case GL_DEBUG_TYPE_MARKER_KHR: + type_desc = "MARKER"; + break; + case GL_DEBUG_TYPE_PUSH_GROUP_KHR: + type_desc = "PUSH_GROUP"; + break; + case GL_DEBUG_TYPE_POP_GROUP_KHR: + type_desc = "POP_GROUP"; + break; + default: + type_desc = "OTHER"; } String severity_desc; switch (severity) { - case GL_DEBUG_SEVERITY_HIGH_KHR: severity_desc = "HIGH"; break; - case GL_DEBUG_SEVERITY_MEDIUM_KHR: severity_desc = "MEDIUM"; break; - case GL_DEBUG_SEVERITY_LOW_KHR: severity_desc = "LOW"; break; - default: severity_desc = "NOTIFICATION"; + case GL_DEBUG_SEVERITY_HIGH_KHR: + severity_desc = "HIGH"; + break; + case GL_DEBUG_SEVERITY_MEDIUM_KHR: + severity_desc = "MEDIUM"; + break; + case GL_DEBUG_SEVERITY_LOW_KHR: + severity_desc = "LOW"; + break; + default: + severity_desc = "NOTIFICATION"; } String msg = StringUtil::Format("source: %s, type: %s, severity: %s, message: %s", - source_desc.c_str(), type_desc.c_str(), severity_desc.c_str(), message); + source_desc.c_str(), type_desc.c_str(), severity_desc.c_str(), + message); if (severity == GL_DEBUG_SEVERITY_HIGH_KHR) { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) - CCASSERT(false, msg.c_str()); + CCASSERT(false, msg. + + c_str() + + ); #else CC_LOG_ERROR(msg.c_str()); #endif } else { - CC_LOG_DEBUG(msg.c_str()); + CC_LOG_DEBUG(msg + . + + c_str() + + ); } } @@ -143,7 +195,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { // its needs perfectly, so we limit it to returning a single EGLConfig. EGLint num_configs; - if (eglChooseConfig(_eglDisplay, attribs, &_eglConfig, 1, &num_configs) == EGL_FALSE || num_configs <= 0) { + if (eglChooseConfig(_eglDisplay, attribs, &_eglConfig, 1, &num_configs) == EGL_FALSE || + num_configs <= 0) { CC_LOG_ERROR("Choosing configuration failed."); return false; } @@ -180,7 +233,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { #if (CC_PLATFORM == CC_PLATFORM_ANDROID) EGLint n_fmt; - if (eglGetConfigAttrib(_eglDisplay, _eglConfig, EGL_NATIVE_VISUAL_ID, &n_fmt) == EGL_FALSE) { + if (eglGetConfigAttrib(_eglDisplay, _eglConfig, EGL_NATIVE_VISUAL_ID, &n_fmt) == + EGL_FALSE) { CC_LOG_ERROR("Getting configuration attributes failed."); return false; } @@ -190,7 +244,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { ANativeWindow_setBuffersGeometry((ANativeWindow *)_windowHandle, width, height, n_fmt); #endif - _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig, (EGLNativeWindowType)_windowHandle, NULL); + _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig, + (EGLNativeWindowType)_windowHandle, NULL); if (_eglSurface == EGL_NO_SURFACE) { CC_LOG_ERROR("Window surface created failed."); return false; @@ -199,7 +254,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { //String egl_vendor = eglQueryString(_eglDisplay, EGL_VENDOR); //String egl_version = eglQueryString(_eglDisplay, EGL_VERSION); - _extensions = StringUtil::Split((const char *)eglQueryString(_eglDisplay, EGL_EXTENSIONS), " "); + _extensions = StringUtil::Split((const char *)eglQueryString(_eglDisplay, EGL_EXTENSIONS), + " "); _majorVersion = 2; _minorVersion = 0; @@ -244,12 +300,12 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { _depthStencilFmt = sharedCtx->getDepthStencilFormat(); EGLint pbuff_attribs[] = { - EGL_WIDTH, 2, - EGL_HEIGHT, 2, - EGL_LARGEST_PBUFFER, EGL_TRUE, - EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE, - EGL_TEXTURE_TARGET, EGL_NO_TEXTURE, - EGL_NONE}; + EGL_WIDTH, 2, + EGL_HEIGHT, 2, + EGL_LARGEST_PBUFFER, EGL_TRUE, + EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE, + EGL_TEXTURE_TARGET, EGL_NO_TEXTURE, + EGL_NONE}; _eglSurface = eglCreatePbufferSurface(_eglDisplay, _eglConfig, pbuff_attribs); if (_eglSurface == EGL_NO_SURFACE) { @@ -259,7 +315,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { bool has_khr_create_ctx = CheckExtension(CC_TOSTR(EGL_KHR_create_context)); if (!has_khr_create_ctx) { - CC_LOG_INFO("EGL context creation: EGL_KHR_create_context not supported. Minor version will be discarded, and debug disabled."); + CC_LOG_INFO( + "EGL context creation: EGL_KHR_create_context not supported. Minor version will be discarded, and debug disabled."); _minorVersion = 0; } @@ -302,26 +359,35 @@ bool GLES2Context::initialize(const GFXContextInfo &info) { } }); - EventDispatcher::addCustomEventListener(EVENT_RECREATE_WINDOW, [=](const CustomEvent &event) -> void { - _windowHandle = (uintptr_t)event.args->ptrVal; + EventDispatcher::addCustomEventListener(EVENT_RECREATE_WINDOW, + [=](const CustomEvent &event) -> void { + _windowHandle = (uintptr_t)event.args->ptrVal; - EGLint n_fmt; - if (eglGetConfigAttrib(_eglDisplay, _eglConfig, EGL_NATIVE_VISUAL_ID, &n_fmt) == EGL_FALSE) { - CC_LOG_ERROR("Getting configuration attributes failed."); - return; - } - uint width = _device->getWidth(); - uint height = _device->getHeight(); - ANativeWindow_setBuffersGeometry((ANativeWindow *)_windowHandle, width, height, n_fmt); + EGLint n_fmt; + if (eglGetConfigAttrib(_eglDisplay, _eglConfig, + EGL_NATIVE_VISUAL_ID, + &n_fmt) == EGL_FALSE) { + CC_LOG_ERROR( + "Getting configuration attributes failed."); + return; + } + uint width = _device->getWidth(); + uint height = _device->getHeight(); + ANativeWindow_setBuffersGeometry( + (ANativeWindow *)_windowHandle, width, + height, n_fmt); - _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig, (EGLNativeWindowType)_windowHandle, NULL); - if (_eglSurface == EGL_NO_SURFACE) { - CC_LOG_ERROR("Recreate window surface failed."); - return; - } + _eglSurface = eglCreateWindowSurface(_eglDisplay, + _eglConfig, + (EGLNativeWindowType)_windowHandle, + NULL); + if (_eglSurface == EGL_NO_SURFACE) { + CC_LOG_ERROR("Recreate window surface failed."); + return; + } - MakeCurrent(); - }); + MakeCurrent(); + }); #endif return true; @@ -371,12 +437,23 @@ bool GLES2Context::MakeCurrent() { // Turn on or off the vertical sync depending on the input bool value. int interval = 1; switch (_vsyncMode) { - case GFXVsyncMode::OFF: interval = 0; break; - case GFXVsyncMode::ON: interval = 1; break; - case GFXVsyncMode::RELAXED: interval = -1; break; - case GFXVsyncMode::MAILBOX: interval = 0; break; - case GFXVsyncMode::HALF: interval = 2; break; - default: break; + case GFXVsyncMode::OFF: + interval = 0; + break; + case GFXVsyncMode::ON: + interval = 1; + break; + case GFXVsyncMode::RELAXED: + interval = -1; + break; + case GFXVsyncMode::MAILBOX: + interval = 0; + break; + case GFXVsyncMode::HALF: + interval = 2; + break; + default: + break; } if (eglSwapInterval(_eglDisplay, interval) != 1) { @@ -446,4 +523,5 @@ bool GLES2Context::CheckExtension(const String &extension) const { return (std::find(_extensions.begin(), _extensions.end(), extension) != _extensions.end()); } -} +} // namespace gfx +} // namespace cc \ No newline at end of file diff --git a/native/cocos/renderer/gfx-gles2/GLES2Context.h b/native/cocos/renderer/gfx-gles2/GLES2Context.h index 1d351fb4d6..dd0852c34b 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Context.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Context.h @@ -29,6 +29,7 @@ #endif namespace cc { +namespace gfx { class CC_GLES2_API GLES2Context : public GFXContext { public: @@ -89,6 +90,7 @@ private: bool _isInitialized = false; }; -} +} // namespace gfx +} // namespace cc #endif // CC_GFXGLES2_GLES2_EGL_CONTEXT_H_ diff --git a/native/cocos/renderer/gfx-gles2/GLES2Context.mm b/native/cocos/renderer/gfx-gles2/GLES2Context.mm index d8f02ab308..d5734bd637 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Context.mm +++ b/native/cocos/renderer/gfx-gles2/GLES2Context.mm @@ -6,6 +6,7 @@ #import namespace cc { +namespace gfx { #if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) @@ -185,4 +186,5 @@ bool GLES2Context::MakeCurrentImpl() { #endif -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Device.cc b/native/cocos/renderer/gfx-gles2/GLES2Device.cc index 929e9fb38b..2175a00c02 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Device.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Device.cc @@ -19,6 +19,7 @@ #include "GLES2Texture.h" namespace cc { +namespace gfx { GLES2Device::GLES2Device() { } @@ -304,4 +305,5 @@ void GLES2Device::copyBuffersToTexture(const GFXDataArray &buffers, GFXTexture * GLES2CmdFuncCopyBuffersToTexture(this, buffers.datas.data(), ((GLES2Texture *)dst)->gpuTexture(), regions); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Device.h b/native/cocos/renderer/gfx-gles2/GLES2Device.h index 68a4932658..60e11c2f59 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Device.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Device.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_DEVICE_H_ namespace cc { +namespace gfx { class GLES2StateCache; @@ -57,6 +58,7 @@ private: bool _useDiscardFramebuffer = false; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Fence.cc b/native/cocos/renderer/gfx-gles2/GLES2Fence.cc index d83172e1d9..83509994f8 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Fence.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Fence.cc @@ -4,6 +4,7 @@ #include "GLES2GPUObjects.h" namespace cc { +namespace gfx { GLES2Fence::GLES2Fence(GFXDevice *device) : GFXFence(device) { @@ -43,4 +44,5 @@ void GLES2Fence::reset() { // TODO } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Fence.h b/native/cocos/renderer/gfx-gles2/GLES2Fence.h index 65a06b0aa9..569db86041 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Fence.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Fence.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_FENCE_H_ namespace cc { +namespace gfx { class GLES2GPUFence; @@ -20,6 +21,7 @@ private: GLES2GPUFence *_gpuFence = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc index b9df516b6d..db3fa93200 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc @@ -6,6 +6,7 @@ #include "GLES2Texture.h" namespace cc { +namespace gfx { GLES2Framebuffer::GLES2Framebuffer(GFXDevice *device) : GFXFramebuffer(device) { @@ -20,7 +21,7 @@ bool GLES2Framebuffer::initialize(const GFXFramebufferInfo &info) { _colorTextures = info.colorTextures; _depthStencilTexture = info.depthStencilTexture; _isOffscreen = info.isOffscreen; - + if (info.depthStencilMipmapLevel != 0) { CC_LOG_WARNING("Mipmap level of depth stencil attachment should be 0 in GLES2. Convert to 0."); } @@ -71,4 +72,5 @@ void GLES2Framebuffer::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h index b0c3a2eda0..5e3f6f5931 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_FRAMEBUFFER_H_ namespace cc { +namespace gfx { class GLES2GPUFramebuffer; @@ -20,6 +21,7 @@ private: GLES2GPUFramebuffer *_gpuFBO = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h index bfc940fabc..10f740707c 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h +++ b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h @@ -4,6 +4,7 @@ #include "gles2w.h" namespace cc { +namespace gfx { class GLES2GPUBuffer : public Object { public: @@ -237,6 +238,7 @@ class GLES2GPUFence : public Object { public: }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc index b8933c5d30..2b124f187d 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc @@ -4,6 +4,7 @@ #include "GLES2Buffer.h" namespace cc { +namespace gfx { GLES2InputAssembler::GLES2InputAssembler(GFXDevice *device) : GFXInputAssembler(device) { @@ -64,4 +65,5 @@ void GLES2InputAssembler::ExtractCmdDraw(GLES2CmdDraw *cmd) { cmd->draw_info.firstInstance = _firstInstance; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h index b7d85c5c7c..54082159c4 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h +++ b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_INPUT_ASSEMBLER_H_ namespace cc { +namespace gfx { class GLES2GPUInputAssembler; class GLES2CmdDraw; @@ -23,6 +24,7 @@ private: GLES2GPUInputAssembler *_gpuInputAssembler = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc index 6b3c5d7e7b..bc4fb94055 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2PipelineLayout::GLES2PipelineLayout(GFXDevice *device) : GFXPipelineLayout(device) { @@ -30,4 +31,5 @@ void GLES2PipelineLayout::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h index 8a217163f6..ef12925739 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_PIPELINE_LAYOUT_H_ namespace cc { +namespace gfx { class GLES2GPUPipelineLayout; @@ -20,6 +21,7 @@ private: GLES2GPUPipelineLayout *_gpuPipelineLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc index 8ffaf8f865..79d5fd149e 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc @@ -6,6 +6,7 @@ #include "GLES2PipelineLayout.h" namespace cc { +namespace gfx { const GLenum GLES2Primitives[] = { GL_POINTS, @@ -67,4 +68,5 @@ void GLES2PipelineState::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h index 9f4eccb64b..ffb53f1b23 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_PIPELINE_STATE_H_ namespace cc { +namespace gfx { class GLES2GPUPipelineState; @@ -20,6 +21,7 @@ private: GLES2GPUPipelineState *_gpuPipelineState = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Queue.cc b/native/cocos/renderer/gfx-gles2/GLES2Queue.cc index fe4ade20f0..adab50c9b5 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Queue.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Queue.cc @@ -4,6 +4,7 @@ #include "GLES2CommandBuffer.h" namespace cc { +namespace gfx { GLES2Queue::GLES2Queue(GFXDevice *device) : GFXQueue(device) { @@ -36,4 +37,5 @@ void GLES2Queue::submit(const vector::type &cmdBuffs, GFXFen } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Queue.h b/native/cocos/renderer/gfx-gles2/GLES2Queue.h index 6f1a0cea3a..14cef003d0 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Queue.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Queue.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_QUEUE_H_ namespace cc { +namespace gfx { class CC_GLES2_API GLES2Queue : public GFXQueue { public: @@ -24,6 +25,7 @@ private: uint _numTriangles = 0; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc index e9ab80ad81..aa1663d6cf 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2RenderPass::GLES2RenderPass(GFXDevice *device) : GFXRenderPass(device) { @@ -35,4 +36,5 @@ void GLES2RenderPass::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h index aefa94613f..493a3a4f7f 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h +++ b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_RENDER_PASS_H_ namespace cc { +namespace gfx { class GLES2GPURenderPass; @@ -20,6 +21,7 @@ private: GLES2GPURenderPass *_gpuRenderPass = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc b/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc index 92274c701c..b8d5284dc9 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2Sampler::GLES2Sampler(GFXDevice *device) : GFXSampler(device) { @@ -52,4 +53,5 @@ void GLES2Sampler::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Sampler.h b/native/cocos/renderer/gfx-gles2/GLES2Sampler.h index c9daba412e..f8f289c0e2 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Sampler.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Sampler.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_SAMPLER_H_ namespace cc { +namespace gfx { class GLES2GPUSampler; @@ -33,6 +34,7 @@ private: float _mipLODBias = 0.0f; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Shader.cc b/native/cocos/renderer/gfx-gles2/GLES2Shader.cc index c7eb6b00d1..ef18542711 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Shader.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Shader.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2Shader::GLES2Shader(GFXDevice *device) : GFXShader(device) { @@ -43,4 +44,5 @@ void GLES2Shader::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Shader.h b/native/cocos/renderer/gfx-gles2/GLES2Shader.h index 2ee92be11e..97c79b0d97 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Shader.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Shader.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_SHADER_H_ namespace cc { +namespace gfx { class GLES2GPUShader; @@ -20,6 +21,7 @@ private: GLES2GPUShader *_gpuShader = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2StateCache.h b/native/cocos/renderer/gfx-gles2/GLES2StateCache.h index 506d1d917a..80cdebeb27 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2StateCache.h +++ b/native/cocos/renderer/gfx-gles2/GLES2StateCache.h @@ -4,6 +4,7 @@ #include "gles2w.h" namespace cc { +namespace gfx { class GLES2StateCache : public Object { public: @@ -31,6 +32,7 @@ public: GLES2StateCache() {} }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Texture.cc b/native/cocos/renderer/gfx-gles2/GLES2Texture.cc index 43f7106061..c3f2b31611 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Texture.cc +++ b/native/cocos/renderer/gfx-gles2/GLES2Texture.cc @@ -3,6 +3,7 @@ #include "GLES2Commands.h" namespace cc { +namespace gfx { GLES2Texture::GLES2Texture(GFXDevice *device) : GFXTexture(device) { @@ -117,4 +118,5 @@ void GLES2Texture::resize(uint width, uint height) { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles2/GLES2Texture.h b/native/cocos/renderer/gfx-gles2/GLES2Texture.h index 091570023d..c2543a0ef7 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Texture.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Texture.h @@ -2,6 +2,7 @@ #define CC_GFXGLES2_GLES2_TEXTURE_H_ namespace cc { +namespace gfx { class GLES2GPUTexture; @@ -22,6 +23,7 @@ private: GLES2GPUTexture *_gpuTexture = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc index 42b8755594..adc9d199b5 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc @@ -6,6 +6,7 @@ #include "GLES3Texture.h" namespace cc { +namespace gfx { GLES3BindingLayout::GLES3BindingLayout(GFXDevice *device) : GFXBindingLayout(device) { @@ -65,7 +66,7 @@ void GLES3BindingLayout::update() { } case GFXBindingType::SAMPLER: { if (bindingUnit.texture) { - _gpuBindingLayout->gpuBindings[i].gpuTexture = ((GLES3Texture*)bindingUnit.texture)->gpuTexture(); + _gpuBindingLayout->gpuBindings[i].gpuTexture = ((GLES3Texture *)bindingUnit.texture)->gpuTexture(); } if (bindingUnit.sampler) { _gpuBindingLayout->gpuBindings[i].gpuSampler = ((GLES3Sampler *)bindingUnit.sampler)->gpuSampler(); @@ -79,4 +80,5 @@ void GLES3BindingLayout::update() { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h index 3af22004da..3707ef8d84 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h +++ b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_BINDING_LAYOUT_H_ namespace cc { +namespace gfx { class GLES3GPUBindingLayout; @@ -21,6 +22,7 @@ private: GLES3GPUBindingLayout *_gpuBindingLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc b/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc index 087cc11ab7..bd301c3eca 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3Buffer::GLES3Buffer(GFXDevice *device) : GFXBuffer(device) { @@ -107,4 +108,5 @@ void GLES3Buffer::update(void *buffer, uint offset, uint size) { GLES3CmdFuncUpdateBuffer((GLES3Device *)_device, _gpuBuffer, buffer, offset, size); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Buffer.h b/native/cocos/renderer/gfx-gles3/GLES3Buffer.h index ac675d6154..bee3693d0d 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Buffer.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Buffer.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_BUFFER_H_ namespace cc { +namespace gfx { class GLES3GPUBuffer; @@ -22,6 +23,7 @@ private: GLES3GPUBuffer *_gpuBuffer = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc index ed25360af0..023d269cae 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc @@ -2,6 +2,7 @@ #include "GLES3CommandAllocator.h" namespace cc { +namespace gfx { GLES3CommandAllocator::GLES3CommandAllocator(GFXDevice *device) : GFXCommandAllocator(device) { @@ -39,4 +40,5 @@ void GLES3CommandAllocator::clearCmds(GLES3CmdPackage *cmd_package) { cmd_package->cmds.clear(); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h index d744498128..1448db6302 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h @@ -5,6 +5,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { class CC_GLES3_API GLES3CommandAllocator : public GFXCommandAllocator { public: @@ -32,6 +33,7 @@ public: } }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc index e4d163bf5c..37cd278d79 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc @@ -9,6 +9,7 @@ #include "GLES3Texture.h" namespace cc { +namespace gfx { GLES3CommandBuffer::GLES3CommandBuffer(GFXDevice *device) : GFXCommandBuffer(device) { @@ -325,4 +326,5 @@ void GLES3CommandBuffer::BindStates() { _isStateInvalid = false; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h index b7519d9537..9ed2a3820e 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h @@ -4,6 +4,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { class GLES3CommandAllocator; @@ -59,6 +60,7 @@ private: bool _isStateInvalid = false; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.cc b/native/cocos/renderer/gfx-gles3/GLES3Commands.cc index 907c5aa460..3343a06ea3 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Commands.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.cc @@ -6,6 +6,7 @@ #define BUFFER_OFFSET(idx) (static_cast(0) + (idx)) namespace cc { +namespace gfx { namespace { GLenum MapGLInternalFormat(GFXFormat format) { @@ -2215,4 +2216,5 @@ void GLES3CmdFuncCopyBuffersToTexture(GLES3Device *device, uint8_t *const *buffe } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.h b/native/cocos/renderer/gfx-gles3/GLES3Commands.h index 49e2d0b0c8..b4f14eac07 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Commands.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.h @@ -4,6 +4,7 @@ #include "GLES3GPUObjects.h" namespace cc { +namespace gfx { class GLES3Device; @@ -168,6 +169,7 @@ CC_GLES3_API void GLES3CmdFuncDestroyFramebuffer(GLES3Device *device, GLES3GPUFr CC_GLES3_API void GLES3CmdFuncExecuteCmds(GLES3Device *device, GLES3CmdPackage *cmd_package); CC_GLES3_API void GLES3CmdFuncCopyBuffersToTexture(GLES3Device *device, uint8_t *const *buffers, GLES3GPUTexture *gpuTexture, const GFXBufferTextureCopyList ®ions); -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Context.cc b/native/cocos/renderer/gfx-gles3/GLES3Context.cc index 8106546d64..a3741c426e 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Context.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Context.cc @@ -12,6 +12,7 @@ // #define CC_GFX_DEBUG namespace cc { +namespace gfx { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) @@ -458,4 +459,5 @@ bool GLES3Context::CheckExtension(const String &extension) const { return (std::find(_extensions.begin(), _extensions.end(), extension) != _extensions.end()); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Context.h b/native/cocos/renderer/gfx-gles3/GLES3Context.h index b5b98bdf0e..622038e376 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Context.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Context.h @@ -2,33 +2,34 @@ #define CC_GFXGLES3_GLES3_EGL_CONTEXT_H_ #if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) -#ifdef __OBJC__ -#include -#endif + #ifdef __OBJC__ + #include + #endif #else -#include -#include -#include + #include + #include + #include #endif #ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 + #define EGL_KHR_create_context 1 + #define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION + #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB + #define EGL_CONTEXT_FLAGS_KHR 0x30FC + #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD + #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD + #define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE + #define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF + #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 + #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 + #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 + #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 + #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 + #define EGL_OPENGL_ES3_BIT_KHR 0x00000040 #endif namespace cc { +namespace gfx { class CC_GLES3_API GLES3Context : public GFXContext { public: @@ -39,7 +40,7 @@ public: virtual bool initialize(const GFXContextInfo &info) override; virtual void destroy() override; virtual void present() override; - + bool MakeCurrent(); bool CheckExtension(const String &extension) const; @@ -88,6 +89,7 @@ private: bool _isInitialized = false; }; -} +} // namespace gfx +} // namespace cc #endif // CC_GFXGLES3_GLES3_EGL_CONTEXT_H_ diff --git a/native/cocos/renderer/gfx-gles3/GLES3Context.mm b/native/cocos/renderer/gfx-gles3/GLES3Context.mm index 59e9b24fca..c7498bbed6 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Context.mm +++ b/native/cocos/renderer/gfx-gles3/GLES3Context.mm @@ -4,10 +4,11 @@ #import #import -namespace cc { - #if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) +namespace cc { +namespace gfx { + bool GLES3Context::initialize(const GFXContextInfo &info) { @@ -193,6 +194,7 @@ bool GLES3Context::MakeCurrentImpl() return [EAGLContext setCurrentContext:(EAGLContext*)_eaglContext]; } -#endif +} // namespace gfx +} // namespace cc -} +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Device.cc b/native/cocos/renderer/gfx-gles3/GLES3Device.cc index b5d3c3ebce..9efe92eb82 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Device.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Device.cc @@ -19,6 +19,7 @@ #include "GLES3Texture.h" namespace cc { +namespace gfx { GLES3Device::GLES3Device() { } @@ -302,4 +303,5 @@ void GLES3Device::copyBuffersToTexture(const GFXDataArray &buffers, GFXTexture * GLES3CmdFuncCopyBuffersToTexture(this, buffers.datas.data(), ((GLES3Texture *)dst)->gpuTexture(), regions); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Device.h b/native/cocos/renderer/gfx-gles3/GLES3Device.h index 1d46b3b520..60ce73385a 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Device.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Device.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_DEVICE_H_ namespace cc { +namespace gfx { class GLES3StateCache; @@ -51,6 +52,7 @@ private: bool _useVAO = true; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Fence.cc b/native/cocos/renderer/gfx-gles3/GLES3Fence.cc index 29e2d03ea2..841484121f 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Fence.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Fence.cc @@ -4,21 +4,18 @@ #include "GLES3GPUObjects.h" namespace cc { +namespace gfx { -GLES3Fence::GLES3Fence(GFXDevice* device) - : GFXFence(device) -{ +GLES3Fence::GLES3Fence(GFXDevice *device) +: GFXFence(device) { } -GLES3Fence::~GLES3Fence() -{ +GLES3Fence::~GLES3Fence() { } -bool GLES3Fence::initialize(const GFXFenceInfo &info) -{ +bool GLES3Fence::initialize(const GFXFenceInfo &info) { _gpuFence = CC_NEW(GLES3GPUFence); - if (!_gpuFence) - { + if (!_gpuFence) { CC_LOG_ERROR("GLES2Fence: CC_NEW GLES3GPUFence failed."); return false; } @@ -29,10 +26,8 @@ bool GLES3Fence::initialize(const GFXFenceInfo &info) return true; } -void GLES3Fence::destroy() -{ - if (_gpuFence) - { +void GLES3Fence::destroy() { + if (_gpuFence) { // TODO CC_DELETE(_gpuFence); @@ -41,14 +36,13 @@ void GLES3Fence::destroy() _status = GFXStatus::UNREADY; } -void GLES3Fence::wait() -{ +void GLES3Fence::wait() { // TODO } -void GLES3Fence::reset() -{ +void GLES3Fence::reset() { // TODO } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Fence.h b/native/cocos/renderer/gfx-gles3/GLES3Fence.h index f0a8a99b22..5835997eff 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Fence.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Fence.h @@ -2,24 +2,26 @@ #define CC_GFXGLES3_GLES3_FENCE_H_ namespace cc { +namespace gfx { class GLES3GPUFence; class CC_GLES3_API GLES3Fence : public GFXFence { public: - GLES3Fence(GFXDevice* device); + GLES3Fence(GFXDevice *device); ~GLES3Fence(); public: - virtual bool initialize(const GFXFenceInfo& info) override; + virtual bool initialize(const GFXFenceInfo &info) override; virtual void destroy() override; virtual void wait() override; virtual void reset() override; private: - GLES3GPUFence* _gpuFence = nullptr; + GLES3GPUFence *_gpuFence = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc index fe26fa404c..95672f6508 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc @@ -6,6 +6,7 @@ #include "GLES3Texture.h" namespace cc { +namespace gfx { GLES3Framebuffer::GLES3Framebuffer(GFXDevice *device) : GFXFramebuffer(device) { @@ -62,4 +63,5 @@ void GLES3Framebuffer::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h index b66d117b57..e01215fcf8 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_FRAMEBUFFER_H_ namespace cc { +namespace gfx { class GLES3GPUFramebuffer; @@ -20,6 +21,7 @@ private: GLES3GPUFramebuffer *_gpuFBO = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h index 06298df0ba..e2889e264d 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h +++ b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h @@ -4,6 +4,7 @@ #include "gles3w.h" namespace cc { +namespace gfx { class GLES3GPUBuffer : public Object { public: @@ -209,6 +210,7 @@ class GLES3GPUFence : public Object { public: }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc index 509e5bcae8..5dae441a9d 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc @@ -4,6 +4,7 @@ #include "GLES3Buffer.h" namespace cc { +namespace gfx { GLES3InputAssembler::GLES3InputAssembler(GFXDevice *device) : GFXInputAssembler(device) { @@ -64,4 +65,5 @@ void GLES3InputAssembler::ExtractCmdDraw(GLES3CmdDraw *cmd) { cmd->draw_info.firstInstance = _firstInstance; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h index 3513b83d58..950c62df20 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h +++ b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_INPUT_ASSEMBLER_H_ namespace cc { +namespace gfx { class GLES3GPUInputAssembler; class GLES3CmdDraw; @@ -23,6 +24,7 @@ private: GLES3GPUInputAssembler *_gpuInputAssembler = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc index f7c23746a2..7b6c47482b 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3PipelineLayout::GLES3PipelineLayout(GFXDevice *device) : GFXPipelineLayout(device) { @@ -29,4 +30,5 @@ void GLES3PipelineLayout::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h index 967b75a475..ec1232f682 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_PIPELINE_LAYOUT_H_ namespace cc { +namespace gfx { class GLES3GPUPipelineLayout; @@ -20,6 +21,7 @@ private: GLES3GPUPipelineLayout *_gpuPipelineLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc index 7b04af2602..391abb1be6 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc @@ -6,6 +6,7 @@ #include "GLES3PipelineLayout.h" namespace cc { +namespace gfx { const GLenum GLES3Primitives[] = { GL_POINTS, @@ -66,4 +67,5 @@ void GLES3PipelineState::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h index 8d39bd1014..cdce8cc1d9 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_PIPELINE_STATE_H_ namespace cc { +namespace gfx { class GLES3GPUPipelineState; @@ -20,6 +21,7 @@ private: GLES3GPUPipelineState *_gpuPipelineState = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Queue.cc b/native/cocos/renderer/gfx-gles3/GLES3Queue.cc index cd5fd5027b..3d0c341f13 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Queue.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Queue.cc @@ -4,6 +4,7 @@ #include "GLES3CommandBuffer.h" namespace cc { +namespace gfx { GLES3Queue::GLES3Queue(GFXDevice *device) : GFXQueue(device) { @@ -36,4 +37,5 @@ void GLES3Queue::submit(const vector::type &cmdBuffs, GFXFen } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Queue.h b/native/cocos/renderer/gfx-gles3/GLES3Queue.h index abd46b9402..1301fde178 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Queue.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Queue.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_QUEUE_H_ namespace cc { +namespace gfx { class CC_GLES3_API GLES3Queue : public GFXQueue { public: @@ -24,6 +25,7 @@ private: uint _numTriangles = 0; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc index 671acd9be3..ba7b9f9494 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3RenderPass::GLES3RenderPass(GFXDevice *device) : GFXRenderPass(device) { @@ -35,4 +36,5 @@ void GLES3RenderPass::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h index 73d25d1ef3..84279c63a0 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h +++ b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_RENDER_PASS_H_ namespace cc { +namespace gfx { class GLES3GPURenderPass; @@ -20,6 +21,7 @@ private: GLES3GPURenderPass *_gpuRenderPass = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc b/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc index 15c413f462..5742874b9f 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3Sampler::GLES3Sampler(GFXDevice *device) : GFXSampler(device) { @@ -52,4 +53,5 @@ void GLES3Sampler::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Sampler.h b/native/cocos/renderer/gfx-gles3/GLES3Sampler.h index ae348c8834..e774a72d3e 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Sampler.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Sampler.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_SAMPLER_H_ namespace cc { +namespace gfx { class GLES3GPUSampler; @@ -20,6 +21,7 @@ private: GLES3GPUSampler *_gpuSampler = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Shader.cc b/native/cocos/renderer/gfx-gles3/GLES3Shader.cc index ded96b6947..2b6ab35a8b 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Shader.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Shader.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3Shader::GLES3Shader(GFXDevice *device) : GFXShader(device) { @@ -44,4 +45,5 @@ void GLES3Shader::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Shader.h b/native/cocos/renderer/gfx-gles3/GLES3Shader.h index dddf982786..5d0dffe2ec 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Shader.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Shader.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_SHADER_H_ namespace cc { +namespace gfx { class GLES3GPUShader; @@ -20,6 +21,7 @@ private: GLES3GPUShader *_gpuShader = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3StateCache.h b/native/cocos/renderer/gfx-gles3/GLES3StateCache.h index 68f8c1bb3f..0d81a61074 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3StateCache.h +++ b/native/cocos/renderer/gfx-gles3/GLES3StateCache.h @@ -4,6 +4,7 @@ #include "gles3w.h" namespace cc { +namespace gfx { class GLES3StateCache : public Object { public: @@ -31,6 +32,7 @@ public: GLES3StateCache() {} }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Texture.cc b/native/cocos/renderer/gfx-gles3/GLES3Texture.cc index c6d376a61d..c9dca36d60 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Texture.cc +++ b/native/cocos/renderer/gfx-gles3/GLES3Texture.cc @@ -3,6 +3,7 @@ #include "GLES3Commands.h" namespace cc { +namespace gfx { GLES3Texture::GLES3Texture(GFXDevice *device) : GFXTexture(device) { @@ -118,4 +119,5 @@ void GLES3Texture::resize(uint width, uint height) { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-gles3/GLES3Texture.h b/native/cocos/renderer/gfx-gles3/GLES3Texture.h index 7cffd1d232..91c4282295 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Texture.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Texture.h @@ -2,6 +2,7 @@ #define CC_GFXGLES3_GLES3_TEXTURE_H_ namespace cc { +namespace gfx { class GLES3GPUTexture; @@ -22,6 +23,7 @@ private: GLES3GPUTexture *_gpuTexture = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-metal/MTLBindingLayout.cpp b/native/cocos/renderer/gfx-metal/MTLBindingLayout.cpp index fd002bf38c..7780744ff2 100644 --- a/native/cocos/renderer/gfx-metal/MTLBindingLayout.cpp +++ b/native/cocos/renderer/gfx-metal/MTLBindingLayout.cpp @@ -2,6 +2,7 @@ #include "MTLBindingLayout.h" namespace cc { +namespace gfx { CCMTLBindingLayout::CCMTLBindingLayout(GFXDevice *device) : GFXBindingLayout(device) {} CCMTLBindingLayout::~CCMTLBindingLayout() { destroy(); } @@ -30,4 +31,5 @@ void CCMTLBindingLayout::destroy() { void CCMTLBindingLayout::update() { } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLBindingLayout.h b/native/cocos/renderer/gfx-metal/MTLBindingLayout.h index bd4625c706..9d3529410b 100644 --- a/native/cocos/renderer/gfx-metal/MTLBindingLayout.h +++ b/native/cocos/renderer/gfx-metal/MTLBindingLayout.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLBindingLayout : public GFXBindingLayout { public: @@ -12,4 +13,5 @@ public: virtual void update() override; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLBuffer.h b/native/cocos/renderer/gfx-metal/MTLBuffer.h index 79e89146be..408941be87 100644 --- a/native/cocos/renderer/gfx-metal/MTLBuffer.h +++ b/native/cocos/renderer/gfx-metal/MTLBuffer.h @@ -5,6 +5,7 @@ #import namespace cc { +namespace gfx { class CCMTLBuffer : public GFXBuffer { public: @@ -37,4 +38,5 @@ private: uint8_t *_bufferBytes = nullptr; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLBuffer.mm b/native/cocos/renderer/gfx-metal/MTLBuffer.mm index 0ef5a39e06..42f175a7b9 100644 --- a/native/cocos/renderer/gfx-metal/MTLBuffer.mm +++ b/native/cocos/renderer/gfx-metal/MTLBuffer.mm @@ -1,4 +1,5 @@ #include "MTLStd.h" + #include "MTLBuffer.h" #include "MTLDevice.h" #include "MTLUtils.h" @@ -7,6 +8,7 @@ #define MINIMUMR_REQUIRED_SIZE_4KB 4096 namespace cc { +namespace gfx { CCMTLBuffer::CCMTLBuffer(GFXDevice *device) : GFXBuffer(device) {} @@ -21,7 +23,7 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo &info) { _stride = std::max(info.stride, 1U); _count = _size / _stride; _flags = info.flags; - + if (_usage & GFXBufferUsage::INDEX) { switch (_stride) { case 4: _indexType = MTLIndexTypeUInt32; break; @@ -31,9 +33,9 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo &info) { break; } } - + if ((_flags & GFXBufferFlagBit::BAKUP_BUFFER) && _size > 0) { - _buffer = (uint8_t*)CC_MALLOC(_size); + _buffer = (uint8_t *)CC_MALLOC(_size); if (_buffer) _device->getMemoryStatus().bufferSize += _size; else { @@ -42,42 +44,37 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo &info) { return false; } } - + if (_usage & GFXBufferUsage::VERTEX || _usage & GFXBufferUsage::UNIFORM) { //for single-use data smaller than 4 KB, use setVertexBytes:length:atIndex: instead //see more detail at https://developer.apple.com/documentation/metal/mtlrendercommandencoder/1515846-setvertexbytes?language=objc if (_size < MINIMUMR_REQUIRED_SIZE_4KB) { _useOptimizedBufferEncoder = true; - _bufferBytes = static_cast(CC_MALLOC(_size)); + _bufferBytes = static_cast(CC_MALLOC(_size)); _device->getMemoryStatus().bufferSize += _size; - } - else { + } else { createMTLBuffer(_size, _memUsage); } - } - else if(_usage & GFXBufferUsage::INDEX) { + } else if (_usage & GFXBufferUsage::INDEX) { createMTLBuffer(_size, _memUsage); - } - else if (_usage & GFXBufferUsageBit::INDIRECT) { + } else if (_usage & GFXBufferUsageBit::INDIRECT) { _indirects.resize(_count); - } - else if (_usage & GFXBufferUsageBit::TRANSFER_SRC || - _usage & GFXBufferUsageBit::TRANSFER_DST) { - _transferBuffer = (uint8_t*)CC_MALLOC(_size); + } else if (_usage & GFXBufferUsageBit::TRANSFER_SRC || + _usage & GFXBufferUsageBit::TRANSFER_DST) { + _transferBuffer = (uint8_t *)CC_MALLOC(_size); if (!_transferBuffer) { _status = GFXStatus::FAILED; CCASSERT(false, "CCMTLBuffer: failed to create memory for transfer buffer."); return false; } _device->getMemoryStatus().bufferSize += _size; - } - else { + } else { _status = GFXStatus::FAILED; CCASSERT(false, "Unsupported GFXBufferType, create buffer failed."); return false; } - + _status = GFXStatus::SUCCESS; return true; } @@ -85,9 +82,9 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo &info) { bool CCMTLBuffer::createMTLBuffer(uint size, GFXMemoryUsage usage) { if (_mtlBuffer) [_mtlBuffer release]; - + _mtlResourceOptions = mu::toMTLResourseOption(usage); - _mtlBuffer = [id(((CCMTLDevice*)_device)->getMTLDevice() ) newBufferWithLength:size + _mtlBuffer = [id(((CCMTLDevice *)_device)->getMTLDevice()) newBufferWithLength:size options:_mtlResourceOptions]; if (_mtlBuffer == nil) { _status = GFXStatus::FAILED; @@ -102,20 +99,20 @@ void CCMTLBuffer::destroy() { [_mtlBuffer release]; _mtlBuffer = nil; } - + if (_transferBuffer) { CC_FREE(_transferBuffer); _transferBuffer = nullptr; _device->getMemoryStatus().bufferSize -= _size; } - + if (_buffer) { CC_FREE(_buffer); _device->getMemoryStatus().bufferSize -= _size; _buffer = nullptr; } - - if(_bufferBytes) { + + if (_bufferBytes) { CC_FREE(_bufferBytes); _device->getMemoryStatus().bufferSize -= _size; _bufferBytes = nullptr; @@ -126,26 +123,25 @@ void CCMTLBuffer::destroy() { void CCMTLBuffer::resize(uint size) { if (_size == size) return; - + if (_usage & GFXBufferUsage::VERTEX || _usage & GFXBufferUsage::INDEX || _usage & GFXBufferUsage::UNIFORM) { if (_useOptimizedBufferEncoder) { - if(size < MINIMUMR_REQUIRED_SIZE_4KB) + if (size < MINIMUMR_REQUIRED_SIZE_4KB) resizeBuffer(&_bufferBytes, size, _size); else { - if(_bufferBytes) + if (_bufferBytes) CC_SAFE_FREE(_bufferBytes); - + _useOptimizedBufferEncoder = false; createMTLBuffer(size, _memUsage); - } - } - else { + } + } else { createMTLBuffer(size, _memUsage); } } - + const uint oldSize = _size; _size = size; _count = _size / _stride; @@ -158,22 +154,20 @@ void CCMTLBuffer::resize(uint size) { void CCMTLBuffer::resizeBuffer(uint8_t **buffer, uint size, uint oldSize) { if (!(*buffer)) return; - + GFXMemoryStatus &status = _device->getMemoryStatus(); const uint8_t *oldBuffer = *buffer; - uint8_t *temp = (uint8_t*)CC_MALLOC(size); + uint8_t *temp = (uint8_t *)CC_MALLOC(size); if (temp) { - memcpy(temp, oldBuffer, std::min(oldSize, size) ); + memcpy(temp, oldBuffer, std::min(oldSize, size)); *buffer = temp; status.bufferSize += size; - } - else - { + } else { _status = GFXStatus::FAILED; CC_LOG_ERROR("Failed to resize buffer."); return; } - + CC_FREE(oldBuffer); status.bufferSize -= oldSize; _status = GFXStatus::SUCCESS; @@ -184,64 +178,61 @@ void CCMTLBuffer::update(void *buffer, uint offset, uint size) { memcpy(_buffer + offset, buffer, size); if (_usage & GFXBufferUsageBit::INDIRECT) { - memcpy((uint8_t*)_indirects.data() + offset, buffer, size); + memcpy((uint8_t *)_indirects.data() + offset, buffer, size); return; } - - if(_bufferBytes) + + if (_bufferBytes) memcpy(_bufferBytes + offset, buffer, size); - if(_mtlBuffer) { - if(_mtlResourceOptions == MTLResourceStorageModePrivate) { - static_cast(_device)->blitBuffer(buffer, offset, size, _mtlBuffer); - } - else { - uint8_t* dst = (uint8_t*)(_mtlBuffer.contents) + offset; + if (_mtlBuffer) { + if (_mtlResourceOptions == MTLResourceStorageModePrivate) { + static_cast(_device)->blitBuffer(buffer, offset, size, _mtlBuffer); + } else { + uint8_t *dst = (uint8_t *)(_mtlBuffer.contents) + offset; memcpy(dst, buffer, size); - if(_mtlResourceOptions == MTLResourceStorageModeManaged) + if (_mtlResourceOptions == MTLResourceStorageModeManaged) [_mtlBuffer didModifyRange:NSMakeRange(0, _size)]; // Synchronize the managed buffer. } return; } - - if(_transferBuffer) { + + if (_transferBuffer) { memcpy(_transferBuffer + offset, buffer, size); return; } } void CCMTLBuffer::encodeBuffer(id encoder, uint offset, uint binding, GFXShaderType stages) { - if(encoder == nil) { + if (encoder == nil) { CC_LOG_ERROR("CCMTLBuffer::encodeBuffer: MTLRenderCommandEncoder should not be nil."); return; } - - if(stages & GFXShaderType::VERTEX) { - if(_useOptimizedBufferEncoder) { + + if (stages & GFXShaderType::VERTEX) { + if (_useOptimizedBufferEncoder) { [encoder setVertexBytes:_bufferBytes length:_size atIndex:binding]; - } - else { + } else { [encoder setVertexBuffer:_mtlBuffer offset:offset atIndex:binding]; } } - - if(stages & GFXShaderType::FRAGMENT) { - if(_useOptimizedBufferEncoder) { + + if (stages & GFXShaderType::FRAGMENT) { + if (_useOptimizedBufferEncoder) { [encoder setFragmentBytes:_bufferBytes length:_size atIndex:binding]; - } - else { + } else { [encoder setFragmentBuffer:_mtlBuffer offset:offset atIndex:binding]; } } - } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommandAllocator.h b/native/cocos/renderer/gfx-metal/MTLCommandAllocator.h index 61a29b1302..fc61d0423a 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandAllocator.h +++ b/native/cocos/renderer/gfx-metal/MTLCommandAllocator.h @@ -4,6 +4,7 @@ #include "MTLCommands.h" namespace cc { +namespace gfx { class CCMTLCommandPackage; @@ -34,4 +35,5 @@ private: GFXCommandPool _copyBufferToTextureCmdPool; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommandAllocator.mm b/native/cocos/renderer/gfx-metal/MTLCommandAllocator.mm index a3fa0bf101..95d7df1bfe 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandAllocator.mm +++ b/native/cocos/renderer/gfx-metal/MTLCommandAllocator.mm @@ -4,6 +4,7 @@ #include "MTLCommands.h" namespace cc { +namespace gfx { CCMTLCommandAllocator::CCMTLCommandAllocator(GFXDevice *device) : GFXCommandAllocator(device) {} CCMTLCommandAllocator::~CCMTLCommandAllocator() { destroy(); } @@ -37,4 +38,5 @@ void CCMTLCommandAllocator::clearCommands(CCMTLCommandPackage *commandPackage) { commandPackage->commandTypes.clear(); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h index cc1075eec0..5d5e4f87d0 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h +++ b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLCommandPackage; class CCMTLCommandAllocator; @@ -64,4 +65,5 @@ private: std::array _dynamicStateDirty = {false, false, false, false, false, false, false, false}; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm index ab94808338..81d0b3c9b4 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm +++ b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm @@ -13,6 +13,7 @@ #import namespace cc { +namespace gfx { CCMTLCommandBuffer::CCMTLCommandBuffer(GFXDevice *device) : GFXCommandBuffer(device) {} CCMTLCommandBuffer::~CCMTLCommandBuffer() { destroy(); } @@ -292,4 +293,5 @@ void CCMTLCommandBuffer::bindStates() { std::fill(_dynamicStateDirty.begin(), _dynamicStateDirty.end(), false); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommands.h b/native/cocos/renderer/gfx-metal/MTLCommands.h index a33b6ea06f..601361ed3e 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommands.h +++ b/native/cocos/renderer/gfx-metal/MTLCommands.h @@ -3,6 +3,7 @@ #import namespace cc { +namespace gfx { class CCMTLFramebuffer; struct CCMTLGPUPipelineState; @@ -107,4 +108,5 @@ public: CachedArray copyBufferToTextureCmds; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLCommands.mm b/native/cocos/renderer/gfx-metal/MTLCommands.mm index ecf4a458be..ccdc6d2eb1 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommands.mm +++ b/native/cocos/renderer/gfx-metal/MTLCommands.mm @@ -1,7 +1,9 @@ #include "MTLStd.h" + #include "MTLCommands.h" namespace cc { +namespace gfx { -} - +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLContext.h b/native/cocos/renderer/gfx-metal/MTLContext.h index da1d1b12f9..cf17e3994e 100644 --- a/native/cocos/renderer/gfx-metal/MTLContext.h +++ b/native/cocos/renderer/gfx-metal/MTLContext.h @@ -1,7 +1,7 @@ #pragma once namespace cc { - +namespace gfx { class CCMTLContext : public GFXContext { public: @@ -13,4 +13,5 @@ public: void present() override{}; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLContext.mm b/native/cocos/renderer/gfx-metal/MTLContext.mm index c05535fcd6..e62ca50f27 100644 --- a/native/cocos/renderer/gfx-metal/MTLContext.mm +++ b/native/cocos/renderer/gfx-metal/MTLContext.mm @@ -3,10 +3,10 @@ #include "MTLContext.h" #include "MTLDevice.h" - #import namespace cc { +namespace gfx { namespace { GFXFormat toGFXFormat(MTLPixelFormat format) { @@ -39,4 +39,5 @@ bool CCMTLContext::initialize(const GFXContextInfo &info) { return true; } -} // end of namespace cc +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLDevice.h b/native/cocos/renderer/gfx-metal/MTLDevice.h index b733d715bb..5417ea4e3c 100644 --- a/native/cocos/renderer/gfx-metal/MTLDevice.h +++ b/native/cocos/renderer/gfx-metal/MTLDevice.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLStateCache; @@ -50,4 +51,5 @@ private: void *_blitedBuffer = nullptr; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLDevice.mm b/native/cocos/renderer/gfx-metal/MTLDevice.mm index 516aaf692a..6e7ada6c23 100644 --- a/native/cocos/renderer/gfx-metal/MTLDevice.mm +++ b/native/cocos/renderer/gfx-metal/MTLDevice.mm @@ -4,6 +4,7 @@ #include "MTLBuffer.h" #include "MTLCommandAllocator.h" #include "MTLCommandBuffer.h" +#include "MTLContext.h" #include "MTLDevice.h" #include "MTLFence.h" #include "MTLFrameBuffer.h" @@ -17,12 +18,12 @@ #include "MTLStateCache.h" #include "MTLTexture.h" #include "MTLUtils.h" -#include "MTLContext.h" #include #import namespace cc { +namespace gfx { CCMTLDevice::CCMTLDevice() {} CCMTLDevice::~CCMTLDevice() {} @@ -38,9 +39,9 @@ bool CCMTLDevice::initialize(const GFXDeviceInfo &info) { _stateCache = CC_NEW(CCMTLStateCache); - _mtkView = (MTKView*)_windowHandle; - _mtlDevice = ((MTKView*)_mtkView).device; - + _mtkView = (MTKView *)_windowHandle; + _mtlDevice = ((MTKView *)_mtkView).device; + GFXContextInfo contextCreateInfo; contextCreateInfo.windowHandle = _windowHandle; contextCreateInfo.sharedCtx = info.sharedCtx; @@ -302,4 +303,5 @@ void CCMTLDevice::blitBuffer(void *srcData, uint offset, uint size, void *dstBuf [commandBuffer commit]; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLFence.h b/native/cocos/renderer/gfx-metal/MTLFence.h index 0fbd08e691..fbd8de17be 100644 --- a/native/cocos/renderer/gfx-metal/MTLFence.h +++ b/native/cocos/renderer/gfx-metal/MTLFence.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLFence : public GFXFence { public: @@ -15,4 +16,5 @@ public: private: }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLFence.mm b/native/cocos/renderer/gfx-metal/MTLFence.mm index 9d8bcfb91b..77bab3a904 100644 --- a/native/cocos/renderer/gfx-metal/MTLFence.mm +++ b/native/cocos/renderer/gfx-metal/MTLFence.mm @@ -4,6 +4,7 @@ #include "MTLFence.h" namespace cc { +namespace gfx { CCMTLFence::CCMTLFence(GFXDevice *device) : GFXFence(device) {} @@ -32,4 +33,5 @@ void CCMTLFence::reset() { // TODO } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLFrameBuffer.h b/native/cocos/renderer/gfx-metal/MTLFrameBuffer.h index c58d8a236a..e474a5bddc 100644 --- a/native/cocos/renderer/gfx-metal/MTLFrameBuffer.h +++ b/native/cocos/renderer/gfx-metal/MTLFrameBuffer.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLFramebuffer : public GFXFramebuffer { public: @@ -11,4 +12,5 @@ public: virtual void destroy() override; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLFramebuffer.mm b/native/cocos/renderer/gfx-metal/MTLFramebuffer.mm index 40ce952f27..7cd28d7dae 100644 --- a/native/cocos/renderer/gfx-metal/MTLFramebuffer.mm +++ b/native/cocos/renderer/gfx-metal/MTLFramebuffer.mm @@ -5,6 +5,7 @@ #include "MTLTexture.h" namespace cc { +namespace gfx { CCMTLFramebuffer::CCMTLFramebuffer(GFXDevice *device) : GFXFramebuffer(device) {} CCMTLFramebuffer::~CCMTLFramebuffer() { destroy(); } @@ -46,4 +47,5 @@ void CCMTLFramebuffer::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h index 7befe7ce00..ebf50686d0 100644 --- a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h +++ b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h @@ -8,6 +8,7 @@ #import namespace cc { +namespace gfx { struct CCMTLGPUUniformBlock { uint mtlBinding = 0; @@ -59,4 +60,5 @@ public: std::vector> mtlVertexBufers; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLInputAssembler.h b/native/cocos/renderer/gfx-metal/MTLInputAssembler.h index 4d65bb212a..f10da056e5 100644 --- a/native/cocos/renderer/gfx-metal/MTLInputAssembler.h +++ b/native/cocos/renderer/gfx-metal/MTLInputAssembler.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLCmdDraw; class CCMTLGPUInputAssembler; @@ -23,4 +24,5 @@ private: CCMTLGPUInputAssembler *_GPUInputAssembler = nullptr; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLInputAssembler.mm b/native/cocos/renderer/gfx-metal/MTLInputAssembler.mm index 3489d91fef..5614cf6a2a 100644 --- a/native/cocos/renderer/gfx-metal/MTLInputAssembler.mm +++ b/native/cocos/renderer/gfx-metal/MTLInputAssembler.mm @@ -6,6 +6,7 @@ #include "MTLInputAssembler.h" namespace cc { +namespace gfx { CCMTLInputAssembler::CCMTLInputAssembler(GFXDevice *device) : GFXInputAssembler(device) {} CCMTLInputAssembler::~CCMTLInputAssembler() { destroy(); } @@ -54,4 +55,5 @@ void CCMTLInputAssembler::extractDrawInfo(CCMTLCmdDraw *cmd) const { cmd->drawInfo.firstInstance = _firstInstance; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineLayout.cpp b/native/cocos/renderer/gfx-metal/MTLPipelineLayout.cpp index a586f8e0ec..ab006cf0ea 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineLayout.cpp +++ b/native/cocos/renderer/gfx-metal/MTLPipelineLayout.cpp @@ -2,6 +2,7 @@ #include "MTLPipelineLayout.h" namespace cc { +namespace gfx { CCMTLPipelineLayout::CCMTLPipelineLayout(GFXDevice *device) : GFXPipelineLayout(device) {} CCMTLPipelineLayout::~CCMTLPipelineLayout() { destroy(); } @@ -18,4 +19,5 @@ void CCMTLPipelineLayout::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineLayout.h b/native/cocos/renderer/gfx-metal/MTLPipelineLayout.h index 3631f37a6e..2eb375122b 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineLayout.h +++ b/native/cocos/renderer/gfx-metal/MTLPipelineLayout.h @@ -1,6 +1,7 @@ #pragma once namespace cc { +namespace gfx { class CCMTLPipelineLayout : public GFXPipelineLayout { public: @@ -11,4 +12,5 @@ public: virtual void destroy() override; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineState.h b/native/cocos/renderer/gfx-metal/MTLPipelineState.h index 079ff34b4d..de17e3d859 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineState.h +++ b/native/cocos/renderer/gfx-metal/MTLPipelineState.h @@ -7,6 +7,7 @@ #import namespace cc { +namespace gfx { class CCMTLPipelineState : public GFXPipelineState { public: @@ -35,4 +36,5 @@ private: CCMTLGPUPipelineState *_GPUPipelieState = nullptr; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm index 5e539b5b75..8fdff9a31f 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm +++ b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm @@ -14,6 +14,7 @@ #import namespace cc { +namespace gfx { CCMTLPipelineState::CCMTLPipelineState(GFXDevice *device) : GFXPipelineState(device) {} CCMTLPipelineState::~CCMTLPipelineState() { destroy(); } @@ -252,4 +253,5 @@ bool CCMTLPipelineState::createMTLRenderPipeline(MTLRenderPipelineDescriptor *de return true; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLQueue.h b/native/cocos/renderer/gfx-metal/MTLQueue.h index da581f1c77..29b0926552 100644 --- a/native/cocos/renderer/gfx-metal/MTLQueue.h +++ b/native/cocos/renderer/gfx-metal/MTLQueue.h @@ -4,6 +4,7 @@ #import namespace cc { +namespace gfx { class CCMTLCommandPackage; @@ -17,7 +18,7 @@ public: virtual bool initialize(const GFXQueueInfo &info) override; virtual void destroy() override; virtual void submit(const vector::type &cmdBuffs, GFXFence *fence) override; - + private: CC_INLINE void executeCommands(const CCMTLCommandPackage *, id mtlCommandBuffer); @@ -30,4 +31,5 @@ private: uint _numTriangles = 0; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLQueue.mm b/native/cocos/renderer/gfx-metal/MTLQueue.mm index dcc91fb341..5897de7d00 100644 --- a/native/cocos/renderer/gfx-metal/MTLQueue.mm +++ b/native/cocos/renderer/gfx-metal/MTLQueue.mm @@ -20,6 +20,7 @@ #import namespace cc { +namespace gfx { CCMTLQueue::CCMTLQueue(GFXDevice *device) : GFXQueue(device) {} @@ -306,4 +307,5 @@ void CCMTLQueue::executeCommands(const CCMTLCommandPackage *commandPackage, id namespace cc { +namespace gfx { class GFXTextureView; @@ -27,4 +28,5 @@ private: size_t _colorRenderTargetNums = 0; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLRenderPass.mm b/native/cocos/renderer/gfx-metal/MTLRenderPass.mm index d3ec892fad..8c2ff4af46 100644 --- a/native/cocos/renderer/gfx-metal/MTLRenderPass.mm +++ b/native/cocos/renderer/gfx-metal/MTLRenderPass.mm @@ -5,6 +5,7 @@ #include "MTLUtils.h" namespace cc { +namespace gfx { CCMTLRenderPass::CCMTLRenderPass(GFXDevice *device) : GFXRenderPass(device) {} CCMTLRenderPass::~CCMTLRenderPass() { destroy(); } @@ -77,4 +78,5 @@ void CCMTLRenderPass::setDepthStencilAttachment(id texture, int leve _status = GFXStatus::SUCCESS; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLSampler.h b/native/cocos/renderer/gfx-metal/MTLSampler.h index 7d0ff90fcd..e4b9fd1f6d 100644 --- a/native/cocos/renderer/gfx-metal/MTLSampler.h +++ b/native/cocos/renderer/gfx-metal/MTLSampler.h @@ -3,6 +3,7 @@ #import namespace cc { +namespace gfx { class CCMTLSampler : public GFXSampler { public: @@ -18,4 +19,5 @@ private: id _mtlSamplerState = nil; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLSampler.mm b/native/cocos/renderer/gfx-metal/MTLSampler.mm index b610dd025c..baf126d31f 100644 --- a/native/cocos/renderer/gfx-metal/MTLSampler.mm +++ b/native/cocos/renderer/gfx-metal/MTLSampler.mm @@ -7,6 +7,7 @@ #import namespace cc { +namespace gfx { CCMTLSampler::CCMTLSampler(GFXDevice *device) : GFXSampler(device) {} CCMTLSampler::~CCMTLSampler() { destroy(); } @@ -58,4 +59,5 @@ void CCMTLSampler::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLShader.h b/native/cocos/renderer/gfx-metal/MTLShader.h index caa5e96897..060e80e9e0 100644 --- a/native/cocos/renderer/gfx-metal/MTLShader.h +++ b/native/cocos/renderer/gfx-metal/MTLShader.h @@ -4,6 +4,7 @@ #import namespace cc { +namespace gfx { class CCMTLShader : public GFXShader { public: @@ -43,4 +44,5 @@ private: #endif }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLShader.mm b/native/cocos/renderer/gfx-metal/MTLShader.mm index 36d5e6a622..8f8d9e60ef 100644 --- a/native/cocos/renderer/gfx-metal/MTLShader.mm +++ b/native/cocos/renderer/gfx-metal/MTLShader.mm @@ -6,6 +6,7 @@ #import namespace cc { +namespace gfx { CCMTLShader::CCMTLShader(GFXDevice *device) : GFXShader(device) {} CCMTLShader::~CCMTLShader() { destroy(); } @@ -93,4 +94,5 @@ bool CCMTLShader::createMTLFunction(const GFXShaderStage &stage) { return true; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLStateCache.h b/native/cocos/renderer/gfx-metal/MTLStateCache.h index 1be2d83dcd..5f7b57fcaf 100644 --- a/native/cocos/renderer/gfx-metal/MTLStateCache.h +++ b/native/cocos/renderer/gfx-metal/MTLStateCache.h @@ -1,9 +1,11 @@ #pragma once namespace cc { +namespace gfx { class CCMTLStateCache : public Object { public: }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLTexture.h b/native/cocos/renderer/gfx-metal/MTLTexture.h index 62e47bc6bf..736c307fca 100644 --- a/native/cocos/renderer/gfx-metal/MTLTexture.h +++ b/native/cocos/renderer/gfx-metal/MTLTexture.h @@ -3,6 +3,7 @@ #import namespace cc { +namespace gfx { class CCMTLTexture : public GFXTexture { friend class CCMTLDevice; @@ -30,4 +31,5 @@ private: GFXFormat _convertedFormat = GFXFormat::UNKNOWN; }; -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLTexture.mm b/native/cocos/renderer/gfx-metal/MTLTexture.mm index 5a3f1687ba..89e7187e94 100644 --- a/native/cocos/renderer/gfx-metal/MTLTexture.mm +++ b/native/cocos/renderer/gfx-metal/MTLTexture.mm @@ -6,6 +6,7 @@ #include namespace cc { +namespace gfx { namespace { uint8_t *convertData(uint8_t *source, uint length, GFXFormat type) { @@ -271,4 +272,5 @@ void CCMTLTexture::generateMipmaps() { [mtlCommandBuffer commit]; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLUtils.h b/native/cocos/renderer/gfx-metal/MTLUtils.h index 441335ff20..7e9ae1a661 100644 --- a/native/cocos/renderer/gfx-metal/MTLUtils.h +++ b/native/cocos/renderer/gfx-metal/MTLUtils.h @@ -8,8 +8,8 @@ #import #include - namespace cc { +namespace gfx { namespace mu { MTLResourceOptions toMTLResourseOption(GFXMemoryUsage usage); @@ -61,6 +61,8 @@ bool isLinearTextureSupported(uint family); bool isIndirectCommandBufferSupported(MTLFeatureSet featureSet); bool isDepthStencilFormatSupported(GFXFormat format, uint family); String featureSetToString(MTLFeatureSet featureSet); + } // namespace mu -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-metal/MTLUtils.mm b/native/cocos/renderer/gfx-metal/MTLUtils.mm index dbd49ff485..d11b81a18b 100644 --- a/native/cocos/renderer/gfx-metal/MTLUtils.mm +++ b/native/cocos/renderer/gfx-metal/MTLUtils.mm @@ -6,6 +6,7 @@ #include namespace cc { +namespace gfx { namespace { const TBuiltInResource DefaultTBuiltInResource = { /* .MaxLights = */ 32, @@ -1247,4 +1248,5 @@ String featureSetToString(MTLFeatureSet featureSet) { } //namespace mu -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKBindingLayout.cc b/native/cocos/renderer/gfx-vulkan/VKBindingLayout.cc index 0aae6c34ad..00ab9fb92f 100644 --- a/native/cocos/renderer/gfx-vulkan/VKBindingLayout.cc +++ b/native/cocos/renderer/gfx-vulkan/VKBindingLayout.cc @@ -8,6 +8,7 @@ #include "VKTexture.h" namespace cc { +namespace gfx { CCVKBindingLayout::CCVKBindingLayout(GFXDevice *device) : GFXBindingLayout(device) { @@ -93,4 +94,5 @@ void CCVKBindingLayout::update() { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKBindingLayout.h b/native/cocos/renderer/gfx-vulkan/VKBindingLayout.h index 0bbf694f6e..e0a503ea93 100644 --- a/native/cocos/renderer/gfx-vulkan/VKBindingLayout.h +++ b/native/cocos/renderer/gfx-vulkan/VKBindingLayout.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_BINDING_LAYOUT_H_ namespace cc { +namespace gfx { class CCVKGPUBindingLayout; @@ -21,6 +22,7 @@ private: CCVKGPUBindingLayout *_gpuBindingLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKBuffer.cc b/native/cocos/renderer/gfx-vulkan/VKBuffer.cc index 4d340eac4d..afb43aec8f 100644 --- a/native/cocos/renderer/gfx-vulkan/VKBuffer.cc +++ b/native/cocos/renderer/gfx-vulkan/VKBuffer.cc @@ -4,6 +4,7 @@ #include "VKCommands.h" namespace cc { +namespace gfx { CCVKBuffer::CCVKBuffer(GFXDevice *device) : GFXBuffer(device) { @@ -91,4 +92,5 @@ void CCVKBuffer::update(void *buffer, uint offset, uint size) { CCVKCmdFuncUpdateBuffer((CCVKDevice *)_device, _gpuBuffer, buffer, offset, size); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKBuffer.h b/native/cocos/renderer/gfx-vulkan/VKBuffer.h index 1526c508dd..399a5ef568 100644 --- a/native/cocos/renderer/gfx-vulkan/VKBuffer.h +++ b/native/cocos/renderer/gfx-vulkan/VKBuffer.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_BUFFER_H_ namespace cc { +namespace gfx { class CCVKGPUBuffer; @@ -22,6 +23,7 @@ private: CCVKGPUBuffer *_gpuBuffer = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.cc b/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.cc index 24d9451a22..578e2dbceb 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.cc +++ b/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.cc @@ -5,6 +5,7 @@ #include "VKDevice.h" namespace cc { +namespace gfx { CCVKCommandAllocator::CCVKCommandAllocator(GFXDevice *device) : GFXCommandAllocator(device) { @@ -38,4 +39,5 @@ void CCVKCommandAllocator::reset() { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.h b/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.h index 55f2fa6b04..ae4c3081c9 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.h +++ b/native/cocos/renderer/gfx-vulkan/VKCommandAllocator.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_COMMAND_ALLOCATOR_H_ namespace cc { +namespace gfx { class CCVKGPUCommandPool; @@ -21,6 +22,7 @@ private: CCVKGPUCommandPool *_gpuCommandPool; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cc b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cc index 223fac1bed..aa063bfd68 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cc +++ b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cc @@ -12,6 +12,7 @@ #include "VKTexture.h" namespace cc { +namespace gfx { CCVKCommandBuffer::CCVKCommandBuffer(GFXDevice *device) : GFXCommandBuffer(device) { @@ -333,4 +334,5 @@ void CCVKCommandBuffer::copyBufferToTexture(GFXBuffer *src, GFXTexture *dst, GFX } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h index 51c3cb17aa..a499c4e6bd 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h +++ b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h @@ -4,6 +4,7 @@ #include "VKCommands.h" namespace cc { +namespace gfx { class CC_VULKAN_API CCVKCommandBuffer : public GFXCommandBuffer { public: @@ -56,6 +57,7 @@ private: CCVKStencilCompareMask _curStencilCompareMask; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.cc b/native/cocos/renderer/gfx-vulkan/VKCommands.cc index c9c1182648..14601c48dc 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.cc +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.cc @@ -13,6 +13,7 @@ #define BUFFER_OFFSET(idx) (static_cast(0) + (idx)) namespace cc { +namespace gfx { void insertVkDynamicStates(vector::type &out, const vector::type &dynamicStates) { for (GFXDynamicState dynamicState : dynamicStates) { @@ -983,4 +984,5 @@ void CCVKCmdFuncCopyBuffersToTexture(CCVKDevice *device, uint8_t *const *buffers endOneTimeCommands(device, &cmdBuff); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.h b/native/cocos/renderer/gfx-vulkan/VKCommands.h index c575835ded..95bf88c8a3 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.h +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.h @@ -4,6 +4,7 @@ #include "VKGPUObjects.h" namespace cc { +namespace gfx { class CCVKDevice; @@ -64,6 +65,7 @@ CC_VULKAN_API void CCVKCmdFuncDestroyPipelineState(CCVKDevice *device, CCVKGPUPi CC_VULKAN_API void CCVKCmdFuncCopyBuffersToTexture(CCVKDevice *device, uint8_t *const *buffers, CCVKGPUTexture *gpuTexture, const GFXBufferTextureCopyList ®ions); -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKContext.cc b/native/cocos/renderer/gfx-vulkan/VKContext.cc index 4e646f3259..5dc92f5cbd 100644 --- a/native/cocos/renderer/gfx-vulkan/VKContext.cc +++ b/native/cocos/renderer/gfx-vulkan/VKContext.cc @@ -9,6 +9,7 @@ #include "VKUtils.h" namespace cc { +namespace gfx { namespace { @@ -500,4 +501,5 @@ void CCVKContext::destroy() { } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKContext.h b/native/cocos/renderer/gfx-vulkan/VKContext.h index 11ca1ef33d..0e8e22d120 100644 --- a/native/cocos/renderer/gfx-vulkan/VKContext.h +++ b/native/cocos/renderer/gfx-vulkan/VKContext.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_CONTEXT_H_ namespace cc { +namespace gfx { class CCVKDevice; class CCVKGPUDevice; @@ -41,6 +42,7 @@ private: vector::type _extensions; }; -} +} // namespace gfx +} // namespace cc #endif // CC_GFXVULKAN_CCVK_CONTEXT_H_ diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.cc b/native/cocos/renderer/gfx-vulkan/VKDevice.cc index 188d4e99fc..bbe030a2bd 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.cc +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.cc @@ -24,6 +24,7 @@ CC_DISABLE_WARNINGS() CC_ENABLE_WARNINGS() namespace cc { +namespace gfx { CCVKDevice::CCVKDevice() { _minClipZ = 0.0f; @@ -270,13 +271,13 @@ bool CCVKDevice::initialize(const GFXDeviceInfo &info) { _features[static_cast(GFXFeature::LINE_WIDTH)] = true; _features[static_cast(GFXFeature::STENCIL_COMPARE_MASK)] = true; _features[static_cast(GFXFeature::STENCIL_WRITE_MASK)] = true; - _features[static_cast(GFXFeature::FORMAT_RGB8)] = findSupportedFormat({ GFXFormat::RGB8, VK_FORMAT_R8G8B8_UNORM }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, gpuContext->physicalDevice); - _features[static_cast(GFXFeature::FORMAT_D16)] = findSupportedFormat({ GFXFormat::D16, VK_FORMAT_D16_UNORM }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); - _features[static_cast(GFXFeature::FORMAT_D16S8)] = findSupportedFormat({ GFXFormat::D16S8, VK_FORMAT_D16_UNORM_S8_UINT }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_RGB8)] = findSupportedFormat({GFXFormat::RGB8, VK_FORMAT_R8G8B8_UNORM}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_D16)] = findSupportedFormat({GFXFormat::D16, VK_FORMAT_D16_UNORM}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_D16S8)] = findSupportedFormat({GFXFormat::D16S8, VK_FORMAT_D16_UNORM_S8_UINT}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); _features[static_cast(GFXFeature::FORMAT_D24)] = false; - _features[static_cast(GFXFeature::FORMAT_D24S8)] = findSupportedFormat({ GFXFormat::D24S8, VK_FORMAT_D24_UNORM_S8_UINT }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); - _features[static_cast(GFXFeature::FORMAT_D32F)] = findSupportedFormat({ GFXFormat::D32F, VK_FORMAT_D32_SFLOAT }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); - _features[static_cast(GFXFeature::FORMAT_D32FS8)] = findSupportedFormat({ GFXFormat::D32F_S8, VK_FORMAT_D32_SFLOAT_S8_UINT }, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_D24S8)] = findSupportedFormat({GFXFormat::D24S8, VK_FORMAT_D24_UNORM_S8_UINT}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_D32F)] = findSupportedFormat({GFXFormat::D32F, VK_FORMAT_D32_SFLOAT}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); + _features[static_cast(GFXFeature::FORMAT_D32FS8)] = findSupportedFormat({GFXFormat::D32F_S8, VK_FORMAT_D32_SFLOAT_S8_UINT}, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, gpuContext->physicalDevice); uint32_t apiVersion = gpuContext->physicalDeviceProperties.apiVersion; _renderer = gpuContext->physicalDeviceProperties.deviceName; @@ -628,4 +629,5 @@ void CCVKDevice::copyBuffersToTexture(const GFXDataArray &buffers, GFXTexture *d CCVKCmdFuncCopyBuffersToTexture(this, buffers.datas.data(), ((CCVKTexture *)dst)->gpuTexture(), regions); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.h b/native/cocos/renderer/gfx-vulkan/VKDevice.h index 1d0b9262d0..0eaf3fab71 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.h +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_DEVICE_H_ namespace cc { +namespace gfx { class CCVKGPUContext; class CCVKGPUDevice; @@ -75,6 +76,7 @@ private: std::vector _extensions; }; -} +} // namespace gfx +} // namespace cc #endif // CC_GFXVULKAN_CCVK_DEVICE_H_ diff --git a/native/cocos/renderer/gfx-vulkan/VKFence.cc b/native/cocos/renderer/gfx-vulkan/VKFence.cc index 4d3e42d3cd..31a3704da2 100644 --- a/native/cocos/renderer/gfx-vulkan/VKFence.cc +++ b/native/cocos/renderer/gfx-vulkan/VKFence.cc @@ -5,6 +5,7 @@ #include "VKGPUObjects.h" namespace cc { +namespace gfx { CCVKFence::CCVKFence(GFXDevice *device) : GFXFence(device) { @@ -45,4 +46,5 @@ void CCVKFence::reset() { VK_CHECK(vkResetFences(((CCVKDevice *)_device)->gpuDevice()->vkDevice, 1, &_gpuFence->vkFence)); } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKFence.h b/native/cocos/renderer/gfx-vulkan/VKFence.h index ff87d17090..a5d29d439a 100644 --- a/native/cocos/renderer/gfx-vulkan/VKFence.h +++ b/native/cocos/renderer/gfx-vulkan/VKFence.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_FENCE_H_ namespace cc { +namespace gfx { class CCVKGPUFence; @@ -22,6 +23,7 @@ private: CCVKGPUFence *_gpuFence = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKFramebuffer.cc b/native/cocos/renderer/gfx-vulkan/VKFramebuffer.cc index 5f25949634..6ab06ef153 100644 --- a/native/cocos/renderer/gfx-vulkan/VKFramebuffer.cc +++ b/native/cocos/renderer/gfx-vulkan/VKFramebuffer.cc @@ -7,6 +7,7 @@ #include "VKTexture.h" namespace cc { +namespace gfx { CCVKFramebuffer::CCVKFramebuffer(GFXDevice *device) : GFXFramebuffer(device) { @@ -57,4 +58,5 @@ void CCVKFramebuffer::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKFramebuffer.h b/native/cocos/renderer/gfx-vulkan/VKFramebuffer.h index 241231ad5e..f5cdc37abc 100644 --- a/native/cocos/renderer/gfx-vulkan/VKFramebuffer.h +++ b/native/cocos/renderer/gfx-vulkan/VKFramebuffer.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_FRAMEBUFFER_H_ namespace cc { +namespace gfx { class CCVKGPUFramebuffer; @@ -20,6 +21,7 @@ private: CCVKGPUFramebuffer *_gpuFBO = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h index 310f28bc65..5dd5cb64e8 100644 --- a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h +++ b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h @@ -4,6 +4,7 @@ #include "VKUtils.h" namespace cc { +namespace gfx { class CCVKGPUContext : public Object { public: @@ -317,6 +318,7 @@ private: vector::type _fences; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKInputAssembler.cc b/native/cocos/renderer/gfx-vulkan/VKInputAssembler.cc index e6a8ed5202..82c017e76e 100644 --- a/native/cocos/renderer/gfx-vulkan/VKInputAssembler.cc +++ b/native/cocos/renderer/gfx-vulkan/VKInputAssembler.cc @@ -5,6 +5,7 @@ #include "VKInputAssembler.h" namespace cc { +namespace gfx { CCVKInputAssembler::CCVKInputAssembler(GFXDevice *device) : GFXInputAssembler(device) { @@ -59,4 +60,5 @@ void CCVKInputAssembler::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKInputAssembler.h b/native/cocos/renderer/gfx-vulkan/VKInputAssembler.h index 2fca2ad2e9..64473f7cf1 100644 --- a/native/cocos/renderer/gfx-vulkan/VKInputAssembler.h +++ b/native/cocos/renderer/gfx-vulkan/VKInputAssembler.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_INPUT_ASSEMBLER_H_ namespace cc { +namespace gfx { class CCVKGPUInputAssembler; @@ -20,6 +21,7 @@ private: CCVKGPUInputAssembler *_gpuInputAssembler = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.cc b/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.cc index b836be1f40..1e8d9f4696 100644 --- a/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.cc +++ b/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.cc @@ -5,6 +5,7 @@ #include "VKPipelineLayout.h" namespace cc { +namespace gfx { CCVKPipelineLayout::CCVKPipelineLayout(GFXDevice *device) : GFXPipelineLayout(device) { @@ -41,4 +42,5 @@ void CCVKPipelineLayout::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.h b/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.h index 6287aa1e59..0b7227634c 100644 --- a/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.h +++ b/native/cocos/renderer/gfx-vulkan/VKPipelineLayout.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_PIPELINE_LAYOUT_H_ namespace cc { +namespace gfx { class CCVKGPUPipelineLayout; @@ -20,6 +21,7 @@ private: CCVKGPUPipelineLayout *_gpuPipelineLayout = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKPipelineState.cc b/native/cocos/renderer/gfx-vulkan/VKPipelineState.cc index 9ff98c225a..6f7497b66b 100644 --- a/native/cocos/renderer/gfx-vulkan/VKPipelineState.cc +++ b/native/cocos/renderer/gfx-vulkan/VKPipelineState.cc @@ -7,6 +7,7 @@ #include "VKShader.h" namespace cc { +namespace gfx { CCVKPipelineState::CCVKPipelineState(GFXDevice *device) : GFXPipelineState(device) { @@ -53,4 +54,5 @@ void CCVKPipelineState::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKPipelineState.h b/native/cocos/renderer/gfx-vulkan/VKPipelineState.h index 43f831ceec..676b960651 100644 --- a/native/cocos/renderer/gfx-vulkan/VKPipelineState.h +++ b/native/cocos/renderer/gfx-vulkan/VKPipelineState.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_PIPELINE_STATE_H_ namespace cc { +namespace gfx { class CCVKGPUPipelineState; @@ -20,6 +21,7 @@ private: CCVKGPUPipelineState *_gpuPipelineState = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKQueue.cc b/native/cocos/renderer/gfx-vulkan/VKQueue.cc index caddd1ae18..34cc4a2ce2 100644 --- a/native/cocos/renderer/gfx-vulkan/VKQueue.cc +++ b/native/cocos/renderer/gfx-vulkan/VKQueue.cc @@ -7,6 +7,7 @@ #include "VKQueue.h" namespace cc { +namespace gfx { CCVKQueue::CCVKQueue(GFXDevice *device) : GFXQueue(device) { @@ -58,11 +59,12 @@ void CCVKQueue::submit(const vector::type &cmdBuffs, GFXFenc VkFence vkFence = fence ? ((CCVKFence *)fence)->gpuFence()->vkFence : ((CCVKDevice *)_device)->gpuFencePool()->alloc(); VK_CHECK(vkQueueSubmit(_gpuQueue->vkQueue, 1, &submitInfo, vkFence)); - VK_CHECK(vkWaitForFences(((CCVKDevice*)_device)->gpuDevice()->vkDevice, 1, &vkFence, VK_TRUE, DEFAULT_FENCE_TIMEOUT)); + VK_CHECK(vkWaitForFences(((CCVKDevice *)_device)->gpuDevice()->vkDevice, 1, &vkFence, VK_TRUE, DEFAULT_FENCE_TIMEOUT)); _gpuQueue->nextWaitSemaphore = _gpuQueue->nextSignalSemaphore; _gpuQueue->nextSignalSemaphore = ((CCVKDevice *)_device)->gpuSemaphorePool()->alloc(); } } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKQueue.h b/native/cocos/renderer/gfx-vulkan/VKQueue.h index 74e4747c02..eb80cfce64 100644 --- a/native/cocos/renderer/gfx-vulkan/VKQueue.h +++ b/native/cocos/renderer/gfx-vulkan/VKQueue.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_QUEUE_H_ namespace cc { +namespace gfx { class CCVKGPUQueue; @@ -28,6 +29,7 @@ private: uint _numTriangles = 0; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKRenderPass.cc b/native/cocos/renderer/gfx-vulkan/VKRenderPass.cc index d4a3612040..7c8ca80c40 100644 --- a/native/cocos/renderer/gfx-vulkan/VKRenderPass.cc +++ b/native/cocos/renderer/gfx-vulkan/VKRenderPass.cc @@ -4,6 +4,7 @@ #include "VKRenderPass.h" namespace cc { +namespace gfx { CCVKRenderPass::CCVKRenderPass(GFXDevice *device) : GFXRenderPass(device) { @@ -39,4 +40,5 @@ void CCVKRenderPass::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKRenderPass.h b/native/cocos/renderer/gfx-vulkan/VKRenderPass.h index d41c64470d..c6eecdf434 100644 --- a/native/cocos/renderer/gfx-vulkan/VKRenderPass.h +++ b/native/cocos/renderer/gfx-vulkan/VKRenderPass.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_RENDER_PASS_H_ namespace cc { +namespace gfx { class CCVKGPURenderPass; @@ -20,6 +21,7 @@ private: CCVKGPURenderPass *_gpuRenderPass = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKSPIRV.h b/native/cocos/renderer/gfx-vulkan/VKSPIRV.h index d3af72ed64..ca802be095 100644 --- a/native/cocos/renderer/gfx-vulkan/VKSPIRV.h +++ b/native/cocos/renderer/gfx-vulkan/VKSPIRV.h @@ -1,10 +1,11 @@ #ifndef CC_GFXVULKAN_SPIRV_H_ - #define CC_GFXVULKAN_SPIRV_H_ +#define CC_GFXVULKAN_SPIRV_H_ - #include "SPIRV/GlslangToSpv.h" - #include "glslang/Public/ShaderLang.h" +#include "SPIRV/GlslangToSpv.h" +#include "glslang/Public/ShaderLang.h" namespace cc { +namespace gfx { namespace { EShLanguage getShaderStage(GFXShaderType type) { @@ -193,8 +194,10 @@ const vector::type GLSL2SPIRV(GFXShaderType type, const String &so return std::move(spirv); } + } // namespace -#endif +} // namespace gfx +} // namespace cc -} +#endif diff --git a/native/cocos/renderer/gfx-vulkan/VKSampler.cc b/native/cocos/renderer/gfx-vulkan/VKSampler.cc index a0cab358aa..f6b9bbe97d 100644 --- a/native/cocos/renderer/gfx-vulkan/VKSampler.cc +++ b/native/cocos/renderer/gfx-vulkan/VKSampler.cc @@ -4,6 +4,7 @@ #include "VKSampler.h" namespace cc { +namespace gfx { CCVKSampler::CCVKSampler(GFXDevice *device) : GFXSampler(device) { @@ -57,4 +58,5 @@ void CCVKSampler::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKSampler.h b/native/cocos/renderer/gfx-vulkan/VKSampler.h index a4b32a68eb..344ea29108 100644 --- a/native/cocos/renderer/gfx-vulkan/VKSampler.h +++ b/native/cocos/renderer/gfx-vulkan/VKSampler.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_SAMPLER_H_ namespace cc { +namespace gfx { class CCVKGPUSampler; @@ -20,6 +21,7 @@ private: CCVKGPUSampler *_gpuSampler = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKShader.cc b/native/cocos/renderer/gfx-vulkan/VKShader.cc index 7e28a5d1bf..28408bb08a 100644 --- a/native/cocos/renderer/gfx-vulkan/VKShader.cc +++ b/native/cocos/renderer/gfx-vulkan/VKShader.cc @@ -4,6 +4,7 @@ #include "VKShader.h" namespace cc { +namespace gfx { CCVKShader::CCVKShader(GFXDevice *device) : GFXShader(device) { @@ -45,4 +46,5 @@ void CCVKShader::destroy() { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKShader.h b/native/cocos/renderer/gfx-vulkan/VKShader.h index cf1dc08184..fa8d026aef 100644 --- a/native/cocos/renderer/gfx-vulkan/VKShader.h +++ b/native/cocos/renderer/gfx-vulkan/VKShader.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_SHADER_H_ namespace cc { +namespace gfx { class CCVKGPUShader; @@ -20,6 +21,7 @@ private: CCVKGPUShader *_gpuShader = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKTexture.cc b/native/cocos/renderer/gfx-vulkan/VKTexture.cc index 8a968b4c8a..b1a581a162 100644 --- a/native/cocos/renderer/gfx-vulkan/VKTexture.cc +++ b/native/cocos/renderer/gfx-vulkan/VKTexture.cc @@ -4,6 +4,7 @@ #include "VKTexture.h" namespace cc { +namespace gfx { CCVKTexture::CCVKTexture(GFXDevice *device) : GFXTexture(device) { @@ -167,4 +168,5 @@ void CCVKTexture::resize(uint width, uint height) { _status = GFXStatus::UNREADY; } -} +} // namespace gfx +} // namespace cc diff --git a/native/cocos/renderer/gfx-vulkan/VKTexture.h b/native/cocos/renderer/gfx-vulkan/VKTexture.h index 93cab62ff0..bee7508f36 100644 --- a/native/cocos/renderer/gfx-vulkan/VKTexture.h +++ b/native/cocos/renderer/gfx-vulkan/VKTexture.h @@ -2,6 +2,7 @@ #define CC_GFXVULKAN_CCVK_TEXTURE_H_ namespace cc { +namespace gfx { class CCVKGPUTexture; class CCVKGPUTextureView; @@ -27,6 +28,7 @@ private: CCVKGPUTextureView *_gpuTextureView = nullptr; }; -} +} // namespace gfx +} // namespace cc #endif diff --git a/native/cocos/renderer/gfx-vulkan/VKUtils.h b/native/cocos/renderer/gfx-vulkan/VKUtils.h index 13a73c1457..78e2c6b99c 100644 --- a/native/cocos/renderer/gfx-vulkan/VKUtils.h +++ b/native/cocos/renderer/gfx-vulkan/VKUtils.h @@ -9,6 +9,7 @@ #define DEFAULT_FENCE_TIMEOUT 100000000000 namespace cc { +namespace gfx { namespace { VkFormat MapVkFormat(GFXFormat format) { @@ -340,8 +341,8 @@ uint selectMemoryType(const VkPhysicalDeviceMemoryProperties &memoryProperties, VkImageCreateFlags MapVkImageCreateFlags(GFXTextureType type) { uint res = 0u; switch (type) { - case cc::GFXTextureType::CUBE: res |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; break; - case cc::GFXTextureType::TEX2D_ARRAY: res |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT; break; + case GFXTextureType::CUBE: res |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; break; + case GFXTextureType::TEX2D_ARRAY: res |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT; break; } return (VkImageCreateFlags)res; } @@ -374,9 +375,9 @@ VkCommandBufferLevel MapVkCommandBufferLevel(GFXCommandBufferType type) { VkDescriptorType MapVkDescriptorType(GFXBindingType type) { switch (type) { - case cc::GFXBindingType::UNIFORM_BUFFER: return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; - case cc::GFXBindingType::SAMPLER: return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; - case cc::GFXBindingType::STORAGE_BUFFER: return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + case GFXBindingType::UNIFORM_BUFFER: return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + case GFXBindingType::SAMPLER: return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + case GFXBindingType::STORAGE_BUFFER: return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; default: { CCASSERT(false, "Unsupported GFXBindingType, convert to VkDescriptorType failed."); return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; @@ -642,6 +643,7 @@ bool findSupportedFormat(std::pair format, VkImageTiling ti } } // namespace -} +} // namespace gfx +} // namespace cc #endif // CC_GFXVULKAN_CCVK_UTILS_H_ diff --git a/native/cocos/renderer/pipeline/BatchedBuffer.h b/native/cocos/renderer/pipeline/BatchedBuffer.h index c7e2d27a07..c4b865eca0 100644 --- a/native/cocos/renderer/pipeline/BatchedBuffer.h +++ b/native/cocos/renderer/pipeline/BatchedBuffer.h @@ -10,7 +10,7 @@ class SubModel; namespace cc { namespace pipeline { -class CC_DLL BatchedBuffer : public cc::Object { +class CC_DLL BatchedBuffer : public gfx::Object { public: BatchedBuffer(cc::Pass *pass); ~BatchedBuffer() = default; diff --git a/native/cocos/renderer/pipeline/Define.h b/native/cocos/renderer/pipeline/Define.h index fb3747c7bf..a75a721b0c 100644 --- a/native/cocos/renderer/pipeline/Define.h +++ b/native/cocos/renderer/pipeline/Define.h @@ -15,16 +15,16 @@ class RenderFlow; struct CC_DLL RenderObject { //TODO }; -typedef cc::vector::type RenderObjectList; +typedef gfx::vector::type RenderObjectList; struct CC_DLL RenderPipelineInfo { //TODO }; struct CC_DLL RenderStageInfo { - cc::String name; + gfx::String name; int priority = 0; - cc::String framebuffer; + gfx::String framebuffer; // renderQueues?: RenderQueueDesc[]; }; @@ -42,29 +42,29 @@ struct CC_DLL RenderTargetInfo { }; struct CC_DLL InstancedItem { - cc::GFXBuffer *vb = nullptr; + gfx::GFXBuffer *vb = nullptr; uint8_t *data = nullptr; - cc::GFXInputAssembler *ia = nullptr; + gfx::GFXInputAssembler *ia = nullptr; uint count = 0; uint capacity = 0; uint stride = 0; }; -typedef cc::vector::type InstancedItemList; +typedef gfx::vector::type InstancedItemList; struct BatchedItem { - cc::GFXBufferList vbs; + gfx::GFXBufferList vbs; uint8_t *vbDatas = nullptr; - cc::GFXBuffer *vbIdx = nullptr; + gfx::GFXBuffer *vbIdx = nullptr; float *vbIdxData = nullptr; uint mergCount = 0; - cc::GFXInputAssembler *ia = nullptr; - cc::GFXBuffer *ubo = nullptr; + gfx::GFXInputAssembler *ia = nullptr; + gfx::GFXBuffer *ubo = nullptr; cc::PSOCreateInfo *psoCreatedInfo = nullptr; }; -typedef cc::vector::type BatchedItemList; +typedef gfx::vector::type BatchedItemList; -typedef cc::vector::type RenderStageList; -typedef cc::vector::type RenderFlowList; +typedef gfx::vector::type RenderStageList; +typedef gfx::vector::type RenderFlowList; //TODO const uint CAMERA_DEFAULT_MASK = 1; diff --git a/native/cocos/renderer/pipeline/InstancedBuffer.h b/native/cocos/renderer/pipeline/InstancedBuffer.h index fe66c0dc20..a3b6eab866 100644 --- a/native/cocos/renderer/pipeline/InstancedBuffer.h +++ b/native/cocos/renderer/pipeline/InstancedBuffer.h @@ -12,7 +12,7 @@ class SubModel; namespace cc { namespace pipeline { -class InstancedBuffer : public cc::Object { +class InstancedBuffer : public gfx::Object { public: static const uint INITIAL_CAPACITY = 32; static const uint MAX_CAPACITY = 1024; diff --git a/native/cocos/renderer/pipeline/RenderBatchedQueue.h b/native/cocos/renderer/pipeline/RenderBatchedQueue.h index a4faeec775..4b3def7227 100644 --- a/native/cocos/renderer/pipeline/RenderBatchedQueue.h +++ b/native/cocos/renderer/pipeline/RenderBatchedQueue.h @@ -7,18 +7,18 @@ namespace pipeline { class BatchedBuffer; -class CC_DLL RenderBatchedQueue : public cc::Object { +class CC_DLL RenderBatchedQueue : public gfx::Object { public: RenderBatchedQueue() = default; ~RenderBatchedQueue() = default; void clear(); - void recordCommandBuffer(cc::GFXDevice *, cc::GFXRenderPass *, cc::GFXCommandBuffer *); + void recordCommandBuffer(gfx::GFXDevice *, gfx::GFXRenderPass *, gfx::GFXCommandBuffer *); - CC_INLINE const cc::set::type &getQueue() const { return _queue; } + CC_INLINE const gfx::set::type &getQueue() const { return _queue; } private: - cc::set::type _queue; + gfx::set::type _queue; }; } // namespace pipeline diff --git a/native/cocos/renderer/pipeline/RenderFlow.h b/native/cocos/renderer/pipeline/RenderFlow.h index f168a9bc93..a08d45c625 100644 --- a/native/cocos/renderer/pipeline/RenderFlow.h +++ b/native/cocos/renderer/pipeline/RenderFlow.h @@ -15,7 +15,7 @@ class RenderPipeline; class RenderStage; class RenderView; -class CC_DLL RenderFlow : public cc::Object { +class CC_DLL RenderFlow : public gfx::Object { public: RenderFlow() = default; virtual ~RenderFlow() = default; @@ -32,7 +32,7 @@ public: CC_INLINE const cc::GFXDevice *getDevice() const { return _device; } CC_INLINE const RenderPipeline *getPipeline() const { return _pipeline; } - CC_INLINE const cc::String &getName() const { return _name; } + CC_INLINE const gfx::String &getName() const { return _name; } CC_INLINE int getPriority() const { return _priority; } CC_INLINE const RenderStageList &getStages() const { return _stages; } // CC_INLINE const Material *getMaterial() const { return _material; } @@ -44,7 +44,7 @@ protected: protected: cc::GFXDevice *_device = nullptr; RenderPipeline *_pipeline = nullptr; - cc::String _name; + gfx::String _name; int _priority = 0; RenderStageList _stages; // Material *_material = nullptr; diff --git a/native/cocos/renderer/pipeline/RenderInstancedQueue.h b/native/cocos/renderer/pipeline/RenderInstancedQueue.h index 0190849fae..430aa81529 100644 --- a/native/cocos/renderer/pipeline/RenderInstancedQueue.h +++ b/native/cocos/renderer/pipeline/RenderInstancedQueue.h @@ -7,18 +7,18 @@ namespace pipeline { class InstancedBuffer; -class CC_DLL RenderInstancedQueue : public cc::Object { +class CC_DLL RenderInstancedQueue : public gfx::Object { public: RenderInstancedQueue() = default; ~RenderInstancedQueue() = default; void clear(); - void recordCommandBuffer(cc::GFXDevice *, cc::GFXRenderPass *, cc::GFXCommandBuffer *); + void recordCommandBuffer(gfx::GFXDevice *, gfx::GFXRenderPass *, gfx::GFXCommandBuffer *); - CC_INLINE const cc::set::type &getQueue() const { return _queue; } + CC_INLINE const gfx::set::type &getQueue() const { return _queue; } private: - cc::set::type _queue; + gfx::set::type _queue; }; } // namespace pipeline diff --git a/native/cocos/renderer/pipeline/RenderPipeline.h b/native/cocos/renderer/pipeline/RenderPipeline.h index f133bf6cd5..e8c444ee46 100644 --- a/native/cocos/renderer/pipeline/RenderPipeline.h +++ b/native/cocos/renderer/pipeline/RenderPipeline.h @@ -4,15 +4,19 @@ #include "Define.h" namespace cc { +class Light; +class Root; +class Model; +class Camera; + +namespace gfx { class GFXDevice; class GFXInputAssembler; class GFXTexture; class GFXBuffer; class GFXRenderPass; -class Light; -class Root; -class Model; -class Camera; +} // namespace gfx + } // namespace cc namespace cc { @@ -20,15 +24,15 @@ namespace pipeline { class RenderView; -class CC_DLL RenderPipeline : public cc::Object { +class CC_DLL RenderPipeline : public gfx::Object { public: virtual ~RenderPipeline() = default; virtual void destroy() = 0; - virtual cc::vector::type &getValidLights() const = 0; - virtual cc::vector::type &getLightIndexOffsets() const = 0; - virtual cc::vector::type &getLightIndices() const = 0; - virtual cc::vector::type &getLightBuffers() const = 0; + virtual gfx::vector::type &getValidLights() const = 0; + virtual gfx::vector::type &getLightIndexOffsets() const = 0; + virtual gfx::vector::type &getLightIndices() const = 0; + virtual gfx::vector::type &getLightBuffers() const = 0; virtual bool initialize(const RenderPipelineInfo &info); virtual bool activate(cc::Root *root); @@ -39,21 +43,21 @@ public: virtual void sceneCulling(); void swapFBOS(); - void addRenderPass(uint stage, cc::GFXRenderPass *renderPass); - cc::GFXRenderPass *getRenderPass(uint stage) const; + void addRenderPass(uint stage, gfx::GFXRenderPass *renderPass); + gfx::GFXRenderPass *getRenderPass(uint stage) const; void removeRenderPass(uint stage); void clearRenderPasses(); void destroyFlows(); - RenderFlow *getFlow(const cc::String &name) const; + RenderFlow *getFlow(const gfx::String &name) const; void updateMacros(); - cc::GFXTexture *getTexture(const cc::String &name) const; - cc::GFXTexture *getRenderTexture(const cc::String &name) const; - cc::GFXBuffer *getFrameBuffer(const cc::String &name) const; + gfx::GFXTexture *getTexture(const gfx::String &name) const; + gfx::GFXTexture *getRenderTexture(const gfx::String &name) const; + gfx::GFXBuffer *getFrameBuffer(const gfx::String &name) const; // CC_INLINE const Root* getRoot() const { } - CC_INLINE cc::GFXDevice *getDevice() const { return _device; } - CC_INLINE cc::GFXTexture *getDefaultTexture() const { return _defaultTexture; } - CC_INLINE cc::GFXInputAssembler *getQuadIA() const { return _quadIA; } + CC_INLINE gfx::GFXDevice *getDevice() const { return _device; } + CC_INLINE gfx::GFXTexture *getDefaultTexture() const { return _defaultTexture; } + CC_INLINE gfx::GFXInputAssembler *getQuadIA() const { return _quadIA; } CC_INLINE const RenderFlowList &getFlows() const { return _flows; } CC_INLINE const RenderFlowList &getActiveFlows() const { return _activeFlows; } CC_INLINE const RenderObjectList &getRenderObjects() const { return _renderObjects; } @@ -61,9 +65,9 @@ public: CC_INLINE float getFpScaleInv() const { return _fpScaleInv; } CC_INLINE float getShadingScale() const { return _shadingScale; } CC_INLINE float getLightMeterScale() const { return _lightMeterScale; } - CC_INLINE const cc::String &getCurrentShading() const { return _currIdx; } - CC_INLINE const cc::String &getPreviousShading() const { return _prevIdx; } - CC_INLINE const cc::String &getName() const { return _name; } + CC_INLINE const gfx::String &getCurrentShading() const { return _currIdx; } + CC_INLINE const gfx::String &getPreviousShading() const { return _prevIdx; } + CC_INLINE const gfx::String &getName() const { return _name; } CC_INLINE bool isHDRSupported() const { return _isHDRSupported; } CC_INLINE bool isUsePostProcess() const { return _isUsePostProcess; } CC_INLINE bool isHDR() const { return _isHDR; } @@ -85,18 +89,18 @@ protected: private: void activateFlow(RenderFlow *flow); - cc::GFXFormat getTextureFormat(cc::GFXFormat format, cc::GFXTextureUsageBit usage) const; + gfx::GFXFormat getTextureFormat(gfx::GFXFormat format, gfx::GFXTextureUsageBit usage) const; protected: - cc::String _name; - cc::String _currIdx = "shading"; - cc::String _prevIdx = "shading1"; + gfx::String _name; + gfx::String _currIdx = "shading"; + gfx::String _prevIdx = "shading1"; RenderObjectList _renderObjects; RenderFlowList _flows; RenderFlowList _activeFlows; - cc::GFXDevice *_device = nullptr; - cc::GFXInputAssembler *_quadIA = nullptr; - cc::GFXTexture *_defaultTexture = nullptr; + gfx::GFXDevice *_device = nullptr; + gfx::GFXInputAssembler *_quadIA = nullptr; + gfx::GFXTexture *_defaultTexture = nullptr; float _shadingScale = 1.f; float _lightMeterScale = 1000.f; float _fpScale = 1.f / 1024; diff --git a/native/cocos/renderer/pipeline/RenderStage.h b/native/cocos/renderer/pipeline/RenderStage.h index 8198be61f2..303a46aa72 100644 --- a/native/cocos/renderer/pipeline/RenderStage.h +++ b/native/cocos/renderer/pipeline/RenderStage.h @@ -3,17 +3,18 @@ #include "Define.h" namespace cc { -class GFXFramebuffer; -} -namespace cc { +namespace gfx { +class GFXFramebuffer; +} // namespace gfx + namespace pipeline { class RenderFlow; class RenderPipeline; class RenderView; -class CC_DLL RenderStage : public cc::Object { +class CC_DLL RenderStage : public gfx::Object { public: RenderStage() = default; virtual ~RenderStage() = default; @@ -38,12 +39,12 @@ public: CC_INLINE RenderFlow *getFlow() const { return _flow; } CC_INLINE RenderPipeline *getPipeline() const { return _pipeline; } CC_INLINE int getPriority() const { return _priority; } - CC_INLINE cc::GFXFramebuffer *getFrameBuffer() const { return _frameBuffer; } + CC_INLINE gfx::GFXFramebuffer *getFrameBuffer() const { return _frameBuffer; } protected: RenderFlow *_flow = nullptr; RenderPipeline *_pipeline = nullptr; - cc::GFXFramebuffer *_frameBuffer = nullptr; + gfx::GFXFramebuffer *_frameBuffer = nullptr; int _priority = 0; }; diff --git a/native/cocos/renderer/pipeline/RenderView.h b/native/cocos/renderer/pipeline/RenderView.h index aee68707e5..12b22b529a 100644 --- a/native/cocos/renderer/pipeline/RenderView.h +++ b/native/cocos/renderer/pipeline/RenderView.h @@ -12,7 +12,7 @@ namespace pipeline { class RenderFlow; -class CC_DLL RenderView : public cc::Object { +class CC_DLL RenderView : public gfx::Object { public: static void registerCreateFun(cc::Root *root); @@ -22,7 +22,7 @@ public: void setExecuteFlows(const RenderFlowList &flows); void setPriority(); - CC_INLINE const cc::String &getName() const { return _name; } + CC_INLINE const gfx::String &getName() const { return _name; } CC_INLINE uint getPriority() const { return _priority; } CC_INLINE uint getVisibility() const { return _visibility; } CC_INLINE void setVisibility(uint value) { _visibility = value; } @@ -38,7 +38,7 @@ private: private: RenderFlowList _flows; - cc::String _name; + gfx::String _name; cc::Camera *_camera = nullptr; cc::Root *_root = nullptr; uint _priority = 0; diff --git a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h index ebaf32896a..e4c8b1d19e 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h +++ b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h @@ -16,17 +16,17 @@ public: virtual void rebuild() override; virtual void updateUBOs(RenderView *view) override; virtual void sceneCulling() override; - virtual cc::vector::type &getLightIndices() const override; - virtual cc::vector::type &getLightIndexOffsets() const override; - virtual cc::vector::type &getLightBuffers() const override; + virtual gfx::vector::type &getLightIndices() const override; + virtual gfx::vector::type &getLightIndexOffsets() const override; + virtual gfx::vector::type &getLightBuffers() const override; - CC_INLINE cc::GFXBuffer *getLightsUBO() { return _lightsUBO; } + CC_INLINE gfx::GFXBuffer *getLightsUBO() { return _lightsUBO; } private: void cullLightPerModel(cc::Model *model); private: - cc::GFXBuffer *_lightsUBO = nullptr; + gfx::GFXBuffer *_lightsUBO = nullptr; }; } // namespace pipeline diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp index 5f8788d7d4..cb7e8bce99 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp @@ -10,12 +10,12 @@ #ifndef JSB_FREE #define JSB_FREE(ptr) delete ptr #endif -se::Object* __jsb_cc_GFXOffset_proto = nullptr; -se::Class* __jsb_cc_GFXOffset_class = nullptr; +se::Object* __jsb_cc_gfx_GFXOffset_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXOffset_class = nullptr; static bool js_gfx_GFXOffset_get_x(se::State& s) { - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_get_x : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -29,7 +29,7 @@ SE_BIND_PROP_GET(js_gfx_GFXOffset_get_x) static bool js_gfx_GFXOffset_set_x(se::State& s) { const auto& args = s.args(); - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_set_x : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -43,7 +43,7 @@ SE_BIND_PROP_SET(js_gfx_GFXOffset_set_x) static bool js_gfx_GFXOffset_get_y(se::State& s) { - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_get_y : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -57,7 +57,7 @@ SE_BIND_PROP_GET(js_gfx_GFXOffset_get_y) static bool js_gfx_GFXOffset_set_y(se::State& s) { const auto& args = s.args(); - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_set_y : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -71,7 +71,7 @@ SE_BIND_PROP_SET(js_gfx_GFXOffset_set_y) static bool js_gfx_GFXOffset_get_z(se::State& s) { - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_get_z : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -85,7 +85,7 @@ SE_BIND_PROP_GET(js_gfx_GFXOffset_get_z) static bool js_gfx_GFXOffset_set_z(se::State& s) { const auto& args = s.args(); - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXOffset_set_z : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -97,7 +97,7 @@ static bool js_gfx_GFXOffset_set_z(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXOffset_set_z) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXOffset_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXOffset_finalize) static bool js_gfx_GFXOffset_constructor(se::State& s) { @@ -107,7 +107,7 @@ static bool js_gfx_GFXOffset_constructor(se::State& s) if(argc == 0) { - cc::GFXOffset* cobj = JSB_ALLOC(cc::GFXOffset); + cc::gfx::GFXOffset* cobj = JSB_ALLOC(cc::gfx::GFXOffset); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -117,7 +117,7 @@ static bool js_gfx_GFXOffset_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXOffset* cobj = JSB_ALLOC(cc::GFXOffset); + cc::gfx::GFXOffset* cobj = JSB_ALLOC(cc::gfx::GFXOffset); int arg0 = 0; json->getProperty("x", &field); if(!field.isUndefined()) { @@ -149,7 +149,7 @@ static bool js_gfx_GFXOffset_constructor(se::State& s) } else if(argc == 3) { - cc::GFXOffset* cobj = JSB_ALLOC(cc::GFXOffset); + cc::gfx::GFXOffset* cobj = JSB_ALLOC(cc::gfx::GFXOffset); int arg0 = 0; if (!args[0].isUndefined()) { do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); @@ -180,24 +180,24 @@ static bool js_gfx_GFXOffset_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXOffset_constructor, __jsb_cc_GFXOffset_class, js_cc_GFXOffset_finalize) +SE_BIND_CTOR(js_gfx_GFXOffset_constructor, __jsb_cc_gfx_GFXOffset_class, js_cc_gfx_GFXOffset_finalize) -static bool js_cc_GFXOffset_finalize(se::State& s) +static bool js_cc_gfx_GFXOffset_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXOffset)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXOffset)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXOffset* cobj = (cc::GFXOffset*)s.nativeThisObject(); + cc::gfx::GFXOffset* cobj = (cc::gfx::GFXOffset*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXOffset_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXOffset_finalize) bool js_register_gfx_GFXOffset(se::Object* obj) { @@ -206,23 +206,23 @@ bool js_register_gfx_GFXOffset(se::Object* obj) cls->defineProperty("x", _SE(js_gfx_GFXOffset_get_x), _SE(js_gfx_GFXOffset_set_x)); cls->defineProperty("y", _SE(js_gfx_GFXOffset_get_y), _SE(js_gfx_GFXOffset_set_y)); cls->defineProperty("z", _SE(js_gfx_GFXOffset_get_z), _SE(js_gfx_GFXOffset_set_z)); - cls->defineFinalizeFunction(_SE(js_cc_GFXOffset_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXOffset_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXOffset_proto = cls->getProto(); - __jsb_cc_GFXOffset_class = cls; + __jsb_cc_gfx_GFXOffset_proto = cls->getProto(); + __jsb_cc_gfx_GFXOffset_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXRect_proto = nullptr; -se::Class* __jsb_cc_GFXRect_class = nullptr; +se::Object* __jsb_cc_gfx_GFXRect_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXRect_class = nullptr; static bool js_gfx_GFXRect_get_x(se::State& s) { - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_get_x : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -236,7 +236,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRect_get_x) static bool js_gfx_GFXRect_set_x(se::State& s) { const auto& args = s.args(); - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_set_x : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -250,7 +250,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRect_set_x) static bool js_gfx_GFXRect_get_y(se::State& s) { - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_get_y : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -264,7 +264,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRect_get_y) static bool js_gfx_GFXRect_set_y(se::State& s) { const auto& args = s.args(); - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_set_y : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -278,7 +278,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRect_set_y) static bool js_gfx_GFXRect_get_width(se::State& s) { - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_get_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -292,7 +292,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRect_get_width) static bool js_gfx_GFXRect_set_width(se::State& s) { const auto& args = s.args(); - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_set_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -306,7 +306,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRect_set_width) static bool js_gfx_GFXRect_get_height(se::State& s) { - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_get_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -320,7 +320,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRect_get_height) static bool js_gfx_GFXRect_set_height(se::State& s) { const auto& args = s.args(); - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRect_set_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -332,7 +332,7 @@ static bool js_gfx_GFXRect_set_height(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXRect_set_height) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXRect_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXRect_finalize) static bool js_gfx_GFXRect_constructor(se::State& s) { @@ -342,7 +342,7 @@ static bool js_gfx_GFXRect_constructor(se::State& s) if(argc == 0) { - cc::GFXRect* cobj = JSB_ALLOC(cc::GFXRect); + cc::gfx::GFXRect* cobj = JSB_ALLOC(cc::gfx::GFXRect); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -352,7 +352,7 @@ static bool js_gfx_GFXRect_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXRect* cobj = JSB_ALLOC(cc::GFXRect); + cc::gfx::GFXRect* cobj = JSB_ALLOC(cc::gfx::GFXRect); int arg0 = 0; json->getProperty("x", &field); if(!field.isUndefined()) { @@ -390,7 +390,7 @@ static bool js_gfx_GFXRect_constructor(se::State& s) } else if(argc == 4) { - cc::GFXRect* cobj = JSB_ALLOC(cc::GFXRect); + cc::gfx::GFXRect* cobj = JSB_ALLOC(cc::gfx::GFXRect); int arg0 = 0; if (!args[0].isUndefined()) { do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); @@ -426,24 +426,24 @@ static bool js_gfx_GFXRect_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXRect_constructor, __jsb_cc_GFXRect_class, js_cc_GFXRect_finalize) +SE_BIND_CTOR(js_gfx_GFXRect_constructor, __jsb_cc_gfx_GFXRect_class, js_cc_gfx_GFXRect_finalize) -static bool js_cc_GFXRect_finalize(se::State& s) +static bool js_cc_gfx_GFXRect_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXRect)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXRect)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXRect* cobj = (cc::GFXRect*)s.nativeThisObject(); + cc::gfx::GFXRect* cobj = (cc::gfx::GFXRect*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXRect_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXRect_finalize) bool js_register_gfx_GFXRect(se::Object* obj) { @@ -453,23 +453,23 @@ bool js_register_gfx_GFXRect(se::Object* obj) cls->defineProperty("y", _SE(js_gfx_GFXRect_get_y), _SE(js_gfx_GFXRect_set_y)); cls->defineProperty("width", _SE(js_gfx_GFXRect_get_width), _SE(js_gfx_GFXRect_set_width)); cls->defineProperty("height", _SE(js_gfx_GFXRect_get_height), _SE(js_gfx_GFXRect_set_height)); - cls->defineFinalizeFunction(_SE(js_cc_GFXRect_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXRect_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXRect_proto = cls->getProto(); - __jsb_cc_GFXRect_class = cls; + __jsb_cc_gfx_GFXRect_proto = cls->getProto(); + __jsb_cc_gfx_GFXRect_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXExtent_proto = nullptr; -se::Class* __jsb_cc_GFXExtent_class = nullptr; +se::Object* __jsb_cc_gfx_GFXExtent_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXExtent_class = nullptr; static bool js_gfx_GFXExtent_get_width(se::State& s) { - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_get_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -483,7 +483,7 @@ SE_BIND_PROP_GET(js_gfx_GFXExtent_get_width) static bool js_gfx_GFXExtent_set_width(se::State& s) { const auto& args = s.args(); - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_set_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -497,7 +497,7 @@ SE_BIND_PROP_SET(js_gfx_GFXExtent_set_width) static bool js_gfx_GFXExtent_get_height(se::State& s) { - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_get_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -511,7 +511,7 @@ SE_BIND_PROP_GET(js_gfx_GFXExtent_get_height) static bool js_gfx_GFXExtent_set_height(se::State& s) { const auto& args = s.args(); - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_set_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -525,7 +525,7 @@ SE_BIND_PROP_SET(js_gfx_GFXExtent_set_height) static bool js_gfx_GFXExtent_get_depth(se::State& s) { - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_get_depth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -539,7 +539,7 @@ SE_BIND_PROP_GET(js_gfx_GFXExtent_get_depth) static bool js_gfx_GFXExtent_set_depth(se::State& s) { const auto& args = s.args(); - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXExtent_set_depth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -551,7 +551,7 @@ static bool js_gfx_GFXExtent_set_depth(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXExtent_set_depth) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXExtent_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXExtent_finalize) static bool js_gfx_GFXExtent_constructor(se::State& s) { @@ -561,7 +561,7 @@ static bool js_gfx_GFXExtent_constructor(se::State& s) if(argc == 0) { - cc::GFXExtent* cobj = JSB_ALLOC(cc::GFXExtent); + cc::gfx::GFXExtent* cobj = JSB_ALLOC(cc::gfx::GFXExtent); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -571,7 +571,7 @@ static bool js_gfx_GFXExtent_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXExtent* cobj = JSB_ALLOC(cc::GFXExtent); + cc::gfx::GFXExtent* cobj = JSB_ALLOC(cc::gfx::GFXExtent); unsigned int arg0 = 0; json->getProperty("width", &field); if(!field.isUndefined()) { @@ -603,7 +603,7 @@ static bool js_gfx_GFXExtent_constructor(se::State& s) } else if(argc == 3) { - cc::GFXExtent* cobj = JSB_ALLOC(cc::GFXExtent); + cc::gfx::GFXExtent* cobj = JSB_ALLOC(cc::gfx::GFXExtent); unsigned int arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); @@ -634,24 +634,24 @@ static bool js_gfx_GFXExtent_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXExtent_constructor, __jsb_cc_GFXExtent_class, js_cc_GFXExtent_finalize) +SE_BIND_CTOR(js_gfx_GFXExtent_constructor, __jsb_cc_gfx_GFXExtent_class, js_cc_gfx_GFXExtent_finalize) -static bool js_cc_GFXExtent_finalize(se::State& s) +static bool js_cc_gfx_GFXExtent_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXExtent)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXExtent)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXExtent* cobj = (cc::GFXExtent*)s.nativeThisObject(); + cc::gfx::GFXExtent* cobj = (cc::gfx::GFXExtent*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXExtent_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXExtent_finalize) bool js_register_gfx_GFXExtent(se::Object* obj) { @@ -660,23 +660,23 @@ bool js_register_gfx_GFXExtent(se::Object* obj) cls->defineProperty("width", _SE(js_gfx_GFXExtent_get_width), _SE(js_gfx_GFXExtent_set_width)); cls->defineProperty("height", _SE(js_gfx_GFXExtent_get_height), _SE(js_gfx_GFXExtent_set_height)); cls->defineProperty("depth", _SE(js_gfx_GFXExtent_get_depth), _SE(js_gfx_GFXExtent_set_depth)); - cls->defineFinalizeFunction(_SE(js_cc_GFXExtent_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXExtent_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXExtent_proto = cls->getProto(); - __jsb_cc_GFXExtent_class = cls; + __jsb_cc_gfx_GFXExtent_proto = cls->getProto(); + __jsb_cc_gfx_GFXExtent_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXTextureSubres_proto = nullptr; -se::Class* __jsb_cc_GFXTextureSubres_class = nullptr; +se::Object* __jsb_cc_gfx_GFXTextureSubres_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXTextureSubres_class = nullptr; static bool js_gfx_GFXTextureSubres_get_mipLevel(se::State& s) { - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_get_mipLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -690,7 +690,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureSubres_get_mipLevel) static bool js_gfx_GFXTextureSubres_set_mipLevel(se::State& s) { const auto& args = s.args(); - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_set_mipLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -704,7 +704,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureSubres_set_mipLevel) static bool js_gfx_GFXTextureSubres_get_baseArrayLayer(se::State& s) { - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_get_baseArrayLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -718,7 +718,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureSubres_get_baseArrayLayer) static bool js_gfx_GFXTextureSubres_set_baseArrayLayer(se::State& s) { const auto& args = s.args(); - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_set_baseArrayLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -732,7 +732,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureSubres_set_baseArrayLayer) static bool js_gfx_GFXTextureSubres_get_layerCount(se::State& s) { - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_get_layerCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -746,7 +746,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureSubres_get_layerCount) static bool js_gfx_GFXTextureSubres_set_layerCount(se::State& s) { const auto& args = s.args(); - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureSubres_set_layerCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -758,7 +758,7 @@ static bool js_gfx_GFXTextureSubres_set_layerCount(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXTextureSubres_set_layerCount) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXTextureSubres_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXTextureSubres_finalize) static bool js_gfx_GFXTextureSubres_constructor(se::State& s) { @@ -768,7 +768,7 @@ static bool js_gfx_GFXTextureSubres_constructor(se::State& s) if(argc == 0) { - cc::GFXTextureSubres* cobj = JSB_ALLOC(cc::GFXTextureSubres); + cc::gfx::GFXTextureSubres* cobj = JSB_ALLOC(cc::gfx::GFXTextureSubres); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -778,7 +778,7 @@ static bool js_gfx_GFXTextureSubres_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXTextureSubres* cobj = JSB_ALLOC(cc::GFXTextureSubres); + cc::gfx::GFXTextureSubres* cobj = JSB_ALLOC(cc::gfx::GFXTextureSubres); unsigned int arg0 = 0; json->getProperty("mipLevel", &field); if(!field.isUndefined()) { @@ -810,7 +810,7 @@ static bool js_gfx_GFXTextureSubres_constructor(se::State& s) } else if(argc == 3) { - cc::GFXTextureSubres* cobj = JSB_ALLOC(cc::GFXTextureSubres); + cc::gfx::GFXTextureSubres* cobj = JSB_ALLOC(cc::gfx::GFXTextureSubres); unsigned int arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); @@ -841,24 +841,24 @@ static bool js_gfx_GFXTextureSubres_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXTextureSubres_constructor, __jsb_cc_GFXTextureSubres_class, js_cc_GFXTextureSubres_finalize) +SE_BIND_CTOR(js_gfx_GFXTextureSubres_constructor, __jsb_cc_gfx_GFXTextureSubres_class, js_cc_gfx_GFXTextureSubres_finalize) -static bool js_cc_GFXTextureSubres_finalize(se::State& s) +static bool js_cc_gfx_GFXTextureSubres_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXTextureSubres)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXTextureSubres)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXTextureSubres* cobj = (cc::GFXTextureSubres*)s.nativeThisObject(); + cc::gfx::GFXTextureSubres* cobj = (cc::gfx::GFXTextureSubres*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXTextureSubres_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXTextureSubres_finalize) bool js_register_gfx_GFXTextureSubres(se::Object* obj) { @@ -867,23 +867,23 @@ bool js_register_gfx_GFXTextureSubres(se::Object* obj) cls->defineProperty("mipLevel", _SE(js_gfx_GFXTextureSubres_get_mipLevel), _SE(js_gfx_GFXTextureSubres_set_mipLevel)); cls->defineProperty("baseArrayLayer", _SE(js_gfx_GFXTextureSubres_get_baseArrayLayer), _SE(js_gfx_GFXTextureSubres_set_baseArrayLayer)); cls->defineProperty("layerCount", _SE(js_gfx_GFXTextureSubres_get_layerCount), _SE(js_gfx_GFXTextureSubres_set_layerCount)); - cls->defineFinalizeFunction(_SE(js_cc_GFXTextureSubres_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXTextureSubres_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXTextureSubres_proto = cls->getProto(); - __jsb_cc_GFXTextureSubres_class = cls; + __jsb_cc_gfx_GFXTextureSubres_proto = cls->getProto(); + __jsb_cc_gfx_GFXTextureSubres_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXTextureCopy_proto = nullptr; -se::Class* __jsb_cc_GFXTextureCopy_class = nullptr; +se::Object* __jsb_cc_gfx_GFXTextureCopy_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXTextureCopy_class = nullptr; static bool js_gfx_GFXTextureCopy_get_srcSubres(se::State& s) { - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_get_srcSubres : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -897,11 +897,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureCopy_get_srcSubres) static bool js_gfx_GFXTextureCopy_set_srcSubres(se::State& s) { const auto& args = s.args(); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_set_srcSubres : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureSubres* arg0 = nullptr; + cc::gfx::GFXTextureSubres* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureCopy_set_srcSubres : Error processing new value"); cobj->srcSubres = *arg0; @@ -911,7 +911,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureCopy_set_srcSubres) static bool js_gfx_GFXTextureCopy_get_srcOffset(se::State& s) { - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_get_srcOffset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -925,11 +925,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureCopy_get_srcOffset) static bool js_gfx_GFXTextureCopy_set_srcOffset(se::State& s) { const auto& args = s.args(); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_set_srcOffset : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXOffset* arg0 = nullptr; + cc::gfx::GFXOffset* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureCopy_set_srcOffset : Error processing new value"); cobj->srcOffset = *arg0; @@ -939,7 +939,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureCopy_set_srcOffset) static bool js_gfx_GFXTextureCopy_get_dstSubres(se::State& s) { - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_get_dstSubres : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -953,11 +953,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureCopy_get_dstSubres) static bool js_gfx_GFXTextureCopy_set_dstSubres(se::State& s) { const auto& args = s.args(); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_set_dstSubres : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureSubres* arg0 = nullptr; + cc::gfx::GFXTextureSubres* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureCopy_set_dstSubres : Error processing new value"); cobj->dstSubres = *arg0; @@ -967,7 +967,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureCopy_set_dstSubres) static bool js_gfx_GFXTextureCopy_get_dstOffset(se::State& s) { - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_get_dstOffset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -981,11 +981,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureCopy_get_dstOffset) static bool js_gfx_GFXTextureCopy_set_dstOffset(se::State& s) { const auto& args = s.args(); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_set_dstOffset : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXOffset* arg0 = nullptr; + cc::gfx::GFXOffset* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureCopy_set_dstOffset : Error processing new value"); cobj->dstOffset = *arg0; @@ -995,7 +995,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureCopy_set_dstOffset) static bool js_gfx_GFXTextureCopy_get_extent(se::State& s) { - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_get_extent : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1009,11 +1009,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureCopy_get_extent) static bool js_gfx_GFXTextureCopy_set_extent(se::State& s) { const auto& args = s.args(); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureCopy_set_extent : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXExtent* arg0 = nullptr; + cc::gfx::GFXExtent* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureCopy_set_extent : Error processing new value"); cobj->extent = *arg0; @@ -1021,7 +1021,7 @@ static bool js_gfx_GFXTextureCopy_set_extent(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXTextureCopy_set_extent) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXTextureCopy_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXTextureCopy_finalize) static bool js_gfx_GFXTextureCopy_constructor(se::State& s) { @@ -1031,7 +1031,7 @@ static bool js_gfx_GFXTextureCopy_constructor(se::State& s) if(argc == 0) { - cc::GFXTextureCopy* cobj = JSB_ALLOC(cc::GFXTextureCopy); + cc::gfx::GFXTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXTextureCopy); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -1041,32 +1041,32 @@ static bool js_gfx_GFXTextureCopy_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXTextureCopy* cobj = JSB_ALLOC(cc::GFXTextureCopy); - cc::GFXTextureSubres* arg0 = nullptr; + cc::gfx::GFXTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXTextureCopy); + cc::gfx::GFXTextureSubres* arg0 = nullptr; json->getProperty("srcSubres", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg0); cobj->srcSubres = *arg0; } - cc::GFXOffset* arg1 = nullptr; + cc::gfx::GFXOffset* arg1 = nullptr; json->getProperty("srcOffset", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg1); cobj->srcOffset = *arg1; } - cc::GFXTextureSubres* arg2 = nullptr; + cc::gfx::GFXTextureSubres* arg2 = nullptr; json->getProperty("dstSubres", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg2); cobj->dstSubres = *arg2; } - cc::GFXOffset* arg3 = nullptr; + cc::gfx::GFXOffset* arg3 = nullptr; json->getProperty("dstOffset", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg3); cobj->dstOffset = *arg3; } - cc::GFXExtent* arg4 = nullptr; + cc::gfx::GFXExtent* arg4 = nullptr; json->getProperty("extent", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg4); @@ -1085,28 +1085,28 @@ static bool js_gfx_GFXTextureCopy_constructor(se::State& s) } else if(argc == 5) { - cc::GFXTextureCopy* cobj = JSB_ALLOC(cc::GFXTextureCopy); - cc::GFXTextureSubres* arg0 = nullptr; + cc::gfx::GFXTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXTextureCopy); + cc::gfx::GFXTextureSubres* arg0 = nullptr; if (!args[0].isUndefined()) { ok &= seval_to_reference(args[0], &arg0); cobj->srcSubres = *arg0; } - cc::GFXOffset* arg1 = nullptr; + cc::gfx::GFXOffset* arg1 = nullptr; if (!args[1].isUndefined()) { ok &= seval_to_reference(args[1], &arg1); cobj->srcOffset = *arg1; } - cc::GFXTextureSubres* arg2 = nullptr; + cc::gfx::GFXTextureSubres* arg2 = nullptr; if (!args[2].isUndefined()) { ok &= seval_to_reference(args[2], &arg2); cobj->dstSubres = *arg2; } - cc::GFXOffset* arg3 = nullptr; + cc::gfx::GFXOffset* arg3 = nullptr; if (!args[3].isUndefined()) { ok &= seval_to_reference(args[3], &arg3); cobj->dstOffset = *arg3; } - cc::GFXExtent* arg4 = nullptr; + cc::gfx::GFXExtent* arg4 = nullptr; if (!args[4].isUndefined()) { ok &= seval_to_reference(args[4], &arg4); cobj->extent = *arg4; @@ -1126,24 +1126,24 @@ static bool js_gfx_GFXTextureCopy_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXTextureCopy_constructor, __jsb_cc_GFXTextureCopy_class, js_cc_GFXTextureCopy_finalize) +SE_BIND_CTOR(js_gfx_GFXTextureCopy_constructor, __jsb_cc_gfx_GFXTextureCopy_class, js_cc_gfx_GFXTextureCopy_finalize) -static bool js_cc_GFXTextureCopy_finalize(se::State& s) +static bool js_cc_gfx_GFXTextureCopy_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXTextureCopy)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXTextureCopy)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXTextureCopy* cobj = (cc::GFXTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXTextureCopy* cobj = (cc::gfx::GFXTextureCopy*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXTextureCopy_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXTextureCopy_finalize) bool js_register_gfx_GFXTextureCopy(se::Object* obj) { @@ -1154,23 +1154,23 @@ bool js_register_gfx_GFXTextureCopy(se::Object* obj) cls->defineProperty("dstSubres", _SE(js_gfx_GFXTextureCopy_get_dstSubres), _SE(js_gfx_GFXTextureCopy_set_dstSubres)); cls->defineProperty("dstOffset", _SE(js_gfx_GFXTextureCopy_get_dstOffset), _SE(js_gfx_GFXTextureCopy_set_dstOffset)); cls->defineProperty("extent", _SE(js_gfx_GFXTextureCopy_get_extent), _SE(js_gfx_GFXTextureCopy_set_extent)); - cls->defineFinalizeFunction(_SE(js_cc_GFXTextureCopy_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXTextureCopy_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXTextureCopy_proto = cls->getProto(); - __jsb_cc_GFXTextureCopy_class = cls; + __jsb_cc_gfx_GFXTextureCopy_proto = cls->getProto(); + __jsb_cc_gfx_GFXTextureCopy_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBufferTextureCopy_proto = nullptr; -se::Class* __jsb_cc_GFXBufferTextureCopy_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBufferTextureCopy_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBufferTextureCopy_class = nullptr; static bool js_gfx_GFXBufferTextureCopy_get_buffStride(se::State& s) { - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_get_buffStride : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1184,7 +1184,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferTextureCopy_get_buffStride) static bool js_gfx_GFXBufferTextureCopy_set_buffStride(se::State& s) { const auto& args = s.args(); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_set_buffStride : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1198,7 +1198,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferTextureCopy_set_buffStride) static bool js_gfx_GFXBufferTextureCopy_get_buffTexHeight(se::State& s) { - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_get_buffTexHeight : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1212,7 +1212,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferTextureCopy_get_buffTexHeight) static bool js_gfx_GFXBufferTextureCopy_set_buffTexHeight(se::State& s) { const auto& args = s.args(); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_set_buffTexHeight : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1226,7 +1226,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferTextureCopy_set_buffTexHeight) static bool js_gfx_GFXBufferTextureCopy_get_texOffset(se::State& s) { - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_get_texOffset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1240,11 +1240,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferTextureCopy_get_texOffset) static bool js_gfx_GFXBufferTextureCopy_set_texOffset(se::State& s) { const auto& args = s.args(); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_set_texOffset : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXOffset* arg0 = nullptr; + cc::gfx::GFXOffset* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferTextureCopy_set_texOffset : Error processing new value"); cobj->texOffset = *arg0; @@ -1254,7 +1254,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferTextureCopy_set_texOffset) static bool js_gfx_GFXBufferTextureCopy_get_texExtent(se::State& s) { - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_get_texExtent : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1268,11 +1268,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferTextureCopy_get_texExtent) static bool js_gfx_GFXBufferTextureCopy_set_texExtent(se::State& s) { const auto& args = s.args(); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_set_texExtent : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXExtent* arg0 = nullptr; + cc::gfx::GFXExtent* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferTextureCopy_set_texExtent : Error processing new value"); cobj->texExtent = *arg0; @@ -1282,7 +1282,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferTextureCopy_set_texExtent) static bool js_gfx_GFXBufferTextureCopy_get_texSubres(se::State& s) { - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_get_texSubres : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1296,11 +1296,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferTextureCopy_get_texSubres) static bool js_gfx_GFXBufferTextureCopy_set_texSubres(se::State& s) { const auto& args = s.args(); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferTextureCopy_set_texSubres : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureSubres* arg0 = nullptr; + cc::gfx::GFXTextureSubres* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferTextureCopy_set_texSubres : Error processing new value"); cobj->texSubres = *arg0; @@ -1308,7 +1308,7 @@ static bool js_gfx_GFXBufferTextureCopy_set_texSubres(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXBufferTextureCopy_set_texSubres) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBufferTextureCopy_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBufferTextureCopy_finalize) static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) { @@ -1318,7 +1318,7 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) if(argc == 0) { - cc::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::GFXBufferTextureCopy); + cc::gfx::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXBufferTextureCopy); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -1328,7 +1328,7 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::GFXBufferTextureCopy); + cc::gfx::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXBufferTextureCopy); unsigned int arg0 = 0; json->getProperty("buffStride", &field); if(!field.isUndefined()) { @@ -1341,19 +1341,19 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg1); cobj->buffTexHeight = arg1; } - cc::GFXOffset* arg2 = nullptr; + cc::gfx::GFXOffset* arg2 = nullptr; json->getProperty("texOffset", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg2); cobj->texOffset = *arg2; } - cc::GFXExtent* arg3 = nullptr; + cc::gfx::GFXExtent* arg3 = nullptr; json->getProperty("texExtent", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg3); cobj->texExtent = *arg3; } - cc::GFXTextureSubres* arg4 = nullptr; + cc::gfx::GFXTextureSubres* arg4 = nullptr; json->getProperty("texSubres", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg4); @@ -1372,7 +1372,7 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) } else if(argc == 5) { - cc::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::GFXBufferTextureCopy); + cc::gfx::GFXBufferTextureCopy* cobj = JSB_ALLOC(cc::gfx::GFXBufferTextureCopy); unsigned int arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); @@ -1383,17 +1383,17 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); cobj->buffTexHeight = arg1; } - cc::GFXOffset* arg2 = nullptr; + cc::gfx::GFXOffset* arg2 = nullptr; if (!args[2].isUndefined()) { ok &= seval_to_reference(args[2], &arg2); cobj->texOffset = *arg2; } - cc::GFXExtent* arg3 = nullptr; + cc::gfx::GFXExtent* arg3 = nullptr; if (!args[3].isUndefined()) { ok &= seval_to_reference(args[3], &arg3); cobj->texExtent = *arg3; } - cc::GFXTextureSubres* arg4 = nullptr; + cc::gfx::GFXTextureSubres* arg4 = nullptr; if (!args[4].isUndefined()) { ok &= seval_to_reference(args[4], &arg4); cobj->texSubres = *arg4; @@ -1413,24 +1413,24 @@ static bool js_gfx_GFXBufferTextureCopy_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBufferTextureCopy_constructor, __jsb_cc_GFXBufferTextureCopy_class, js_cc_GFXBufferTextureCopy_finalize) +SE_BIND_CTOR(js_gfx_GFXBufferTextureCopy_constructor, __jsb_cc_gfx_GFXBufferTextureCopy_class, js_cc_gfx_GFXBufferTextureCopy_finalize) -static bool js_cc_GFXBufferTextureCopy_finalize(se::State& s) +static bool js_cc_gfx_GFXBufferTextureCopy_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBufferTextureCopy)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBufferTextureCopy)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBufferTextureCopy* cobj = (cc::GFXBufferTextureCopy*)s.nativeThisObject(); + cc::gfx::GFXBufferTextureCopy* cobj = (cc::gfx::GFXBufferTextureCopy*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBufferTextureCopy_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBufferTextureCopy_finalize) bool js_register_gfx_GFXBufferTextureCopy(se::Object* obj) { @@ -1441,23 +1441,23 @@ bool js_register_gfx_GFXBufferTextureCopy(se::Object* obj) cls->defineProperty("texOffset", _SE(js_gfx_GFXBufferTextureCopy_get_texOffset), _SE(js_gfx_GFXBufferTextureCopy_set_texOffset)); cls->defineProperty("texExtent", _SE(js_gfx_GFXBufferTextureCopy_get_texExtent), _SE(js_gfx_GFXBufferTextureCopy_set_texExtent)); cls->defineProperty("texSubres", _SE(js_gfx_GFXBufferTextureCopy_get_texSubres), _SE(js_gfx_GFXBufferTextureCopy_set_texSubres)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBufferTextureCopy_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBufferTextureCopy_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBufferTextureCopy_proto = cls->getProto(); - __jsb_cc_GFXBufferTextureCopy_class = cls; + __jsb_cc_gfx_GFXBufferTextureCopy_proto = cls->getProto(); + __jsb_cc_gfx_GFXBufferTextureCopy_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXViewport_proto = nullptr; -se::Class* __jsb_cc_GFXViewport_class = nullptr; +se::Object* __jsb_cc_gfx_GFXViewport_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXViewport_class = nullptr; static bool js_gfx_GFXViewport_get_left(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_left : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1471,7 +1471,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_left) static bool js_gfx_GFXViewport_set_left(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_left : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1485,7 +1485,7 @@ SE_BIND_PROP_SET(js_gfx_GFXViewport_set_left) static bool js_gfx_GFXViewport_get_top(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_top : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1499,7 +1499,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_top) static bool js_gfx_GFXViewport_set_top(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_top : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1513,7 +1513,7 @@ SE_BIND_PROP_SET(js_gfx_GFXViewport_set_top) static bool js_gfx_GFXViewport_get_width(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1527,7 +1527,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_width) static bool js_gfx_GFXViewport_set_width(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1541,7 +1541,7 @@ SE_BIND_PROP_SET(js_gfx_GFXViewport_set_width) static bool js_gfx_GFXViewport_get_height(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1555,7 +1555,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_height) static bool js_gfx_GFXViewport_set_height(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1569,7 +1569,7 @@ SE_BIND_PROP_SET(js_gfx_GFXViewport_set_height) static bool js_gfx_GFXViewport_get_minDepth(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_minDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1583,7 +1583,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_minDepth) static bool js_gfx_GFXViewport_set_minDepth(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_minDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1597,7 +1597,7 @@ SE_BIND_PROP_SET(js_gfx_GFXViewport_set_minDepth) static bool js_gfx_GFXViewport_get_maxDepth(se::State& s) { - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_get_maxDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1611,7 +1611,7 @@ SE_BIND_PROP_GET(js_gfx_GFXViewport_get_maxDepth) static bool js_gfx_GFXViewport_set_maxDepth(se::State& s) { const auto& args = s.args(); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXViewport_set_maxDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1623,7 +1623,7 @@ static bool js_gfx_GFXViewport_set_maxDepth(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXViewport_set_maxDepth) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXViewport_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXViewport_finalize) static bool js_gfx_GFXViewport_constructor(se::State& s) { @@ -1633,7 +1633,7 @@ static bool js_gfx_GFXViewport_constructor(se::State& s) if(argc == 0) { - cc::GFXViewport* cobj = JSB_ALLOC(cc::GFXViewport); + cc::gfx::GFXViewport* cobj = JSB_ALLOC(cc::gfx::GFXViewport); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -1643,7 +1643,7 @@ static bool js_gfx_GFXViewport_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXViewport* cobj = JSB_ALLOC(cc::GFXViewport); + cc::gfx::GFXViewport* cobj = JSB_ALLOC(cc::gfx::GFXViewport); int arg0 = 0; json->getProperty("left", &field); if(!field.isUndefined()) { @@ -1693,7 +1693,7 @@ static bool js_gfx_GFXViewport_constructor(se::State& s) } else if(argc == 6) { - cc::GFXViewport* cobj = JSB_ALLOC(cc::GFXViewport); + cc::gfx::GFXViewport* cobj = JSB_ALLOC(cc::gfx::GFXViewport); int arg0 = 0; if (!args[0].isUndefined()) { do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); @@ -1739,24 +1739,24 @@ static bool js_gfx_GFXViewport_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXViewport_constructor, __jsb_cc_GFXViewport_class, js_cc_GFXViewport_finalize) +SE_BIND_CTOR(js_gfx_GFXViewport_constructor, __jsb_cc_gfx_GFXViewport_class, js_cc_gfx_GFXViewport_finalize) -static bool js_cc_GFXViewport_finalize(se::State& s) +static bool js_cc_gfx_GFXViewport_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXViewport)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXViewport)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXViewport* cobj = (cc::GFXViewport*)s.nativeThisObject(); + cc::gfx::GFXViewport* cobj = (cc::gfx::GFXViewport*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXViewport_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXViewport_finalize) bool js_register_gfx_GFXViewport(se::Object* obj) { @@ -1768,23 +1768,23 @@ bool js_register_gfx_GFXViewport(se::Object* obj) cls->defineProperty("height", _SE(js_gfx_GFXViewport_get_height), _SE(js_gfx_GFXViewport_set_height)); cls->defineProperty("minDepth", _SE(js_gfx_GFXViewport_get_minDepth), _SE(js_gfx_GFXViewport_set_minDepth)); cls->defineProperty("maxDepth", _SE(js_gfx_GFXViewport_get_maxDepth), _SE(js_gfx_GFXViewport_set_maxDepth)); - cls->defineFinalizeFunction(_SE(js_cc_GFXViewport_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXViewport_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXViewport_proto = cls->getProto(); - __jsb_cc_GFXViewport_class = cls; + __jsb_cc_gfx_GFXViewport_proto = cls->getProto(); + __jsb_cc_gfx_GFXViewport_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXColor_proto = nullptr; -se::Class* __jsb_cc_GFXColor_class = nullptr; +se::Object* __jsb_cc_gfx_GFXColor_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXColor_class = nullptr; static bool js_gfx_GFXColor_get_r(se::State& s) { - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_get_r : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1798,7 +1798,7 @@ SE_BIND_PROP_GET(js_gfx_GFXColor_get_r) static bool js_gfx_GFXColor_set_r(se::State& s) { const auto& args = s.args(); - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_set_r : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1812,7 +1812,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColor_set_r) static bool js_gfx_GFXColor_get_g(se::State& s) { - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_get_g : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1826,7 +1826,7 @@ SE_BIND_PROP_GET(js_gfx_GFXColor_get_g) static bool js_gfx_GFXColor_set_g(se::State& s) { const auto& args = s.args(); - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_set_g : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1840,7 +1840,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColor_set_g) static bool js_gfx_GFXColor_get_b(se::State& s) { - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_get_b : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1854,7 +1854,7 @@ SE_BIND_PROP_GET(js_gfx_GFXColor_get_b) static bool js_gfx_GFXColor_set_b(se::State& s) { const auto& args = s.args(); - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_set_b : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1868,7 +1868,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColor_set_b) static bool js_gfx_GFXColor_get_a(se::State& s) { - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_get_a : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1882,7 +1882,7 @@ SE_BIND_PROP_GET(js_gfx_GFXColor_get_a) static bool js_gfx_GFXColor_set_a(se::State& s) { const auto& args = s.args(); - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColor_set_a : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -1894,7 +1894,7 @@ static bool js_gfx_GFXColor_set_a(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXColor_set_a) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXColor_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXColor_finalize) static bool js_gfx_GFXColor_constructor(se::State& s) { @@ -1904,7 +1904,7 @@ static bool js_gfx_GFXColor_constructor(se::State& s) if(argc == 0) { - cc::GFXColor* cobj = JSB_ALLOC(cc::GFXColor); + cc::gfx::GFXColor* cobj = JSB_ALLOC(cc::gfx::GFXColor); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -1914,7 +1914,7 @@ static bool js_gfx_GFXColor_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXColor* cobj = JSB_ALLOC(cc::GFXColor); + cc::gfx::GFXColor* cobj = JSB_ALLOC(cc::gfx::GFXColor); float arg0 = 0; json->getProperty("r", &field); if(!field.isUndefined()) { @@ -1952,7 +1952,7 @@ static bool js_gfx_GFXColor_constructor(se::State& s) } else if(argc == 4) { - cc::GFXColor* cobj = JSB_ALLOC(cc::GFXColor); + cc::gfx::GFXColor* cobj = JSB_ALLOC(cc::gfx::GFXColor); float arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_float(args[0], &arg0); @@ -1988,24 +1988,24 @@ static bool js_gfx_GFXColor_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXColor_constructor, __jsb_cc_GFXColor_class, js_cc_GFXColor_finalize) +SE_BIND_CTOR(js_gfx_GFXColor_constructor, __jsb_cc_gfx_GFXColor_class, js_cc_gfx_GFXColor_finalize) -static bool js_cc_GFXColor_finalize(se::State& s) +static bool js_cc_gfx_GFXColor_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXColor)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXColor)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXColor* cobj = (cc::GFXColor*)s.nativeThisObject(); + cc::gfx::GFXColor* cobj = (cc::gfx::GFXColor*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXColor_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXColor_finalize) bool js_register_gfx_GFXColor(se::Object* obj) { @@ -2015,23 +2015,23 @@ bool js_register_gfx_GFXColor(se::Object* obj) cls->defineProperty("g", _SE(js_gfx_GFXColor_get_g), _SE(js_gfx_GFXColor_set_g)); cls->defineProperty("b", _SE(js_gfx_GFXColor_get_b), _SE(js_gfx_GFXColor_set_b)); cls->defineProperty("a", _SE(js_gfx_GFXColor_get_a), _SE(js_gfx_GFXColor_set_a)); - cls->defineFinalizeFunction(_SE(js_cc_GFXColor_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXColor_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXColor_proto = cls->getProto(); - __jsb_cc_GFXColor_class = cls; + __jsb_cc_gfx_GFXColor_proto = cls->getProto(); + __jsb_cc_gfx_GFXColor_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXDeviceInfo_proto = nullptr; -se::Class* __jsb_cc_GFXDeviceInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXDeviceInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXDeviceInfo_class = nullptr; static bool js_gfx_GFXDeviceInfo_get_windowHandle(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_windowHandle : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2045,7 +2045,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_windowHandle) static bool js_gfx_GFXDeviceInfo_set_windowHandle(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_windowHandle : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2059,7 +2059,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_windowHandle) static bool js_gfx_GFXDeviceInfo_get_width(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2073,7 +2073,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_width) static bool js_gfx_GFXDeviceInfo_set_width(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2087,7 +2087,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_width) static bool js_gfx_GFXDeviceInfo_get_height(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2101,7 +2101,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_height) static bool js_gfx_GFXDeviceInfo_set_height(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2115,7 +2115,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_height) static bool js_gfx_GFXDeviceInfo_get_nativeWidth(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_nativeWidth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2129,7 +2129,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_nativeWidth) static bool js_gfx_GFXDeviceInfo_set_nativeWidth(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_nativeWidth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2143,7 +2143,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_nativeWidth) static bool js_gfx_GFXDeviceInfo_get_nativeHeight(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_nativeHeight : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2157,7 +2157,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_nativeHeight) static bool js_gfx_GFXDeviceInfo_set_nativeHeight(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_nativeHeight : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2171,7 +2171,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_nativeHeight) static bool js_gfx_GFXDeviceInfo_get_sharedCtx(se::State& s) { - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_get_sharedCtx : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2185,11 +2185,11 @@ SE_BIND_PROP_GET(js_gfx_GFXDeviceInfo_get_sharedCtx) static bool js_gfx_GFXDeviceInfo_set_sharedCtx(se::State& s) { const auto& args = s.args(); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDeviceInfo_set_sharedCtx : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXContext* arg0 = nullptr; + cc::gfx::GFXContext* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDeviceInfo_set_sharedCtx : Error processing new value"); cobj->sharedCtx = arg0; @@ -2197,7 +2197,7 @@ static bool js_gfx_GFXDeviceInfo_set_sharedCtx(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXDeviceInfo_set_sharedCtx) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXDeviceInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXDeviceInfo_finalize) static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) { @@ -2207,7 +2207,7 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXDeviceInfo* cobj = JSB_ALLOC(cc::GFXDeviceInfo); + cc::gfx::GFXDeviceInfo* cobj = JSB_ALLOC(cc::gfx::GFXDeviceInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -2217,7 +2217,7 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXDeviceInfo* cobj = JSB_ALLOC(cc::GFXDeviceInfo); + cc::gfx::GFXDeviceInfo* cobj = JSB_ALLOC(cc::gfx::GFXDeviceInfo); uintptr_t arg0 = 0; json->getProperty("windowHandle", &field); if(!field.isUndefined()) { @@ -2248,7 +2248,7 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg4); cobj->nativeHeight = arg4; } - cc::GFXContext* arg5 = nullptr; + cc::gfx::GFXContext* arg5 = nullptr; json->getProperty("sharedCtx", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg5); @@ -2267,7 +2267,7 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) } else if(argc == 6) { - cc::GFXDeviceInfo* cobj = JSB_ALLOC(cc::GFXDeviceInfo); + cc::gfx::GFXDeviceInfo* cobj = JSB_ALLOC(cc::gfx::GFXDeviceInfo); uintptr_t arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uintptr_t(args[0], &arg0); @@ -2293,7 +2293,7 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) ok &= seval_to_uint32(args[4], (uint32_t*)&arg4); cobj->nativeHeight = arg4; } - cc::GFXContext* arg5 = nullptr; + cc::gfx::GFXContext* arg5 = nullptr; if (!args[5].isUndefined()) { ok &= seval_to_native_ptr(args[5], &arg5); cobj->sharedCtx = arg5; @@ -2313,24 +2313,24 @@ static bool js_gfx_GFXDeviceInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXDeviceInfo_constructor, __jsb_cc_GFXDeviceInfo_class, js_cc_GFXDeviceInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXDeviceInfo_constructor, __jsb_cc_gfx_GFXDeviceInfo_class, js_cc_gfx_GFXDeviceInfo_finalize) -static bool js_cc_GFXDeviceInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXDeviceInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXDeviceInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXDeviceInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXDeviceInfo* cobj = (cc::GFXDeviceInfo*)s.nativeThisObject(); + cc::gfx::GFXDeviceInfo* cobj = (cc::gfx::GFXDeviceInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXDeviceInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXDeviceInfo_finalize) bool js_register_gfx_GFXDeviceInfo(se::Object* obj) { @@ -2342,23 +2342,23 @@ bool js_register_gfx_GFXDeviceInfo(se::Object* obj) cls->defineProperty("nativeWidth", _SE(js_gfx_GFXDeviceInfo_get_nativeWidth), _SE(js_gfx_GFXDeviceInfo_set_nativeWidth)); cls->defineProperty("nativeHeight", _SE(js_gfx_GFXDeviceInfo_get_nativeHeight), _SE(js_gfx_GFXDeviceInfo_set_nativeHeight)); cls->defineProperty("sharedCtx", _SE(js_gfx_GFXDeviceInfo_get_sharedCtx), _SE(js_gfx_GFXDeviceInfo_set_sharedCtx)); - cls->defineFinalizeFunction(_SE(js_cc_GFXDeviceInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXDeviceInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXDeviceInfo_proto = cls->getProto(); - __jsb_cc_GFXDeviceInfo_class = cls; + __jsb_cc_gfx_GFXDeviceInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXDeviceInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXContextInfo_proto = nullptr; -se::Class* __jsb_cc_GFXContextInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXContextInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXContextInfo_class = nullptr; static bool js_gfx_GFXContextInfo_get_windowHandle(se::State& s) { - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_get_windowHandle : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2372,7 +2372,7 @@ SE_BIND_PROP_GET(js_gfx_GFXContextInfo_get_windowHandle) static bool js_gfx_GFXContextInfo_set_windowHandle(se::State& s) { const auto& args = s.args(); - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_set_windowHandle : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2386,7 +2386,7 @@ SE_BIND_PROP_SET(js_gfx_GFXContextInfo_set_windowHandle) static bool js_gfx_GFXContextInfo_get_sharedCtx(se::State& s) { - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_get_sharedCtx : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2400,11 +2400,11 @@ SE_BIND_PROP_GET(js_gfx_GFXContextInfo_get_sharedCtx) static bool js_gfx_GFXContextInfo_set_sharedCtx(se::State& s) { const auto& args = s.args(); - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_set_sharedCtx : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXContext* arg0 = nullptr; + cc::gfx::GFXContext* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXContextInfo_set_sharedCtx : Error processing new value"); cobj->sharedCtx = arg0; @@ -2414,7 +2414,7 @@ SE_BIND_PROP_SET(js_gfx_GFXContextInfo_set_sharedCtx) static bool js_gfx_GFXContextInfo_get_vsyncMode(se::State& s) { - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_get_vsyncMode : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2428,19 +2428,19 @@ SE_BIND_PROP_GET(js_gfx_GFXContextInfo_get_vsyncMode) static bool js_gfx_GFXContextInfo_set_vsyncMode(se::State& s) { const auto& args = s.args(); - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXContextInfo_set_vsyncMode : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXVsyncMode arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXVsyncMode)tmp; } while(false); + cc::gfx::GFXVsyncMode arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXVsyncMode)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXContextInfo_set_vsyncMode : Error processing new value"); cobj->vsyncMode = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXContextInfo_set_vsyncMode) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXContextInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXContextInfo_finalize) static bool js_gfx_GFXContextInfo_constructor(se::State& s) { @@ -2450,7 +2450,7 @@ static bool js_gfx_GFXContextInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXContextInfo* cobj = JSB_ALLOC(cc::GFXContextInfo); + cc::gfx::GFXContextInfo* cobj = JSB_ALLOC(cc::gfx::GFXContextInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -2460,23 +2460,23 @@ static bool js_gfx_GFXContextInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXContextInfo* cobj = JSB_ALLOC(cc::GFXContextInfo); + cc::gfx::GFXContextInfo* cobj = JSB_ALLOC(cc::gfx::GFXContextInfo); uintptr_t arg0 = 0; json->getProperty("windowHandle", &field); if(!field.isUndefined()) { ok &= seval_to_uintptr_t(field, &arg0); cobj->windowHandle = arg0; } - cc::GFXContext* arg1 = nullptr; + cc::gfx::GFXContext* arg1 = nullptr; json->getProperty("sharedCtx", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg1); cobj->sharedCtx = arg1; } - cc::GFXVsyncMode arg2; + cc::gfx::GFXVsyncMode arg2; json->getProperty("vsyncMode", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXVsyncMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXVsyncMode)tmp; } while(false); cobj->vsyncMode = arg2; } @@ -2492,20 +2492,20 @@ static bool js_gfx_GFXContextInfo_constructor(se::State& s) } else if(argc == 3) { - cc::GFXContextInfo* cobj = JSB_ALLOC(cc::GFXContextInfo); + cc::gfx::GFXContextInfo* cobj = JSB_ALLOC(cc::gfx::GFXContextInfo); uintptr_t arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uintptr_t(args[0], &arg0); cobj->windowHandle = arg0; } - cc::GFXContext* arg1 = nullptr; + cc::gfx::GFXContext* arg1 = nullptr; if (!args[1].isUndefined()) { ok &= seval_to_native_ptr(args[1], &arg1); cobj->sharedCtx = arg1; } - cc::GFXVsyncMode arg2; + cc::gfx::GFXVsyncMode arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXVsyncMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXVsyncMode)tmp; } while(false); cobj->vsyncMode = arg2; } @@ -2523,24 +2523,24 @@ static bool js_gfx_GFXContextInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXContextInfo_constructor, __jsb_cc_GFXContextInfo_class, js_cc_GFXContextInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXContextInfo_constructor, __jsb_cc_gfx_GFXContextInfo_class, js_cc_gfx_GFXContextInfo_finalize) -static bool js_cc_GFXContextInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXContextInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXContextInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXContextInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXContextInfo* cobj = (cc::GFXContextInfo*)s.nativeThisObject(); + cc::gfx::GFXContextInfo* cobj = (cc::gfx::GFXContextInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXContextInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXContextInfo_finalize) bool js_register_gfx_GFXContextInfo(se::Object* obj) { @@ -2549,23 +2549,23 @@ bool js_register_gfx_GFXContextInfo(se::Object* obj) cls->defineProperty("windowHandle", _SE(js_gfx_GFXContextInfo_get_windowHandle), _SE(js_gfx_GFXContextInfo_set_windowHandle)); cls->defineProperty("sharedCtx", _SE(js_gfx_GFXContextInfo_get_sharedCtx), _SE(js_gfx_GFXContextInfo_set_sharedCtx)); cls->defineProperty("vsyncMode", _SE(js_gfx_GFXContextInfo_get_vsyncMode), _SE(js_gfx_GFXContextInfo_set_vsyncMode)); - cls->defineFinalizeFunction(_SE(js_cc_GFXContextInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXContextInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXContextInfo_proto = cls->getProto(); - __jsb_cc_GFXContextInfo_class = cls; + __jsb_cc_gfx_GFXContextInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXContextInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBufferInfo_proto = nullptr; -se::Class* __jsb_cc_GFXBufferInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBufferInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBufferInfo_class = nullptr; static bool js_gfx_GFXBufferInfo_get_usage(se::State& s) { - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_get_usage : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2579,12 +2579,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferInfo_get_usage) static bool js_gfx_GFXBufferInfo_set_usage(se::State& s) { const auto& args = s.args(); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_set_usage : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBufferUsageBit arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBufferUsageBit)tmp; } while(false); + cc::gfx::GFXBufferUsageBit arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBufferUsageBit)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferInfo_set_usage : Error processing new value"); cobj->usage = arg0; return true; @@ -2593,7 +2593,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferInfo_set_usage) static bool js_gfx_GFXBufferInfo_get_memUsage(se::State& s) { - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_get_memUsage : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2607,12 +2607,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferInfo_get_memUsage) static bool js_gfx_GFXBufferInfo_set_memUsage(se::State& s) { const auto& args = s.args(); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_set_memUsage : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXMemoryUsageBit arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXMemoryUsageBit)tmp; } while(false); + cc::gfx::GFXMemoryUsageBit arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXMemoryUsageBit)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferInfo_set_memUsage : Error processing new value"); cobj->memUsage = arg0; return true; @@ -2621,7 +2621,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferInfo_set_memUsage) static bool js_gfx_GFXBufferInfo_get_stride(se::State& s) { - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_get_stride : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2635,7 +2635,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferInfo_get_stride) static bool js_gfx_GFXBufferInfo_set_stride(se::State& s) { const auto& args = s.args(); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_set_stride : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2649,7 +2649,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferInfo_set_stride) static bool js_gfx_GFXBufferInfo_get_size(se::State& s) { - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_get_size : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2663,7 +2663,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferInfo_get_size) static bool js_gfx_GFXBufferInfo_set_size(se::State& s) { const auto& args = s.args(); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_set_size : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2677,7 +2677,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBufferInfo_set_size) static bool js_gfx_GFXBufferInfo_get_flags(se::State& s) { - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_get_flags : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2691,19 +2691,19 @@ SE_BIND_PROP_GET(js_gfx_GFXBufferInfo_get_flags) static bool js_gfx_GFXBufferInfo_set_flags(se::State& s) { const auto& args = s.args(); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBufferInfo_set_flags : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBufferFlagBit arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBufferFlagBit)tmp; } while(false); + cc::gfx::GFXBufferFlagBit arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBufferFlagBit)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBufferInfo_set_flags : Error processing new value"); cobj->flags = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXBufferInfo_set_flags) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBufferInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBufferInfo_finalize) static bool js_gfx_GFXBufferInfo_constructor(se::State& s) { @@ -2713,7 +2713,7 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXBufferInfo* cobj = JSB_ALLOC(cc::GFXBufferInfo); + cc::gfx::GFXBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXBufferInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -2723,17 +2723,17 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBufferInfo* cobj = JSB_ALLOC(cc::GFXBufferInfo); - cc::GFXBufferUsageBit arg0; + cc::gfx::GFXBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXBufferInfo); + cc::gfx::GFXBufferUsageBit arg0; json->getProperty("usage", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXBufferUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXBufferUsageBit)tmp; } while(false); cobj->usage = arg0; } - cc::GFXMemoryUsageBit arg1; + cc::gfx::GFXMemoryUsageBit arg1; json->getProperty("memUsage", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXMemoryUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXMemoryUsageBit)tmp; } while(false); cobj->memUsage = arg1; } unsigned int arg2 = 0; @@ -2748,10 +2748,10 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg3); cobj->size = arg3; } - cc::GFXBufferFlagBit arg4; + cc::gfx::GFXBufferFlagBit arg4; json->getProperty("flags", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXBufferFlagBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXBufferFlagBit)tmp; } while(false); cobj->flags = arg4; } @@ -2767,15 +2767,15 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) } else if(argc == 5) { - cc::GFXBufferInfo* cobj = JSB_ALLOC(cc::GFXBufferInfo); - cc::GFXBufferUsageBit arg0; + cc::gfx::GFXBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXBufferInfo); + cc::gfx::GFXBufferUsageBit arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBufferUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBufferUsageBit)tmp; } while(false); cobj->usage = arg0; } - cc::GFXMemoryUsageBit arg1; + cc::gfx::GFXMemoryUsageBit arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXMemoryUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXMemoryUsageBit)tmp; } while(false); cobj->memUsage = arg1; } unsigned int arg2 = 0; @@ -2788,9 +2788,9 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) ok &= seval_to_uint32(args[3], (uint32_t*)&arg3); cobj->size = arg3; } - cc::GFXBufferFlagBit arg4; + cc::gfx::GFXBufferFlagBit arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXBufferFlagBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXBufferFlagBit)tmp; } while(false); cobj->flags = arg4; } @@ -2808,24 +2808,24 @@ static bool js_gfx_GFXBufferInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBufferInfo_constructor, __jsb_cc_GFXBufferInfo_class, js_cc_GFXBufferInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXBufferInfo_constructor, __jsb_cc_gfx_GFXBufferInfo_class, js_cc_gfx_GFXBufferInfo_finalize) -static bool js_cc_GFXBufferInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXBufferInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBufferInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBufferInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBufferInfo* cobj = (cc::GFXBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXBufferInfo* cobj = (cc::gfx::GFXBufferInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBufferInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBufferInfo_finalize) bool js_register_gfx_GFXBufferInfo(se::Object* obj) { @@ -2836,23 +2836,23 @@ bool js_register_gfx_GFXBufferInfo(se::Object* obj) cls->defineProperty("stride", _SE(js_gfx_GFXBufferInfo_get_stride), _SE(js_gfx_GFXBufferInfo_set_stride)); cls->defineProperty("size", _SE(js_gfx_GFXBufferInfo_get_size), _SE(js_gfx_GFXBufferInfo_set_size)); cls->defineProperty("flags", _SE(js_gfx_GFXBufferInfo_get_flags), _SE(js_gfx_GFXBufferInfo_set_flags)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBufferInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBufferInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBufferInfo_proto = cls->getProto(); - __jsb_cc_GFXBufferInfo_class = cls; + __jsb_cc_gfx_GFXBufferInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXBufferInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXDrawInfo_proto = nullptr; -se::Class* __jsb_cc_GFXDrawInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXDrawInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXDrawInfo_class = nullptr; static bool js_gfx_GFXDrawInfo_get_vertexCount(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_vertexCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2866,7 +2866,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_vertexCount) static bool js_gfx_GFXDrawInfo_set_vertexCount(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_vertexCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2880,7 +2880,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_vertexCount) static bool js_gfx_GFXDrawInfo_get_firstVertex(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_firstVertex : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2894,7 +2894,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_firstVertex) static bool js_gfx_GFXDrawInfo_set_firstVertex(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_firstVertex : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2908,7 +2908,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_firstVertex) static bool js_gfx_GFXDrawInfo_get_indexCount(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_indexCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2922,7 +2922,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_indexCount) static bool js_gfx_GFXDrawInfo_set_indexCount(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_indexCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2936,7 +2936,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_indexCount) static bool js_gfx_GFXDrawInfo_get_firstIndex(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_firstIndex : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2950,7 +2950,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_firstIndex) static bool js_gfx_GFXDrawInfo_set_firstIndex(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_firstIndex : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2964,7 +2964,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_firstIndex) static bool js_gfx_GFXDrawInfo_get_vertexOffset(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_vertexOffset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2978,7 +2978,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_vertexOffset) static bool js_gfx_GFXDrawInfo_set_vertexOffset(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_vertexOffset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -2992,7 +2992,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_vertexOffset) static bool js_gfx_GFXDrawInfo_get_instanceCount(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_instanceCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3006,7 +3006,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_instanceCount) static bool js_gfx_GFXDrawInfo_set_instanceCount(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_instanceCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3020,7 +3020,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_instanceCount) static bool js_gfx_GFXDrawInfo_get_firstInstance(se::State& s) { - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_get_firstInstance : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3034,7 +3034,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDrawInfo_get_firstInstance) static bool js_gfx_GFXDrawInfo_set_firstInstance(se::State& s) { const auto& args = s.args(); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDrawInfo_set_firstInstance : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3046,7 +3046,7 @@ static bool js_gfx_GFXDrawInfo_set_firstInstance(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXDrawInfo_set_firstInstance) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXDrawInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXDrawInfo_finalize) static bool js_gfx_GFXDrawInfo_constructor(se::State& s) { @@ -3056,7 +3056,7 @@ static bool js_gfx_GFXDrawInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXDrawInfo* cobj = JSB_ALLOC(cc::GFXDrawInfo); + cc::gfx::GFXDrawInfo* cobj = JSB_ALLOC(cc::gfx::GFXDrawInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -3066,7 +3066,7 @@ static bool js_gfx_GFXDrawInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXDrawInfo* cobj = JSB_ALLOC(cc::GFXDrawInfo); + cc::gfx::GFXDrawInfo* cobj = JSB_ALLOC(cc::gfx::GFXDrawInfo); unsigned int arg0 = 0; json->getProperty("vertexCount", &field); if(!field.isUndefined()) { @@ -3122,7 +3122,7 @@ static bool js_gfx_GFXDrawInfo_constructor(se::State& s) } else if(argc == 7) { - cc::GFXDrawInfo* cobj = JSB_ALLOC(cc::GFXDrawInfo); + cc::gfx::GFXDrawInfo* cobj = JSB_ALLOC(cc::gfx::GFXDrawInfo); unsigned int arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); @@ -3173,24 +3173,24 @@ static bool js_gfx_GFXDrawInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXDrawInfo_constructor, __jsb_cc_GFXDrawInfo_class, js_cc_GFXDrawInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXDrawInfo_constructor, __jsb_cc_gfx_GFXDrawInfo_class, js_cc_gfx_GFXDrawInfo_finalize) -static bool js_cc_GFXDrawInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXDrawInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXDrawInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXDrawInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXDrawInfo* cobj = (cc::GFXDrawInfo*)s.nativeThisObject(); + cc::gfx::GFXDrawInfo* cobj = (cc::gfx::GFXDrawInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXDrawInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXDrawInfo_finalize) bool js_register_gfx_GFXDrawInfo(se::Object* obj) { @@ -3203,23 +3203,23 @@ bool js_register_gfx_GFXDrawInfo(se::Object* obj) cls->defineProperty("vertexOffset", _SE(js_gfx_GFXDrawInfo_get_vertexOffset), _SE(js_gfx_GFXDrawInfo_set_vertexOffset)); cls->defineProperty("instanceCount", _SE(js_gfx_GFXDrawInfo_get_instanceCount), _SE(js_gfx_GFXDrawInfo_set_instanceCount)); cls->defineProperty("firstInstance", _SE(js_gfx_GFXDrawInfo_get_firstInstance), _SE(js_gfx_GFXDrawInfo_set_firstInstance)); - cls->defineFinalizeFunction(_SE(js_cc_GFXDrawInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXDrawInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXDrawInfo_proto = cls->getProto(); - __jsb_cc_GFXDrawInfo_class = cls; + __jsb_cc_gfx_GFXDrawInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXDrawInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXIndirectBuffer_proto = nullptr; -se::Class* __jsb_cc_GFXIndirectBuffer_class = nullptr; +se::Object* __jsb_cc_gfx_GFXIndirectBuffer_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXIndirectBuffer_class = nullptr; static bool js_gfx_GFXIndirectBuffer_get_drawInfos(se::State& s) { - cc::GFXIndirectBuffer* cobj = (cc::GFXIndirectBuffer*)s.nativeThisObject(); + cc::gfx::GFXIndirectBuffer* cobj = (cc::gfx::GFXIndirectBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXIndirectBuffer_get_drawInfos : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3233,11 +3233,11 @@ SE_BIND_PROP_GET(js_gfx_GFXIndirectBuffer_get_drawInfos) static bool js_gfx_GFXIndirectBuffer_set_drawInfos(se::State& s) { const auto& args = s.args(); - cc::GFXIndirectBuffer* cobj = (cc::GFXIndirectBuffer*)s.nativeThisObject(); + cc::gfx::GFXIndirectBuffer* cobj = (cc::gfx::GFXIndirectBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXIndirectBuffer_set_drawInfos : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXIndirectBuffer_set_drawInfos : Error processing new value"); cobj->drawInfos = arg0; @@ -3245,7 +3245,7 @@ static bool js_gfx_GFXIndirectBuffer_set_drawInfos(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXIndirectBuffer_set_drawInfos) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXIndirectBuffer_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXIndirectBuffer_finalize) static bool js_gfx_GFXIndirectBuffer_constructor(se::State& s) { @@ -3255,15 +3255,15 @@ static bool js_gfx_GFXIndirectBuffer_constructor(se::State& s) if(argc == 0) { - cc::GFXIndirectBuffer* cobj = JSB_ALLOC(cc::GFXIndirectBuffer); + cc::gfx::GFXIndirectBuffer* cobj = JSB_ALLOC(cc::gfx::GFXIndirectBuffer); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } else if(argc == 1) { - cc::GFXIndirectBuffer* cobj = JSB_ALLOC(cc::GFXIndirectBuffer); - std::vector arg0; + cc::gfx::GFXIndirectBuffer* cobj = JSB_ALLOC(cc::gfx::GFXIndirectBuffer); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->drawInfos = arg0; @@ -3283,47 +3283,47 @@ static bool js_gfx_GFXIndirectBuffer_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXIndirectBuffer_constructor, __jsb_cc_GFXIndirectBuffer_class, js_cc_GFXIndirectBuffer_finalize) +SE_BIND_CTOR(js_gfx_GFXIndirectBuffer_constructor, __jsb_cc_gfx_GFXIndirectBuffer_class, js_cc_gfx_GFXIndirectBuffer_finalize) -static bool js_cc_GFXIndirectBuffer_finalize(se::State& s) +static bool js_cc_gfx_GFXIndirectBuffer_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXIndirectBuffer)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXIndirectBuffer)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXIndirectBuffer* cobj = (cc::GFXIndirectBuffer*)s.nativeThisObject(); + cc::gfx::GFXIndirectBuffer* cobj = (cc::gfx::GFXIndirectBuffer*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXIndirectBuffer_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXIndirectBuffer_finalize) bool js_register_gfx_GFXIndirectBuffer(se::Object* obj) { auto cls = se::Class::create("GFXIndirectBuffer", obj, nullptr, _SE(js_gfx_GFXIndirectBuffer_constructor)); cls->defineProperty("drawInfos", _SE(js_gfx_GFXIndirectBuffer_get_drawInfos), _SE(js_gfx_GFXIndirectBuffer_set_drawInfos)); - cls->defineFinalizeFunction(_SE(js_cc_GFXIndirectBuffer_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXIndirectBuffer_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXIndirectBuffer_proto = cls->getProto(); - __jsb_cc_GFXIndirectBuffer_class = cls; + __jsb_cc_gfx_GFXIndirectBuffer_proto = cls->getProto(); + __jsb_cc_gfx_GFXIndirectBuffer_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXTextureInfo_proto = nullptr; -se::Class* __jsb_cc_GFXTextureInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXTextureInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXTextureInfo_class = nullptr; static bool js_gfx_GFXTextureInfo_get_type(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3337,12 +3337,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_type) static bool js_gfx_GFXTextureInfo_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureType)tmp; } while(false); + cc::gfx::GFXTextureType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureInfo_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -3351,7 +3351,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_type) static bool js_gfx_GFXTextureInfo_get_usage(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_usage : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3365,12 +3365,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_usage) static bool js_gfx_GFXTextureInfo_set_usage(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_usage : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureUsageBit arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureUsageBit)tmp; } while(false); + cc::gfx::GFXTextureUsageBit arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureUsageBit)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureInfo_set_usage : Error processing new value"); cobj->usage = arg0; return true; @@ -3379,7 +3379,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_usage) static bool js_gfx_GFXTextureInfo_get_format(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_format : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3393,12 +3393,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_format) static bool js_gfx_GFXTextureInfo_set_format(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_format : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormat arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + cc::gfx::GFXFormat arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureInfo_set_format : Error processing new value"); cobj->format = arg0; return true; @@ -3407,7 +3407,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_format) static bool js_gfx_GFXTextureInfo_get_width(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3421,7 +3421,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_width) static bool js_gfx_GFXTextureInfo_set_width(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_width : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3435,7 +3435,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_width) static bool js_gfx_GFXTextureInfo_get_height(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3449,7 +3449,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_height) static bool js_gfx_GFXTextureInfo_set_height(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_height : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3463,7 +3463,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_height) static bool js_gfx_GFXTextureInfo_get_depth(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_depth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3477,7 +3477,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_depth) static bool js_gfx_GFXTextureInfo_set_depth(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_depth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3491,7 +3491,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_depth) static bool js_gfx_GFXTextureInfo_get_arrayLayer(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_arrayLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3505,7 +3505,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_arrayLayer) static bool js_gfx_GFXTextureInfo_set_arrayLayer(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_arrayLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3519,7 +3519,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_arrayLayer) static bool js_gfx_GFXTextureInfo_get_mipLevel(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_mipLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3533,7 +3533,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_mipLevel) static bool js_gfx_GFXTextureInfo_set_mipLevel(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_mipLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3547,7 +3547,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_mipLevel) static bool js_gfx_GFXTextureInfo_get_samples(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_samples : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3561,12 +3561,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_samples) static bool js_gfx_GFXTextureInfo_set_samples(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_samples : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXSampleCount arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXSampleCount)tmp; } while(false); + cc::gfx::GFXSampleCount arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXSampleCount)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureInfo_set_samples : Error processing new value"); cobj->samples = arg0; return true; @@ -3575,7 +3575,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_samples) static bool js_gfx_GFXTextureInfo_get_flags(se::State& s) { - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_get_flags : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3589,19 +3589,19 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureInfo_get_flags) static bool js_gfx_GFXTextureInfo_set_flags(se::State& s) { const auto& args = s.args(); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureInfo_set_flags : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureFlagBit arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureFlagBit)tmp; } while(false); + cc::gfx::GFXTextureFlagBit arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureFlagBit)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureInfo_set_flags : Error processing new value"); cobj->flags = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXTextureInfo_set_flags) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXTextureInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXTextureInfo_finalize) static bool js_gfx_GFXTextureInfo_constructor(se::State& s) { @@ -3611,7 +3611,7 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXTextureInfo* cobj = JSB_ALLOC(cc::GFXTextureInfo); + cc::gfx::GFXTextureInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -3621,23 +3621,23 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXTextureInfo* cobj = JSB_ALLOC(cc::GFXTextureInfo); - cc::GFXTextureType arg0; + cc::gfx::GFXTextureInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureInfo); + cc::gfx::GFXTextureType arg0; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXTextureType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXTextureType)tmp; } while(false); cobj->type = arg0; } - cc::GFXTextureUsageBit arg1; + cc::gfx::GFXTextureUsageBit arg1; json->getProperty("usage", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXTextureUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXTextureUsageBit)tmp; } while(false); cobj->usage = arg1; } - cc::GFXFormat arg2; + cc::gfx::GFXFormat arg2; json->getProperty("format", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg2; } unsigned int arg3 = 0; @@ -3670,16 +3670,16 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg7); cobj->mipLevel = arg7; } - cc::GFXSampleCount arg8; + cc::gfx::GFXSampleCount arg8; json->getProperty("samples", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::GFXSampleCount)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::gfx::GFXSampleCount)tmp; } while(false); cobj->samples = arg8; } - cc::GFXTextureFlagBit arg9; + cc::gfx::GFXTextureFlagBit arg9; json->getProperty("flags", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg9 = (cc::GFXTextureFlagBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg9 = (cc::gfx::GFXTextureFlagBit)tmp; } while(false); cobj->flags = arg9; } @@ -3695,20 +3695,20 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) } else if(argc == 10) { - cc::GFXTextureInfo* cobj = JSB_ALLOC(cc::GFXTextureInfo); - cc::GFXTextureType arg0; + cc::gfx::GFXTextureInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureInfo); + cc::gfx::GFXTextureType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureType)tmp; } while(false); cobj->type = arg0; } - cc::GFXTextureUsageBit arg1; + cc::gfx::GFXTextureUsageBit arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXTextureUsageBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXTextureUsageBit)tmp; } while(false); cobj->usage = arg1; } - cc::GFXFormat arg2; + cc::gfx::GFXFormat arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg2; } unsigned int arg3 = 0; @@ -3736,14 +3736,14 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) ok &= seval_to_uint32(args[7], (uint32_t*)&arg7); cobj->mipLevel = arg7; } - cc::GFXSampleCount arg8; + cc::gfx::GFXSampleCount arg8; if (!args[8].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::GFXSampleCount)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::gfx::GFXSampleCount)tmp; } while(false); cobj->samples = arg8; } - cc::GFXTextureFlagBit arg9; + cc::gfx::GFXTextureFlagBit arg9; if (!args[9].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[9], &tmp); arg9 = (cc::GFXTextureFlagBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[9], &tmp); arg9 = (cc::gfx::GFXTextureFlagBit)tmp; } while(false); cobj->flags = arg9; } @@ -3761,24 +3761,24 @@ static bool js_gfx_GFXTextureInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXTextureInfo_constructor, __jsb_cc_GFXTextureInfo_class, js_cc_GFXTextureInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXTextureInfo_constructor, __jsb_cc_gfx_GFXTextureInfo_class, js_cc_gfx_GFXTextureInfo_finalize) -static bool js_cc_GFXTextureInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXTextureInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXTextureInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXTextureInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXTextureInfo* cobj = (cc::GFXTextureInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureInfo* cobj = (cc::gfx::GFXTextureInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXTextureInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXTextureInfo_finalize) bool js_register_gfx_GFXTextureInfo(se::Object* obj) { @@ -3794,23 +3794,23 @@ bool js_register_gfx_GFXTextureInfo(se::Object* obj) cls->defineProperty("mipLevel", _SE(js_gfx_GFXTextureInfo_get_mipLevel), _SE(js_gfx_GFXTextureInfo_set_mipLevel)); cls->defineProperty("samples", _SE(js_gfx_GFXTextureInfo_get_samples), _SE(js_gfx_GFXTextureInfo_set_samples)); cls->defineProperty("flags", _SE(js_gfx_GFXTextureInfo_get_flags), _SE(js_gfx_GFXTextureInfo_set_flags)); - cls->defineFinalizeFunction(_SE(js_cc_GFXTextureInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXTextureInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXTextureInfo_proto = cls->getProto(); - __jsb_cc_GFXTextureInfo_class = cls; + __jsb_cc_gfx_GFXTextureInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXTextureInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXTextureViewInfo_proto = nullptr; -se::Class* __jsb_cc_GFXTextureViewInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXTextureViewInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXTextureViewInfo_class = nullptr; static bool js_gfx_GFXTextureViewInfo_get_texture(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_texture : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3824,11 +3824,11 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_texture) static bool js_gfx_GFXTextureViewInfo_set_texture(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_texture : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTexture* arg0 = nullptr; + cc::gfx::GFXTexture* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureViewInfo_set_texture : Error processing new value"); cobj->texture = arg0; @@ -3838,7 +3838,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_texture) static bool js_gfx_GFXTextureViewInfo_get_type(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3852,12 +3852,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_type) static bool js_gfx_GFXTextureViewInfo_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureType)tmp; } while(false); + cc::gfx::GFXTextureType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureViewInfo_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -3866,7 +3866,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_type) static bool js_gfx_GFXTextureViewInfo_get_format(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_format : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3880,12 +3880,12 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_format) static bool js_gfx_GFXTextureViewInfo_set_format(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_format : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormat arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + cc::gfx::GFXFormat arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXTextureViewInfo_set_format : Error processing new value"); cobj->format = arg0; return true; @@ -3894,7 +3894,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_format) static bool js_gfx_GFXTextureViewInfo_get_baseLevel(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_baseLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3908,7 +3908,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_baseLevel) static bool js_gfx_GFXTextureViewInfo_set_baseLevel(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_baseLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3922,7 +3922,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_baseLevel) static bool js_gfx_GFXTextureViewInfo_get_levelCount(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_levelCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3936,7 +3936,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_levelCount) static bool js_gfx_GFXTextureViewInfo_set_levelCount(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_levelCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3950,7 +3950,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_levelCount) static bool js_gfx_GFXTextureViewInfo_get_baseLayer(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_baseLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3964,7 +3964,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_baseLayer) static bool js_gfx_GFXTextureViewInfo_set_baseLayer(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_baseLayer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3978,7 +3978,7 @@ SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_baseLayer) static bool js_gfx_GFXTextureViewInfo_get_layerCount(se::State& s) { - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_get_layerCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -3992,7 +3992,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTextureViewInfo_get_layerCount) static bool js_gfx_GFXTextureViewInfo_set_layerCount(se::State& s) { const auto& args = s.args(); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTextureViewInfo_set_layerCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4004,7 +4004,7 @@ static bool js_gfx_GFXTextureViewInfo_set_layerCount(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXTextureViewInfo_set_layerCount) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXTextureViewInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXTextureViewInfo_finalize) static bool js_gfx_GFXTextureViewInfo_constructor(se::State& s) { @@ -4014,7 +4014,7 @@ static bool js_gfx_GFXTextureViewInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::GFXTextureViewInfo); + cc::gfx::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureViewInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -4024,23 +4024,23 @@ static bool js_gfx_GFXTextureViewInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::GFXTextureViewInfo); - cc::GFXTexture* arg0 = nullptr; + cc::gfx::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureViewInfo); + cc::gfx::GFXTexture* arg0 = nullptr; json->getProperty("texture", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg0); cobj->texture = arg0; } - cc::GFXTextureType arg1; + cc::gfx::GFXTextureType arg1; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXTextureType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXTextureType)tmp; } while(false); cobj->type = arg1; } - cc::GFXFormat arg2; + cc::gfx::GFXFormat arg2; json->getProperty("format", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg2; } unsigned int arg3 = 0; @@ -4080,20 +4080,20 @@ static bool js_gfx_GFXTextureViewInfo_constructor(se::State& s) } else if(argc == 7) { - cc::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::GFXTextureViewInfo); - cc::GFXTexture* arg0 = nullptr; + cc::gfx::GFXTextureViewInfo* cobj = JSB_ALLOC(cc::gfx::GFXTextureViewInfo); + cc::gfx::GFXTexture* arg0 = nullptr; if (!args[0].isUndefined()) { ok &= seval_to_native_ptr(args[0], &arg0); cobj->texture = arg0; } - cc::GFXTextureType arg1; + cc::gfx::GFXTextureType arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXTextureType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXTextureType)tmp; } while(false); cobj->type = arg1; } - cc::GFXFormat arg2; + cc::gfx::GFXFormat arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg2; } unsigned int arg3 = 0; @@ -4131,24 +4131,24 @@ static bool js_gfx_GFXTextureViewInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXTextureViewInfo_constructor, __jsb_cc_GFXTextureViewInfo_class, js_cc_GFXTextureViewInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXTextureViewInfo_constructor, __jsb_cc_gfx_GFXTextureViewInfo_class, js_cc_gfx_GFXTextureViewInfo_finalize) -static bool js_cc_GFXTextureViewInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXTextureViewInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXTextureViewInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXTextureViewInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXTextureViewInfo* cobj = (cc::GFXTextureViewInfo*)s.nativeThisObject(); + cc::gfx::GFXTextureViewInfo* cobj = (cc::gfx::GFXTextureViewInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXTextureViewInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXTextureViewInfo_finalize) bool js_register_gfx_GFXTextureViewInfo(se::Object* obj) { @@ -4161,23 +4161,23 @@ bool js_register_gfx_GFXTextureViewInfo(se::Object* obj) cls->defineProperty("levelCount", _SE(js_gfx_GFXTextureViewInfo_get_levelCount), _SE(js_gfx_GFXTextureViewInfo_set_levelCount)); cls->defineProperty("baseLayer", _SE(js_gfx_GFXTextureViewInfo_get_baseLayer), _SE(js_gfx_GFXTextureViewInfo_set_baseLayer)); cls->defineProperty("layerCount", _SE(js_gfx_GFXTextureViewInfo_get_layerCount), _SE(js_gfx_GFXTextureViewInfo_set_layerCount)); - cls->defineFinalizeFunction(_SE(js_cc_GFXTextureViewInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXTextureViewInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXTextureViewInfo_proto = cls->getProto(); - __jsb_cc_GFXTextureViewInfo_class = cls; + __jsb_cc_gfx_GFXTextureViewInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXTextureViewInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXSamplerInfo_proto = nullptr; -se::Class* __jsb_cc_GFXSamplerInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXSamplerInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXSamplerInfo_class = nullptr; static bool js_gfx_GFXSamplerInfo_get_name(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4191,11 +4191,11 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_name) static bool js_gfx_GFXSamplerInfo_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_name : Error processing new value"); cobj->name = arg0; @@ -4205,7 +4205,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_name) static bool js_gfx_GFXSamplerInfo_get_minFilter(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_minFilter : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4219,12 +4219,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_minFilter) static bool js_gfx_GFXSamplerInfo_set_minFilter(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_minFilter : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFilter arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFilter)tmp; } while(false); + cc::gfx::GFXFilter arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFilter)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_minFilter : Error processing new value"); cobj->minFilter = arg0; return true; @@ -4233,7 +4233,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_minFilter) static bool js_gfx_GFXSamplerInfo_get_magFilter(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_magFilter : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4247,12 +4247,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_magFilter) static bool js_gfx_GFXSamplerInfo_set_magFilter(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_magFilter : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFilter arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFilter)tmp; } while(false); + cc::gfx::GFXFilter arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFilter)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_magFilter : Error processing new value"); cobj->magFilter = arg0; return true; @@ -4261,7 +4261,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_magFilter) static bool js_gfx_GFXSamplerInfo_get_mipFilter(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_mipFilter : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4275,12 +4275,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_mipFilter) static bool js_gfx_GFXSamplerInfo_set_mipFilter(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_mipFilter : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFilter arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFilter)tmp; } while(false); + cc::gfx::GFXFilter arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFilter)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_mipFilter : Error processing new value"); cobj->mipFilter = arg0; return true; @@ -4289,7 +4289,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_mipFilter) static bool js_gfx_GFXSamplerInfo_get_addressU(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_addressU : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4303,12 +4303,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_addressU) static bool js_gfx_GFXSamplerInfo_set_addressU(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_addressU : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXAddress arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXAddress)tmp; } while(false); + cc::gfx::GFXAddress arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXAddress)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_addressU : Error processing new value"); cobj->addressU = arg0; return true; @@ -4317,7 +4317,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_addressU) static bool js_gfx_GFXSamplerInfo_get_addressV(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_addressV : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4331,12 +4331,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_addressV) static bool js_gfx_GFXSamplerInfo_set_addressV(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_addressV : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXAddress arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXAddress)tmp; } while(false); + cc::gfx::GFXAddress arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXAddress)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_addressV : Error processing new value"); cobj->addressV = arg0; return true; @@ -4345,7 +4345,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_addressV) static bool js_gfx_GFXSamplerInfo_get_addressW(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_addressW : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4359,12 +4359,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_addressW) static bool js_gfx_GFXSamplerInfo_set_addressW(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_addressW : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXAddress arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXAddress)tmp; } while(false); + cc::gfx::GFXAddress arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXAddress)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_addressW : Error processing new value"); cobj->addressW = arg0; return true; @@ -4373,7 +4373,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_addressW) static bool js_gfx_GFXSamplerInfo_get_maxAnisotropy(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_maxAnisotropy : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4387,7 +4387,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_maxAnisotropy) static bool js_gfx_GFXSamplerInfo_set_maxAnisotropy(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_maxAnisotropy : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4401,7 +4401,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_maxAnisotropy) static bool js_gfx_GFXSamplerInfo_get_cmpFunc(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_cmpFunc : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4415,12 +4415,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_cmpFunc) static bool js_gfx_GFXSamplerInfo_set_cmpFunc(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_cmpFunc : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXComparisonFunc arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXComparisonFunc)tmp; } while(false); + cc::gfx::GFXComparisonFunc arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_cmpFunc : Error processing new value"); cobj->cmpFunc = arg0; return true; @@ -4429,7 +4429,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_cmpFunc) static bool js_gfx_GFXSamplerInfo_get_borderColor(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_borderColor : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4443,11 +4443,11 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_borderColor) static bool js_gfx_GFXSamplerInfo_set_borderColor(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_borderColor : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXColor* arg0 = nullptr; + cc::gfx::GFXColor* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXSamplerInfo_set_borderColor : Error processing new value"); cobj->borderColor = *arg0; @@ -4457,7 +4457,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_borderColor) static bool js_gfx_GFXSamplerInfo_get_minLOD(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_minLOD : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4471,7 +4471,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_minLOD) static bool js_gfx_GFXSamplerInfo_set_minLOD(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_minLOD : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4485,7 +4485,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_minLOD) static bool js_gfx_GFXSamplerInfo_get_maxLOD(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_maxLOD : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4499,7 +4499,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_maxLOD) static bool js_gfx_GFXSamplerInfo_set_maxLOD(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_maxLOD : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4513,7 +4513,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_maxLOD) static bool js_gfx_GFXSamplerInfo_get_mipLODBias(se::State& s) { - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_get_mipLODBias : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4527,7 +4527,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSamplerInfo_get_mipLODBias) static bool js_gfx_GFXSamplerInfo_set_mipLODBias(se::State& s) { const auto& args = s.args(); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSamplerInfo_set_mipLODBias : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4539,7 +4539,7 @@ static bool js_gfx_GFXSamplerInfo_set_mipLODBias(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXSamplerInfo_set_mipLODBias) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXSamplerInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXSamplerInfo_finalize) static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) { @@ -4549,7 +4549,7 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXSamplerInfo* cobj = JSB_ALLOC(cc::GFXSamplerInfo); + cc::gfx::GFXSamplerInfo* cobj = JSB_ALLOC(cc::gfx::GFXSamplerInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -4559,47 +4559,47 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXSamplerInfo* cobj = JSB_ALLOC(cc::GFXSamplerInfo); - cc::String arg0; + cc::gfx::GFXSamplerInfo* cobj = JSB_ALLOC(cc::gfx::GFXSamplerInfo); + cc::gfx::String arg0; json->getProperty("name", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); cobj->name = arg0; } - cc::GFXFilter arg1; + cc::gfx::GFXFilter arg1; json->getProperty("minFilter", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->minFilter = arg1; } - cc::GFXFilter arg2; + cc::gfx::GFXFilter arg2; json->getProperty("magFilter", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->magFilter = arg2; } - cc::GFXFilter arg3; + cc::gfx::GFXFilter arg3; json->getProperty("mipFilter", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->mipFilter = arg3; } - cc::GFXAddress arg4; + cc::gfx::GFXAddress arg4; json->getProperty("addressU", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressU = arg4; } - cc::GFXAddress arg5; + cc::gfx::GFXAddress arg5; json->getProperty("addressV", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressV = arg5; } - cc::GFXAddress arg6; + cc::gfx::GFXAddress arg6; json->getProperty("addressW", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressW = arg6; } unsigned int arg7 = 0; @@ -4608,13 +4608,13 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg7); cobj->maxAnisotropy = arg7; } - cc::GFXComparisonFunc arg8; + cc::gfx::GFXComparisonFunc arg8; json->getProperty("cmpFunc", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->cmpFunc = arg8; } - cc::GFXColor* arg9 = nullptr; + cc::gfx::GFXColor* arg9 = nullptr; json->getProperty("borderColor", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg9); @@ -4651,40 +4651,40 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) } else if(argc == 13) { - cc::GFXSamplerInfo* cobj = JSB_ALLOC(cc::GFXSamplerInfo); - cc::String arg0; + cc::gfx::GFXSamplerInfo* cobj = JSB_ALLOC(cc::gfx::GFXSamplerInfo); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->name = arg0; } - cc::GFXFilter arg1; + cc::gfx::GFXFilter arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->minFilter = arg1; } - cc::GFXFilter arg2; + cc::gfx::GFXFilter arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->magFilter = arg2; } - cc::GFXFilter arg3; + cc::gfx::GFXFilter arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXFilter)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXFilter)tmp; } while(false); cobj->mipFilter = arg3; } - cc::GFXAddress arg4; + cc::gfx::GFXAddress arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressU = arg4; } - cc::GFXAddress arg5; + cc::gfx::GFXAddress arg5; if (!args[5].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressV = arg5; } - cc::GFXAddress arg6; + cc::gfx::GFXAddress arg6; if (!args[6].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::GFXAddress)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::gfx::GFXAddress)tmp; } while(false); cobj->addressW = arg6; } unsigned int arg7 = 0; @@ -4692,12 +4692,12 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) ok &= seval_to_uint32(args[7], (uint32_t*)&arg7); cobj->maxAnisotropy = arg7; } - cc::GFXComparisonFunc arg8; + cc::gfx::GFXComparisonFunc arg8; if (!args[8].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->cmpFunc = arg8; } - cc::GFXColor* arg9 = nullptr; + cc::gfx::GFXColor* arg9 = nullptr; if (!args[9].isUndefined()) { ok &= seval_to_reference(args[9], &arg9); cobj->borderColor = *arg9; @@ -4732,24 +4732,24 @@ static bool js_gfx_GFXSamplerInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXSamplerInfo_constructor, __jsb_cc_GFXSamplerInfo_class, js_cc_GFXSamplerInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXSamplerInfo_constructor, __jsb_cc_gfx_GFXSamplerInfo_class, js_cc_gfx_GFXSamplerInfo_finalize) -static bool js_cc_GFXSamplerInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXSamplerInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXSamplerInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXSamplerInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXSamplerInfo* cobj = (cc::GFXSamplerInfo*)s.nativeThisObject(); + cc::gfx::GFXSamplerInfo* cobj = (cc::gfx::GFXSamplerInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXSamplerInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXSamplerInfo_finalize) bool js_register_gfx_GFXSamplerInfo(se::Object* obj) { @@ -4768,23 +4768,23 @@ bool js_register_gfx_GFXSamplerInfo(se::Object* obj) cls->defineProperty("minLOD", _SE(js_gfx_GFXSamplerInfo_get_minLOD), _SE(js_gfx_GFXSamplerInfo_set_minLOD)); cls->defineProperty("maxLOD", _SE(js_gfx_GFXSamplerInfo_get_maxLOD), _SE(js_gfx_GFXSamplerInfo_set_maxLOD)); cls->defineProperty("mipLODBias", _SE(js_gfx_GFXSamplerInfo_get_mipLODBias), _SE(js_gfx_GFXSamplerInfo_set_mipLODBias)); - cls->defineFinalizeFunction(_SE(js_cc_GFXSamplerInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXSamplerInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXSamplerInfo_proto = cls->getProto(); - __jsb_cc_GFXSamplerInfo_class = cls; + __jsb_cc_gfx_GFXSamplerInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXSamplerInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXShaderMacro_proto = nullptr; -se::Class* __jsb_cc_GFXShaderMacro_class = nullptr; +se::Object* __jsb_cc_gfx_GFXShaderMacro_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXShaderMacro_class = nullptr; static bool js_gfx_GFXShaderMacro_get_macro(se::State& s) { - cc::GFXShaderMacro* cobj = (cc::GFXShaderMacro*)s.nativeThisObject(); + cc::gfx::GFXShaderMacro* cobj = (cc::gfx::GFXShaderMacro*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderMacro_get_macro : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4798,11 +4798,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderMacro_get_macro) static bool js_gfx_GFXShaderMacro_set_macro(se::State& s) { const auto& args = s.args(); - cc::GFXShaderMacro* cobj = (cc::GFXShaderMacro*)s.nativeThisObject(); + cc::gfx::GFXShaderMacro* cobj = (cc::gfx::GFXShaderMacro*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderMacro_set_macro : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderMacro_set_macro : Error processing new value"); cobj->macro = arg0; @@ -4812,7 +4812,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderMacro_set_macro) static bool js_gfx_GFXShaderMacro_get_value(se::State& s) { - cc::GFXShaderMacro* cobj = (cc::GFXShaderMacro*)s.nativeThisObject(); + cc::gfx::GFXShaderMacro* cobj = (cc::gfx::GFXShaderMacro*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderMacro_get_value : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4826,11 +4826,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderMacro_get_value) static bool js_gfx_GFXShaderMacro_set_value(se::State& s) { const auto& args = s.args(); - cc::GFXShaderMacro* cobj = (cc::GFXShaderMacro*)s.nativeThisObject(); + cc::gfx::GFXShaderMacro* cobj = (cc::gfx::GFXShaderMacro*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderMacro_set_value : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderMacro_set_value : Error processing new value"); cobj->value = arg0; @@ -4838,7 +4838,7 @@ static bool js_gfx_GFXShaderMacro_set_value(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXShaderMacro_set_value) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXShaderMacro_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXShaderMacro_finalize) static bool js_gfx_GFXShaderMacro_constructor(se::State& s) { @@ -4848,7 +4848,7 @@ static bool js_gfx_GFXShaderMacro_constructor(se::State& s) if(argc == 0) { - cc::GFXShaderMacro* cobj = JSB_ALLOC(cc::GFXShaderMacro); + cc::gfx::GFXShaderMacro* cobj = JSB_ALLOC(cc::gfx::GFXShaderMacro); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -4858,14 +4858,14 @@ static bool js_gfx_GFXShaderMacro_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXShaderMacro* cobj = JSB_ALLOC(cc::GFXShaderMacro); - cc::String arg0; + cc::gfx::GFXShaderMacro* cobj = JSB_ALLOC(cc::gfx::GFXShaderMacro); + cc::gfx::String arg0; json->getProperty("macro", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); cobj->macro = arg0; } - cc::String arg1; + cc::gfx::String arg1; json->getProperty("value", &field); if(!field.isUndefined()) { arg1 = field.toStringForce().c_str(); @@ -4884,13 +4884,13 @@ static bool js_gfx_GFXShaderMacro_constructor(se::State& s) } else if(argc == 2) { - cc::GFXShaderMacro* cobj = JSB_ALLOC(cc::GFXShaderMacro); - cc::String arg0; + cc::gfx::GFXShaderMacro* cobj = JSB_ALLOC(cc::gfx::GFXShaderMacro); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->macro = arg0; } - cc::String arg1; + cc::gfx::String arg1; if (!args[1].isUndefined()) { arg1 = args[1].toStringForce().c_str(); cobj->value = arg1; @@ -4910,24 +4910,24 @@ static bool js_gfx_GFXShaderMacro_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXShaderMacro_constructor, __jsb_cc_GFXShaderMacro_class, js_cc_GFXShaderMacro_finalize) +SE_BIND_CTOR(js_gfx_GFXShaderMacro_constructor, __jsb_cc_gfx_GFXShaderMacro_class, js_cc_gfx_GFXShaderMacro_finalize) -static bool js_cc_GFXShaderMacro_finalize(se::State& s) +static bool js_cc_gfx_GFXShaderMacro_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXShaderMacro)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXShaderMacro)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXShaderMacro* cobj = (cc::GFXShaderMacro*)s.nativeThisObject(); + cc::gfx::GFXShaderMacro* cobj = (cc::gfx::GFXShaderMacro*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXShaderMacro_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXShaderMacro_finalize) bool js_register_gfx_GFXShaderMacro(se::Object* obj) { @@ -4935,23 +4935,23 @@ bool js_register_gfx_GFXShaderMacro(se::Object* obj) cls->defineProperty("macro", _SE(js_gfx_GFXShaderMacro_get_macro), _SE(js_gfx_GFXShaderMacro_set_macro)); cls->defineProperty("value", _SE(js_gfx_GFXShaderMacro_get_value), _SE(js_gfx_GFXShaderMacro_set_value)); - cls->defineFinalizeFunction(_SE(js_cc_GFXShaderMacro_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXShaderMacro_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXShaderMacro_proto = cls->getProto(); - __jsb_cc_GFXShaderMacro_class = cls; + __jsb_cc_gfx_GFXShaderMacro_proto = cls->getProto(); + __jsb_cc_gfx_GFXShaderMacro_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXUniform_proto = nullptr; -se::Class* __jsb_cc_GFXUniform_class = nullptr; +se::Object* __jsb_cc_gfx_GFXUniform_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXUniform_class = nullptr; static bool js_gfx_GFXUniform_get_name(se::State& s) { - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4965,11 +4965,11 @@ SE_BIND_PROP_GET(js_gfx_GFXUniform_get_name) static bool js_gfx_GFXUniform_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniform_set_name : Error processing new value"); cobj->name = arg0; @@ -4979,7 +4979,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniform_set_name) static bool js_gfx_GFXUniform_get_type(se::State& s) { - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -4993,12 +4993,12 @@ SE_BIND_PROP_GET(js_gfx_GFXUniform_get_type) static bool js_gfx_GFXUniform_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXType)tmp; } while(false); + cc::gfx::GFXType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniform_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -5007,7 +5007,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniform_set_type) static bool js_gfx_GFXUniform_get_count(se::State& s) { - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5021,7 +5021,7 @@ SE_BIND_PROP_GET(js_gfx_GFXUniform_get_count) static bool js_gfx_GFXUniform_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniform_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5033,7 +5033,7 @@ static bool js_gfx_GFXUniform_set_count(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXUniform_set_count) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXUniform_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXUniform_finalize) static bool js_gfx_GFXUniform_constructor(se::State& s) { @@ -5043,7 +5043,7 @@ static bool js_gfx_GFXUniform_constructor(se::State& s) if(argc == 0) { - cc::GFXUniform* cobj = JSB_ALLOC(cc::GFXUniform); + cc::gfx::GFXUniform* cobj = JSB_ALLOC(cc::gfx::GFXUniform); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -5053,17 +5053,17 @@ static bool js_gfx_GFXUniform_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXUniform* cobj = JSB_ALLOC(cc::GFXUniform); - cc::String arg0; + cc::gfx::GFXUniform* cobj = JSB_ALLOC(cc::gfx::GFXUniform); + cc::gfx::String arg0; json->getProperty("name", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); cobj->name = arg0; } - cc::GFXType arg1; + cc::gfx::GFXType arg1; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXType)tmp; } while(false); cobj->type = arg1; } unsigned int arg2 = 0; @@ -5085,15 +5085,15 @@ static bool js_gfx_GFXUniform_constructor(se::State& s) } else if(argc == 3) { - cc::GFXUniform* cobj = JSB_ALLOC(cc::GFXUniform); - cc::String arg0; + cc::gfx::GFXUniform* cobj = JSB_ALLOC(cc::gfx::GFXUniform); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->name = arg0; } - cc::GFXType arg1; + cc::gfx::GFXType arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXType)tmp; } while(false); cobj->type = arg1; } unsigned int arg2 = 0; @@ -5116,24 +5116,24 @@ static bool js_gfx_GFXUniform_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXUniform_constructor, __jsb_cc_GFXUniform_class, js_cc_GFXUniform_finalize) +SE_BIND_CTOR(js_gfx_GFXUniform_constructor, __jsb_cc_gfx_GFXUniform_class, js_cc_gfx_GFXUniform_finalize) -static bool js_cc_GFXUniform_finalize(se::State& s) +static bool js_cc_gfx_GFXUniform_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXUniform)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXUniform)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXUniform* cobj = (cc::GFXUniform*)s.nativeThisObject(); + cc::gfx::GFXUniform* cobj = (cc::gfx::GFXUniform*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXUniform_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXUniform_finalize) bool js_register_gfx_GFXUniform(se::Object* obj) { @@ -5142,23 +5142,23 @@ bool js_register_gfx_GFXUniform(se::Object* obj) cls->defineProperty("name", _SE(js_gfx_GFXUniform_get_name), _SE(js_gfx_GFXUniform_set_name)); cls->defineProperty("type", _SE(js_gfx_GFXUniform_get_type), _SE(js_gfx_GFXUniform_set_type)); cls->defineProperty("count", _SE(js_gfx_GFXUniform_get_count), _SE(js_gfx_GFXUniform_set_count)); - cls->defineFinalizeFunction(_SE(js_cc_GFXUniform_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXUniform_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXUniform_proto = cls->getProto(); - __jsb_cc_GFXUniform_class = cls; + __jsb_cc_gfx_GFXUniform_proto = cls->getProto(); + __jsb_cc_gfx_GFXUniform_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXUniformBlock_proto = nullptr; -se::Class* __jsb_cc_GFXUniformBlock_class = nullptr; +se::Object* __jsb_cc_gfx_GFXUniformBlock_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXUniformBlock_class = nullptr; static bool js_gfx_GFXUniformBlock_get_shaderStages(se::State& s) { - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_get_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5172,12 +5172,12 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformBlock_get_shaderStages) static bool js_gfx_GFXUniformBlock_set_shaderStages(se::State& s) { const auto& args = s.args(); - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_set_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformBlock_set_shaderStages : Error processing new value"); cobj->shaderStages = arg0; return true; @@ -5186,7 +5186,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformBlock_set_shaderStages) static bool js_gfx_GFXUniformBlock_get_binding(se::State& s) { - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_get_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5200,7 +5200,7 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformBlock_get_binding) static bool js_gfx_GFXUniformBlock_set_binding(se::State& s) { const auto& args = s.args(); - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_set_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5214,7 +5214,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformBlock_set_binding) static bool js_gfx_GFXUniformBlock_get_name(se::State& s) { - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5228,11 +5228,11 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformBlock_get_name) static bool js_gfx_GFXUniformBlock_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformBlock_set_name : Error processing new value"); cobj->name = arg0; @@ -5242,7 +5242,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformBlock_set_name) static bool js_gfx_GFXUniformBlock_get_uniforms(se::State& s) { - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_get_uniforms : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5256,11 +5256,11 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformBlock_get_uniforms) static bool js_gfx_GFXUniformBlock_set_uniforms(se::State& s) { const auto& args = s.args(); - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformBlock_set_uniforms : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformBlock_set_uniforms : Error processing new value"); cobj->uniforms = arg0; @@ -5268,7 +5268,7 @@ static bool js_gfx_GFXUniformBlock_set_uniforms(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXUniformBlock_set_uniforms) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXUniformBlock_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXUniformBlock_finalize) static bool js_gfx_GFXUniformBlock_constructor(se::State& s) { @@ -5278,7 +5278,7 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) if(argc == 0) { - cc::GFXUniformBlock* cobj = JSB_ALLOC(cc::GFXUniformBlock); + cc::gfx::GFXUniformBlock* cobj = JSB_ALLOC(cc::gfx::GFXUniformBlock); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -5288,11 +5288,11 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXUniformBlock* cobj = JSB_ALLOC(cc::GFXUniformBlock); - cc::GFXShaderType arg0; + cc::gfx::GFXUniformBlock* cobj = JSB_ALLOC(cc::gfx::GFXUniformBlock); + cc::gfx::GFXShaderType arg0; json->getProperty("shaderStages", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -5301,13 +5301,13 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg1); cobj->binding = arg1; } - cc::String arg2; + cc::gfx::String arg2; json->getProperty("name", &field); if(!field.isUndefined()) { arg2 = field.toStringForce().c_str(); cobj->name = arg2; } - std::vector arg3; + std::vector arg3; json->getProperty("uniforms", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg3); @@ -5326,10 +5326,10 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) } else if(argc == 4) { - cc::GFXUniformBlock* cobj = JSB_ALLOC(cc::GFXUniformBlock); - cc::GFXShaderType arg0; + cc::gfx::GFXUniformBlock* cobj = JSB_ALLOC(cc::gfx::GFXUniformBlock); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -5337,12 +5337,12 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); cobj->binding = arg1; } - cc::String arg2; + cc::gfx::String arg2; if (!args[2].isUndefined()) { arg2 = args[2].toStringForce().c_str(); cobj->name = arg2; } - std::vector arg3; + std::vector arg3; if (!args[3].isUndefined()) { ok &= seval_to_std_vector(args[3], &arg3); cobj->uniforms = arg3; @@ -5362,24 +5362,24 @@ static bool js_gfx_GFXUniformBlock_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXUniformBlock_constructor, __jsb_cc_GFXUniformBlock_class, js_cc_GFXUniformBlock_finalize) +SE_BIND_CTOR(js_gfx_GFXUniformBlock_constructor, __jsb_cc_gfx_GFXUniformBlock_class, js_cc_gfx_GFXUniformBlock_finalize) -static bool js_cc_GFXUniformBlock_finalize(se::State& s) +static bool js_cc_gfx_GFXUniformBlock_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXUniformBlock)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXUniformBlock)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXUniformBlock* cobj = (cc::GFXUniformBlock*)s.nativeThisObject(); + cc::gfx::GFXUniformBlock* cobj = (cc::gfx::GFXUniformBlock*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXUniformBlock_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXUniformBlock_finalize) bool js_register_gfx_GFXUniformBlock(se::Object* obj) { @@ -5389,23 +5389,23 @@ bool js_register_gfx_GFXUniformBlock(se::Object* obj) cls->defineProperty("binding", _SE(js_gfx_GFXUniformBlock_get_binding), _SE(js_gfx_GFXUniformBlock_set_binding)); cls->defineProperty("name", _SE(js_gfx_GFXUniformBlock_get_name), _SE(js_gfx_GFXUniformBlock_set_name)); cls->defineProperty("uniforms", _SE(js_gfx_GFXUniformBlock_get_uniforms), _SE(js_gfx_GFXUniformBlock_set_uniforms)); - cls->defineFinalizeFunction(_SE(js_cc_GFXUniformBlock_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXUniformBlock_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXUniformBlock_proto = cls->getProto(); - __jsb_cc_GFXUniformBlock_class = cls; + __jsb_cc_gfx_GFXUniformBlock_proto = cls->getProto(); + __jsb_cc_gfx_GFXUniformBlock_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXUniformSampler_proto = nullptr; -se::Class* __jsb_cc_GFXUniformSampler_class = nullptr; +se::Object* __jsb_cc_gfx_GFXUniformSampler_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXUniformSampler_class = nullptr; static bool js_gfx_GFXUniformSampler_get_shaderStages(se::State& s) { - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_get_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5419,12 +5419,12 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformSampler_get_shaderStages) static bool js_gfx_GFXUniformSampler_set_shaderStages(se::State& s) { const auto& args = s.args(); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_set_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformSampler_set_shaderStages : Error processing new value"); cobj->shaderStages = arg0; return true; @@ -5433,7 +5433,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformSampler_set_shaderStages) static bool js_gfx_GFXUniformSampler_get_binding(se::State& s) { - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_get_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5447,7 +5447,7 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformSampler_get_binding) static bool js_gfx_GFXUniformSampler_set_binding(se::State& s) { const auto& args = s.args(); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_set_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5461,7 +5461,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformSampler_set_binding) static bool js_gfx_GFXUniformSampler_get_name(se::State& s) { - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5475,11 +5475,11 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformSampler_get_name) static bool js_gfx_GFXUniformSampler_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformSampler_set_name : Error processing new value"); cobj->name = arg0; @@ -5489,7 +5489,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformSampler_set_name) static bool js_gfx_GFXUniformSampler_get_type(se::State& s) { - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5503,12 +5503,12 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformSampler_get_type) static bool js_gfx_GFXUniformSampler_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXType)tmp; } while(false); + cc::gfx::GFXType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXUniformSampler_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -5517,7 +5517,7 @@ SE_BIND_PROP_SET(js_gfx_GFXUniformSampler_set_type) static bool js_gfx_GFXUniformSampler_get_count(se::State& s) { - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5531,7 +5531,7 @@ SE_BIND_PROP_GET(js_gfx_GFXUniformSampler_get_count) static bool js_gfx_GFXUniformSampler_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXUniformSampler_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5543,7 +5543,7 @@ static bool js_gfx_GFXUniformSampler_set_count(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXUniformSampler_set_count) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXUniformSampler_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXUniformSampler_finalize) static bool js_gfx_GFXUniformSampler_constructor(se::State& s) { @@ -5553,7 +5553,7 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) if(argc == 0) { - cc::GFXUniformSampler* cobj = JSB_ALLOC(cc::GFXUniformSampler); + cc::gfx::GFXUniformSampler* cobj = JSB_ALLOC(cc::gfx::GFXUniformSampler); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -5563,11 +5563,11 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXUniformSampler* cobj = JSB_ALLOC(cc::GFXUniformSampler); - cc::GFXShaderType arg0; + cc::gfx::GFXUniformSampler* cobj = JSB_ALLOC(cc::gfx::GFXUniformSampler); + cc::gfx::GFXShaderType arg0; json->getProperty("shaderStages", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -5576,16 +5576,16 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg1); cobj->binding = arg1; } - cc::String arg2; + cc::gfx::String arg2; json->getProperty("name", &field); if(!field.isUndefined()) { arg2 = field.toStringForce().c_str(); cobj->name = arg2; } - cc::GFXType arg3; + cc::gfx::GFXType arg3; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXType)tmp; } while(false); cobj->type = arg3; } unsigned int arg4 = 0; @@ -5607,10 +5607,10 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) } else if(argc == 5) { - cc::GFXUniformSampler* cobj = JSB_ALLOC(cc::GFXUniformSampler); - cc::GFXShaderType arg0; + cc::gfx::GFXUniformSampler* cobj = JSB_ALLOC(cc::gfx::GFXUniformSampler); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -5618,14 +5618,14 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); cobj->binding = arg1; } - cc::String arg2; + cc::gfx::String arg2; if (!args[2].isUndefined()) { arg2 = args[2].toStringForce().c_str(); cobj->name = arg2; } - cc::GFXType arg3; + cc::gfx::GFXType arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXType)tmp; } while(false); cobj->type = arg3; } unsigned int arg4 = 0; @@ -5648,24 +5648,24 @@ static bool js_gfx_GFXUniformSampler_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXUniformSampler_constructor, __jsb_cc_GFXUniformSampler_class, js_cc_GFXUniformSampler_finalize) +SE_BIND_CTOR(js_gfx_GFXUniformSampler_constructor, __jsb_cc_gfx_GFXUniformSampler_class, js_cc_gfx_GFXUniformSampler_finalize) -static bool js_cc_GFXUniformSampler_finalize(se::State& s) +static bool js_cc_gfx_GFXUniformSampler_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXUniformSampler)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXUniformSampler)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXUniformSampler* cobj = (cc::GFXUniformSampler*)s.nativeThisObject(); + cc::gfx::GFXUniformSampler* cobj = (cc::gfx::GFXUniformSampler*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXUniformSampler_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXUniformSampler_finalize) bool js_register_gfx_GFXUniformSampler(se::Object* obj) { @@ -5676,23 +5676,23 @@ bool js_register_gfx_GFXUniformSampler(se::Object* obj) cls->defineProperty("name", _SE(js_gfx_GFXUniformSampler_get_name), _SE(js_gfx_GFXUniformSampler_set_name)); cls->defineProperty("type", _SE(js_gfx_GFXUniformSampler_get_type), _SE(js_gfx_GFXUniformSampler_set_type)); cls->defineProperty("count", _SE(js_gfx_GFXUniformSampler_get_count), _SE(js_gfx_GFXUniformSampler_set_count)); - cls->defineFinalizeFunction(_SE(js_cc_GFXUniformSampler_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXUniformSampler_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXUniformSampler_proto = cls->getProto(); - __jsb_cc_GFXUniformSampler_class = cls; + __jsb_cc_gfx_GFXUniformSampler_proto = cls->getProto(); + __jsb_cc_gfx_GFXUniformSampler_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXShaderStage_proto = nullptr; -se::Class* __jsb_cc_GFXShaderStage_class = nullptr; +se::Object* __jsb_cc_gfx_GFXShaderStage_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXShaderStage_class = nullptr; static bool js_gfx_GFXShaderStage_get_type(se::State& s) { - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5706,12 +5706,12 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderStage_get_type) static bool js_gfx_GFXShaderStage_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderStage_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -5720,7 +5720,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderStage_set_type) static bool js_gfx_GFXShaderStage_get_source(se::State& s) { - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_get_source : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5734,11 +5734,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderStage_get_source) static bool js_gfx_GFXShaderStage_set_source(se::State& s) { const auto& args = s.args(); - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_set_source : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderStage_set_source : Error processing new value"); cobj->source = arg0; @@ -5748,7 +5748,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderStage_set_source) static bool js_gfx_GFXShaderStage_get_macros(se::State& s) { - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_get_macros : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5762,11 +5762,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderStage_get_macros) static bool js_gfx_GFXShaderStage_set_macros(se::State& s) { const auto& args = s.args(); - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderStage_set_macros : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderStage_set_macros : Error processing new value"); cobj->macros = arg0; @@ -5774,7 +5774,7 @@ static bool js_gfx_GFXShaderStage_set_macros(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXShaderStage_set_macros) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXShaderStage_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXShaderStage_finalize) static bool js_gfx_GFXShaderStage_constructor(se::State& s) { @@ -5784,7 +5784,7 @@ static bool js_gfx_GFXShaderStage_constructor(se::State& s) if(argc == 0) { - cc::GFXShaderStage* cobj = JSB_ALLOC(cc::GFXShaderStage); + cc::gfx::GFXShaderStage* cobj = JSB_ALLOC(cc::gfx::GFXShaderStage); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -5794,20 +5794,20 @@ static bool js_gfx_GFXShaderStage_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXShaderStage* cobj = JSB_ALLOC(cc::GFXShaderStage); - cc::GFXShaderType arg0; + cc::gfx::GFXShaderStage* cobj = JSB_ALLOC(cc::gfx::GFXShaderStage); + cc::gfx::GFXShaderType arg0; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->type = arg0; } - cc::String arg1; + cc::gfx::String arg1; json->getProperty("source", &field); if(!field.isUndefined()) { arg1 = field.toStringForce().c_str(); cobj->source = arg1; } - std::vector arg2; + std::vector arg2; json->getProperty("macros", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg2); @@ -5826,18 +5826,18 @@ static bool js_gfx_GFXShaderStage_constructor(se::State& s) } else if(argc == 3) { - cc::GFXShaderStage* cobj = JSB_ALLOC(cc::GFXShaderStage); - cc::GFXShaderType arg0; + cc::gfx::GFXShaderStage* cobj = JSB_ALLOC(cc::gfx::GFXShaderStage); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->type = arg0; } - cc::String arg1; + cc::gfx::String arg1; if (!args[1].isUndefined()) { arg1 = args[1].toStringForce().c_str(); cobj->source = arg1; } - std::vector arg2; + std::vector arg2; if (!args[2].isUndefined()) { ok &= seval_to_std_vector(args[2], &arg2); cobj->macros = arg2; @@ -5857,24 +5857,24 @@ static bool js_gfx_GFXShaderStage_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXShaderStage_constructor, __jsb_cc_GFXShaderStage_class, js_cc_GFXShaderStage_finalize) +SE_BIND_CTOR(js_gfx_GFXShaderStage_constructor, __jsb_cc_gfx_GFXShaderStage_class, js_cc_gfx_GFXShaderStage_finalize) -static bool js_cc_GFXShaderStage_finalize(se::State& s) +static bool js_cc_gfx_GFXShaderStage_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXShaderStage)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXShaderStage)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXShaderStage* cobj = (cc::GFXShaderStage*)s.nativeThisObject(); + cc::gfx::GFXShaderStage* cobj = (cc::gfx::GFXShaderStage*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXShaderStage_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXShaderStage_finalize) bool js_register_gfx_GFXShaderStage(se::Object* obj) { @@ -5883,23 +5883,23 @@ bool js_register_gfx_GFXShaderStage(se::Object* obj) cls->defineProperty("type", _SE(js_gfx_GFXShaderStage_get_type), _SE(js_gfx_GFXShaderStage_set_type)); cls->defineProperty("source", _SE(js_gfx_GFXShaderStage_get_source), _SE(js_gfx_GFXShaderStage_set_source)); cls->defineProperty("macros", _SE(js_gfx_GFXShaderStage_get_macros), _SE(js_gfx_GFXShaderStage_set_macros)); - cls->defineFinalizeFunction(_SE(js_cc_GFXShaderStage_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXShaderStage_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXShaderStage_proto = cls->getProto(); - __jsb_cc_GFXShaderStage_class = cls; + __jsb_cc_gfx_GFXShaderStage_proto = cls->getProto(); + __jsb_cc_gfx_GFXShaderStage_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXAttribute_proto = nullptr; -se::Class* __jsb_cc_GFXAttribute_class = nullptr; +se::Object* __jsb_cc_gfx_GFXAttribute_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXAttribute_class = nullptr; static bool js_gfx_GFXAttribute_get_name(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5913,11 +5913,11 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_name) static bool js_gfx_GFXAttribute_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXAttribute_set_name : Error processing new value"); cobj->name = arg0; @@ -5927,7 +5927,7 @@ SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_name) static bool js_gfx_GFXAttribute_get_format(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_format : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5941,12 +5941,12 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_format) static bool js_gfx_GFXAttribute_set_format(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_format : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormat arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + cc::gfx::GFXFormat arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXAttribute_set_format : Error processing new value"); cobj->format = arg0; return true; @@ -5955,7 +5955,7 @@ SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_format) static bool js_gfx_GFXAttribute_get_isNormalized(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_isNormalized : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5969,7 +5969,7 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_isNormalized) static bool js_gfx_GFXAttribute_set_isNormalized(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_isNormalized : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5983,7 +5983,7 @@ SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_isNormalized) static bool js_gfx_GFXAttribute_get_stream(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_stream : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -5997,7 +5997,7 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_stream) static bool js_gfx_GFXAttribute_set_stream(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_stream : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6011,7 +6011,7 @@ SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_stream) static bool js_gfx_GFXAttribute_get_isInstanced(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_isInstanced : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6025,7 +6025,7 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_isInstanced) static bool js_gfx_GFXAttribute_set_isInstanced(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_isInstanced : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6039,7 +6039,7 @@ SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_isInstanced) static bool js_gfx_GFXAttribute_get_location(se::State& s) { - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_get_location : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6053,7 +6053,7 @@ SE_BIND_PROP_GET(js_gfx_GFXAttribute_get_location) static bool js_gfx_GFXAttribute_set_location(se::State& s) { const auto& args = s.args(); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXAttribute_set_location : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6065,7 +6065,7 @@ static bool js_gfx_GFXAttribute_set_location(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXAttribute_set_location) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXAttribute_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXAttribute_finalize) static bool js_gfx_GFXAttribute_constructor(se::State& s) { @@ -6075,7 +6075,7 @@ static bool js_gfx_GFXAttribute_constructor(se::State& s) if(argc == 0) { - cc::GFXAttribute* cobj = JSB_ALLOC(cc::GFXAttribute); + cc::gfx::GFXAttribute* cobj = JSB_ALLOC(cc::gfx::GFXAttribute); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -6085,17 +6085,17 @@ static bool js_gfx_GFXAttribute_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXAttribute* cobj = JSB_ALLOC(cc::GFXAttribute); - cc::String arg0; + cc::gfx::GFXAttribute* cobj = JSB_ALLOC(cc::gfx::GFXAttribute); + cc::gfx::String arg0; json->getProperty("name", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); cobj->name = arg0; } - cc::GFXFormat arg1; + cc::gfx::GFXFormat arg1; json->getProperty("format", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg1; } bool arg2; @@ -6135,15 +6135,15 @@ static bool js_gfx_GFXAttribute_constructor(se::State& s) } else if(argc == 6) { - cc::GFXAttribute* cobj = JSB_ALLOC(cc::GFXAttribute); - cc::String arg0; + cc::gfx::GFXAttribute* cobj = JSB_ALLOC(cc::gfx::GFXAttribute); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->name = arg0; } - cc::GFXFormat arg1; + cc::gfx::GFXFormat arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg1; } bool arg2; @@ -6181,24 +6181,24 @@ static bool js_gfx_GFXAttribute_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXAttribute_constructor, __jsb_cc_GFXAttribute_class, js_cc_GFXAttribute_finalize) +SE_BIND_CTOR(js_gfx_GFXAttribute_constructor, __jsb_cc_gfx_GFXAttribute_class, js_cc_gfx_GFXAttribute_finalize) -static bool js_cc_GFXAttribute_finalize(se::State& s) +static bool js_cc_gfx_GFXAttribute_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXAttribute)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXAttribute)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXAttribute* cobj = (cc::GFXAttribute*)s.nativeThisObject(); + cc::gfx::GFXAttribute* cobj = (cc::gfx::GFXAttribute*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXAttribute_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXAttribute_finalize) bool js_register_gfx_GFXAttribute(se::Object* obj) { @@ -6210,23 +6210,23 @@ bool js_register_gfx_GFXAttribute(se::Object* obj) cls->defineProperty("stream", _SE(js_gfx_GFXAttribute_get_stream), _SE(js_gfx_GFXAttribute_set_stream)); cls->defineProperty("isInstanced", _SE(js_gfx_GFXAttribute_get_isInstanced), _SE(js_gfx_GFXAttribute_set_isInstanced)); cls->defineProperty("location", _SE(js_gfx_GFXAttribute_get_location), _SE(js_gfx_GFXAttribute_set_location)); - cls->defineFinalizeFunction(_SE(js_cc_GFXAttribute_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXAttribute_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXAttribute_proto = cls->getProto(); - __jsb_cc_GFXAttribute_class = cls; + __jsb_cc_gfx_GFXAttribute_proto = cls->getProto(); + __jsb_cc_gfx_GFXAttribute_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXShaderInfo_proto = nullptr; -se::Class* __jsb_cc_GFXShaderInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXShaderInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXShaderInfo_class = nullptr; static bool js_gfx_GFXShaderInfo_get_name(se::State& s) { - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6240,11 +6240,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderInfo_get_name) static bool js_gfx_GFXShaderInfo_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderInfo_set_name : Error processing new value"); cobj->name = arg0; @@ -6254,7 +6254,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderInfo_set_name) static bool js_gfx_GFXShaderInfo_get_stages(se::State& s) { - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_get_stages : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6268,11 +6268,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderInfo_get_stages) static bool js_gfx_GFXShaderInfo_set_stages(se::State& s) { const auto& args = s.args(); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_set_stages : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderInfo_set_stages : Error processing new value"); cobj->stages = arg0; @@ -6282,7 +6282,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderInfo_set_stages) static bool js_gfx_GFXShaderInfo_get_attributes(se::State& s) { - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_get_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6296,11 +6296,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderInfo_get_attributes) static bool js_gfx_GFXShaderInfo_set_attributes(se::State& s) { const auto& args = s.args(); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_set_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderInfo_set_attributes : Error processing new value"); cobj->attributes = arg0; @@ -6310,7 +6310,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderInfo_set_attributes) static bool js_gfx_GFXShaderInfo_get_blocks(se::State& s) { - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_get_blocks : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6324,11 +6324,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderInfo_get_blocks) static bool js_gfx_GFXShaderInfo_set_blocks(se::State& s) { const auto& args = s.args(); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_set_blocks : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderInfo_set_blocks : Error processing new value"); cobj->blocks = arg0; @@ -6338,7 +6338,7 @@ SE_BIND_PROP_SET(js_gfx_GFXShaderInfo_set_blocks) static bool js_gfx_GFXShaderInfo_get_samplers(se::State& s) { - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_get_samplers : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6352,11 +6352,11 @@ SE_BIND_PROP_GET(js_gfx_GFXShaderInfo_get_samplers) static bool js_gfx_GFXShaderInfo_set_samplers(se::State& s) { const auto& args = s.args(); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShaderInfo_set_samplers : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShaderInfo_set_samplers : Error processing new value"); cobj->samplers = arg0; @@ -6364,7 +6364,7 @@ static bool js_gfx_GFXShaderInfo_set_samplers(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXShaderInfo_set_samplers) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXShaderInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXShaderInfo_finalize) static bool js_gfx_GFXShaderInfo_constructor(se::State& s) { @@ -6374,7 +6374,7 @@ static bool js_gfx_GFXShaderInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXShaderInfo* cobj = JSB_ALLOC(cc::GFXShaderInfo); + cc::gfx::GFXShaderInfo* cobj = JSB_ALLOC(cc::gfx::GFXShaderInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -6384,32 +6384,32 @@ static bool js_gfx_GFXShaderInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXShaderInfo* cobj = JSB_ALLOC(cc::GFXShaderInfo); - cc::String arg0; + cc::gfx::GFXShaderInfo* cobj = JSB_ALLOC(cc::gfx::GFXShaderInfo); + cc::gfx::String arg0; json->getProperty("name", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); cobj->name = arg0; } - std::vector arg1; + std::vector arg1; json->getProperty("stages", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg1); cobj->stages = arg1; } - std::vector arg2; + std::vector arg2; json->getProperty("attributes", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg2); cobj->attributes = arg2; } - std::vector arg3; + std::vector arg3; json->getProperty("blocks", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg3); cobj->blocks = arg3; } - std::vector arg4; + std::vector arg4; json->getProperty("samplers", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg4); @@ -6428,28 +6428,28 @@ static bool js_gfx_GFXShaderInfo_constructor(se::State& s) } else if(argc == 5) { - cc::GFXShaderInfo* cobj = JSB_ALLOC(cc::GFXShaderInfo); - cc::String arg0; + cc::gfx::GFXShaderInfo* cobj = JSB_ALLOC(cc::gfx::GFXShaderInfo); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->name = arg0; } - std::vector arg1; + std::vector arg1; if (!args[1].isUndefined()) { ok &= seval_to_std_vector(args[1], &arg1); cobj->stages = arg1; } - std::vector arg2; + std::vector arg2; if (!args[2].isUndefined()) { ok &= seval_to_std_vector(args[2], &arg2); cobj->attributes = arg2; } - std::vector arg3; + std::vector arg3; if (!args[3].isUndefined()) { ok &= seval_to_std_vector(args[3], &arg3); cobj->blocks = arg3; } - std::vector arg4; + std::vector arg4; if (!args[4].isUndefined()) { ok &= seval_to_std_vector(args[4], &arg4); cobj->samplers = arg4; @@ -6469,24 +6469,24 @@ static bool js_gfx_GFXShaderInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXShaderInfo_constructor, __jsb_cc_GFXShaderInfo_class, js_cc_GFXShaderInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXShaderInfo_constructor, __jsb_cc_gfx_GFXShaderInfo_class, js_cc_gfx_GFXShaderInfo_finalize) -static bool js_cc_GFXShaderInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXShaderInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXShaderInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXShaderInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXShaderInfo* cobj = (cc::GFXShaderInfo*)s.nativeThisObject(); + cc::gfx::GFXShaderInfo* cobj = (cc::gfx::GFXShaderInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXShaderInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXShaderInfo_finalize) bool js_register_gfx_GFXShaderInfo(se::Object* obj) { @@ -6497,23 +6497,23 @@ bool js_register_gfx_GFXShaderInfo(se::Object* obj) cls->defineProperty("attributes", _SE(js_gfx_GFXShaderInfo_get_attributes), _SE(js_gfx_GFXShaderInfo_set_attributes)); cls->defineProperty("blocks", _SE(js_gfx_GFXShaderInfo_get_blocks), _SE(js_gfx_GFXShaderInfo_set_blocks)); cls->defineProperty("samplers", _SE(js_gfx_GFXShaderInfo_get_samplers), _SE(js_gfx_GFXShaderInfo_set_samplers)); - cls->defineFinalizeFunction(_SE(js_cc_GFXShaderInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXShaderInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXShaderInfo_proto = cls->getProto(); - __jsb_cc_GFXShaderInfo_class = cls; + __jsb_cc_gfx_GFXShaderInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXShaderInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXInputAssemblerInfo_proto = nullptr; -se::Class* __jsb_cc_GFXInputAssemblerInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXInputAssemblerInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXInputAssemblerInfo_class = nullptr; static bool js_gfx_GFXInputAssemblerInfo_get_attributes(se::State& s) { - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_get_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6527,11 +6527,11 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssemblerInfo_get_attributes) static bool js_gfx_GFXInputAssemblerInfo_set_attributes(se::State& s) { const auto& args = s.args(); - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_set_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssemblerInfo_set_attributes : Error processing new value"); cobj->attributes = arg0; @@ -6541,7 +6541,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssemblerInfo_set_attributes) static bool js_gfx_GFXInputAssemblerInfo_get_vertexBuffers(se::State& s) { - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_get_vertexBuffers : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6555,11 +6555,11 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssemblerInfo_get_vertexBuffers) static bool js_gfx_GFXInputAssemblerInfo_set_vertexBuffers(se::State& s) { const auto& args = s.args(); - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_set_vertexBuffers : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssemblerInfo_set_vertexBuffers : Error processing new value"); cobj->vertexBuffers = arg0; @@ -6569,7 +6569,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssemblerInfo_set_vertexBuffers) static bool js_gfx_GFXInputAssemblerInfo_get_indexBuffer(se::State& s) { - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_get_indexBuffer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6583,11 +6583,11 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssemblerInfo_get_indexBuffer) static bool js_gfx_GFXInputAssemblerInfo_set_indexBuffer(se::State& s) { const auto& args = s.args(); - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_set_indexBuffer : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXBuffer* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssemblerInfo_set_indexBuffer : Error processing new value"); cobj->indexBuffer = arg0; @@ -6597,7 +6597,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssemblerInfo_set_indexBuffer) static bool js_gfx_GFXInputAssemblerInfo_get_indirectBuffer(se::State& s) { - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_get_indirectBuffer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6611,11 +6611,11 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssemblerInfo_get_indirectBuffer) static bool js_gfx_GFXInputAssemblerInfo_set_indirectBuffer(se::State& s) { const auto& args = s.args(); - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssemblerInfo_set_indirectBuffer : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXBuffer* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssemblerInfo_set_indirectBuffer : Error processing new value"); cobj->indirectBuffer = arg0; @@ -6623,7 +6623,7 @@ static bool js_gfx_GFXInputAssemblerInfo_set_indirectBuffer(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXInputAssemblerInfo_set_indirectBuffer) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXInputAssemblerInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXInputAssemblerInfo_finalize) static bool js_gfx_GFXInputAssemblerInfo_constructor(se::State& s) { @@ -6633,7 +6633,7 @@ static bool js_gfx_GFXInputAssemblerInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::GFXInputAssemblerInfo); + cc::gfx::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::gfx::GFXInputAssemblerInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -6643,26 +6643,26 @@ static bool js_gfx_GFXInputAssemblerInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::GFXInputAssemblerInfo); - std::vector arg0; + cc::gfx::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::gfx::GFXInputAssemblerInfo); + std::vector arg0; json->getProperty("attributes", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg0); cobj->attributes = arg0; } - std::vector arg1; + std::vector arg1; json->getProperty("vertexBuffers", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg1); cobj->vertexBuffers = arg1; } - cc::GFXBuffer* arg2 = nullptr; + cc::gfx::GFXBuffer* arg2 = nullptr; json->getProperty("indexBuffer", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg2); cobj->indexBuffer = arg2; } - cc::GFXBuffer* arg3 = nullptr; + cc::gfx::GFXBuffer* arg3 = nullptr; json->getProperty("indirectBuffer", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg3); @@ -6681,23 +6681,23 @@ static bool js_gfx_GFXInputAssemblerInfo_constructor(se::State& s) } else if(argc == 4) { - cc::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::GFXInputAssemblerInfo); - std::vector arg0; + cc::gfx::GFXInputAssemblerInfo* cobj = JSB_ALLOC(cc::gfx::GFXInputAssemblerInfo); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->attributes = arg0; } - std::vector arg1; + std::vector arg1; if (!args[1].isUndefined()) { ok &= seval_to_std_vector(args[1], &arg1); cobj->vertexBuffers = arg1; } - cc::GFXBuffer* arg2 = nullptr; + cc::gfx::GFXBuffer* arg2 = nullptr; if (!args[2].isUndefined()) { ok &= seval_to_native_ptr(args[2], &arg2); cobj->indexBuffer = arg2; } - cc::GFXBuffer* arg3 = nullptr; + cc::gfx::GFXBuffer* arg3 = nullptr; if (!args[3].isUndefined()) { ok &= seval_to_native_ptr(args[3], &arg3); cobj->indirectBuffer = arg3; @@ -6717,24 +6717,24 @@ static bool js_gfx_GFXInputAssemblerInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXInputAssemblerInfo_constructor, __jsb_cc_GFXInputAssemblerInfo_class, js_cc_GFXInputAssemblerInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXInputAssemblerInfo_constructor, __jsb_cc_gfx_GFXInputAssemblerInfo_class, js_cc_gfx_GFXInputAssemblerInfo_finalize) -static bool js_cc_GFXInputAssemblerInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXInputAssemblerInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXInputAssemblerInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXInputAssemblerInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXInputAssemblerInfo* cobj = (cc::GFXInputAssemblerInfo*)s.nativeThisObject(); + cc::gfx::GFXInputAssemblerInfo* cobj = (cc::gfx::GFXInputAssemblerInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXInputAssemblerInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXInputAssemblerInfo_finalize) bool js_register_gfx_GFXInputAssemblerInfo(se::Object* obj) { @@ -6744,23 +6744,23 @@ bool js_register_gfx_GFXInputAssemblerInfo(se::Object* obj) cls->defineProperty("vertexBuffers", _SE(js_gfx_GFXInputAssemblerInfo_get_vertexBuffers), _SE(js_gfx_GFXInputAssemblerInfo_set_vertexBuffers)); cls->defineProperty("indexBuffer", _SE(js_gfx_GFXInputAssemblerInfo_get_indexBuffer), _SE(js_gfx_GFXInputAssemblerInfo_set_indexBuffer)); cls->defineProperty("indirectBuffer", _SE(js_gfx_GFXInputAssemblerInfo_get_indirectBuffer), _SE(js_gfx_GFXInputAssemblerInfo_set_indirectBuffer)); - cls->defineFinalizeFunction(_SE(js_cc_GFXInputAssemblerInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXInputAssemblerInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXInputAssemblerInfo_proto = cls->getProto(); - __jsb_cc_GFXInputAssemblerInfo_class = cls; + __jsb_cc_gfx_GFXInputAssemblerInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXInputAssemblerInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXColorAttachment_proto = nullptr; -se::Class* __jsb_cc_GFXColorAttachment_class = nullptr; +se::Object* __jsb_cc_gfx_GFXColorAttachment_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXColorAttachment_class = nullptr; static bool js_gfx_GFXColorAttachment_get_format(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_format : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6774,12 +6774,12 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_format) static bool js_gfx_GFXColorAttachment_set_format(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_format : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormat arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + cc::gfx::GFXFormat arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXColorAttachment_set_format : Error processing new value"); cobj->format = arg0; return true; @@ -6788,7 +6788,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_format) static bool js_gfx_GFXColorAttachment_get_loadOp(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_loadOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6802,12 +6802,12 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_loadOp) static bool js_gfx_GFXColorAttachment_set_loadOp(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_loadOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXLoadOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXLoadOp)tmp; } while(false); + cc::gfx::GFXLoadOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXLoadOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXColorAttachment_set_loadOp : Error processing new value"); cobj->loadOp = arg0; return true; @@ -6816,7 +6816,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_loadOp) static bool js_gfx_GFXColorAttachment_get_storeOp(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_storeOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6830,12 +6830,12 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_storeOp) static bool js_gfx_GFXColorAttachment_set_storeOp(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_storeOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStoreOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStoreOp)tmp; } while(false); + cc::gfx::GFXStoreOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStoreOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXColorAttachment_set_storeOp : Error processing new value"); cobj->storeOp = arg0; return true; @@ -6844,7 +6844,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_storeOp) static bool js_gfx_GFXColorAttachment_get_sampleCount(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_sampleCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6858,7 +6858,7 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_sampleCount) static bool js_gfx_GFXColorAttachment_set_sampleCount(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_sampleCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6872,7 +6872,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_sampleCount) static bool js_gfx_GFXColorAttachment_get_beginLayout(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_beginLayout : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6886,12 +6886,12 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_beginLayout) static bool js_gfx_GFXColorAttachment_set_beginLayout(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_beginLayout : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureLayout arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureLayout)tmp; } while(false); + cc::gfx::GFXTextureLayout arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureLayout)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXColorAttachment_set_beginLayout : Error processing new value"); cobj->beginLayout = arg0; return true; @@ -6900,7 +6900,7 @@ SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_beginLayout) static bool js_gfx_GFXColorAttachment_get_endLayout(se::State& s) { - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_get_endLayout : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -6914,19 +6914,19 @@ SE_BIND_PROP_GET(js_gfx_GFXColorAttachment_get_endLayout) static bool js_gfx_GFXColorAttachment_set_endLayout(se::State& s) { const auto& args = s.args(); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXColorAttachment_set_endLayout : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureLayout arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureLayout)tmp; } while(false); + cc::gfx::GFXTextureLayout arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureLayout)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXColorAttachment_set_endLayout : Error processing new value"); cobj->endLayout = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXColorAttachment_set_endLayout) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXColorAttachment_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXColorAttachment_finalize) static bool js_gfx_GFXColorAttachment_constructor(se::State& s) { @@ -6936,7 +6936,7 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) if(argc == 0) { - cc::GFXColorAttachment* cobj = JSB_ALLOC(cc::GFXColorAttachment); + cc::gfx::GFXColorAttachment* cobj = JSB_ALLOC(cc::gfx::GFXColorAttachment); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -6946,23 +6946,23 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXColorAttachment* cobj = JSB_ALLOC(cc::GFXColorAttachment); - cc::GFXFormat arg0; + cc::gfx::GFXColorAttachment* cobj = JSB_ALLOC(cc::gfx::GFXColorAttachment); + cc::gfx::GFXFormat arg0; json->getProperty("format", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg0; } - cc::GFXLoadOp arg1; + cc::gfx::GFXLoadOp arg1; json->getProperty("loadOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->loadOp = arg1; } - cc::GFXStoreOp arg2; + cc::gfx::GFXStoreOp arg2; json->getProperty("storeOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->storeOp = arg2; } unsigned int arg3 = 0; @@ -6971,16 +6971,16 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg3); cobj->sampleCount = arg3; } - cc::GFXTextureLayout arg4; + cc::gfx::GFXTextureLayout arg4; json->getProperty("beginLayout", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->beginLayout = arg4; } - cc::GFXTextureLayout arg5; + cc::gfx::GFXTextureLayout arg5; json->getProperty("endLayout", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->endLayout = arg5; } @@ -6996,20 +6996,20 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) } else if(argc == 6) { - cc::GFXColorAttachment* cobj = JSB_ALLOC(cc::GFXColorAttachment); - cc::GFXFormat arg0; + cc::gfx::GFXColorAttachment* cobj = JSB_ALLOC(cc::gfx::GFXColorAttachment); + cc::gfx::GFXFormat arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg0; } - cc::GFXLoadOp arg1; + cc::gfx::GFXLoadOp arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->loadOp = arg1; } - cc::GFXStoreOp arg2; + cc::gfx::GFXStoreOp arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->storeOp = arg2; } unsigned int arg3 = 0; @@ -7017,14 +7017,14 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) ok &= seval_to_uint32(args[3], (uint32_t*)&arg3); cobj->sampleCount = arg3; } - cc::GFXTextureLayout arg4; + cc::gfx::GFXTextureLayout arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->beginLayout = arg4; } - cc::GFXTextureLayout arg5; + cc::gfx::GFXTextureLayout arg5; if (!args[5].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->endLayout = arg5; } @@ -7042,24 +7042,24 @@ static bool js_gfx_GFXColorAttachment_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXColorAttachment_constructor, __jsb_cc_GFXColorAttachment_class, js_cc_GFXColorAttachment_finalize) +SE_BIND_CTOR(js_gfx_GFXColorAttachment_constructor, __jsb_cc_gfx_GFXColorAttachment_class, js_cc_gfx_GFXColorAttachment_finalize) -static bool js_cc_GFXColorAttachment_finalize(se::State& s) +static bool js_cc_gfx_GFXColorAttachment_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXColorAttachment)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXColorAttachment)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXColorAttachment* cobj = (cc::GFXColorAttachment*)s.nativeThisObject(); + cc::gfx::GFXColorAttachment* cobj = (cc::gfx::GFXColorAttachment*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXColorAttachment_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXColorAttachment_finalize) bool js_register_gfx_GFXColorAttachment(se::Object* obj) { @@ -7071,23 +7071,23 @@ bool js_register_gfx_GFXColorAttachment(se::Object* obj) cls->defineProperty("sampleCount", _SE(js_gfx_GFXColorAttachment_get_sampleCount), _SE(js_gfx_GFXColorAttachment_set_sampleCount)); cls->defineProperty("beginLayout", _SE(js_gfx_GFXColorAttachment_get_beginLayout), _SE(js_gfx_GFXColorAttachment_set_beginLayout)); cls->defineProperty("endLayout", _SE(js_gfx_GFXColorAttachment_get_endLayout), _SE(js_gfx_GFXColorAttachment_set_endLayout)); - cls->defineFinalizeFunction(_SE(js_cc_GFXColorAttachment_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXColorAttachment_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXColorAttachment_proto = cls->getProto(); - __jsb_cc_GFXColorAttachment_class = cls; + __jsb_cc_gfx_GFXColorAttachment_proto = cls->getProto(); + __jsb_cc_gfx_GFXColorAttachment_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXDepthStencilAttachment_proto = nullptr; -se::Class* __jsb_cc_GFXDepthStencilAttachment_class = nullptr; +se::Object* __jsb_cc_gfx_GFXDepthStencilAttachment_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXDepthStencilAttachment_class = nullptr; static bool js_gfx_GFXDepthStencilAttachment_get_format(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_format : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7101,12 +7101,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_format) static bool js_gfx_GFXDepthStencilAttachment_set_format(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_format : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormat arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + cc::gfx::GFXFormat arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_format : Error processing new value"); cobj->format = arg0; return true; @@ -7115,7 +7115,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_format) static bool js_gfx_GFXDepthStencilAttachment_get_depthLoadOp(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_depthLoadOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7129,12 +7129,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_depthLoadOp) static bool js_gfx_GFXDepthStencilAttachment_set_depthLoadOp(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_depthLoadOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXLoadOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXLoadOp)tmp; } while(false); + cc::gfx::GFXLoadOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXLoadOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_depthLoadOp : Error processing new value"); cobj->depthLoadOp = arg0; return true; @@ -7143,7 +7143,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_depthLoadOp) static bool js_gfx_GFXDepthStencilAttachment_get_depthStoreOp(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_depthStoreOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7157,12 +7157,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_depthStoreOp) static bool js_gfx_GFXDepthStencilAttachment_set_depthStoreOp(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_depthStoreOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStoreOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStoreOp)tmp; } while(false); + cc::gfx::GFXStoreOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStoreOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_depthStoreOp : Error processing new value"); cobj->depthStoreOp = arg0; return true; @@ -7171,7 +7171,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_depthStoreOp) static bool js_gfx_GFXDepthStencilAttachment_get_stencilLoadOp(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_stencilLoadOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7185,12 +7185,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_stencilLoadOp) static bool js_gfx_GFXDepthStencilAttachment_set_stencilLoadOp(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_stencilLoadOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXLoadOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXLoadOp)tmp; } while(false); + cc::gfx::GFXLoadOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXLoadOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_stencilLoadOp : Error processing new value"); cobj->stencilLoadOp = arg0; return true; @@ -7199,7 +7199,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_stencilLoadOp) static bool js_gfx_GFXDepthStencilAttachment_get_stencilStoreOp(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_stencilStoreOp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7213,12 +7213,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_stencilStoreOp) static bool js_gfx_GFXDepthStencilAttachment_set_stencilStoreOp(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_stencilStoreOp : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStoreOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStoreOp)tmp; } while(false); + cc::gfx::GFXStoreOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStoreOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_stencilStoreOp : Error processing new value"); cobj->stencilStoreOp = arg0; return true; @@ -7227,7 +7227,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_stencilStoreOp) static bool js_gfx_GFXDepthStencilAttachment_get_sampleCount(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_sampleCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7241,7 +7241,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_sampleCount) static bool js_gfx_GFXDepthStencilAttachment_set_sampleCount(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_sampleCount : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7255,7 +7255,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_sampleCount) static bool js_gfx_GFXDepthStencilAttachment_get_beginLayout(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_beginLayout : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7269,12 +7269,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_beginLayout) static bool js_gfx_GFXDepthStencilAttachment_set_beginLayout(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_beginLayout : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureLayout arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureLayout)tmp; } while(false); + cc::gfx::GFXTextureLayout arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureLayout)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_beginLayout : Error processing new value"); cobj->beginLayout = arg0; return true; @@ -7283,7 +7283,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_beginLayout) static bool js_gfx_GFXDepthStencilAttachment_get_endLayout(se::State& s) { - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_get_endLayout : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7297,19 +7297,19 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilAttachment_get_endLayout) static bool js_gfx_GFXDepthStencilAttachment_set_endLayout(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilAttachment_set_endLayout : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTextureLayout arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXTextureLayout)tmp; } while(false); + cc::gfx::GFXTextureLayout arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXTextureLayout)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilAttachment_set_endLayout : Error processing new value"); cobj->endLayout = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXDepthStencilAttachment_set_endLayout) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXDepthStencilAttachment_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXDepthStencilAttachment_finalize) static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) { @@ -7319,7 +7319,7 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) if(argc == 0) { - cc::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::GFXDepthStencilAttachment); + cc::gfx::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilAttachment); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -7329,35 +7329,35 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::GFXDepthStencilAttachment); - cc::GFXFormat arg0; + cc::gfx::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilAttachment); + cc::gfx::GFXFormat arg0; json->getProperty("format", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg0; } - cc::GFXLoadOp arg1; + cc::gfx::GFXLoadOp arg1; json->getProperty("depthLoadOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->depthLoadOp = arg1; } - cc::GFXStoreOp arg2; + cc::gfx::GFXStoreOp arg2; json->getProperty("depthStoreOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->depthStoreOp = arg2; } - cc::GFXLoadOp arg3; + cc::gfx::GFXLoadOp arg3; json->getProperty("stencilLoadOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->stencilLoadOp = arg3; } - cc::GFXStoreOp arg4; + cc::gfx::GFXStoreOp arg4; json->getProperty("stencilStoreOp", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->stencilStoreOp = arg4; } unsigned int arg5 = 0; @@ -7366,16 +7366,16 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg5); cobj->sampleCount = arg5; } - cc::GFXTextureLayout arg6; + cc::gfx::GFXTextureLayout arg6; json->getProperty("beginLayout", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->beginLayout = arg6; } - cc::GFXTextureLayout arg7; + cc::gfx::GFXTextureLayout arg7; json->getProperty("endLayout", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->endLayout = arg7; } @@ -7391,30 +7391,30 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) } else if(argc == 8) { - cc::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::GFXDepthStencilAttachment); - cc::GFXFormat arg0; + cc::gfx::GFXDepthStencilAttachment* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilAttachment); + cc::gfx::GFXFormat arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormat)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormat)tmp; } while(false); cobj->format = arg0; } - cc::GFXLoadOp arg1; + cc::gfx::GFXLoadOp arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->depthLoadOp = arg1; } - cc::GFXStoreOp arg2; + cc::gfx::GFXStoreOp arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->depthStoreOp = arg2; } - cc::GFXLoadOp arg3; + cc::gfx::GFXLoadOp arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXLoadOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXLoadOp)tmp; } while(false); cobj->stencilLoadOp = arg3; } - cc::GFXStoreOp arg4; + cc::gfx::GFXStoreOp arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXStoreOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXStoreOp)tmp; } while(false); cobj->stencilStoreOp = arg4; } unsigned int arg5 = 0; @@ -7422,14 +7422,14 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) ok &= seval_to_uint32(args[5], (uint32_t*)&arg5); cobj->sampleCount = arg5; } - cc::GFXTextureLayout arg6; + cc::gfx::GFXTextureLayout arg6; if (!args[6].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->beginLayout = arg6; } - cc::GFXTextureLayout arg7; + cc::gfx::GFXTextureLayout arg7; if (!args[7].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::gfx::GFXTextureLayout)tmp; } while(false); cobj->endLayout = arg7; } @@ -7447,24 +7447,24 @@ static bool js_gfx_GFXDepthStencilAttachment_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXDepthStencilAttachment_constructor, __jsb_cc_GFXDepthStencilAttachment_class, js_cc_GFXDepthStencilAttachment_finalize) +SE_BIND_CTOR(js_gfx_GFXDepthStencilAttachment_constructor, __jsb_cc_gfx_GFXDepthStencilAttachment_class, js_cc_gfx_GFXDepthStencilAttachment_finalize) -static bool js_cc_GFXDepthStencilAttachment_finalize(se::State& s) +static bool js_cc_gfx_GFXDepthStencilAttachment_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXDepthStencilAttachment)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXDepthStencilAttachment)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXDepthStencilAttachment* cobj = (cc::GFXDepthStencilAttachment*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilAttachment* cobj = (cc::gfx::GFXDepthStencilAttachment*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXDepthStencilAttachment_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXDepthStencilAttachment_finalize) bool js_register_gfx_GFXDepthStencilAttachment(se::Object* obj) { @@ -7478,23 +7478,23 @@ bool js_register_gfx_GFXDepthStencilAttachment(se::Object* obj) cls->defineProperty("sampleCount", _SE(js_gfx_GFXDepthStencilAttachment_get_sampleCount), _SE(js_gfx_GFXDepthStencilAttachment_set_sampleCount)); cls->defineProperty("beginLayout", _SE(js_gfx_GFXDepthStencilAttachment_get_beginLayout), _SE(js_gfx_GFXDepthStencilAttachment_set_beginLayout)); cls->defineProperty("endLayout", _SE(js_gfx_GFXDepthStencilAttachment_get_endLayout), _SE(js_gfx_GFXDepthStencilAttachment_set_endLayout)); - cls->defineFinalizeFunction(_SE(js_cc_GFXDepthStencilAttachment_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXDepthStencilAttachment_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXDepthStencilAttachment_proto = cls->getProto(); - __jsb_cc_GFXDepthStencilAttachment_class = cls; + __jsb_cc_gfx_GFXDepthStencilAttachment_proto = cls->getProto(); + __jsb_cc_gfx_GFXDepthStencilAttachment_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXRenderPassInfo_proto = nullptr; -se::Class* __jsb_cc_GFXRenderPassInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXRenderPassInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXRenderPassInfo_class = nullptr; static bool js_gfx_GFXRenderPassInfo_get_colorAttachments(se::State& s) { - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_get_colorAttachments : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7508,11 +7508,11 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPassInfo_get_colorAttachments) static bool js_gfx_GFXRenderPassInfo_set_colorAttachments(se::State& s) { const auto& args = s.args(); - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_set_colorAttachments : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPassInfo_set_colorAttachments : Error processing new value"); cobj->colorAttachments = arg0; @@ -7522,7 +7522,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRenderPassInfo_set_colorAttachments) static bool js_gfx_GFXRenderPassInfo_get_depthStencilAttachment(se::State& s) { - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_get_depthStencilAttachment : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7536,11 +7536,11 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPassInfo_get_depthStencilAttachment) static bool js_gfx_GFXRenderPassInfo_set_depthStencilAttachment(se::State& s) { const auto& args = s.args(); - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_set_depthStencilAttachment : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXDepthStencilAttachment* arg0 = nullptr; + cc::gfx::GFXDepthStencilAttachment* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPassInfo_set_depthStencilAttachment : Error processing new value"); cobj->depthStencilAttachment = *arg0; @@ -7550,7 +7550,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRenderPassInfo_set_depthStencilAttachment) static bool js_gfx_GFXRenderPassInfo_get_subPasses(se::State& s) { - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_get_subPasses : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7564,11 +7564,11 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPassInfo_get_subPasses) static bool js_gfx_GFXRenderPassInfo_set_subPasses(se::State& s) { const auto& args = s.args(); - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPassInfo_set_subPasses : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPassInfo_set_subPasses : Error processing new value"); cobj->subPasses = arg0; @@ -7576,7 +7576,7 @@ static bool js_gfx_GFXRenderPassInfo_set_subPasses(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXRenderPassInfo_set_subPasses) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXRenderPassInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXRenderPassInfo_finalize) static bool js_gfx_GFXRenderPassInfo_constructor(se::State& s) { @@ -7586,7 +7586,7 @@ static bool js_gfx_GFXRenderPassInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::GFXRenderPassInfo); + cc::gfx::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::gfx::GFXRenderPassInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -7596,20 +7596,20 @@ static bool js_gfx_GFXRenderPassInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::GFXRenderPassInfo); - std::vector arg0; + cc::gfx::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::gfx::GFXRenderPassInfo); + std::vector arg0; json->getProperty("colorAttachments", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg0); cobj->colorAttachments = arg0; } - cc::GFXDepthStencilAttachment* arg1 = nullptr; + cc::gfx::GFXDepthStencilAttachment* arg1 = nullptr; json->getProperty("depthStencilAttachment", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg1); cobj->depthStencilAttachment = *arg1; } - std::vector arg2; + std::vector arg2; json->getProperty("subPasses", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg2); @@ -7628,18 +7628,18 @@ static bool js_gfx_GFXRenderPassInfo_constructor(se::State& s) } else if(argc == 3) { - cc::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::GFXRenderPassInfo); - std::vector arg0; + cc::gfx::GFXRenderPassInfo* cobj = JSB_ALLOC(cc::gfx::GFXRenderPassInfo); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->colorAttachments = arg0; } - cc::GFXDepthStencilAttachment* arg1 = nullptr; + cc::gfx::GFXDepthStencilAttachment* arg1 = nullptr; if (!args[1].isUndefined()) { ok &= seval_to_reference(args[1], &arg1); cobj->depthStencilAttachment = *arg1; } - std::vector arg2; + std::vector arg2; if (!args[2].isUndefined()) { ok &= seval_to_std_vector(args[2], &arg2); cobj->subPasses = arg2; @@ -7659,24 +7659,24 @@ static bool js_gfx_GFXRenderPassInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXRenderPassInfo_constructor, __jsb_cc_GFXRenderPassInfo_class, js_cc_GFXRenderPassInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXRenderPassInfo_constructor, __jsb_cc_gfx_GFXRenderPassInfo_class, js_cc_gfx_GFXRenderPassInfo_finalize) -static bool js_cc_GFXRenderPassInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXRenderPassInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXRenderPassInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXRenderPassInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXRenderPassInfo* cobj = (cc::GFXRenderPassInfo*)s.nativeThisObject(); + cc::gfx::GFXRenderPassInfo* cobj = (cc::gfx::GFXRenderPassInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXRenderPassInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXRenderPassInfo_finalize) bool js_register_gfx_GFXRenderPassInfo(se::Object* obj) { @@ -7685,23 +7685,23 @@ bool js_register_gfx_GFXRenderPassInfo(se::Object* obj) cls->defineProperty("colorAttachments", _SE(js_gfx_GFXRenderPassInfo_get_colorAttachments), _SE(js_gfx_GFXRenderPassInfo_set_colorAttachments)); cls->defineProperty("depthStencilAttachment", _SE(js_gfx_GFXRenderPassInfo_get_depthStencilAttachment), _SE(js_gfx_GFXRenderPassInfo_set_depthStencilAttachment)); cls->defineProperty("subPasses", _SE(js_gfx_GFXRenderPassInfo_get_subPasses), _SE(js_gfx_GFXRenderPassInfo_set_subPasses)); - cls->defineFinalizeFunction(_SE(js_cc_GFXRenderPassInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXRenderPassInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXRenderPassInfo_proto = cls->getProto(); - __jsb_cc_GFXRenderPassInfo_class = cls; + __jsb_cc_gfx_GFXRenderPassInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXRenderPassInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXFramebufferInfo_proto = nullptr; -se::Class* __jsb_cc_GFXFramebufferInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXFramebufferInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXFramebufferInfo_class = nullptr; static bool js_gfx_GFXFramebufferInfo_get_renderPass(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_renderPass : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7715,11 +7715,11 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_renderPass) static bool js_gfx_GFXFramebufferInfo_set_renderPass(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_renderPass : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXRenderPass* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebufferInfo_set_renderPass : Error processing new value"); cobj->renderPass = arg0; @@ -7729,7 +7729,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_renderPass) static bool js_gfx_GFXFramebufferInfo_get_colorTextures(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_colorTextures : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7743,11 +7743,11 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_colorTextures) static bool js_gfx_GFXFramebufferInfo_set_colorTextures(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_colorTextures : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebufferInfo_set_colorTextures : Error processing new value"); cobj->colorTextures = arg0; @@ -7757,7 +7757,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_colorTextures) static bool js_gfx_GFXFramebufferInfo_get_colorMipmapLevels(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_colorMipmapLevels : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7771,7 +7771,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_colorMipmapLevels) static bool js_gfx_GFXFramebufferInfo_set_colorMipmapLevels(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_colorMipmapLevels : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7785,7 +7785,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_colorMipmapLevels) static bool js_gfx_GFXFramebufferInfo_get_depthStencilTexture(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_depthStencilTexture : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7799,11 +7799,11 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_depthStencilTexture) static bool js_gfx_GFXFramebufferInfo_set_depthStencilTexture(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_depthStencilTexture : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTexture* arg0 = nullptr; + cc::gfx::GFXTexture* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebufferInfo_set_depthStencilTexture : Error processing new value"); cobj->depthStencilTexture = arg0; @@ -7813,7 +7813,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_depthStencilTexture) static bool js_gfx_GFXFramebufferInfo_get_depthStencilMipmapLevel(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_depthStencilMipmapLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7827,7 +7827,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_depthStencilMipmapLevel) static bool js_gfx_GFXFramebufferInfo_set_depthStencilMipmapLevel(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_depthStencilMipmapLevel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7841,7 +7841,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_depthStencilMipmapLevel) static bool js_gfx_GFXFramebufferInfo_get_isOffscreen(se::State& s) { - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_get_isOffscreen : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7855,7 +7855,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebufferInfo_get_isOffscreen) static bool js_gfx_GFXFramebufferInfo_set_isOffscreen(se::State& s) { const auto& args = s.args(); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebufferInfo_set_isOffscreen : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -7867,7 +7867,7 @@ static bool js_gfx_GFXFramebufferInfo_set_isOffscreen(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXFramebufferInfo_set_isOffscreen) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXFramebufferInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXFramebufferInfo_finalize) static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) { @@ -7877,7 +7877,7 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::GFXFramebufferInfo); + cc::gfx::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXFramebufferInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -7887,14 +7887,14 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::GFXFramebufferInfo); - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXFramebufferInfo); + cc::gfx::GFXRenderPass* arg0 = nullptr; json->getProperty("renderPass", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg0); cobj->renderPass = arg0; } - std::vector arg1; + std::vector arg1; json->getProperty("colorTextures", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg1); @@ -7906,7 +7906,7 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) ok &= seval_to_std_vector(field, &arg2); cobj->colorMipmapLevels = arg2; } - cc::GFXTexture* arg3 = nullptr; + cc::gfx::GFXTexture* arg3 = nullptr; json->getProperty("depthStencilTexture", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg3); @@ -7937,13 +7937,13 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) } else if(argc == 6) { - cc::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::GFXFramebufferInfo); - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXFramebufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXFramebufferInfo); + cc::gfx::GFXRenderPass* arg0 = nullptr; if (!args[0].isUndefined()) { ok &= seval_to_native_ptr(args[0], &arg0); cobj->renderPass = arg0; } - std::vector arg1; + std::vector arg1; if (!args[1].isUndefined()) { ok &= seval_to_std_vector(args[1], &arg1); cobj->colorTextures = arg1; @@ -7953,7 +7953,7 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) ok &= seval_to_std_vector(args[2], &arg2); cobj->colorMipmapLevels = arg2; } - cc::GFXTexture* arg3 = nullptr; + cc::gfx::GFXTexture* arg3 = nullptr; if (!args[3].isUndefined()) { ok &= seval_to_native_ptr(args[3], &arg3); cobj->depthStencilTexture = arg3; @@ -7983,24 +7983,24 @@ static bool js_gfx_GFXFramebufferInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXFramebufferInfo_constructor, __jsb_cc_GFXFramebufferInfo_class, js_cc_GFXFramebufferInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXFramebufferInfo_constructor, __jsb_cc_gfx_GFXFramebufferInfo_class, js_cc_gfx_GFXFramebufferInfo_finalize) -static bool js_cc_GFXFramebufferInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXFramebufferInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXFramebufferInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXFramebufferInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXFramebufferInfo* cobj = (cc::GFXFramebufferInfo*)s.nativeThisObject(); + cc::gfx::GFXFramebufferInfo* cobj = (cc::gfx::GFXFramebufferInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXFramebufferInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXFramebufferInfo_finalize) bool js_register_gfx_GFXFramebufferInfo(se::Object* obj) { @@ -8012,23 +8012,23 @@ bool js_register_gfx_GFXFramebufferInfo(se::Object* obj) cls->defineProperty("depthStencilTexture", _SE(js_gfx_GFXFramebufferInfo_get_depthStencilTexture), _SE(js_gfx_GFXFramebufferInfo_set_depthStencilTexture)); cls->defineProperty("depthStencilMipmapLevel", _SE(js_gfx_GFXFramebufferInfo_get_depthStencilMipmapLevel), _SE(js_gfx_GFXFramebufferInfo_set_depthStencilMipmapLevel)); cls->defineProperty("isOffscreen", _SE(js_gfx_GFXFramebufferInfo_get_isOffscreen), _SE(js_gfx_GFXFramebufferInfo_set_isOffscreen)); - cls->defineFinalizeFunction(_SE(js_cc_GFXFramebufferInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXFramebufferInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXFramebufferInfo_proto = cls->getProto(); - __jsb_cc_GFXFramebufferInfo_class = cls; + __jsb_cc_gfx_GFXFramebufferInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXFramebufferInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBinding_proto = nullptr; -se::Class* __jsb_cc_GFXBinding_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBinding_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBinding_class = nullptr; static bool js_gfx_GFXBinding_get_shaderStages(se::State& s) { - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_get_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8042,12 +8042,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBinding_get_shaderStages) static bool js_gfx_GFXBinding_set_shaderStages(se::State& s) { const auto& args = s.args(); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_set_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBinding_set_shaderStages : Error processing new value"); cobj->shaderStages = arg0; return true; @@ -8056,7 +8056,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBinding_set_shaderStages) static bool js_gfx_GFXBinding_get_binding(se::State& s) { - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_get_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8070,7 +8070,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBinding_get_binding) static bool js_gfx_GFXBinding_set_binding(se::State& s) { const auto& args = s.args(); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_set_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8084,7 +8084,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBinding_set_binding) static bool js_gfx_GFXBinding_get_type(se::State& s) { - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8098,12 +8098,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBinding_get_type) static bool js_gfx_GFXBinding_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBindingType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBindingType)tmp; } while(false); + cc::gfx::GFXBindingType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBindingType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBinding_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -8112,7 +8112,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBinding_set_type) static bool js_gfx_GFXBinding_get_name(se::State& s) { - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8126,11 +8126,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBinding_get_name) static bool js_gfx_GFXBinding_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXBinding_set_name : Error processing new value"); cobj->name = arg0; @@ -8140,7 +8140,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBinding_set_name) static bool js_gfx_GFXBinding_get_count(se::State& s) { - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8154,7 +8154,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBinding_get_count) static bool js_gfx_GFXBinding_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBinding_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8166,7 +8166,7 @@ static bool js_gfx_GFXBinding_set_count(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXBinding_set_count) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBinding_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBinding_finalize) static bool js_gfx_GFXBinding_constructor(se::State& s) { @@ -8176,7 +8176,7 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) if(argc == 0) { - cc::GFXBinding* cobj = JSB_ALLOC(cc::GFXBinding); + cc::gfx::GFXBinding* cobj = JSB_ALLOC(cc::gfx::GFXBinding); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -8186,11 +8186,11 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBinding* cobj = JSB_ALLOC(cc::GFXBinding); - cc::GFXShaderType arg0; + cc::gfx::GFXBinding* cobj = JSB_ALLOC(cc::gfx::GFXBinding); + cc::gfx::GFXShaderType arg0; json->getProperty("shaderStages", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -8199,13 +8199,13 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg1); cobj->binding = arg1; } - cc::GFXBindingType arg2; + cc::gfx::GFXBindingType arg2; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXBindingType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXBindingType)tmp; } while(false); cobj->type = arg2; } - cc::String arg3; + cc::gfx::String arg3; json->getProperty("name", &field); if(!field.isUndefined()) { arg3 = field.toStringForce().c_str(); @@ -8230,10 +8230,10 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) } else if(argc == 5) { - cc::GFXBinding* cobj = JSB_ALLOC(cc::GFXBinding); - cc::GFXShaderType arg0; + cc::gfx::GFXBinding* cobj = JSB_ALLOC(cc::gfx::GFXBinding); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -8241,12 +8241,12 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); cobj->binding = arg1; } - cc::GFXBindingType arg2; + cc::gfx::GFXBindingType arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXBindingType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXBindingType)tmp; } while(false); cobj->type = arg2; } - cc::String arg3; + cc::gfx::String arg3; if (!args[3].isUndefined()) { arg3 = args[3].toStringForce().c_str(); cobj->name = arg3; @@ -8271,24 +8271,24 @@ static bool js_gfx_GFXBinding_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBinding_constructor, __jsb_cc_GFXBinding_class, js_cc_GFXBinding_finalize) +SE_BIND_CTOR(js_gfx_GFXBinding_constructor, __jsb_cc_gfx_GFXBinding_class, js_cc_gfx_GFXBinding_finalize) -static bool js_cc_GFXBinding_finalize(se::State& s) +static bool js_cc_gfx_GFXBinding_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBinding)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBinding)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBinding* cobj = (cc::GFXBinding*)s.nativeThisObject(); + cc::gfx::GFXBinding* cobj = (cc::gfx::GFXBinding*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBinding_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBinding_finalize) bool js_register_gfx_GFXBinding(se::Object* obj) { @@ -8299,23 +8299,23 @@ bool js_register_gfx_GFXBinding(se::Object* obj) cls->defineProperty("type", _SE(js_gfx_GFXBinding_get_type), _SE(js_gfx_GFXBinding_set_type)); cls->defineProperty("name", _SE(js_gfx_GFXBinding_get_name), _SE(js_gfx_GFXBinding_set_name)); cls->defineProperty("count", _SE(js_gfx_GFXBinding_get_count), _SE(js_gfx_GFXBinding_set_count)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBinding_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBinding_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBinding_proto = cls->getProto(); - __jsb_cc_GFXBinding_class = cls; + __jsb_cc_gfx_GFXBinding_proto = cls->getProto(); + __jsb_cc_gfx_GFXBinding_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBindingLayoutInfo_proto = nullptr; -se::Class* __jsb_cc_GFXBindingLayoutInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBindingLayoutInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBindingLayoutInfo_class = nullptr; static bool js_gfx_GFXBindingLayoutInfo_get_bindings(se::State& s) { - cc::GFXBindingLayoutInfo* cobj = (cc::GFXBindingLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXBindingLayoutInfo* cobj = (cc::gfx::GFXBindingLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayoutInfo_get_bindings : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8329,11 +8329,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingLayoutInfo_get_bindings) static bool js_gfx_GFXBindingLayoutInfo_set_bindings(se::State& s) { const auto& args = s.args(); - cc::GFXBindingLayoutInfo* cobj = (cc::GFXBindingLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXBindingLayoutInfo* cobj = (cc::gfx::GFXBindingLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayoutInfo_set_bindings : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayoutInfo_set_bindings : Error processing new value"); cobj->bindings = arg0; @@ -8341,7 +8341,7 @@ static bool js_gfx_GFXBindingLayoutInfo_set_bindings(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXBindingLayoutInfo_set_bindings) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBindingLayoutInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBindingLayoutInfo_finalize) static bool js_gfx_GFXBindingLayoutInfo_constructor(se::State& s) { @@ -8351,15 +8351,15 @@ static bool js_gfx_GFXBindingLayoutInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXBindingLayoutInfo* cobj = JSB_ALLOC(cc::GFXBindingLayoutInfo); + cc::gfx::GFXBindingLayoutInfo* cobj = JSB_ALLOC(cc::gfx::GFXBindingLayoutInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } else if(argc == 1) { - cc::GFXBindingLayoutInfo* cobj = JSB_ALLOC(cc::GFXBindingLayoutInfo); - std::vector arg0; + cc::gfx::GFXBindingLayoutInfo* cobj = JSB_ALLOC(cc::gfx::GFXBindingLayoutInfo); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->bindings = arg0; @@ -8379,47 +8379,47 @@ static bool js_gfx_GFXBindingLayoutInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBindingLayoutInfo_constructor, __jsb_cc_GFXBindingLayoutInfo_class, js_cc_GFXBindingLayoutInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXBindingLayoutInfo_constructor, __jsb_cc_gfx_GFXBindingLayoutInfo_class, js_cc_gfx_GFXBindingLayoutInfo_finalize) -static bool js_cc_GFXBindingLayoutInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXBindingLayoutInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBindingLayoutInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBindingLayoutInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBindingLayoutInfo* cobj = (cc::GFXBindingLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXBindingLayoutInfo* cobj = (cc::gfx::GFXBindingLayoutInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBindingLayoutInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBindingLayoutInfo_finalize) bool js_register_gfx_GFXBindingLayoutInfo(se::Object* obj) { auto cls = se::Class::create("GFXBindingLayoutInfo", obj, nullptr, _SE(js_gfx_GFXBindingLayoutInfo_constructor)); cls->defineProperty("bindings", _SE(js_gfx_GFXBindingLayoutInfo_get_bindings), _SE(js_gfx_GFXBindingLayoutInfo_set_bindings)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBindingLayoutInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBindingLayoutInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBindingLayoutInfo_proto = cls->getProto(); - __jsb_cc_GFXBindingLayoutInfo_class = cls; + __jsb_cc_gfx_GFXBindingLayoutInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXBindingLayoutInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBindingUnit_proto = nullptr; -se::Class* __jsb_cc_GFXBindingUnit_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBindingUnit_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBindingUnit_class = nullptr; static bool js_gfx_GFXBindingUnit_get_shaderStages(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8433,12 +8433,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_shaderStages) static bool js_gfx_GFXBindingUnit_set_shaderStages(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_shaderStages : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_shaderStages : Error processing new value"); cobj->shaderStages = arg0; return true; @@ -8447,7 +8447,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_shaderStages) static bool js_gfx_GFXBindingUnit_get_binding(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8461,7 +8461,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_binding) static bool js_gfx_GFXBindingUnit_set_binding(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_binding : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8475,7 +8475,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_binding) static bool js_gfx_GFXBindingUnit_get_type(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8489,12 +8489,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_type) static bool js_gfx_GFXBindingUnit_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBindingType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBindingType)tmp; } while(false); + cc::gfx::GFXBindingType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBindingType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -8503,7 +8503,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_type) static bool js_gfx_GFXBindingUnit_get_name(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8517,11 +8517,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_name) static bool js_gfx_GFXBindingUnit_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_name : Error processing new value"); cobj->name = arg0; @@ -8531,7 +8531,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_name) static bool js_gfx_GFXBindingUnit_get_count(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8545,7 +8545,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_count) static bool js_gfx_GFXBindingUnit_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8559,7 +8559,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_count) static bool js_gfx_GFXBindingUnit_get_buffer(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_buffer : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8573,11 +8573,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_buffer) static bool js_gfx_GFXBindingUnit_set_buffer(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_buffer : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXBuffer* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_buffer : Error processing new value"); cobj->buffer = arg0; @@ -8587,7 +8587,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_buffer) static bool js_gfx_GFXBindingUnit_get_texture(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_texture : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8601,11 +8601,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_texture) static bool js_gfx_GFXBindingUnit_set_texture(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_texture : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXTexture* arg0 = nullptr; + cc::gfx::GFXTexture* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_texture : Error processing new value"); cobj->texture = arg0; @@ -8615,7 +8615,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_texture) static bool js_gfx_GFXBindingUnit_get_sampler(se::State& s) { - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_get_sampler : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8629,11 +8629,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingUnit_get_sampler) static bool js_gfx_GFXBindingUnit_set_sampler(se::State& s) { const auto& args = s.args(); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingUnit_set_sampler : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXSampler* arg0 = nullptr; + cc::gfx::GFXSampler* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingUnit_set_sampler : Error processing new value"); cobj->sampler = arg0; @@ -8641,7 +8641,7 @@ static bool js_gfx_GFXBindingUnit_set_sampler(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXBindingUnit_set_sampler) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBindingUnit_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBindingUnit_finalize) static bool js_gfx_GFXBindingUnit_constructor(se::State& s) { @@ -8651,7 +8651,7 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) if(argc == 0) { - cc::GFXBindingUnit* cobj = JSB_ALLOC(cc::GFXBindingUnit); + cc::gfx::GFXBindingUnit* cobj = JSB_ALLOC(cc::gfx::GFXBindingUnit); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -8661,11 +8661,11 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBindingUnit* cobj = JSB_ALLOC(cc::GFXBindingUnit); - cc::GFXShaderType arg0; + cc::gfx::GFXBindingUnit* cobj = JSB_ALLOC(cc::gfx::GFXBindingUnit); + cc::gfx::GFXShaderType arg0; json->getProperty("shaderStages", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -8674,13 +8674,13 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg1); cobj->binding = arg1; } - cc::GFXBindingType arg2; + cc::gfx::GFXBindingType arg2; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXBindingType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXBindingType)tmp; } while(false); cobj->type = arg2; } - cc::String arg3; + cc::gfx::String arg3; json->getProperty("name", &field); if(!field.isUndefined()) { arg3 = field.toStringForce().c_str(); @@ -8692,19 +8692,19 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg4); cobj->count = arg4; } - cc::GFXBuffer* arg5 = nullptr; + cc::gfx::GFXBuffer* arg5 = nullptr; json->getProperty("buffer", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg5); cobj->buffer = arg5; } - cc::GFXTexture* arg6 = nullptr; + cc::gfx::GFXTexture* arg6 = nullptr; json->getProperty("texture", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg6); cobj->texture = arg6; } - cc::GFXSampler* arg7 = nullptr; + cc::gfx::GFXSampler* arg7 = nullptr; json->getProperty("sampler", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg7); @@ -8723,10 +8723,10 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) } else if(argc == 8) { - cc::GFXBindingUnit* cobj = JSB_ALLOC(cc::GFXBindingUnit); - cc::GFXShaderType arg0; + cc::gfx::GFXBindingUnit* cobj = JSB_ALLOC(cc::gfx::GFXBindingUnit); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderStages = arg0; } unsigned int arg1 = 0; @@ -8734,12 +8734,12 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); cobj->binding = arg1; } - cc::GFXBindingType arg2; + cc::gfx::GFXBindingType arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXBindingType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXBindingType)tmp; } while(false); cobj->type = arg2; } - cc::String arg3; + cc::gfx::String arg3; if (!args[3].isUndefined()) { arg3 = args[3].toStringForce().c_str(); cobj->name = arg3; @@ -8749,17 +8749,17 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) ok &= seval_to_uint32(args[4], (uint32_t*)&arg4); cobj->count = arg4; } - cc::GFXBuffer* arg5 = nullptr; + cc::gfx::GFXBuffer* arg5 = nullptr; if (!args[5].isUndefined()) { ok &= seval_to_native_ptr(args[5], &arg5); cobj->buffer = arg5; } - cc::GFXTexture* arg6 = nullptr; + cc::gfx::GFXTexture* arg6 = nullptr; if (!args[6].isUndefined()) { ok &= seval_to_native_ptr(args[6], &arg6); cobj->texture = arg6; } - cc::GFXSampler* arg7 = nullptr; + cc::gfx::GFXSampler* arg7 = nullptr; if (!args[7].isUndefined()) { ok &= seval_to_native_ptr(args[7], &arg7); cobj->sampler = arg7; @@ -8779,24 +8779,24 @@ static bool js_gfx_GFXBindingUnit_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBindingUnit_constructor, __jsb_cc_GFXBindingUnit_class, js_cc_GFXBindingUnit_finalize) +SE_BIND_CTOR(js_gfx_GFXBindingUnit_constructor, __jsb_cc_gfx_GFXBindingUnit_class, js_cc_gfx_GFXBindingUnit_finalize) -static bool js_cc_GFXBindingUnit_finalize(se::State& s) +static bool js_cc_gfx_GFXBindingUnit_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBindingUnit)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBindingUnit)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBindingUnit* cobj = (cc::GFXBindingUnit*)s.nativeThisObject(); + cc::gfx::GFXBindingUnit* cobj = (cc::gfx::GFXBindingUnit*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBindingUnit_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBindingUnit_finalize) bool js_register_gfx_GFXBindingUnit(se::Object* obj) { @@ -8810,23 +8810,23 @@ bool js_register_gfx_GFXBindingUnit(se::Object* obj) cls->defineProperty("buffer", _SE(js_gfx_GFXBindingUnit_get_buffer), _SE(js_gfx_GFXBindingUnit_set_buffer)); cls->defineProperty("texture", _SE(js_gfx_GFXBindingUnit_get_texture), _SE(js_gfx_GFXBindingUnit_set_texture)); cls->defineProperty("sampler", _SE(js_gfx_GFXBindingUnit_get_sampler), _SE(js_gfx_GFXBindingUnit_set_sampler)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBindingUnit_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBindingUnit_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBindingUnit_proto = cls->getProto(); - __jsb_cc_GFXBindingUnit_class = cls; + __jsb_cc_gfx_GFXBindingUnit_proto = cls->getProto(); + __jsb_cc_gfx_GFXBindingUnit_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXPushConstantRange_proto = nullptr; -se::Class* __jsb_cc_GFXPushConstantRange_class = nullptr; +se::Object* __jsb_cc_gfx_GFXPushConstantRange_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXPushConstantRange_class = nullptr; static bool js_gfx_GFXPushConstantRange_get_shaderType(se::State& s) { - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_get_shaderType : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8840,12 +8840,12 @@ SE_BIND_PROP_GET(js_gfx_GFXPushConstantRange_get_shaderType) static bool js_gfx_GFXPushConstantRange_set_shaderType(se::State& s) { const auto& args = s.args(); - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_set_shaderType : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShaderType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + cc::gfx::GFXShaderType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXPushConstantRange_set_shaderType : Error processing new value"); cobj->shaderType = arg0; return true; @@ -8854,7 +8854,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPushConstantRange_set_shaderType) static bool js_gfx_GFXPushConstantRange_get_offset(se::State& s) { - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_get_offset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8868,7 +8868,7 @@ SE_BIND_PROP_GET(js_gfx_GFXPushConstantRange_get_offset) static bool js_gfx_GFXPushConstantRange_set_offset(se::State& s) { const auto& args = s.args(); - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_set_offset : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8882,7 +8882,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPushConstantRange_set_offset) static bool js_gfx_GFXPushConstantRange_get_count(se::State& s) { - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8896,7 +8896,7 @@ SE_BIND_PROP_GET(js_gfx_GFXPushConstantRange_get_count) static bool js_gfx_GFXPushConstantRange_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPushConstantRange_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -8908,7 +8908,7 @@ static bool js_gfx_GFXPushConstantRange_set_count(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXPushConstantRange_set_count) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXPushConstantRange_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXPushConstantRange_finalize) static bool js_gfx_GFXPushConstantRange_constructor(se::State& s) { @@ -8918,7 +8918,7 @@ static bool js_gfx_GFXPushConstantRange_constructor(se::State& s) if(argc == 0) { - cc::GFXPushConstantRange* cobj = JSB_ALLOC(cc::GFXPushConstantRange); + cc::gfx::GFXPushConstantRange* cobj = JSB_ALLOC(cc::gfx::GFXPushConstantRange); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -8928,11 +8928,11 @@ static bool js_gfx_GFXPushConstantRange_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXPushConstantRange* cobj = JSB_ALLOC(cc::GFXPushConstantRange); - cc::GFXShaderType arg0; + cc::gfx::GFXPushConstantRange* cobj = JSB_ALLOC(cc::gfx::GFXPushConstantRange); + cc::gfx::GFXShaderType arg0; json->getProperty("shaderType", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderType = arg0; } unsigned int arg1 = 0; @@ -8960,10 +8960,10 @@ static bool js_gfx_GFXPushConstantRange_constructor(se::State& s) } else if(argc == 3) { - cc::GFXPushConstantRange* cobj = JSB_ALLOC(cc::GFXPushConstantRange); - cc::GFXShaderType arg0; + cc::gfx::GFXPushConstantRange* cobj = JSB_ALLOC(cc::gfx::GFXPushConstantRange); + cc::gfx::GFXShaderType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShaderType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShaderType)tmp; } while(false); cobj->shaderType = arg0; } unsigned int arg1 = 0; @@ -8991,24 +8991,24 @@ static bool js_gfx_GFXPushConstantRange_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXPushConstantRange_constructor, __jsb_cc_GFXPushConstantRange_class, js_cc_GFXPushConstantRange_finalize) +SE_BIND_CTOR(js_gfx_GFXPushConstantRange_constructor, __jsb_cc_gfx_GFXPushConstantRange_class, js_cc_gfx_GFXPushConstantRange_finalize) -static bool js_cc_GFXPushConstantRange_finalize(se::State& s) +static bool js_cc_gfx_GFXPushConstantRange_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXPushConstantRange)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXPushConstantRange)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXPushConstantRange* cobj = (cc::GFXPushConstantRange*)s.nativeThisObject(); + cc::gfx::GFXPushConstantRange* cobj = (cc::gfx::GFXPushConstantRange*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXPushConstantRange_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXPushConstantRange_finalize) bool js_register_gfx_GFXPushConstantRange(se::Object* obj) { @@ -9017,23 +9017,23 @@ bool js_register_gfx_GFXPushConstantRange(se::Object* obj) cls->defineProperty("shaderType", _SE(js_gfx_GFXPushConstantRange_get_shaderType), _SE(js_gfx_GFXPushConstantRange_set_shaderType)); cls->defineProperty("offset", _SE(js_gfx_GFXPushConstantRange_get_offset), _SE(js_gfx_GFXPushConstantRange_set_offset)); cls->defineProperty("count", _SE(js_gfx_GFXPushConstantRange_get_count), _SE(js_gfx_GFXPushConstantRange_set_count)); - cls->defineFinalizeFunction(_SE(js_cc_GFXPushConstantRange_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXPushConstantRange_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXPushConstantRange_proto = cls->getProto(); - __jsb_cc_GFXPushConstantRange_class = cls; + __jsb_cc_gfx_GFXPushConstantRange_proto = cls->getProto(); + __jsb_cc_gfx_GFXPushConstantRange_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXPipelineLayoutInfo_proto = nullptr; -se::Class* __jsb_cc_GFXPipelineLayoutInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXPipelineLayoutInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXPipelineLayoutInfo_class = nullptr; static bool js_gfx_GFXPipelineLayoutInfo_get_pushConstantsRanges(se::State& s) { - cc::GFXPipelineLayoutInfo* cobj = (cc::GFXPipelineLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayoutInfo* cobj = (cc::gfx::GFXPipelineLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayoutInfo_get_pushConstantsRanges : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9047,11 +9047,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineLayoutInfo_get_pushConstantsRanges) static bool js_gfx_GFXPipelineLayoutInfo_set_pushConstantsRanges(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineLayoutInfo* cobj = (cc::GFXPipelineLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayoutInfo* cobj = (cc::gfx::GFXPipelineLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayoutInfo_set_pushConstantsRanges : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayoutInfo_set_pushConstantsRanges : Error processing new value"); cobj->pushConstantsRanges = arg0; @@ -9061,7 +9061,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineLayoutInfo_set_pushConstantsRanges) static bool js_gfx_GFXPipelineLayoutInfo_get_layouts(se::State& s) { - cc::GFXPipelineLayoutInfo* cobj = (cc::GFXPipelineLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayoutInfo* cobj = (cc::gfx::GFXPipelineLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayoutInfo_get_layouts : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9075,11 +9075,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineLayoutInfo_get_layouts) static bool js_gfx_GFXPipelineLayoutInfo_set_layouts(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineLayoutInfo* cobj = (cc::GFXPipelineLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayoutInfo* cobj = (cc::gfx::GFXPipelineLayoutInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayoutInfo_set_layouts : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayoutInfo_set_layouts : Error processing new value"); cobj->layouts = arg0; @@ -9087,7 +9087,7 @@ static bool js_gfx_GFXPipelineLayoutInfo_set_layouts(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXPipelineLayoutInfo_set_layouts) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXPipelineLayoutInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXPipelineLayoutInfo_finalize) static bool js_gfx_GFXPipelineLayoutInfo_constructor(se::State& s) { @@ -9097,7 +9097,7 @@ static bool js_gfx_GFXPipelineLayoutInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::GFXPipelineLayoutInfo); + cc::gfx::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineLayoutInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -9107,14 +9107,14 @@ static bool js_gfx_GFXPipelineLayoutInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::GFXPipelineLayoutInfo); - std::vector arg0; + cc::gfx::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineLayoutInfo); + std::vector arg0; json->getProperty("pushConstantsRanges", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg0); cobj->pushConstantsRanges = arg0; } - std::vector arg1; + std::vector arg1; json->getProperty("layouts", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg1); @@ -9133,13 +9133,13 @@ static bool js_gfx_GFXPipelineLayoutInfo_constructor(se::State& s) } else if(argc == 2) { - cc::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::GFXPipelineLayoutInfo); - std::vector arg0; + cc::gfx::GFXPipelineLayoutInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineLayoutInfo); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->pushConstantsRanges = arg0; } - std::vector arg1; + std::vector arg1; if (!args[1].isUndefined()) { ok &= seval_to_std_vector(args[1], &arg1); cobj->layouts = arg1; @@ -9159,24 +9159,24 @@ static bool js_gfx_GFXPipelineLayoutInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXPipelineLayoutInfo_constructor, __jsb_cc_GFXPipelineLayoutInfo_class, js_cc_GFXPipelineLayoutInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXPipelineLayoutInfo_constructor, __jsb_cc_gfx_GFXPipelineLayoutInfo_class, js_cc_gfx_GFXPipelineLayoutInfo_finalize) -static bool js_cc_GFXPipelineLayoutInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXPipelineLayoutInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXPipelineLayoutInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXPipelineLayoutInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXPipelineLayoutInfo* cobj = (cc::GFXPipelineLayoutInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayoutInfo* cobj = (cc::gfx::GFXPipelineLayoutInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXPipelineLayoutInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXPipelineLayoutInfo_finalize) bool js_register_gfx_GFXPipelineLayoutInfo(se::Object* obj) { @@ -9184,23 +9184,23 @@ bool js_register_gfx_GFXPipelineLayoutInfo(se::Object* obj) cls->defineProperty("pushConstantsRanges", _SE(js_gfx_GFXPipelineLayoutInfo_get_pushConstantsRanges), _SE(js_gfx_GFXPipelineLayoutInfo_set_pushConstantsRanges)); cls->defineProperty("layouts", _SE(js_gfx_GFXPipelineLayoutInfo_get_layouts), _SE(js_gfx_GFXPipelineLayoutInfo_set_layouts)); - cls->defineFinalizeFunction(_SE(js_cc_GFXPipelineLayoutInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXPipelineLayoutInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXPipelineLayoutInfo_proto = cls->getProto(); - __jsb_cc_GFXPipelineLayoutInfo_class = cls; + __jsb_cc_gfx_GFXPipelineLayoutInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXPipelineLayoutInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXInputState_proto = nullptr; -se::Class* __jsb_cc_GFXInputState_class = nullptr; +se::Object* __jsb_cc_gfx_GFXInputState_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXInputState_class = nullptr; static bool js_gfx_GFXInputState_get_attributes(se::State& s) { - cc::GFXInputState* cobj = (cc::GFXInputState*)s.nativeThisObject(); + cc::gfx::GFXInputState* cobj = (cc::gfx::GFXInputState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputState_get_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9214,11 +9214,11 @@ SE_BIND_PROP_GET(js_gfx_GFXInputState_get_attributes) static bool js_gfx_GFXInputState_set_attributes(se::State& s) { const auto& args = s.args(); - cc::GFXInputState* cobj = (cc::GFXInputState*)s.nativeThisObject(); + cc::gfx::GFXInputState* cobj = (cc::gfx::GFXInputState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputState_set_attributes : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputState_set_attributes : Error processing new value"); cobj->attributes = arg0; @@ -9226,7 +9226,7 @@ static bool js_gfx_GFXInputState_set_attributes(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXInputState_set_attributes) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXInputState_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXInputState_finalize) static bool js_gfx_GFXInputState_constructor(se::State& s) { @@ -9236,15 +9236,15 @@ static bool js_gfx_GFXInputState_constructor(se::State& s) if(argc == 0) { - cc::GFXInputState* cobj = JSB_ALLOC(cc::GFXInputState); + cc::gfx::GFXInputState* cobj = JSB_ALLOC(cc::gfx::GFXInputState); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } else if(argc == 1) { - cc::GFXInputState* cobj = JSB_ALLOC(cc::GFXInputState); - std::vector arg0; + cc::gfx::GFXInputState* cobj = JSB_ALLOC(cc::gfx::GFXInputState); + std::vector arg0; if (!args[0].isUndefined()) { ok &= seval_to_std_vector(args[0], &arg0); cobj->attributes = arg0; @@ -9264,47 +9264,47 @@ static bool js_gfx_GFXInputState_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXInputState_constructor, __jsb_cc_GFXInputState_class, js_cc_GFXInputState_finalize) +SE_BIND_CTOR(js_gfx_GFXInputState_constructor, __jsb_cc_gfx_GFXInputState_class, js_cc_gfx_GFXInputState_finalize) -static bool js_cc_GFXInputState_finalize(se::State& s) +static bool js_cc_gfx_GFXInputState_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXInputState)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXInputState)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXInputState* cobj = (cc::GFXInputState*)s.nativeThisObject(); + cc::gfx::GFXInputState* cobj = (cc::gfx::GFXInputState*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXInputState_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXInputState_finalize) bool js_register_gfx_GFXInputState(se::Object* obj) { auto cls = se::Class::create("GFXInputState", obj, nullptr, _SE(js_gfx_GFXInputState_constructor)); cls->defineProperty("attributes", _SE(js_gfx_GFXInputState_get_attributes), _SE(js_gfx_GFXInputState_set_attributes)); - cls->defineFinalizeFunction(_SE(js_cc_GFXInputState_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXInputState_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXInputState_proto = cls->getProto(); - __jsb_cc_GFXInputState_class = cls; + __jsb_cc_gfx_GFXInputState_proto = cls->getProto(); + __jsb_cc_gfx_GFXInputState_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXRasterizerState_proto = nullptr; -se::Class* __jsb_cc_GFXRasterizerState_class = nullptr; +se::Object* __jsb_cc_gfx_GFXRasterizerState_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXRasterizerState_class = nullptr; static bool js_gfx_GFXRasterizerState_get_isDiscard(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_isDiscard : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9318,7 +9318,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_isDiscard) static bool js_gfx_GFXRasterizerState_set_isDiscard(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_isDiscard : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9332,7 +9332,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_isDiscard) static bool js_gfx_GFXRasterizerState_get_polygonMode(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_polygonMode : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9346,12 +9346,12 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_polygonMode) static bool js_gfx_GFXRasterizerState_set_polygonMode(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_polygonMode : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXPolygonMode arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXPolygonMode)tmp; } while(false); + cc::gfx::GFXPolygonMode arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXPolygonMode)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXRasterizerState_set_polygonMode : Error processing new value"); cobj->polygonMode = arg0; return true; @@ -9360,7 +9360,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_polygonMode) static bool js_gfx_GFXRasterizerState_get_shadeModel(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_shadeModel : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9374,12 +9374,12 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_shadeModel) static bool js_gfx_GFXRasterizerState_set_shadeModel(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_shadeModel : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShadeModel arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXShadeModel)tmp; } while(false); + cc::gfx::GFXShadeModel arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXShadeModel)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXRasterizerState_set_shadeModel : Error processing new value"); cobj->shadeModel = arg0; return true; @@ -9388,7 +9388,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_shadeModel) static bool js_gfx_GFXRasterizerState_get_cullMode(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_cullMode : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9402,12 +9402,12 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_cullMode) static bool js_gfx_GFXRasterizerState_set_cullMode(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_cullMode : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXCullMode arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXCullMode)tmp; } while(false); + cc::gfx::GFXCullMode arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXCullMode)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXRasterizerState_set_cullMode : Error processing new value"); cobj->cullMode = arg0; return true; @@ -9416,7 +9416,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_cullMode) static bool js_gfx_GFXRasterizerState_get_isFrontFaceCCW(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_isFrontFaceCCW : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9430,7 +9430,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_isFrontFaceCCW) static bool js_gfx_GFXRasterizerState_set_isFrontFaceCCW(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_isFrontFaceCCW : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9444,7 +9444,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_isFrontFaceCCW) static bool js_gfx_GFXRasterizerState_get_depthBiasEnabled(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_depthBiasEnabled : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9458,7 +9458,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_depthBiasEnabled) static bool js_gfx_GFXRasterizerState_set_depthBiasEnabled(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_depthBiasEnabled : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9472,7 +9472,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_depthBiasEnabled) static bool js_gfx_GFXRasterizerState_get_depthBias(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_depthBias : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9486,7 +9486,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_depthBias) static bool js_gfx_GFXRasterizerState_set_depthBias(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_depthBias : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9500,7 +9500,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_depthBias) static bool js_gfx_GFXRasterizerState_get_depthBiasClamp(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_depthBiasClamp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9514,7 +9514,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_depthBiasClamp) static bool js_gfx_GFXRasterizerState_set_depthBiasClamp(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_depthBiasClamp : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9528,7 +9528,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_depthBiasClamp) static bool js_gfx_GFXRasterizerState_get_depthBiasSlop(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_depthBiasSlop : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9542,7 +9542,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_depthBiasSlop) static bool js_gfx_GFXRasterizerState_set_depthBiasSlop(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_depthBiasSlop : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9556,7 +9556,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_depthBiasSlop) static bool js_gfx_GFXRasterizerState_get_isDepthClip(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_isDepthClip : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9570,7 +9570,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_isDepthClip) static bool js_gfx_GFXRasterizerState_set_isDepthClip(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_isDepthClip : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9584,7 +9584,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_isDepthClip) static bool js_gfx_GFXRasterizerState_get_isMultisample(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_isMultisample : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9598,7 +9598,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_isMultisample) static bool js_gfx_GFXRasterizerState_set_isMultisample(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_isMultisample : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9612,7 +9612,7 @@ SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_isMultisample) static bool js_gfx_GFXRasterizerState_get_lineWidth(se::State& s) { - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_get_lineWidth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9626,7 +9626,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRasterizerState_get_lineWidth) static bool js_gfx_GFXRasterizerState_set_lineWidth(se::State& s) { const auto& args = s.args(); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRasterizerState_set_lineWidth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9638,7 +9638,7 @@ static bool js_gfx_GFXRasterizerState_set_lineWidth(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXRasterizerState_set_lineWidth) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXRasterizerState_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXRasterizerState_finalize) static bool js_gfx_GFXRasterizerState_constructor(se::State& s) { @@ -9648,7 +9648,7 @@ static bool js_gfx_GFXRasterizerState_constructor(se::State& s) if(argc == 0) { - cc::GFXRasterizerState* cobj = JSB_ALLOC(cc::GFXRasterizerState); + cc::gfx::GFXRasterizerState* cobj = JSB_ALLOC(cc::gfx::GFXRasterizerState); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -9658,29 +9658,29 @@ static bool js_gfx_GFXRasterizerState_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXRasterizerState* cobj = JSB_ALLOC(cc::GFXRasterizerState); + cc::gfx::GFXRasterizerState* cobj = JSB_ALLOC(cc::gfx::GFXRasterizerState); bool arg0; json->getProperty("isDiscard", &field); if(!field.isUndefined()) { ok &= seval_to_boolean(field, &arg0); cobj->isDiscard = arg0; } - cc::GFXPolygonMode arg1; + cc::gfx::GFXPolygonMode arg1; json->getProperty("polygonMode", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXPolygonMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXPolygonMode)tmp; } while(false); cobj->polygonMode = arg1; } - cc::GFXShadeModel arg2; + cc::gfx::GFXShadeModel arg2; json->getProperty("shadeModel", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXShadeModel)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXShadeModel)tmp; } while(false); cobj->shadeModel = arg2; } - cc::GFXCullMode arg3; + cc::gfx::GFXCullMode arg3; json->getProperty("cullMode", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXCullMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXCullMode)tmp; } while(false); cobj->cullMode = arg3; } bool arg4; @@ -9744,25 +9744,25 @@ static bool js_gfx_GFXRasterizerState_constructor(se::State& s) } else if(argc == 12) { - cc::GFXRasterizerState* cobj = JSB_ALLOC(cc::GFXRasterizerState); + cc::gfx::GFXRasterizerState* cobj = JSB_ALLOC(cc::gfx::GFXRasterizerState); bool arg0; if (!args[0].isUndefined()) { ok &= seval_to_boolean(args[0], &arg0); cobj->isDiscard = arg0; } - cc::GFXPolygonMode arg1; + cc::gfx::GFXPolygonMode arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXPolygonMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXPolygonMode)tmp; } while(false); cobj->polygonMode = arg1; } - cc::GFXShadeModel arg2; + cc::gfx::GFXShadeModel arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXShadeModel)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXShadeModel)tmp; } while(false); cobj->shadeModel = arg2; } - cc::GFXCullMode arg3; + cc::gfx::GFXCullMode arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXCullMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXCullMode)tmp; } while(false); cobj->cullMode = arg3; } bool arg4; @@ -9820,24 +9820,24 @@ static bool js_gfx_GFXRasterizerState_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXRasterizerState_constructor, __jsb_cc_GFXRasterizerState_class, js_cc_GFXRasterizerState_finalize) +SE_BIND_CTOR(js_gfx_GFXRasterizerState_constructor, __jsb_cc_gfx_GFXRasterizerState_class, js_cc_gfx_GFXRasterizerState_finalize) -static bool js_cc_GFXRasterizerState_finalize(se::State& s) +static bool js_cc_gfx_GFXRasterizerState_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXRasterizerState)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXRasterizerState)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXRasterizerState* cobj = (cc::GFXRasterizerState*)s.nativeThisObject(); + cc::gfx::GFXRasterizerState* cobj = (cc::gfx::GFXRasterizerState*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXRasterizerState_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXRasterizerState_finalize) bool js_register_gfx_GFXRasterizerState(se::Object* obj) { @@ -9855,23 +9855,23 @@ bool js_register_gfx_GFXRasterizerState(se::Object* obj) cls->defineProperty("isDepthClip", _SE(js_gfx_GFXRasterizerState_get_isDepthClip), _SE(js_gfx_GFXRasterizerState_set_isDepthClip)); cls->defineProperty("isMultisample", _SE(js_gfx_GFXRasterizerState_get_isMultisample), _SE(js_gfx_GFXRasterizerState_set_isMultisample)); cls->defineProperty("lineWidth", _SE(js_gfx_GFXRasterizerState_get_lineWidth), _SE(js_gfx_GFXRasterizerState_set_lineWidth)); - cls->defineFinalizeFunction(_SE(js_cc_GFXRasterizerState_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXRasterizerState_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXRasterizerState_proto = cls->getProto(); - __jsb_cc_GFXRasterizerState_class = cls; + __jsb_cc_gfx_GFXRasterizerState_proto = cls->getProto(); + __jsb_cc_gfx_GFXRasterizerState_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXDepthStencilState_proto = nullptr; -se::Class* __jsb_cc_GFXDepthStencilState_class = nullptr; +se::Object* __jsb_cc_gfx_GFXDepthStencilState_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXDepthStencilState_class = nullptr; static bool js_gfx_GFXDepthStencilState_get_depthTest(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_depthTest : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9885,7 +9885,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_depthTest) static bool js_gfx_GFXDepthStencilState_set_depthTest(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_depthTest : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9899,7 +9899,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_depthTest) static bool js_gfx_GFXDepthStencilState_get_depthWrite(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_depthWrite : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9913,7 +9913,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_depthWrite) static bool js_gfx_GFXDepthStencilState_set_depthWrite(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_depthWrite : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9927,7 +9927,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_depthWrite) static bool js_gfx_GFXDepthStencilState_get_depthFunc(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_depthFunc : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9941,12 +9941,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_depthFunc) static bool js_gfx_GFXDepthStencilState_set_depthFunc(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_depthFunc : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXComparisonFunc arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXComparisonFunc)tmp; } while(false); + cc::gfx::GFXComparisonFunc arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_depthFunc : Error processing new value"); cobj->depthFunc = arg0; return true; @@ -9955,7 +9955,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_depthFunc) static bool js_gfx_GFXDepthStencilState_get_stencilTestFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilTestFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9969,7 +9969,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilTestFront) static bool js_gfx_GFXDepthStencilState_set_stencilTestFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilTestFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9983,7 +9983,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilTestFront) static bool js_gfx_GFXDepthStencilState_get_stencilFuncFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilFuncFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -9997,12 +9997,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilFuncFront) static bool js_gfx_GFXDepthStencilState_set_stencilFuncFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilFuncFront : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXComparisonFunc arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXComparisonFunc)tmp; } while(false); + cc::gfx::GFXComparisonFunc arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilFuncFront : Error processing new value"); cobj->stencilFuncFront = arg0; return true; @@ -10011,7 +10011,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilFuncFront) static bool js_gfx_GFXDepthStencilState_get_stencilReadMaskFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilReadMaskFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10025,7 +10025,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilReadMaskFront) static bool js_gfx_GFXDepthStencilState_set_stencilReadMaskFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilReadMaskFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10039,7 +10039,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilReadMaskFront) static bool js_gfx_GFXDepthStencilState_get_stencilWriteMaskFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilWriteMaskFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10053,7 +10053,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilWriteMaskFront) static bool js_gfx_GFXDepthStencilState_set_stencilWriteMaskFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilWriteMaskFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10067,7 +10067,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilWriteMaskFront) static bool js_gfx_GFXDepthStencilState_get_stencilFailOpFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilFailOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10081,12 +10081,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilFailOpFront) static bool js_gfx_GFXDepthStencilState_set_stencilFailOpFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilFailOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilFailOpFront : Error processing new value"); cobj->stencilFailOpFront = arg0; return true; @@ -10095,7 +10095,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilFailOpFront) static bool js_gfx_GFXDepthStencilState_get_stencilZFailOpFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilZFailOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10109,12 +10109,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilZFailOpFront) static bool js_gfx_GFXDepthStencilState_set_stencilZFailOpFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilZFailOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilZFailOpFront : Error processing new value"); cobj->stencilZFailOpFront = arg0; return true; @@ -10123,7 +10123,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilZFailOpFront) static bool js_gfx_GFXDepthStencilState_get_stencilPassOpFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilPassOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10137,12 +10137,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilPassOpFront) static bool js_gfx_GFXDepthStencilState_set_stencilPassOpFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilPassOpFront : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilPassOpFront : Error processing new value"); cobj->stencilPassOpFront = arg0; return true; @@ -10151,7 +10151,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilPassOpFront) static bool js_gfx_GFXDepthStencilState_get_stencilRefFront(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilRefFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10165,7 +10165,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilRefFront) static bool js_gfx_GFXDepthStencilState_set_stencilRefFront(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilRefFront : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10179,7 +10179,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilRefFront) static bool js_gfx_GFXDepthStencilState_get_stencilTestBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilTestBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10193,7 +10193,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilTestBack) static bool js_gfx_GFXDepthStencilState_set_stencilTestBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilTestBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10207,7 +10207,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilTestBack) static bool js_gfx_GFXDepthStencilState_get_stencilFuncBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilFuncBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10221,12 +10221,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilFuncBack) static bool js_gfx_GFXDepthStencilState_set_stencilFuncBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilFuncBack : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXComparisonFunc arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXComparisonFunc)tmp; } while(false); + cc::gfx::GFXComparisonFunc arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilFuncBack : Error processing new value"); cobj->stencilFuncBack = arg0; return true; @@ -10235,7 +10235,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilFuncBack) static bool js_gfx_GFXDepthStencilState_get_stencilReadMaskBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilReadMaskBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10249,7 +10249,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilReadMaskBack) static bool js_gfx_GFXDepthStencilState_set_stencilReadMaskBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilReadMaskBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10263,7 +10263,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilReadMaskBack) static bool js_gfx_GFXDepthStencilState_get_stencilWriteMaskBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilWriteMaskBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10277,7 +10277,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilWriteMaskBack) static bool js_gfx_GFXDepthStencilState_set_stencilWriteMaskBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilWriteMaskBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10291,7 +10291,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilWriteMaskBack) static bool js_gfx_GFXDepthStencilState_get_stencilFailOpBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilFailOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10305,12 +10305,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilFailOpBack) static bool js_gfx_GFXDepthStencilState_set_stencilFailOpBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilFailOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilFailOpBack : Error processing new value"); cobj->stencilFailOpBack = arg0; return true; @@ -10319,7 +10319,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilFailOpBack) static bool js_gfx_GFXDepthStencilState_get_stencilZFailOpBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilZFailOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10333,12 +10333,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilZFailOpBack) static bool js_gfx_GFXDepthStencilState_set_stencilZFailOpBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilZFailOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilZFailOpBack : Error processing new value"); cobj->stencilZFailOpBack = arg0; return true; @@ -10347,7 +10347,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilZFailOpBack) static bool js_gfx_GFXDepthStencilState_get_stencilPassOpBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilPassOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10361,12 +10361,12 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilPassOpBack) static bool js_gfx_GFXDepthStencilState_set_stencilPassOpBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilPassOpBack : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXStencilOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilOp)tmp; } while(false); + cc::gfx::GFXStencilOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDepthStencilState_set_stencilPassOpBack : Error processing new value"); cobj->stencilPassOpBack = arg0; return true; @@ -10375,7 +10375,7 @@ SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilPassOpBack) static bool js_gfx_GFXDepthStencilState_get_stencilRefBack(se::State& s) { - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_get_stencilRefBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10389,7 +10389,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDepthStencilState_get_stencilRefBack) static bool js_gfx_GFXDepthStencilState_set_stencilRefBack(se::State& s) { const auto& args = s.args(); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDepthStencilState_set_stencilRefBack : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10401,7 +10401,7 @@ static bool js_gfx_GFXDepthStencilState_set_stencilRefBack(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXDepthStencilState_set_stencilRefBack) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXDepthStencilState_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXDepthStencilState_finalize) static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) { @@ -10411,7 +10411,7 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) if(argc == 0) { - cc::GFXDepthStencilState* cobj = JSB_ALLOC(cc::GFXDepthStencilState); + cc::gfx::GFXDepthStencilState* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilState); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -10421,7 +10421,7 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXDepthStencilState* cobj = JSB_ALLOC(cc::GFXDepthStencilState); + cc::gfx::GFXDepthStencilState* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilState); bool arg0; json->getProperty("depthTest", &field); if(!field.isUndefined()) { @@ -10434,10 +10434,10 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(field, &arg1); cobj->depthWrite = arg1; } - cc::GFXComparisonFunc arg2; + cc::gfx::GFXComparisonFunc arg2; json->getProperty("depthFunc", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->depthFunc = arg2; } bool arg3; @@ -10446,10 +10446,10 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(field, &arg3); cobj->stencilTestFront = arg3; } - cc::GFXComparisonFunc arg4; + cc::gfx::GFXComparisonFunc arg4; json->getProperty("stencilFuncFront", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->stencilFuncFront = arg4; } unsigned int arg5 = 0; @@ -10464,22 +10464,22 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg6); cobj->stencilWriteMaskFront = arg6; } - cc::GFXStencilOp arg7; + cc::gfx::GFXStencilOp arg7; json->getProperty("stencilFailOpFront", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilFailOpFront = arg7; } - cc::GFXStencilOp arg8; + cc::gfx::GFXStencilOp arg8; json->getProperty("stencilZFailOpFront", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg8 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilZFailOpFront = arg8; } - cc::GFXStencilOp arg9; + cc::gfx::GFXStencilOp arg9; json->getProperty("stencilPassOpFront", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg9 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg9 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilPassOpFront = arg9; } unsigned int arg10 = 0; @@ -10494,10 +10494,10 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(field, &arg11); cobj->stencilTestBack = arg11; } - cc::GFXComparisonFunc arg12; + cc::gfx::GFXComparisonFunc arg12; json->getProperty("stencilFuncBack", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg12 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg12 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->stencilFuncBack = arg12; } unsigned int arg13 = 0; @@ -10512,22 +10512,22 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg14); cobj->stencilWriteMaskBack = arg14; } - cc::GFXStencilOp arg15; + cc::gfx::GFXStencilOp arg15; json->getProperty("stencilFailOpBack", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg15 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg15 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilFailOpBack = arg15; } - cc::GFXStencilOp arg16; + cc::gfx::GFXStencilOp arg16; json->getProperty("stencilZFailOpBack", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg16 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg16 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilZFailOpBack = arg16; } - cc::GFXStencilOp arg17; + cc::gfx::GFXStencilOp arg17; json->getProperty("stencilPassOpBack", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg17 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg17 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilPassOpBack = arg17; } unsigned int arg18 = 0; @@ -10549,7 +10549,7 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) } else if(argc == 19) { - cc::GFXDepthStencilState* cobj = JSB_ALLOC(cc::GFXDepthStencilState); + cc::gfx::GFXDepthStencilState* cobj = JSB_ALLOC(cc::gfx::GFXDepthStencilState); bool arg0; if (!args[0].isUndefined()) { ok &= seval_to_boolean(args[0], &arg0); @@ -10560,9 +10560,9 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(args[1], &arg1); cobj->depthWrite = arg1; } - cc::GFXComparisonFunc arg2; + cc::gfx::GFXComparisonFunc arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->depthFunc = arg2; } bool arg3; @@ -10570,9 +10570,9 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(args[3], &arg3); cobj->stencilTestFront = arg3; } - cc::GFXComparisonFunc arg4; + cc::gfx::GFXComparisonFunc arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->stencilFuncFront = arg4; } unsigned int arg5 = 0; @@ -10585,19 +10585,19 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_uint32(args[6], (uint32_t*)&arg6); cobj->stencilWriteMaskFront = arg6; } - cc::GFXStencilOp arg7; + cc::gfx::GFXStencilOp arg7; if (!args[7].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilFailOpFront = arg7; } - cc::GFXStencilOp arg8; + cc::gfx::GFXStencilOp arg8; if (!args[8].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[8], &tmp); arg8 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilZFailOpFront = arg8; } - cc::GFXStencilOp arg9; + cc::gfx::GFXStencilOp arg9; if (!args[9].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[9], &tmp); arg9 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[9], &tmp); arg9 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilPassOpFront = arg9; } unsigned int arg10 = 0; @@ -10610,9 +10610,9 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_boolean(args[11], &arg11); cobj->stencilTestBack = arg11; } - cc::GFXComparisonFunc arg12; + cc::gfx::GFXComparisonFunc arg12; if (!args[12].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[12], &tmp); arg12 = (cc::GFXComparisonFunc)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[12], &tmp); arg12 = (cc::gfx::GFXComparisonFunc)tmp; } while(false); cobj->stencilFuncBack = arg12; } unsigned int arg13 = 0; @@ -10625,19 +10625,19 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) ok &= seval_to_uint32(args[14], (uint32_t*)&arg14); cobj->stencilWriteMaskBack = arg14; } - cc::GFXStencilOp arg15; + cc::gfx::GFXStencilOp arg15; if (!args[15].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[15], &tmp); arg15 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[15], &tmp); arg15 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilFailOpBack = arg15; } - cc::GFXStencilOp arg16; + cc::gfx::GFXStencilOp arg16; if (!args[16].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[16], &tmp); arg16 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[16], &tmp); arg16 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilZFailOpBack = arg16; } - cc::GFXStencilOp arg17; + cc::gfx::GFXStencilOp arg17; if (!args[17].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[17], &tmp); arg17 = (cc::GFXStencilOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[17], &tmp); arg17 = (cc::gfx::GFXStencilOp)tmp; } while(false); cobj->stencilPassOpBack = arg17; } unsigned int arg18 = 0; @@ -10660,24 +10660,24 @@ static bool js_gfx_GFXDepthStencilState_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXDepthStencilState_constructor, __jsb_cc_GFXDepthStencilState_class, js_cc_GFXDepthStencilState_finalize) +SE_BIND_CTOR(js_gfx_GFXDepthStencilState_constructor, __jsb_cc_gfx_GFXDepthStencilState_class, js_cc_gfx_GFXDepthStencilState_finalize) -static bool js_cc_GFXDepthStencilState_finalize(se::State& s) +static bool js_cc_gfx_GFXDepthStencilState_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXDepthStencilState)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXDepthStencilState)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXDepthStencilState* cobj = (cc::GFXDepthStencilState*)s.nativeThisObject(); + cc::gfx::GFXDepthStencilState* cobj = (cc::gfx::GFXDepthStencilState*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXDepthStencilState_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXDepthStencilState_finalize) bool js_register_gfx_GFXDepthStencilState(se::Object* obj) { @@ -10702,23 +10702,23 @@ bool js_register_gfx_GFXDepthStencilState(se::Object* obj) cls->defineProperty("stencilZFailOpBack", _SE(js_gfx_GFXDepthStencilState_get_stencilZFailOpBack), _SE(js_gfx_GFXDepthStencilState_set_stencilZFailOpBack)); cls->defineProperty("stencilPassOpBack", _SE(js_gfx_GFXDepthStencilState_get_stencilPassOpBack), _SE(js_gfx_GFXDepthStencilState_set_stencilPassOpBack)); cls->defineProperty("stencilRefBack", _SE(js_gfx_GFXDepthStencilState_get_stencilRefBack), _SE(js_gfx_GFXDepthStencilState_set_stencilRefBack)); - cls->defineFinalizeFunction(_SE(js_cc_GFXDepthStencilState_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXDepthStencilState_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXDepthStencilState_proto = cls->getProto(); - __jsb_cc_GFXDepthStencilState_class = cls; + __jsb_cc_gfx_GFXDepthStencilState_proto = cls->getProto(); + __jsb_cc_gfx_GFXDepthStencilState_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBlendTarget_proto = nullptr; -se::Class* __jsb_cc_GFXBlendTarget_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBlendTarget_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBlendTarget_class = nullptr; static bool js_gfx_GFXBlendTarget_get_blend(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blend : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10732,7 +10732,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blend) static bool js_gfx_GFXBlendTarget_set_blend(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blend : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10746,7 +10746,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blend) static bool js_gfx_GFXBlendTarget_get_blendSrc(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendSrc : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10760,12 +10760,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendSrc) static bool js_gfx_GFXBlendTarget_set_blendSrc(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendSrc : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendFactor arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendFactor)tmp; } while(false); + cc::gfx::GFXBlendFactor arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendFactor)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendSrc : Error processing new value"); cobj->blendSrc = arg0; return true; @@ -10774,7 +10774,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendSrc) static bool js_gfx_GFXBlendTarget_get_blendDst(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendDst : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10788,12 +10788,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendDst) static bool js_gfx_GFXBlendTarget_set_blendDst(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendDst : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendFactor arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendFactor)tmp; } while(false); + cc::gfx::GFXBlendFactor arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendFactor)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendDst : Error processing new value"); cobj->blendDst = arg0; return true; @@ -10802,7 +10802,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendDst) static bool js_gfx_GFXBlendTarget_get_blendEq(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendEq : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10816,12 +10816,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendEq) static bool js_gfx_GFXBlendTarget_set_blendEq(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendEq : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendOp)tmp; } while(false); + cc::gfx::GFXBlendOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendEq : Error processing new value"); cobj->blendEq = arg0; return true; @@ -10830,7 +10830,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendEq) static bool js_gfx_GFXBlendTarget_get_blendSrcAlpha(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendSrcAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10844,12 +10844,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendSrcAlpha) static bool js_gfx_GFXBlendTarget_set_blendSrcAlpha(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendSrcAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendFactor arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendFactor)tmp; } while(false); + cc::gfx::GFXBlendFactor arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendFactor)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendSrcAlpha : Error processing new value"); cobj->blendSrcAlpha = arg0; return true; @@ -10858,7 +10858,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendSrcAlpha) static bool js_gfx_GFXBlendTarget_get_blendDstAlpha(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendDstAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10872,12 +10872,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendDstAlpha) static bool js_gfx_GFXBlendTarget_set_blendDstAlpha(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendDstAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendFactor arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendFactor)tmp; } while(false); + cc::gfx::GFXBlendFactor arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendFactor)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendDstAlpha : Error processing new value"); cobj->blendDstAlpha = arg0; return true; @@ -10886,7 +10886,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendDstAlpha) static bool js_gfx_GFXBlendTarget_get_blendAlphaEq(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendAlphaEq : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10900,12 +10900,12 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendAlphaEq) static bool js_gfx_GFXBlendTarget_set_blendAlphaEq(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendAlphaEq : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendOp arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXBlendOp)tmp; } while(false); + cc::gfx::GFXBlendOp arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXBlendOp)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendAlphaEq : Error processing new value"); cobj->blendAlphaEq = arg0; return true; @@ -10914,7 +10914,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendAlphaEq) static bool js_gfx_GFXBlendTarget_get_blendColorMask(se::State& s) { - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_get_blendColorMask : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -10928,19 +10928,19 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendTarget_get_blendColorMask) static bool js_gfx_GFXBlendTarget_set_blendColorMask(se::State& s) { const auto& args = s.args(); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendTarget_set_blendColorMask : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXColorMask arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXColorMask)tmp; } while(false); + cc::gfx::GFXColorMask arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXColorMask)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendTarget_set_blendColorMask : Error processing new value"); cobj->blendColorMask = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXBlendTarget_set_blendColorMask) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBlendTarget_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBlendTarget_finalize) static bool js_gfx_GFXBlendTarget_constructor(se::State& s) { @@ -10950,7 +10950,7 @@ static bool js_gfx_GFXBlendTarget_constructor(se::State& s) if(argc == 0) { - cc::GFXBlendTarget* cobj = JSB_ALLOC(cc::GFXBlendTarget); + cc::gfx::GFXBlendTarget* cobj = JSB_ALLOC(cc::gfx::GFXBlendTarget); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -10960,53 +10960,53 @@ static bool js_gfx_GFXBlendTarget_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBlendTarget* cobj = JSB_ALLOC(cc::GFXBlendTarget); + cc::gfx::GFXBlendTarget* cobj = JSB_ALLOC(cc::gfx::GFXBlendTarget); bool arg0; json->getProperty("blend", &field); if(!field.isUndefined()) { ok &= seval_to_boolean(field, &arg0); cobj->blend = arg0; } - cc::GFXBlendFactor arg1; + cc::gfx::GFXBlendFactor arg1; json->getProperty("blendSrc", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendSrc = arg1; } - cc::GFXBlendFactor arg2; + cc::gfx::GFXBlendFactor arg2; json->getProperty("blendDst", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg2 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendDst = arg2; } - cc::GFXBlendOp arg3; + cc::gfx::GFXBlendOp arg3; json->getProperty("blendEq", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXBlendOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXBlendOp)tmp; } while(false); cobj->blendEq = arg3; } - cc::GFXBlendFactor arg4; + cc::gfx::GFXBlendFactor arg4; json->getProperty("blendSrcAlpha", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg4 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendSrcAlpha = arg4; } - cc::GFXBlendFactor arg5; + cc::gfx::GFXBlendFactor arg5; json->getProperty("blendDstAlpha", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg5 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendDstAlpha = arg5; } - cc::GFXBlendOp arg6; + cc::gfx::GFXBlendOp arg6; json->getProperty("blendAlphaEq", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::GFXBlendOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg6 = (cc::gfx::GFXBlendOp)tmp; } while(false); cobj->blendAlphaEq = arg6; } - cc::GFXColorMask arg7; + cc::gfx::GFXColorMask arg7; json->getProperty("blendColorMask", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::GFXColorMask)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg7 = (cc::gfx::GFXColorMask)tmp; } while(false); cobj->blendColorMask = arg7; } @@ -11022,45 +11022,45 @@ static bool js_gfx_GFXBlendTarget_constructor(se::State& s) } else if(argc == 8) { - cc::GFXBlendTarget* cobj = JSB_ALLOC(cc::GFXBlendTarget); + cc::gfx::GFXBlendTarget* cobj = JSB_ALLOC(cc::gfx::GFXBlendTarget); bool arg0; if (!args[0].isUndefined()) { ok &= seval_to_boolean(args[0], &arg0); cobj->blend = arg0; } - cc::GFXBlendFactor arg1; + cc::gfx::GFXBlendFactor arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendSrc = arg1; } - cc::GFXBlendFactor arg2; + cc::gfx::GFXBlendFactor arg2; if (!args[2].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendDst = arg2; } - cc::GFXBlendOp arg3; + cc::gfx::GFXBlendOp arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXBlendOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXBlendOp)tmp; } while(false); cobj->blendEq = arg3; } - cc::GFXBlendFactor arg4; + cc::gfx::GFXBlendFactor arg4; if (!args[4].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[4], &tmp); arg4 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendSrcAlpha = arg4; } - cc::GFXBlendFactor arg5; + cc::gfx::GFXBlendFactor arg5; if (!args[5].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::GFXBlendFactor)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (cc::gfx::GFXBlendFactor)tmp; } while(false); cobj->blendDstAlpha = arg5; } - cc::GFXBlendOp arg6; + cc::gfx::GFXBlendOp arg6; if (!args[6].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::GFXBlendOp)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[6], &tmp); arg6 = (cc::gfx::GFXBlendOp)tmp; } while(false); cobj->blendAlphaEq = arg6; } - cc::GFXColorMask arg7; + cc::gfx::GFXColorMask arg7; if (!args[7].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::GFXColorMask)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[7], &tmp); arg7 = (cc::gfx::GFXColorMask)tmp; } while(false); cobj->blendColorMask = arg7; } @@ -11078,24 +11078,24 @@ static bool js_gfx_GFXBlendTarget_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBlendTarget_constructor, __jsb_cc_GFXBlendTarget_class, js_cc_GFXBlendTarget_finalize) +SE_BIND_CTOR(js_gfx_GFXBlendTarget_constructor, __jsb_cc_gfx_GFXBlendTarget_class, js_cc_gfx_GFXBlendTarget_finalize) -static bool js_cc_GFXBlendTarget_finalize(se::State& s) +static bool js_cc_gfx_GFXBlendTarget_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBlendTarget)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBlendTarget)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBlendTarget* cobj = (cc::GFXBlendTarget*)s.nativeThisObject(); + cc::gfx::GFXBlendTarget* cobj = (cc::gfx::GFXBlendTarget*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBlendTarget_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBlendTarget_finalize) bool js_register_gfx_GFXBlendTarget(se::Object* obj) { @@ -11109,23 +11109,23 @@ bool js_register_gfx_GFXBlendTarget(se::Object* obj) cls->defineProperty("blendDstAlpha", _SE(js_gfx_GFXBlendTarget_get_blendDstAlpha), _SE(js_gfx_GFXBlendTarget_set_blendDstAlpha)); cls->defineProperty("blendAlphaEq", _SE(js_gfx_GFXBlendTarget_get_blendAlphaEq), _SE(js_gfx_GFXBlendTarget_set_blendAlphaEq)); cls->defineProperty("blendColorMask", _SE(js_gfx_GFXBlendTarget_get_blendColorMask), _SE(js_gfx_GFXBlendTarget_set_blendColorMask)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBlendTarget_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBlendTarget_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBlendTarget_proto = cls->getProto(); - __jsb_cc_GFXBlendTarget_class = cls; + __jsb_cc_gfx_GFXBlendTarget_proto = cls->getProto(); + __jsb_cc_gfx_GFXBlendTarget_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBlendState_proto = nullptr; -se::Class* __jsb_cc_GFXBlendState_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBlendState_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBlendState_class = nullptr; static bool js_gfx_GFXBlendState_get_isA2C(se::State& s) { - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_get_isA2C : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11139,7 +11139,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendState_get_isA2C) static bool js_gfx_GFXBlendState_set_isA2C(se::State& s) { const auto& args = s.args(); - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_set_isA2C : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11153,7 +11153,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendState_set_isA2C) static bool js_gfx_GFXBlendState_get_isIndepend(se::State& s) { - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_get_isIndepend : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11167,7 +11167,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendState_get_isIndepend) static bool js_gfx_GFXBlendState_set_isIndepend(se::State& s) { const auto& args = s.args(); - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_set_isIndepend : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11181,7 +11181,7 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendState_set_isIndepend) static bool js_gfx_GFXBlendState_get_blendColor(se::State& s) { - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_get_blendColor : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11195,11 +11195,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendState_get_blendColor) static bool js_gfx_GFXBlendState_set_blendColor(se::State& s) { const auto& args = s.args(); - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_set_blendColor : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXColor* arg0 = nullptr; + cc::gfx::GFXColor* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendState_set_blendColor : Error processing new value"); cobj->blendColor = *arg0; @@ -11207,7 +11207,7 @@ static bool js_gfx_GFXBlendState_set_blendColor(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXBlendState_set_blendColor) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBlendState_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBlendState_finalize) static bool js_gfx_GFXBlendState_constructor(se::State& s) { @@ -11217,7 +11217,7 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) if(argc == 0) { - cc::GFXBlendState* cobj = JSB_ALLOC(cc::GFXBlendState); + cc::gfx::GFXBlendState* cobj = JSB_ALLOC(cc::gfx::GFXBlendState); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -11227,7 +11227,7 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXBlendState* cobj = JSB_ALLOC(cc::GFXBlendState); + cc::gfx::GFXBlendState* cobj = JSB_ALLOC(cc::gfx::GFXBlendState); bool arg0; json->getProperty("isA2C", &field); if(!field.isUndefined()) { @@ -11240,13 +11240,13 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) ok &= seval_to_boolean(field, &arg1); cobj->isIndepend = arg1; } - cc::GFXColor* arg2 = nullptr; + cc::gfx::GFXColor* arg2 = nullptr; json->getProperty("blendColor", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg2); cobj->blendColor = *arg2; } - std::vector arg3; + std::vector arg3; json->getProperty("targets", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg3); @@ -11265,7 +11265,7 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) } else if(argc == 4) { - cc::GFXBlendState* cobj = JSB_ALLOC(cc::GFXBlendState); + cc::gfx::GFXBlendState* cobj = JSB_ALLOC(cc::gfx::GFXBlendState); bool arg0; if (!args[0].isUndefined()) { ok &= seval_to_boolean(args[0], &arg0); @@ -11276,12 +11276,12 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) ok &= seval_to_boolean(args[1], &arg1); cobj->isIndepend = arg1; } - cc::GFXColor* arg2 = nullptr; + cc::gfx::GFXColor* arg2 = nullptr; if (!args[2].isUndefined()) { ok &= seval_to_reference(args[2], &arg2); cobj->blendColor = *arg2; } - std::vector arg3; + std::vector arg3; if (!args[3].isUndefined()) { ok &= seval_to_std_vector(args[3], &arg3); cobj->targets = arg3; @@ -11301,24 +11301,24 @@ static bool js_gfx_GFXBlendState_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXBlendState_constructor, __jsb_cc_GFXBlendState_class, js_cc_GFXBlendState_finalize) +SE_BIND_CTOR(js_gfx_GFXBlendState_constructor, __jsb_cc_gfx_GFXBlendState_class, js_cc_gfx_GFXBlendState_finalize) -static bool js_cc_GFXBlendState_finalize(se::State& s) +static bool js_cc_gfx_GFXBlendState_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBlendState)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBlendState)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBlendState_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBlendState_finalize) bool js_register_gfx_GFXBlendState(se::Object* obj) { @@ -11327,23 +11327,23 @@ bool js_register_gfx_GFXBlendState(se::Object* obj) cls->defineProperty("isA2C", _SE(js_gfx_GFXBlendState_get_isA2C), _SE(js_gfx_GFXBlendState_set_isA2C)); cls->defineProperty("isIndepend", _SE(js_gfx_GFXBlendState_get_isIndepend), _SE(js_gfx_GFXBlendState_set_isIndepend)); cls->defineProperty("blendColor", _SE(js_gfx_GFXBlendState_get_blendColor), _SE(js_gfx_GFXBlendState_set_blendColor)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBlendState_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBlendState_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBlendState_proto = cls->getProto(); - __jsb_cc_GFXBlendState_class = cls; + __jsb_cc_gfx_GFXBlendState_proto = cls->getProto(); + __jsb_cc_gfx_GFXBlendState_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXPipelineStateInfo_proto = nullptr; -se::Class* __jsb_cc_GFXPipelineStateInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXPipelineStateInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXPipelineStateInfo_class = nullptr; static bool js_gfx_GFXPipelineStateInfo_get_primitive(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_primitive : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11357,12 +11357,12 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_primitive) static bool js_gfx_GFXPipelineStateInfo_set_primitive(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_primitive : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXPrimitiveMode arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXPrimitiveMode)tmp; } while(false); + cc::gfx::GFXPrimitiveMode arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXPrimitiveMode)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_primitive : Error processing new value"); cobj->primitive = arg0; return true; @@ -11371,7 +11371,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_primitive) static bool js_gfx_GFXPipelineStateInfo_get_shader(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_shader : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11385,11 +11385,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_shader) static bool js_gfx_GFXPipelineStateInfo_set_shader(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_shader : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXShader* arg0 = nullptr; + cc::gfx::GFXShader* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_shader : Error processing new value"); cobj->shader = arg0; @@ -11399,7 +11399,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_shader) static bool js_gfx_GFXPipelineStateInfo_get_inputState(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_inputState : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11413,11 +11413,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_inputState) static bool js_gfx_GFXPipelineStateInfo_set_inputState(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_inputState : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXInputState* arg0 = nullptr; + cc::gfx::GFXInputState* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_inputState : Error processing new value"); cobj->inputState = *arg0; @@ -11427,7 +11427,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_inputState) static bool js_gfx_GFXPipelineStateInfo_get_rasterizerState(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_rasterizerState : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11441,11 +11441,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_rasterizerState) static bool js_gfx_GFXPipelineStateInfo_set_rasterizerState(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_rasterizerState : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXRasterizerState* arg0 = nullptr; + cc::gfx::GFXRasterizerState* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_rasterizerState : Error processing new value"); cobj->rasterizerState = *arg0; @@ -11455,7 +11455,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_rasterizerState) static bool js_gfx_GFXPipelineStateInfo_get_depthStencilState(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_depthStencilState : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11469,11 +11469,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_depthStencilState) static bool js_gfx_GFXPipelineStateInfo_set_depthStencilState(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_depthStencilState : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXDepthStencilState* arg0 = nullptr; + cc::gfx::GFXDepthStencilState* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_depthStencilState : Error processing new value"); cobj->depthStencilState = *arg0; @@ -11483,7 +11483,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_depthStencilState) static bool js_gfx_GFXPipelineStateInfo_get_blendState(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_blendState : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11497,11 +11497,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_blendState) static bool js_gfx_GFXPipelineStateInfo_set_blendState(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_blendState : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXBlendState* arg0 = nullptr; + cc::gfx::GFXBlendState* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_blendState : Error processing new value"); cobj->blendState = *arg0; @@ -11511,7 +11511,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_blendState) static bool js_gfx_GFXPipelineStateInfo_get_dynamicStates(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_dynamicStates : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11525,11 +11525,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_dynamicStates) static bool js_gfx_GFXPipelineStateInfo_set_dynamicStates(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_dynamicStates : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_dynamicStates : Error processing new value"); cobj->dynamicStates = arg0; @@ -11539,7 +11539,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_dynamicStates) static bool js_gfx_GFXPipelineStateInfo_get_layout(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_layout : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11553,11 +11553,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_layout) static bool js_gfx_GFXPipelineStateInfo_set_layout(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_layout : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXPipelineLayout* arg0 = nullptr; + cc::gfx::GFXPipelineLayout* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_layout : Error processing new value"); cobj->layout = arg0; @@ -11567,7 +11567,7 @@ SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_layout) static bool js_gfx_GFXPipelineStateInfo_get_renderPass(se::State& s) { - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_get_renderPass : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11581,11 +11581,11 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineStateInfo_get_renderPass) static bool js_gfx_GFXPipelineStateInfo_set_renderPass(se::State& s) { const auto& args = s.args(); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineStateInfo_set_renderPass : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXRenderPass* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineStateInfo_set_renderPass : Error processing new value"); cobj->renderPass = arg0; @@ -11593,7 +11593,7 @@ static bool js_gfx_GFXPipelineStateInfo_set_renderPass(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXPipelineStateInfo_set_renderPass) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXPipelineStateInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXPipelineStateInfo_finalize) static bool js_gfx_GFXPipelineStateInfo_constructor(se::State& s) { @@ -11603,7 +11603,7 @@ static bool js_gfx_GFXPipelineStateInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::GFXPipelineStateInfo); + cc::gfx::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineStateInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -11613,56 +11613,56 @@ static bool js_gfx_GFXPipelineStateInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::GFXPipelineStateInfo); - cc::GFXPrimitiveMode arg0; + cc::gfx::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineStateInfo); + cc::gfx::GFXPrimitiveMode arg0; json->getProperty("primitive", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXPrimitiveMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXPrimitiveMode)tmp; } while(false); cobj->primitive = arg0; } - cc::GFXShader* arg1 = nullptr; + cc::gfx::GFXShader* arg1 = nullptr; json->getProperty("shader", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg1); cobj->shader = arg1; } - cc::GFXInputState* arg2 = nullptr; + cc::gfx::GFXInputState* arg2 = nullptr; json->getProperty("inputState", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg2); cobj->inputState = *arg2; } - cc::GFXRasterizerState* arg3 = nullptr; + cc::gfx::GFXRasterizerState* arg3 = nullptr; json->getProperty("rasterizerState", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg3); cobj->rasterizerState = *arg3; } - cc::GFXDepthStencilState* arg4 = nullptr; + cc::gfx::GFXDepthStencilState* arg4 = nullptr; json->getProperty("depthStencilState", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg4); cobj->depthStencilState = *arg4; } - cc::GFXBlendState* arg5 = nullptr; + cc::gfx::GFXBlendState* arg5 = nullptr; json->getProperty("blendState", &field); if(!field.isUndefined()) { ok &= seval_to_reference(field, &arg5); cobj->blendState = *arg5; } - std::vector arg6; + std::vector arg6; json->getProperty("dynamicStates", &field); if(!field.isUndefined()) { ok &= seval_to_std_vector(field, &arg6); cobj->dynamicStates = arg6; } - cc::GFXPipelineLayout* arg7 = nullptr; + cc::gfx::GFXPipelineLayout* arg7 = nullptr; json->getProperty("layout", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg7); cobj->layout = arg7; } - cc::GFXRenderPass* arg8 = nullptr; + cc::gfx::GFXRenderPass* arg8 = nullptr; json->getProperty("renderPass", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg8); @@ -11681,48 +11681,48 @@ static bool js_gfx_GFXPipelineStateInfo_constructor(se::State& s) } else if(argc == 9) { - cc::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::GFXPipelineStateInfo); - cc::GFXPrimitiveMode arg0; + cc::gfx::GFXPipelineStateInfo* cobj = JSB_ALLOC(cc::gfx::GFXPipelineStateInfo); + cc::gfx::GFXPrimitiveMode arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXPrimitiveMode)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXPrimitiveMode)tmp; } while(false); cobj->primitive = arg0; } - cc::GFXShader* arg1 = nullptr; + cc::gfx::GFXShader* arg1 = nullptr; if (!args[1].isUndefined()) { ok &= seval_to_native_ptr(args[1], &arg1); cobj->shader = arg1; } - cc::GFXInputState* arg2 = nullptr; + cc::gfx::GFXInputState* arg2 = nullptr; if (!args[2].isUndefined()) { ok &= seval_to_reference(args[2], &arg2); cobj->inputState = *arg2; } - cc::GFXRasterizerState* arg3 = nullptr; + cc::gfx::GFXRasterizerState* arg3 = nullptr; if (!args[3].isUndefined()) { ok &= seval_to_reference(args[3], &arg3); cobj->rasterizerState = *arg3; } - cc::GFXDepthStencilState* arg4 = nullptr; + cc::gfx::GFXDepthStencilState* arg4 = nullptr; if (!args[4].isUndefined()) { ok &= seval_to_reference(args[4], &arg4); cobj->depthStencilState = *arg4; } - cc::GFXBlendState* arg5 = nullptr; + cc::gfx::GFXBlendState* arg5 = nullptr; if (!args[5].isUndefined()) { ok &= seval_to_reference(args[5], &arg5); cobj->blendState = *arg5; } - std::vector arg6; + std::vector arg6; if (!args[6].isUndefined()) { ok &= seval_to_std_vector(args[6], &arg6); cobj->dynamicStates = arg6; } - cc::GFXPipelineLayout* arg7 = nullptr; + cc::gfx::GFXPipelineLayout* arg7 = nullptr; if (!args[7].isUndefined()) { ok &= seval_to_native_ptr(args[7], &arg7); cobj->layout = arg7; } - cc::GFXRenderPass* arg8 = nullptr; + cc::gfx::GFXRenderPass* arg8 = nullptr; if (!args[8].isUndefined()) { ok &= seval_to_native_ptr(args[8], &arg8); cobj->renderPass = arg8; @@ -11742,24 +11742,24 @@ static bool js_gfx_GFXPipelineStateInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXPipelineStateInfo_constructor, __jsb_cc_GFXPipelineStateInfo_class, js_cc_GFXPipelineStateInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXPipelineStateInfo_constructor, __jsb_cc_gfx_GFXPipelineStateInfo_class, js_cc_gfx_GFXPipelineStateInfo_finalize) -static bool js_cc_GFXPipelineStateInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXPipelineStateInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXPipelineStateInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXPipelineStateInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXPipelineStateInfo* cobj = (cc::GFXPipelineStateInfo*)s.nativeThisObject(); + cc::gfx::GFXPipelineStateInfo* cobj = (cc::gfx::GFXPipelineStateInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXPipelineStateInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXPipelineStateInfo_finalize) bool js_register_gfx_GFXPipelineStateInfo(se::Object* obj) { @@ -11774,23 +11774,23 @@ bool js_register_gfx_GFXPipelineStateInfo(se::Object* obj) cls->defineProperty("dynamicStates", _SE(js_gfx_GFXPipelineStateInfo_get_dynamicStates), _SE(js_gfx_GFXPipelineStateInfo_set_dynamicStates)); cls->defineProperty("layout", _SE(js_gfx_GFXPipelineStateInfo_get_layout), _SE(js_gfx_GFXPipelineStateInfo_set_layout)); cls->defineProperty("renderPass", _SE(js_gfx_GFXPipelineStateInfo_get_renderPass), _SE(js_gfx_GFXPipelineStateInfo_set_renderPass)); - cls->defineFinalizeFunction(_SE(js_cc_GFXPipelineStateInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXPipelineStateInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXPipelineStateInfo_proto = cls->getProto(); - __jsb_cc_GFXPipelineStateInfo_class = cls; + __jsb_cc_gfx_GFXPipelineStateInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXPipelineStateInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXCommandBufferInfo_proto = nullptr; -se::Class* __jsb_cc_GFXCommandBufferInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXCommandBufferInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXCommandBufferInfo_class = nullptr; static bool js_gfx_GFXCommandBufferInfo_get_allocator(se::State& s) { - cc::GFXCommandBufferInfo* cobj = (cc::GFXCommandBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXCommandBufferInfo* cobj = (cc::gfx::GFXCommandBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBufferInfo_get_allocator : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11804,11 +11804,11 @@ SE_BIND_PROP_GET(js_gfx_GFXCommandBufferInfo_get_allocator) static bool js_gfx_GFXCommandBufferInfo_set_allocator(se::State& s) { const auto& args = s.args(); - cc::GFXCommandBufferInfo* cobj = (cc::GFXCommandBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXCommandBufferInfo* cobj = (cc::gfx::GFXCommandBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBufferInfo_set_allocator : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXCommandAllocator* arg0 = nullptr; + cc::gfx::GFXCommandAllocator* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBufferInfo_set_allocator : Error processing new value"); cobj->allocator = arg0; @@ -11818,7 +11818,7 @@ SE_BIND_PROP_SET(js_gfx_GFXCommandBufferInfo_set_allocator) static bool js_gfx_GFXCommandBufferInfo_get_type(se::State& s) { - cc::GFXCommandBufferInfo* cobj = (cc::GFXCommandBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXCommandBufferInfo* cobj = (cc::gfx::GFXCommandBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBufferInfo_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11832,19 +11832,19 @@ SE_BIND_PROP_GET(js_gfx_GFXCommandBufferInfo_get_type) static bool js_gfx_GFXCommandBufferInfo_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXCommandBufferInfo* cobj = (cc::GFXCommandBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXCommandBufferInfo* cobj = (cc::gfx::GFXCommandBufferInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBufferInfo_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXCommandBufferType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXCommandBufferType)tmp; } while(false); + cc::gfx::GFXCommandBufferType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXCommandBufferType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBufferInfo_set_type : Error processing new value"); cobj->type = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXCommandBufferInfo_set_type) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXCommandBufferInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXCommandBufferInfo_finalize) static bool js_gfx_GFXCommandBufferInfo_constructor(se::State& s) { @@ -11854,7 +11854,7 @@ static bool js_gfx_GFXCommandBufferInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::GFXCommandBufferInfo); + cc::gfx::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXCommandBufferInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -11864,17 +11864,17 @@ static bool js_gfx_GFXCommandBufferInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::GFXCommandBufferInfo); - cc::GFXCommandAllocator* arg0 = nullptr; + cc::gfx::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXCommandBufferInfo); + cc::gfx::GFXCommandAllocator* arg0 = nullptr; json->getProperty("allocator", &field); if(!field.isUndefined()) { ok &= seval_to_native_ptr(field, &arg0); cobj->allocator = arg0; } - cc::GFXCommandBufferType arg1; + cc::gfx::GFXCommandBufferType arg1; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::GFXCommandBufferType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg1 = (cc::gfx::GFXCommandBufferType)tmp; } while(false); cobj->type = arg1; } @@ -11890,15 +11890,15 @@ static bool js_gfx_GFXCommandBufferInfo_constructor(se::State& s) } else if(argc == 2) { - cc::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::GFXCommandBufferInfo); - cc::GFXCommandAllocator* arg0 = nullptr; + cc::gfx::GFXCommandBufferInfo* cobj = JSB_ALLOC(cc::gfx::GFXCommandBufferInfo); + cc::gfx::GFXCommandAllocator* arg0 = nullptr; if (!args[0].isUndefined()) { ok &= seval_to_native_ptr(args[0], &arg0); cobj->allocator = arg0; } - cc::GFXCommandBufferType arg1; + cc::gfx::GFXCommandBufferType arg1; if (!args[1].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::GFXCommandBufferType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (cc::gfx::GFXCommandBufferType)tmp; } while(false); cobj->type = arg1; } @@ -11916,24 +11916,24 @@ static bool js_gfx_GFXCommandBufferInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXCommandBufferInfo_constructor, __jsb_cc_GFXCommandBufferInfo_class, js_cc_GFXCommandBufferInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXCommandBufferInfo_constructor, __jsb_cc_gfx_GFXCommandBufferInfo_class, js_cc_gfx_GFXCommandBufferInfo_finalize) -static bool js_cc_GFXCommandBufferInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXCommandBufferInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXCommandBufferInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXCommandBufferInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXCommandBufferInfo* cobj = (cc::GFXCommandBufferInfo*)s.nativeThisObject(); + cc::gfx::GFXCommandBufferInfo* cobj = (cc::gfx::GFXCommandBufferInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXCommandBufferInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXCommandBufferInfo_finalize) bool js_register_gfx_GFXCommandBufferInfo(se::Object* obj) { @@ -11941,23 +11941,23 @@ bool js_register_gfx_GFXCommandBufferInfo(se::Object* obj) cls->defineProperty("allocator", _SE(js_gfx_GFXCommandBufferInfo_get_allocator), _SE(js_gfx_GFXCommandBufferInfo_set_allocator)); cls->defineProperty("type", _SE(js_gfx_GFXCommandBufferInfo_get_type), _SE(js_gfx_GFXCommandBufferInfo_set_type)); - cls->defineFinalizeFunction(_SE(js_cc_GFXCommandBufferInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXCommandBufferInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXCommandBufferInfo_proto = cls->getProto(); - __jsb_cc_GFXCommandBufferInfo_class = cls; + __jsb_cc_gfx_GFXCommandBufferInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXCommandBufferInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXQueueInfo_proto = nullptr; -se::Class* __jsb_cc_GFXQueueInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXQueueInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXQueueInfo_class = nullptr; static bool js_gfx_GFXQueueInfo_get_type(se::State& s) { - cc::GFXQueueInfo* cobj = (cc::GFXQueueInfo*)s.nativeThisObject(); + cc::gfx::GFXQueueInfo* cobj = (cc::gfx::GFXQueueInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueueInfo_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -11971,19 +11971,19 @@ SE_BIND_PROP_GET(js_gfx_GFXQueueInfo_get_type) static bool js_gfx_GFXQueueInfo_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXQueueInfo* cobj = (cc::GFXQueueInfo*)s.nativeThisObject(); + cc::gfx::GFXQueueInfo* cobj = (cc::gfx::GFXQueueInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueueInfo_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXQueueType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXQueueType)tmp; } while(false); + cc::gfx::GFXQueueType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXQueueType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXQueueInfo_set_type : Error processing new value"); cobj->type = arg0; return true; } SE_BIND_PROP_SET(js_gfx_GFXQueueInfo_set_type) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXQueueInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXQueueInfo_finalize) static bool js_gfx_GFXQueueInfo_constructor(se::State& s) { @@ -11993,17 +11993,17 @@ static bool js_gfx_GFXQueueInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXQueueInfo* cobj = JSB_ALLOC(cc::GFXQueueInfo); + cc::gfx::GFXQueueInfo* cobj = JSB_ALLOC(cc::gfx::GFXQueueInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } else if(argc == 1) { - cc::GFXQueueInfo* cobj = JSB_ALLOC(cc::GFXQueueInfo); - cc::GFXQueueType arg0; + cc::gfx::GFXQueueInfo* cobj = JSB_ALLOC(cc::gfx::GFXQueueInfo); + cc::gfx::GFXQueueType arg0; if (!args[0].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXQueueType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXQueueType)tmp; } while(false); cobj->type = arg0; } @@ -12021,47 +12021,47 @@ static bool js_gfx_GFXQueueInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXQueueInfo_constructor, __jsb_cc_GFXQueueInfo_class, js_cc_GFXQueueInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXQueueInfo_constructor, __jsb_cc_gfx_GFXQueueInfo_class, js_cc_gfx_GFXQueueInfo_finalize) -static bool js_cc_GFXQueueInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXQueueInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXQueueInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXQueueInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXQueueInfo* cobj = (cc::GFXQueueInfo*)s.nativeThisObject(); + cc::gfx::GFXQueueInfo* cobj = (cc::gfx::GFXQueueInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXQueueInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXQueueInfo_finalize) bool js_register_gfx_GFXQueueInfo(se::Object* obj) { auto cls = se::Class::create("GFXQueueInfo", obj, nullptr, _SE(js_gfx_GFXQueueInfo_constructor)); cls->defineProperty("type", _SE(js_gfx_GFXQueueInfo_get_type), _SE(js_gfx_GFXQueueInfo_set_type)); - cls->defineFinalizeFunction(_SE(js_cc_GFXQueueInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXQueueInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXQueueInfo_proto = cls->getProto(); - __jsb_cc_GFXQueueInfo_class = cls; + __jsb_cc_gfx_GFXQueueInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXQueueInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXFormatInfo_proto = nullptr; -se::Class* __jsb_cc_GFXFormatInfo_class = nullptr; +se::Object* __jsb_cc_gfx_GFXFormatInfo_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXFormatInfo_class = nullptr; static bool js_gfx_GFXFormatInfo_get_name(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12075,11 +12075,11 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_name) static bool js_gfx_GFXFormatInfo_set_name(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXFormatInfo_set_name : Error processing new value"); cobj->name = arg0; @@ -12089,7 +12089,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_name) static bool js_gfx_GFXFormatInfo_get_size(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_size : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12103,7 +12103,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_size) static bool js_gfx_GFXFormatInfo_set_size(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_size : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12117,7 +12117,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_size) static bool js_gfx_GFXFormatInfo_get_count(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12131,7 +12131,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_count) static bool js_gfx_GFXFormatInfo_set_count(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_count : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12145,7 +12145,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_count) static bool js_gfx_GFXFormatInfo_get_type(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_type : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12159,12 +12159,12 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_type) static bool js_gfx_GFXFormatInfo_set_type(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_type : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXFormatType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFormatType)tmp; } while(false); + cc::gfx::GFXFormatType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFormatType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXFormatInfo_set_type : Error processing new value"); cobj->type = arg0; return true; @@ -12173,7 +12173,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_type) static bool js_gfx_GFXFormatInfo_get_hasAlpha(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_hasAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12187,7 +12187,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_hasAlpha) static bool js_gfx_GFXFormatInfo_set_hasAlpha(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_hasAlpha : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12201,7 +12201,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_hasAlpha) static bool js_gfx_GFXFormatInfo_get_hasDepth(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_hasDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12215,7 +12215,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_hasDepth) static bool js_gfx_GFXFormatInfo_set_hasDepth(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_hasDepth : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12229,7 +12229,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_hasDepth) static bool js_gfx_GFXFormatInfo_get_hasStencil(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_hasStencil : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12243,7 +12243,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_hasStencil) static bool js_gfx_GFXFormatInfo_set_hasStencil(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_hasStencil : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12257,7 +12257,7 @@ SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_hasStencil) static bool js_gfx_GFXFormatInfo_get_isCompressed(se::State& s) { - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_get_isCompressed : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12271,7 +12271,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFormatInfo_get_isCompressed) static bool js_gfx_GFXFormatInfo_set_isCompressed(se::State& s) { const auto& args = s.args(); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFormatInfo_set_isCompressed : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12283,7 +12283,7 @@ static bool js_gfx_GFXFormatInfo_set_isCompressed(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXFormatInfo_set_isCompressed) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXFormatInfo_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXFormatInfo_finalize) static bool js_gfx_GFXFormatInfo_constructor(se::State& s) { @@ -12293,7 +12293,7 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) if(argc == 0) { - cc::GFXFormatInfo* cobj = JSB_ALLOC(cc::GFXFormatInfo); + cc::gfx::GFXFormatInfo* cobj = JSB_ALLOC(cc::gfx::GFXFormatInfo); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -12303,8 +12303,8 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXFormatInfo* cobj = JSB_ALLOC(cc::GFXFormatInfo); - cc::String arg0; + cc::gfx::GFXFormatInfo* cobj = JSB_ALLOC(cc::gfx::GFXFormatInfo); + cc::gfx::String arg0; json->getProperty("name", &field); if(!field.isUndefined()) { arg0 = field.toStringForce().c_str(); @@ -12322,10 +12322,10 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) ok &= seval_to_uint32(field, (uint32_t*)&arg2); cobj->count = arg2; } - cc::GFXFormatType arg3; + cc::gfx::GFXFormatType arg3; json->getProperty("type", &field); if(!field.isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::GFXFormatType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg3 = (cc::gfx::GFXFormatType)tmp; } while(false); cobj->type = arg3; } bool arg4; @@ -12365,8 +12365,8 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) } else if(argc == 8) { - cc::GFXFormatInfo* cobj = JSB_ALLOC(cc::GFXFormatInfo); - cc::String arg0; + cc::gfx::GFXFormatInfo* cobj = JSB_ALLOC(cc::gfx::GFXFormatInfo); + cc::gfx::String arg0; if (!args[0].isUndefined()) { arg0 = args[0].toStringForce().c_str(); cobj->name = arg0; @@ -12381,9 +12381,9 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) ok &= seval_to_uint32(args[2], (uint32_t*)&arg2); cobj->count = arg2; } - cc::GFXFormatType arg3; + cc::gfx::GFXFormatType arg3; if (!args[3].isUndefined()) { - do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::GFXFormatType)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[3], &tmp); arg3 = (cc::gfx::GFXFormatType)tmp; } while(false); cobj->type = arg3; } bool arg4; @@ -12421,24 +12421,24 @@ static bool js_gfx_GFXFormatInfo_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXFormatInfo_constructor, __jsb_cc_GFXFormatInfo_class, js_cc_GFXFormatInfo_finalize) +SE_BIND_CTOR(js_gfx_GFXFormatInfo_constructor, __jsb_cc_gfx_GFXFormatInfo_class, js_cc_gfx_GFXFormatInfo_finalize) -static bool js_cc_GFXFormatInfo_finalize(se::State& s) +static bool js_cc_gfx_GFXFormatInfo_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXFormatInfo)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXFormatInfo)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXFormatInfo* cobj = (cc::GFXFormatInfo*)s.nativeThisObject(); + cc::gfx::GFXFormatInfo* cobj = (cc::gfx::GFXFormatInfo*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXFormatInfo_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXFormatInfo_finalize) bool js_register_gfx_GFXFormatInfo(se::Object* obj) { @@ -12452,23 +12452,23 @@ bool js_register_gfx_GFXFormatInfo(se::Object* obj) cls->defineProperty("hasDepth", _SE(js_gfx_GFXFormatInfo_get_hasDepth), _SE(js_gfx_GFXFormatInfo_set_hasDepth)); cls->defineProperty("hasStencil", _SE(js_gfx_GFXFormatInfo_get_hasStencil), _SE(js_gfx_GFXFormatInfo_set_hasStencil)); cls->defineProperty("isCompressed", _SE(js_gfx_GFXFormatInfo_get_isCompressed), _SE(js_gfx_GFXFormatInfo_set_isCompressed)); - cls->defineFinalizeFunction(_SE(js_cc_GFXFormatInfo_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXFormatInfo_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXFormatInfo_proto = cls->getProto(); - __jsb_cc_GFXFormatInfo_class = cls; + __jsb_cc_gfx_GFXFormatInfo_proto = cls->getProto(); + __jsb_cc_gfx_GFXFormatInfo_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXMemoryStatus_proto = nullptr; -se::Class* __jsb_cc_GFXMemoryStatus_class = nullptr; +se::Object* __jsb_cc_gfx_GFXMemoryStatus_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXMemoryStatus_class = nullptr; static bool js_gfx_GFXMemoryStatus_get_bufferSize(se::State& s) { - cc::GFXMemoryStatus* cobj = (cc::GFXMemoryStatus*)s.nativeThisObject(); + cc::gfx::GFXMemoryStatus* cobj = (cc::gfx::GFXMemoryStatus*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXMemoryStatus_get_bufferSize : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12482,7 +12482,7 @@ SE_BIND_PROP_GET(js_gfx_GFXMemoryStatus_get_bufferSize) static bool js_gfx_GFXMemoryStatus_set_bufferSize(se::State& s) { const auto& args = s.args(); - cc::GFXMemoryStatus* cobj = (cc::GFXMemoryStatus*)s.nativeThisObject(); + cc::gfx::GFXMemoryStatus* cobj = (cc::gfx::GFXMemoryStatus*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXMemoryStatus_set_bufferSize : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12496,7 +12496,7 @@ SE_BIND_PROP_SET(js_gfx_GFXMemoryStatus_set_bufferSize) static bool js_gfx_GFXMemoryStatus_get_textureSize(se::State& s) { - cc::GFXMemoryStatus* cobj = (cc::GFXMemoryStatus*)s.nativeThisObject(); + cc::gfx::GFXMemoryStatus* cobj = (cc::gfx::GFXMemoryStatus*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXMemoryStatus_get_textureSize : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12510,7 +12510,7 @@ SE_BIND_PROP_GET(js_gfx_GFXMemoryStatus_get_textureSize) static bool js_gfx_GFXMemoryStatus_set_textureSize(se::State& s) { const auto& args = s.args(); - cc::GFXMemoryStatus* cobj = (cc::GFXMemoryStatus*)s.nativeThisObject(); + cc::gfx::GFXMemoryStatus* cobj = (cc::gfx::GFXMemoryStatus*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXMemoryStatus_set_textureSize : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -12522,7 +12522,7 @@ static bool js_gfx_GFXMemoryStatus_set_textureSize(se::State& s) } SE_BIND_PROP_SET(js_gfx_GFXMemoryStatus_set_textureSize) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXMemoryStatus_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXMemoryStatus_finalize) static bool js_gfx_GFXMemoryStatus_constructor(se::State& s) { @@ -12532,7 +12532,7 @@ static bool js_gfx_GFXMemoryStatus_constructor(se::State& s) if(argc == 0) { - cc::GFXMemoryStatus* cobj = JSB_ALLOC(cc::GFXMemoryStatus); + cc::gfx::GFXMemoryStatus* cobj = JSB_ALLOC(cc::gfx::GFXMemoryStatus); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -12542,7 +12542,7 @@ static bool js_gfx_GFXMemoryStatus_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXMemoryStatus* cobj = JSB_ALLOC(cc::GFXMemoryStatus); + cc::gfx::GFXMemoryStatus* cobj = JSB_ALLOC(cc::gfx::GFXMemoryStatus); unsigned int arg0 = 0; json->getProperty("bufferSize", &field); if(!field.isUndefined()) { @@ -12568,7 +12568,7 @@ static bool js_gfx_GFXMemoryStatus_constructor(se::State& s) } else if(argc == 2) { - cc::GFXMemoryStatus* cobj = JSB_ALLOC(cc::GFXMemoryStatus); + cc::gfx::GFXMemoryStatus* cobj = JSB_ALLOC(cc::gfx::GFXMemoryStatus); unsigned int arg0 = 0; if (!args[0].isUndefined()) { ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); @@ -12594,24 +12594,24 @@ static bool js_gfx_GFXMemoryStatus_constructor(se::State& s) SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); return false; } -SE_BIND_CTOR(js_gfx_GFXMemoryStatus_constructor, __jsb_cc_GFXMemoryStatus_class, js_cc_GFXMemoryStatus_finalize) +SE_BIND_CTOR(js_gfx_GFXMemoryStatus_constructor, __jsb_cc_gfx_GFXMemoryStatus_class, js_cc_gfx_GFXMemoryStatus_finalize) -static bool js_cc_GFXMemoryStatus_finalize(se::State& s) +static bool js_cc_gfx_GFXMemoryStatus_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXMemoryStatus)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXMemoryStatus)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXMemoryStatus* cobj = (cc::GFXMemoryStatus*)s.nativeThisObject(); + cc::gfx::GFXMemoryStatus* cobj = (cc::gfx::GFXMemoryStatus*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXMemoryStatus_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXMemoryStatus_finalize) bool js_register_gfx_GFXMemoryStatus(se::Object* obj) { @@ -12619,23 +12619,23 @@ bool js_register_gfx_GFXMemoryStatus(se::Object* obj) cls->defineProperty("bufferSize", _SE(js_gfx_GFXMemoryStatus_get_bufferSize), _SE(js_gfx_GFXMemoryStatus_set_bufferSize)); cls->defineProperty("textureSize", _SE(js_gfx_GFXMemoryStatus_get_textureSize), _SE(js_gfx_GFXMemoryStatus_set_textureSize)); - cls->defineFinalizeFunction(_SE(js_cc_GFXMemoryStatus_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXMemoryStatus_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXMemoryStatus_proto = cls->getProto(); - __jsb_cc_GFXMemoryStatus_class = cls; + __jsb_cc_gfx_GFXMemoryStatus_proto = cls->getProto(); + __jsb_cc_gfx_GFXMemoryStatus_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXObject_proto = nullptr; -se::Class* __jsb_cc_GFXObject_class = nullptr; +se::Object* __jsb_cc_gfx_GFXObject_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXObject_class = nullptr; static bool js_gfx_GFXObject_getType(se::State& s) { - cc::GFXObject* cobj = (cc::GFXObject*)s.nativeThisObject(); + cc::gfx::GFXObject* cobj = (cc::gfx::GFXObject*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXObject_getType : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12653,7 +12653,7 @@ SE_BIND_PROP_GET(js_gfx_GFXObject_getType) static bool js_gfx_GFXObject_getStatus(se::State& s) { - cc::GFXObject* cobj = (cc::GFXObject*)s.nativeThisObject(); + cc::gfx::GFXObject* cobj = (cc::gfx::GFXObject*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXObject_getStatus : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12669,38 +12669,38 @@ static bool js_gfx_GFXObject_getStatus(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXObject_getStatus) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXObject_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXObject_finalize) static bool js_gfx_GFXObject_constructor(se::State& s) { CC_UNUSED bool ok = true; const auto& args = s.args(); - cc::GFXObjectType arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXObjectType)tmp; } while(false); + cc::gfx::GFXObjectType arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXObjectType)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXObject_constructor : Error processing arguments"); - cc::GFXObject* cobj = JSB_ALLOC(cc::GFXObject, arg0); + cc::gfx::GFXObject* cobj = JSB_ALLOC(cc::gfx::GFXObject, arg0); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_gfx_GFXObject_constructor, __jsb_cc_GFXObject_class, js_cc_GFXObject_finalize) +SE_BIND_CTOR(js_gfx_GFXObject_constructor, __jsb_cc_gfx_GFXObject_class, js_cc_gfx_GFXObject_finalize) -static bool js_cc_GFXObject_finalize(se::State& s) +static bool js_cc_gfx_GFXObject_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXObject)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXObject)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXObject* cobj = (cc::GFXObject*)s.nativeThisObject(); + cc::gfx::GFXObject* cobj = (cc::gfx::GFXObject*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXObject_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXObject_finalize) bool js_register_gfx_GFXObject(se::Object* obj) { @@ -12708,23 +12708,23 @@ bool js_register_gfx_GFXObject(se::Object* obj) cls->defineProperty("status", _SE(js_gfx_GFXObject_getStatus), nullptr); cls->defineProperty("gfxType", _SE(js_gfx_GFXObject_getType), nullptr); - cls->defineFinalizeFunction(_SE(js_cc_GFXObject_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXObject_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXObject_proto = cls->getProto(); - __jsb_cc_GFXObject_class = cls; + __jsb_cc_gfx_GFXObject_proto = cls->getProto(); + __jsb_cc_gfx_GFXObject_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXDevice_proto = nullptr; -se::Class* __jsb_cc_GFXDevice_class = nullptr; +se::Object* __jsb_cc_gfx_GFXDevice_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXDevice_class = nullptr; static bool js_gfx_GFXDevice_getMaxUniformBlockSize(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxUniformBlockSize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12742,7 +12742,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxUniformBlockSize) static bool js_gfx_GFXDevice_getMaxVertexTextureUnits(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxVertexTextureUnits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12760,7 +12760,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxVertexTextureUnits) static bool js_gfx_GFXDevice_getProjectionSignY(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getProjectionSignY : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12778,7 +12778,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getProjectionSignY) static bool js_gfx_GFXDevice_getMaxVertexUniformVectors(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxVertexUniformVectors : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12796,7 +12796,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxVertexUniformVectors) static bool js_gfx_GFXDevice_getGfxAPI(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getGfxAPI : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12814,13 +12814,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getGfxAPI) static bool js_gfx_GFXDevice_getVendor(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getVendor : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::String& result = cobj->getVendor(); + const cc::gfx::String& result = cobj->getVendor(); s.rval().setString(result); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getVendor : Error processing arguments"); return true; @@ -12832,14 +12832,14 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getVendor) static bool js_gfx_GFXDevice_hasFeature(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_hasFeature : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXFeature arg0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXFeature)tmp; } while(false); + cc::gfx::GFXFeature arg0; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXFeature)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_hasFeature : Error processing arguments"); bool result = cobj->hasFeature(arg0); ok &= boolean_to_seval(result, &s.rval()); @@ -12853,16 +12853,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_hasFeature) static bool js_gfx_GFXDevice_createFence(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createFence : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXFenceInfo* arg0 = nullptr; + cc::gfx::GFXFenceInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createFence : Error processing arguments"); - cc::GFXFence* result = cobj->createFence(*arg0); + cc::gfx::GFXFence* result = cobj->createFence(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createFence : Error processing arguments"); return true; @@ -12874,13 +12874,13 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createFence) static bool js_gfx_GFXDevice_getContext(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getContext : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXContext* result = cobj->getContext(); + cc::gfx::GFXContext* result = cobj->getContext(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getContext : Error processing arguments"); return true; @@ -12892,7 +12892,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getContext) static bool js_gfx_GFXDevice_getWidth(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getWidth : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12910,7 +12910,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getWidth) static bool js_gfx_GFXDevice_setReverseCW(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_setReverseCW : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12929,16 +12929,16 @@ SE_BIND_PROP_SET(js_gfx_GFXDevice_setReverseCW) static bool js_gfx_GFXDevice_createCommandAllocator(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createCommandAllocator : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXCommandAllocatorInfo* arg0 = nullptr; + cc::gfx::GFXCommandAllocatorInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createCommandAllocator : Error processing arguments"); - cc::GFXCommandAllocator* result = cobj->createCommandAllocator(*arg0); + cc::gfx::GFXCommandAllocator* result = cobj->createCommandAllocator(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createCommandAllocator : Error processing arguments"); return true; @@ -12950,13 +12950,13 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createCommandAllocator) static bool js_gfx_GFXDevice_getQueue(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getQueue : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXQueue* result = cobj->getQueue(); + cc::gfx::GFXQueue* result = cobj->getQueue(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getQueue : Error processing arguments"); return true; @@ -12968,7 +12968,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getQueue) static bool js_gfx_GFXDevice_getMaxVertexAttributes(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxVertexAttributes : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -12986,7 +12986,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxVertexAttributes) static bool js_gfx_GFXDevice_getDepthStencilFormat(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getDepthStencilFormat : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13004,7 +13004,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getDepthStencilFormat) static bool js_gfx_GFXDevice_getNumTris(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getNumTris : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13022,13 +13022,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getNumTris) static bool js_gfx_GFXDevice_getRenderer(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getRenderer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::String& result = cobj->getRenderer(); + const cc::gfx::String& result = cobj->getRenderer(); s.rval().setString(result); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getRenderer : Error processing arguments"); return true; @@ -13040,7 +13040,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getRenderer) static bool js_gfx_GFXDevice_getStencilBits(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getStencilBits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13058,13 +13058,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getStencilBits) static bool js_gfx_GFXDevice_getDeviceName(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getDeviceName : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::String& result = cobj->getDeviceName(); + const cc::gfx::String& result = cobj->getDeviceName(); s.rval().setString(result); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getDeviceName : Error processing arguments"); return true; @@ -13076,7 +13076,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getDeviceName) static bool js_gfx_GFXDevice_getNumInstances(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getNumInstances : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13094,7 +13094,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getNumInstances) static bool js_gfx_GFXDevice_getHeight(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getHeight : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13112,7 +13112,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getHeight) static bool js_gfx_GFXDevice_getMaxFragmentUniformVectors(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxFragmentUniformVectors : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13130,16 +13130,16 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxFragmentUniformVectors) static bool js_gfx_GFXDevice_createPipelineState(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createPipelineState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXPipelineStateInfo* arg0 = nullptr; + cc::gfx::GFXPipelineStateInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createPipelineState : Error processing arguments"); - cc::GFXPipelineState* result = cobj->createPipelineState(*arg0); + cc::gfx::GFXPipelineState* result = cobj->createPipelineState(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createPipelineState : Error processing arguments"); return true; @@ -13151,16 +13151,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createPipelineState) static bool js_gfx_GFXDevice_createCommandBuffer(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createCommandBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXCommandBufferInfo* arg0 = nullptr; + cc::gfx::GFXCommandBufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createCommandBuffer : Error processing arguments"); - cc::GFXCommandBuffer* result = cobj->createCommandBuffer(*arg0); + cc::gfx::GFXCommandBuffer* result = cobj->createCommandBuffer(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createCommandBuffer : Error processing arguments"); return true; @@ -13172,7 +13172,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createCommandBuffer) static bool js_gfx_GFXDevice_present(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_present : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13187,7 +13187,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_present) static bool js_gfx_GFXDevice_destroy(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13202,7 +13202,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_destroy) static bool js_gfx_GFXDevice_getColorFormat(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getColorFormat : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13220,16 +13220,16 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getColorFormat) static bool js_gfx_GFXDevice_createFramebuffer(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createFramebuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXFramebufferInfo* arg0 = nullptr; + cc::gfx::GFXFramebufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createFramebuffer : Error processing arguments"); - cc::GFXFramebuffer* result = cobj->createFramebuffer(*arg0); + cc::gfx::GFXFramebuffer* result = cobj->createFramebuffer(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createFramebuffer : Error processing arguments"); return true; @@ -13241,7 +13241,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createFramebuffer) static bool js_gfx_GFXDevice_getMaxTextureSize(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxTextureSize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13259,16 +13259,16 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxTextureSize) static bool js_gfx_GFXDevice_createRenderPass(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createRenderPass : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXRenderPassInfo* arg0 = nullptr; + cc::gfx::GFXRenderPassInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createRenderPass : Error processing arguments"); - cc::GFXRenderPass* result = cobj->createRenderPass(*arg0); + cc::gfx::GFXRenderPass* result = cobj->createRenderPass(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createRenderPass : Error processing arguments"); return true; @@ -13280,16 +13280,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createRenderPass) static bool js_gfx_GFXDevice_createPipelineLayout(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createPipelineLayout : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXPipelineLayoutInfo* arg0 = nullptr; + cc::gfx::GFXPipelineLayoutInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createPipelineLayout : Error processing arguments"); - cc::GFXPipelineLayout* result = cobj->createPipelineLayout(*arg0); + cc::gfx::GFXPipelineLayout* result = cobj->createPipelineLayout(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createPipelineLayout : Error processing arguments"); return true; @@ -13301,7 +13301,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createPipelineLayout) static bool js_gfx_GFXDevice_acquire(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_acquire : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13316,7 +13316,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_acquire) static bool js_gfx_GFXDevice_getMaxCubeMapTextureSize(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxCubeMapTextureSize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13334,7 +13334,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxCubeMapTextureSize) static bool js_gfx_GFXDevice_getShaderIdGen(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getShaderIdGen : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13352,7 +13352,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getShaderIdGen) static bool js_gfx_GFXDevice_getMaxUniformBufferBindings(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxUniformBufferBindings : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13370,16 +13370,16 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxUniformBufferBindings) static bool js_gfx_GFXDevice_createShader(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createShader : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXShaderInfo* arg0 = nullptr; + cc::gfx::GFXShaderInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createShader : Error processing arguments"); - cc::GFXShader* result = cobj->createShader(*arg0); + cc::gfx::GFXShader* result = cobj->createShader(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createShader : Error processing arguments"); return true; @@ -13391,16 +13391,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createShader) static bool js_gfx_GFXDevice_createInputAssembler(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createInputAssembler : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXInputAssemblerInfo* arg0 = nullptr; + cc::gfx::GFXInputAssemblerInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createInputAssembler : Error processing arguments"); - cc::GFXInputAssembler* result = cobj->createInputAssembler(*arg0); + cc::gfx::GFXInputAssembler* result = cobj->createInputAssembler(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createInputAssembler : Error processing arguments"); return true; @@ -13412,14 +13412,14 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createInputAssembler) static bool js_gfx_GFXDevice_defineMacro(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_defineMacro : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { - cc::String arg0; - cc::String arg1; + cc::gfx::String arg0; + cc::gfx::String arg1; arg0 = args[0].toStringForce().c_str(); arg1 = args[1].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_defineMacro : Error processing arguments"); @@ -13433,16 +13433,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_defineMacro) static bool js_gfx_GFXDevice_createSampler(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createSampler : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXSamplerInfo* arg0 = nullptr; + cc::gfx::GFXSamplerInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createSampler : Error processing arguments"); - cc::GFXSampler* result = cobj->createSampler(*arg0); + cc::gfx::GFXSampler* result = cobj->createSampler(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createSampler : Error processing arguments"); return true; @@ -13454,16 +13454,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createSampler) static bool js_gfx_GFXDevice_createBuffer(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXBufferInfo* arg0 = nullptr; + cc::gfx::GFXBufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createBuffer : Error processing arguments"); - cc::GFXBuffer* result = cobj->createBuffer(*arg0); + cc::gfx::GFXBuffer* result = cobj->createBuffer(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createBuffer : Error processing arguments"); return true; @@ -13475,7 +13475,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createBuffer) static bool js_gfx_GFXDevice_getNativeHeight(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getNativeHeight : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13493,13 +13493,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getNativeHeight) static bool js_gfx_GFXDevice_initialize(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXDeviceInfo* arg0 = nullptr; + cc::gfx::GFXDeviceInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -13514,7 +13514,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_initialize) static bool js_gfx_GFXDevice_resize(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_resize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13535,16 +13535,16 @@ SE_BIND_FUNC(js_gfx_GFXDevice_resize) static bool js_gfx_GFXDevice_createQueue(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createQueue : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXQueueInfo* arg0 = nullptr; + cc::gfx::GFXQueueInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createQueue : Error processing arguments"); - cc::GFXQueue* result = cobj->createQueue(*arg0); + cc::gfx::GFXQueue* result = cobj->createQueue(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createQueue : Error processing arguments"); return true; @@ -13556,7 +13556,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createQueue) static bool js_gfx_GFXDevice_getDepthBits(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getDepthBits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13574,7 +13574,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getDepthBits) static bool js_gfx_GFXDevice_getMinClipZ(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMinClipZ : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13592,13 +13592,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMinClipZ) static bool js_gfx_GFXDevice_getMemoryStatus(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMemoryStatus : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXMemoryStatus& result = cobj->getMemoryStatus(); + cc::gfx::GFXMemoryStatus& result = cobj->getMemoryStatus(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getMemoryStatus : Error processing arguments"); return true; @@ -13610,7 +13610,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMemoryStatus) static bool js_gfx_GFXDevice_getMaxTextureUnits(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getMaxTextureUnits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13628,7 +13628,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getMaxTextureUnits) static bool js_gfx_GFXDevice_getReverseCW(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getReverseCW : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13646,13 +13646,13 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getReverseCW) static bool js_gfx_GFXDevice_getCommandAllocator(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getCommandAllocator : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXCommandAllocator* result = cobj->getCommandAllocator(); + cc::gfx::GFXCommandAllocator* result = cobj->getCommandAllocator(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_getCommandAllocator : Error processing arguments"); return true; @@ -13664,7 +13664,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getCommandAllocator) static bool js_gfx_GFXDevice_getNumDrawCalls(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getNumDrawCalls : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13682,7 +13682,7 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getNumDrawCalls) static bool js_gfx_GFXDevice_getNativeWidth(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_getNativeWidth : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13700,16 +13700,16 @@ SE_BIND_PROP_GET(js_gfx_GFXDevice_getNativeWidth) static bool js_gfx_GFXDevice_createBindingLayout(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXDevice_createBindingLayout : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXBindingLayoutInfo* arg0 = nullptr; + cc::gfx::GFXBindingLayoutInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createBindingLayout : Error processing arguments"); - cc::GFXBindingLayout* result = cobj->createBindingLayout(*arg0); + cc::gfx::GFXBindingLayout* result = cobj->createBindingLayout(*arg0); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXDevice_createBindingLayout : Error processing arguments"); return true; @@ -13779,21 +13779,21 @@ bool js_register_gfx_GFXDevice(se::Object* obj) cls->defineFunction("createQueue", _SE(js_gfx_GFXDevice_createQueue)); cls->defineFunction("createBindingLayout", _SE(js_gfx_GFXDevice_createBindingLayout)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXDevice_proto = cls->getProto(); - __jsb_cc_GFXDevice_class = cls; + __jsb_cc_gfx_GFXDevice_proto = cls->getProto(); + __jsb_cc_gfx_GFXDevice_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBuffer_proto = nullptr; -se::Class* __jsb_cc_GFXBuffer_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBuffer_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBuffer_class = nullptr; static bool js_gfx_GFXBuffer_getBufferView(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getBufferView : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13811,7 +13811,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getBufferView) static bool js_gfx_GFXBuffer_getUsage(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getUsage : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13829,7 +13829,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getUsage) static bool js_gfx_GFXBuffer_getMemUsage(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getMemUsage : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13847,7 +13847,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getMemUsage) static bool js_gfx_GFXBuffer_getSize(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getSize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13865,7 +13865,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getSize) static bool js_gfx_GFXBuffer_getCount(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13883,13 +13883,13 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getCount) static bool js_gfx_GFXBuffer_initialize(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXBufferInfo* arg0 = nullptr; + cc::gfx::GFXBufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBuffer_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -13904,7 +13904,7 @@ SE_BIND_FUNC(js_gfx_GFXBuffer_initialize) static bool js_gfx_GFXBuffer_destroy(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13919,7 +13919,7 @@ SE_BIND_FUNC(js_gfx_GFXBuffer_destroy) static bool js_gfx_GFXBuffer_getStride(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getStride : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13937,13 +13937,13 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getStride) static bool js_gfx_GFXBuffer_getDevice(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXBuffer_getDevice : Error processing arguments"); return true; @@ -13955,7 +13955,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getDevice) static bool js_gfx_GFXBuffer_getFlags(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_getFlags : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13973,7 +13973,7 @@ SE_BIND_PROP_GET(js_gfx_GFXBuffer_getFlags) static bool js_gfx_GFXBuffer_resize(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_resize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -13990,37 +13990,37 @@ static bool js_gfx_GFXBuffer_resize(se::State& s) } SE_BIND_FUNC(js_gfx_GFXBuffer_resize) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBuffer_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBuffer_finalize) static bool js_gfx_GFXBuffer_constructor(se::State& s) { - //#3 cc::GFXBuffer: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXBuffer constructor is skipped\")"); + //#3 cc::gfx::GFXBuffer: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXBuffer constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXBuffer_constructor, __jsb_cc_GFXBuffer_class, js_cc_GFXBuffer_finalize) +SE_BIND_CTOR(js_gfx_GFXBuffer_constructor, __jsb_cc_gfx_GFXBuffer_class, js_cc_gfx_GFXBuffer_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXBuffer_finalize(se::State& s) +static bool js_cc_gfx_GFXBuffer_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBuffer)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBuffer)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBuffer_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBuffer_finalize) bool js_register_gfx_GFXBuffer(se::Object* obj) { - auto cls = se::Class::create("GFXBuffer", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXBuffer_constructor)); + auto cls = se::Class::create("GFXBuffer", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXBuffer_constructor)); cls->defineProperty("count", _SE(js_gfx_GFXBuffer_getCount), nullptr); cls->defineProperty("memUsage", _SE(js_gfx_GFXBuffer_getMemUsage), nullptr); @@ -14033,23 +14033,23 @@ bool js_register_gfx_GFXBuffer(se::Object* obj) cls->defineFunction("initialize", _SE(js_gfx_GFXBuffer_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXBuffer_destroy)); cls->defineFunction("resize", _SE(js_gfx_GFXBuffer_resize)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBuffer_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBuffer_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBuffer_proto = cls->getProto(); - __jsb_cc_GFXBuffer_class = cls; + __jsb_cc_gfx_GFXBuffer_proto = cls->getProto(); + __jsb_cc_gfx_GFXBuffer_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXTexture_proto = nullptr; -se::Class* __jsb_cc_GFXTexture_class = nullptr; +se::Object* __jsb_cc_gfx_GFXTexture_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXTexture_class = nullptr; static bool js_gfx_GFXTexture_getSize(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getSize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14067,7 +14067,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getSize) static bool js_gfx_GFXTexture_getDepth(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getDepth : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14085,7 +14085,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getDepth) static bool js_gfx_GFXTexture_getType(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getType : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14103,7 +14103,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getType) static bool js_gfx_GFXTexture_getHeight(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getHeight : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14121,7 +14121,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getHeight) static bool js_gfx_GFXTexture_getBuffer(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14139,7 +14139,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getBuffer) static bool js_gfx_GFXTexture_getWidth(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getWidth : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14157,7 +14157,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getWidth) static bool js_gfx_GFXTexture_getMipLevel(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getMipLevel : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14175,7 +14175,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getMipLevel) static bool js_gfx_GFXTexture_getArrayLayer(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getArrayLayer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14193,7 +14193,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getArrayLayer) static bool js_gfx_GFXTexture_getUsage(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getUsage : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14211,7 +14211,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getUsage) static bool js_gfx_GFXTexture_destroy(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14226,7 +14226,7 @@ SE_BIND_FUNC(js_gfx_GFXTexture_destroy) static bool js_gfx_GFXTexture_getSamples(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getSamples : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14244,7 +14244,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getSamples) static bool js_gfx_GFXTexture_getFormat(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getFormat : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14262,7 +14262,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getFormat) static bool js_gfx_GFXTexture_getFlags(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_getFlags : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14280,7 +14280,7 @@ SE_BIND_PROP_GET(js_gfx_GFXTexture_getFlags) static bool js_gfx_GFXTexture_resize(se::State& s) { - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXTexture_resize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14299,37 +14299,37 @@ static bool js_gfx_GFXTexture_resize(se::State& s) } SE_BIND_FUNC(js_gfx_GFXTexture_resize) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXTexture_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXTexture_finalize) static bool js_gfx_GFXTexture_constructor(se::State& s) { - //#3 cc::GFXTexture: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXTexture constructor is skipped\")"); + //#3 cc::gfx::GFXTexture: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXTexture constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXTexture_constructor, __jsb_cc_GFXTexture_class, js_cc_GFXTexture_finalize) +SE_BIND_CTOR(js_gfx_GFXTexture_constructor, __jsb_cc_gfx_GFXTexture_class, js_cc_gfx_GFXTexture_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXTexture_finalize(se::State& s) +static bool js_cc_gfx_GFXTexture_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXTexture)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXTexture)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXTexture_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXTexture_finalize) bool js_register_gfx_GFXTexture(se::Object* obj) { - auto cls = se::Class::create("GFXTexture", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXTexture_constructor)); + auto cls = se::Class::create("GFXTexture", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXTexture_constructor)); cls->defineProperty("arrayLayer", _SE(js_gfx_GFXTexture_getArrayLayer), nullptr); cls->defineProperty("format", _SE(js_gfx_GFXTexture_getFormat), nullptr); @@ -14345,23 +14345,23 @@ bool js_register_gfx_GFXTexture(se::Object* obj) cls->defineProperty("size", _SE(js_gfx_GFXTexture_getSize), nullptr); cls->defineFunction("destroy", _SE(js_gfx_GFXTexture_destroy)); cls->defineFunction("resize", _SE(js_gfx_GFXTexture_resize)); - cls->defineFinalizeFunction(_SE(js_cc_GFXTexture_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXTexture_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXTexture_proto = cls->getProto(); - __jsb_cc_GFXTexture_class = cls; + __jsb_cc_gfx_GFXTexture_proto = cls->getProto(); + __jsb_cc_gfx_GFXTexture_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXSampler_proto = nullptr; -se::Class* __jsb_cc_GFXSampler_class = nullptr; +se::Object* __jsb_cc_gfx_GFXSampler_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXSampler_class = nullptr; static bool js_gfx_GFXSampler_getAddressW(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getAddressW : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14379,7 +14379,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getAddressW) static bool js_gfx_GFXSampler_getMaxAnisotropy(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMaxAnisotropy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14397,7 +14397,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMaxAnisotropy) static bool js_gfx_GFXSampler_getMipLODBias(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMipLODBias : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14415,7 +14415,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMipLODBias) static bool js_gfx_GFXSampler_getCmpFunc(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getCmpFunc : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14433,13 +14433,13 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getCmpFunc) static bool js_gfx_GFXSampler_getBorderColor(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getBorderColor : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXColor& result = cobj->getBorderColor(); + const cc::gfx::GFXColor& result = cobj->getBorderColor(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXSampler_getBorderColor : Error processing arguments"); return true; @@ -14451,13 +14451,13 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getBorderColor) static bool js_gfx_GFXSampler_getName(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getName : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::String& result = cobj->getName(); + const cc::gfx::String& result = cobj->getName(); s.rval().setString(result); SE_PRECONDITION2(ok, false, "js_gfx_GFXSampler_getName : Error processing arguments"); return true; @@ -14469,7 +14469,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getName) static bool js_gfx_GFXSampler_getMipFilter(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMipFilter : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14487,7 +14487,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMipFilter) static bool js_gfx_GFXSampler_getAddressV(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getAddressV : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14505,7 +14505,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getAddressV) static bool js_gfx_GFXSampler_getAddressU(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getAddressU : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14523,7 +14523,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getAddressU) static bool js_gfx_GFXSampler_getMagFilter(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMagFilter : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14541,13 +14541,13 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMagFilter) static bool js_gfx_GFXSampler_initialize(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXSamplerInfo* arg0 = nullptr; + cc::gfx::GFXSamplerInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXSampler_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -14562,7 +14562,7 @@ SE_BIND_FUNC(js_gfx_GFXSampler_initialize) static bool js_gfx_GFXSampler_destroy(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14577,13 +14577,13 @@ SE_BIND_FUNC(js_gfx_GFXSampler_destroy) static bool js_gfx_GFXSampler_getDevice(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXSampler_getDevice : Error processing arguments"); return true; @@ -14595,7 +14595,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getDevice) static bool js_gfx_GFXSampler_getMinLOD(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMinLOD : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14613,7 +14613,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMinLOD) static bool js_gfx_GFXSampler_getMinFilter(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMinFilter : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14631,7 +14631,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSampler_getMinFilter) static bool js_gfx_GFXSampler_getMaxLOD(se::State& s) { - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSampler_getMaxLOD : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14647,37 +14647,37 @@ static bool js_gfx_GFXSampler_getMaxLOD(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXSampler_getMaxLOD) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXSampler_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXSampler_finalize) static bool js_gfx_GFXSampler_constructor(se::State& s) { - //#3 cc::GFXSampler: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXSampler constructor is skipped\")"); + //#3 cc::gfx::GFXSampler: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXSampler constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXSampler_constructor, __jsb_cc_GFXSampler_class, js_cc_GFXSampler_finalize) +SE_BIND_CTOR(js_gfx_GFXSampler_constructor, __jsb_cc_gfx_GFXSampler_class, js_cc_gfx_GFXSampler_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXSampler_finalize(se::State& s) +static bool js_cc_gfx_GFXSampler_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXSampler)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXSampler)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXSampler* cobj = (cc::GFXSampler*)s.nativeThisObject(); + cc::gfx::GFXSampler* cobj = (cc::gfx::GFXSampler*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXSampler_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXSampler_finalize) bool js_register_gfx_GFXSampler(se::Object* obj) { - auto cls = se::Class::create("GFXSampler", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXSampler_constructor)); + auto cls = se::Class::create("GFXSampler", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXSampler_constructor)); cls->defineProperty("borderColor", _SE(js_gfx_GFXSampler_getBorderColor), nullptr); cls->defineProperty("mipFilter", _SE(js_gfx_GFXSampler_getMipFilter), nullptr); @@ -14695,29 +14695,29 @@ bool js_register_gfx_GFXSampler(se::Object* obj) cls->defineProperty("minLOD", _SE(js_gfx_GFXSampler_getMinLOD), nullptr); cls->defineFunction("initialize", _SE(js_gfx_GFXSampler_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXSampler_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXSampler_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXSampler_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXSampler_proto = cls->getProto(); - __jsb_cc_GFXSampler_class = cls; + __jsb_cc_gfx_GFXSampler_proto = cls->getProto(); + __jsb_cc_gfx_GFXSampler_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXShader_proto = nullptr; -se::Class* __jsb_cc_GFXShader_class = nullptr; +se::Object* __jsb_cc_gfx_GFXShader_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXShader_class = nullptr; static bool js_gfx_GFXShader_getStages(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getStages : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getStages(); + const std::vector& result = cobj->getStages(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getStages : Error processing arguments"); return true; @@ -14729,13 +14729,13 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getStages) static bool js_gfx_GFXShader_getName(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getName : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::String& result = cobj->getName(); + const cc::gfx::String& result = cobj->getName(); s.rval().setString(result); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getName : Error processing arguments"); return true; @@ -14747,13 +14747,13 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getName) static bool js_gfx_GFXShader_getAttributes(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getAttributes : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getAttributes(); + const std::vector& result = cobj->getAttributes(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getAttributes : Error processing arguments"); return true; @@ -14765,7 +14765,7 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getAttributes) static bool js_gfx_GFXShader_getHash(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getHash : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14783,13 +14783,13 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getHash) static bool js_gfx_GFXShader_getSamplers(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getSamplers : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getSamplers(); + const std::vector& result = cobj->getSamplers(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getSamplers : Error processing arguments"); return true; @@ -14801,13 +14801,13 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getSamplers) static bool js_gfx_GFXShader_initialize(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXShaderInfo* arg0 = nullptr; + cc::gfx::GFXShaderInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -14822,7 +14822,7 @@ SE_BIND_FUNC(js_gfx_GFXShader_initialize) static bool js_gfx_GFXShader_destroy(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14837,13 +14837,13 @@ SE_BIND_FUNC(js_gfx_GFXShader_destroy) static bool js_gfx_GFXShader_getDevice(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getDevice : Error processing arguments"); return true; @@ -14855,13 +14855,13 @@ SE_BIND_PROP_GET(js_gfx_GFXShader_getDevice) static bool js_gfx_GFXShader_getBlocks(se::State& s) { - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXShader_getBlocks : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getBlocks(); + const std::vector& result = cobj->getBlocks(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXShader_getBlocks : Error processing arguments"); return true; @@ -14871,37 +14871,37 @@ static bool js_gfx_GFXShader_getBlocks(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXShader_getBlocks) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXShader_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXShader_finalize) static bool js_gfx_GFXShader_constructor(se::State& s) { - //#3 cc::GFXShader: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXShader constructor is skipped\")"); + //#3 cc::gfx::GFXShader: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXShader constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXShader_constructor, __jsb_cc_GFXShader_class, js_cc_GFXShader_finalize) +SE_BIND_CTOR(js_gfx_GFXShader_constructor, __jsb_cc_gfx_GFXShader_class, js_cc_gfx_GFXShader_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXShader_finalize(se::State& s) +static bool js_cc_gfx_GFXShader_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXShader)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXShader)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXShader* cobj = (cc::GFXShader*)s.nativeThisObject(); + cc::gfx::GFXShader* cobj = (cc::gfx::GFXShader*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXShader_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXShader_finalize) bool js_register_gfx_GFXShader(se::Object* obj) { - auto cls = se::Class::create("GFXShader", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXShader_constructor)); + auto cls = se::Class::create("GFXShader", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXShader_constructor)); cls->defineProperty("blocks", _SE(js_gfx_GFXShader_getBlocks), nullptr); cls->defineProperty("name", _SE(js_gfx_GFXShader_getName), nullptr); @@ -14912,23 +14912,23 @@ bool js_register_gfx_GFXShader(se::Object* obj) cls->defineProperty("hash", _SE(js_gfx_GFXShader_getHash), nullptr); cls->defineFunction("initialize", _SE(js_gfx_GFXShader_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXShader_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXShader_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXShader_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXShader_proto = cls->getProto(); - __jsb_cc_GFXShader_class = cls; + __jsb_cc_gfx_GFXShader_proto = cls->getProto(); + __jsb_cc_gfx_GFXShader_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXInputAssembler_proto = nullptr; -se::Class* __jsb_cc_GFXInputAssembler_class = nullptr; +se::Object* __jsb_cc_gfx_GFXInputAssembler_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXInputAssembler_class = nullptr; static bool js_gfx_GFXInputAssembler_getFirstIndex(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getFirstIndex : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14946,7 +14946,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getFirstIndex) static bool js_gfx_GFXInputAssembler_getVertexOffset(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getVertexOffset : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14964,7 +14964,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getVertexOffset) static bool js_gfx_GFXInputAssembler_getVertexCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getVertexCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -14982,7 +14982,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getVertexCount) static bool js_gfx_GFXInputAssembler_setIndexCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setIndexCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15001,7 +15001,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setIndexCount) static bool js_gfx_GFXInputAssembler_getAttributesHash(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getAttributesHash : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15019,7 +15019,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getAttributesHash) static bool js_gfx_GFXInputAssembler_setFirstInstance(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setFirstInstance : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15038,7 +15038,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setFirstInstance) static bool js_gfx_GFXInputAssembler_destroy(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15053,13 +15053,13 @@ SE_BIND_FUNC(js_gfx_GFXInputAssembler_destroy) static bool js_gfx_GFXInputAssembler_getDevice(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_getDevice : Error processing arguments"); return true; @@ -15071,7 +15071,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getDevice) static bool js_gfx_GFXInputAssembler_setVertexOffset(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setVertexOffset : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15090,7 +15090,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setVertexOffset) static bool js_gfx_GFXInputAssembler_getInstanceCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getInstanceCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15108,7 +15108,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getInstanceCount) static bool js_gfx_GFXInputAssembler_getIndexCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getIndexCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15126,13 +15126,13 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getIndexCount) static bool js_gfx_GFXInputAssembler_getIndirectBuffer(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getIndirectBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXBuffer* result = cobj->getIndirectBuffer(); + cc::gfx::GFXBuffer* result = cobj->getIndirectBuffer(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_getIndirectBuffer : Error processing arguments"); return true; @@ -15144,13 +15144,13 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getIndirectBuffer) static bool js_gfx_GFXInputAssembler_getVertexBuffers(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getVertexBuffers : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getVertexBuffers(); + const std::vector& result = cobj->getVertexBuffers(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_getVertexBuffers : Error processing arguments"); return true; @@ -15162,13 +15162,13 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getVertexBuffers) static bool js_gfx_GFXInputAssembler_initialize(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXInputAssemblerInfo* arg0 = nullptr; + cc::gfx::GFXInputAssemblerInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -15183,7 +15183,7 @@ SE_BIND_FUNC(js_gfx_GFXInputAssembler_initialize) static bool js_gfx_GFXInputAssembler_setFirstVertex(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setFirstVertex : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15202,7 +15202,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setFirstVertex) static bool js_gfx_GFXInputAssembler_getFirstVertex(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getFirstVertex : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15220,7 +15220,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getFirstVertex) static bool js_gfx_GFXInputAssembler_setVertexCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setVertexCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15239,13 +15239,13 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setVertexCount) static bool js_gfx_GFXInputAssembler_getAttributes(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getAttributes : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getAttributes(); + const std::vector& result = cobj->getAttributes(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_getAttributes : Error processing arguments"); return true; @@ -15257,13 +15257,13 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getAttributes) static bool js_gfx_GFXInputAssembler_getIndexBuffer(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getIndexBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXBuffer* result = cobj->getIndexBuffer(); + cc::gfx::GFXBuffer* result = cobj->getIndexBuffer(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXInputAssembler_getIndexBuffer : Error processing arguments"); return true; @@ -15275,7 +15275,7 @@ SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getIndexBuffer) static bool js_gfx_GFXInputAssembler_setFirstIndex(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setFirstIndex : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15294,7 +15294,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setFirstIndex) static bool js_gfx_GFXInputAssembler_setInstanceCount(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_setInstanceCount : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15313,7 +15313,7 @@ SE_BIND_PROP_SET(js_gfx_GFXInputAssembler_setInstanceCount) static bool js_gfx_GFXInputAssembler_getFirstInstance(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_getFirstInstance : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15329,37 +15329,37 @@ static bool js_gfx_GFXInputAssembler_getFirstInstance(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXInputAssembler_getFirstInstance) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXInputAssembler_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXInputAssembler_finalize) static bool js_gfx_GFXInputAssembler_constructor(se::State& s) { - //#3 cc::GFXInputAssembler: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXInputAssembler constructor is skipped\")"); + //#3 cc::gfx::GFXInputAssembler: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXInputAssembler constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXInputAssembler_constructor, __jsb_cc_GFXInputAssembler_class, js_cc_GFXInputAssembler_finalize) +SE_BIND_CTOR(js_gfx_GFXInputAssembler_constructor, __jsb_cc_gfx_GFXInputAssembler_class, js_cc_gfx_GFXInputAssembler_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXInputAssembler_finalize(se::State& s) +static bool js_cc_gfx_GFXInputAssembler_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXInputAssembler)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXInputAssembler)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXInputAssembler_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXInputAssembler_finalize) bool js_register_gfx_GFXInputAssembler(se::Object* obj) { - auto cls = se::Class::create("GFXInputAssembler", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXInputAssembler_constructor)); + auto cls = se::Class::create("GFXInputAssembler", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXInputAssembler_constructor)); cls->defineProperty("instanceCount", _SE(js_gfx_GFXInputAssembler_getInstanceCount), _SE(js_gfx_GFXInputAssembler_setInstanceCount)); cls->defineProperty("vertexBuffers", _SE(js_gfx_GFXInputAssembler_getVertexBuffers), nullptr); @@ -15376,29 +15376,29 @@ bool js_register_gfx_GFXInputAssembler(se::Object* obj) cls->defineProperty("firstVertex", _SE(js_gfx_GFXInputAssembler_getFirstVertex), _SE(js_gfx_GFXInputAssembler_setFirstVertex)); cls->defineFunction("destroy", _SE(js_gfx_GFXInputAssembler_destroy)); cls->defineFunction("initialize", _SE(js_gfx_GFXInputAssembler_initialize)); - cls->defineFinalizeFunction(_SE(js_cc_GFXInputAssembler_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXInputAssembler_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXInputAssembler_proto = cls->getProto(); - __jsb_cc_GFXInputAssembler_class = cls; + __jsb_cc_gfx_GFXInputAssembler_proto = cls->getProto(); + __jsb_cc_gfx_GFXInputAssembler_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXRenderPass_proto = nullptr; -se::Class* __jsb_cc_GFXRenderPass_class = nullptr; +se::Object* __jsb_cc_gfx_GFXRenderPass_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXRenderPass_class = nullptr; static bool js_gfx_GFXRenderPass_getColorAttachments(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_getColorAttachments : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getColorAttachments(); + const std::vector& result = cobj->getColorAttachments(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPass_getColorAttachments : Error processing arguments"); return true; @@ -15410,13 +15410,13 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPass_getColorAttachments) static bool js_gfx_GFXRenderPass_getSubPasses(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_getSubPasses : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getSubPasses(); + const std::vector& result = cobj->getSubPasses(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPass_getSubPasses : Error processing arguments"); return true; @@ -15428,7 +15428,7 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPass_getSubPasses) static bool js_gfx_GFXRenderPass_getHash(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_getHash : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15446,13 +15446,13 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPass_getHash) static bool js_gfx_GFXRenderPass_initialize(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXRenderPassInfo* arg0 = nullptr; + cc::gfx::GFXRenderPassInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPass_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -15467,7 +15467,7 @@ SE_BIND_FUNC(js_gfx_GFXRenderPass_initialize) static bool js_gfx_GFXRenderPass_destroy(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15482,13 +15482,13 @@ SE_BIND_FUNC(js_gfx_GFXRenderPass_destroy) static bool js_gfx_GFXRenderPass_getDevice(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPass_getDevice : Error processing arguments"); return true; @@ -15500,13 +15500,13 @@ SE_BIND_PROP_GET(js_gfx_GFXRenderPass_getDevice) static bool js_gfx_GFXRenderPass_getDepthStencilAttachment(se::State& s) { - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXRenderPass_getDepthStencilAttachment : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXDepthStencilAttachment& result = cobj->getDepthStencilAttachment(); + const cc::gfx::GFXDepthStencilAttachment& result = cobj->getDepthStencilAttachment(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXRenderPass_getDepthStencilAttachment : Error processing arguments"); return true; @@ -15516,37 +15516,37 @@ static bool js_gfx_GFXRenderPass_getDepthStencilAttachment(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXRenderPass_getDepthStencilAttachment) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXRenderPass_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXRenderPass_finalize) static bool js_gfx_GFXRenderPass_constructor(se::State& s) { - //#3 cc::GFXRenderPass: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXRenderPass constructor is skipped\")"); + //#3 cc::gfx::GFXRenderPass: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXRenderPass constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXRenderPass_constructor, __jsb_cc_GFXRenderPass_class, js_cc_GFXRenderPass_finalize) +SE_BIND_CTOR(js_gfx_GFXRenderPass_constructor, __jsb_cc_gfx_GFXRenderPass_class, js_cc_gfx_GFXRenderPass_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXRenderPass_finalize(se::State& s) +static bool js_cc_gfx_GFXRenderPass_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXRenderPass)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXRenderPass)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXRenderPass* cobj = (cc::GFXRenderPass*)s.nativeThisObject(); + cc::gfx::GFXRenderPass* cobj = (cc::gfx::GFXRenderPass*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXRenderPass_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXRenderPass_finalize) bool js_register_gfx_GFXRenderPass(se::Object* obj) { - auto cls = se::Class::create("GFXRenderPass", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXRenderPass_constructor)); + auto cls = se::Class::create("GFXRenderPass", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXRenderPass_constructor)); cls->defineProperty("device", _SE(js_gfx_GFXRenderPass_getDevice), nullptr); cls->defineProperty("colorAttachments", _SE(js_gfx_GFXRenderPass_getColorAttachments), nullptr); @@ -15555,29 +15555,29 @@ bool js_register_gfx_GFXRenderPass(se::Object* obj) cls->defineProperty("subPasses", _SE(js_gfx_GFXRenderPass_getSubPasses), nullptr); cls->defineFunction("initialize", _SE(js_gfx_GFXRenderPass_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXRenderPass_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXRenderPass_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXRenderPass_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXRenderPass_proto = cls->getProto(); - __jsb_cc_GFXRenderPass_class = cls; + __jsb_cc_gfx_GFXRenderPass_proto = cls->getProto(); + __jsb_cc_gfx_GFXRenderPass_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXFramebuffer_proto = nullptr; -se::Class* __jsb_cc_GFXFramebuffer_class = nullptr; +se::Object* __jsb_cc_gfx_GFXFramebuffer_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXFramebuffer_class = nullptr; static bool js_gfx_GFXFramebuffer_getColorTextures(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_getColorTextures : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getColorTextures(); + const std::vector& result = cobj->getColorTextures(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebuffer_getColorTextures : Error processing arguments"); return true; @@ -15589,13 +15589,13 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebuffer_getColorTextures) static bool js_gfx_GFXFramebuffer_getDepthStencilTexture(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_getDepthStencilTexture : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXTexture* result = cobj->getDepthStencilTexture(); + cc::gfx::GFXTexture* result = cobj->getDepthStencilTexture(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebuffer_getDepthStencilTexture : Error processing arguments"); return true; @@ -15607,7 +15607,7 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebuffer_getDepthStencilTexture) static bool js_gfx_GFXFramebuffer_isOffscreen(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_isOffscreen : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15625,13 +15625,13 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebuffer_isOffscreen) static bool js_gfx_GFXFramebuffer_initialize(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXFramebufferInfo* arg0 = nullptr; + cc::gfx::GFXFramebufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebuffer_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -15646,7 +15646,7 @@ SE_BIND_FUNC(js_gfx_GFXFramebuffer_initialize) static bool js_gfx_GFXFramebuffer_destroy(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15661,13 +15661,13 @@ SE_BIND_FUNC(js_gfx_GFXFramebuffer_destroy) static bool js_gfx_GFXFramebuffer_getRenderPass(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_getRenderPass : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXRenderPass* result = cobj->getRenderPass(); + cc::gfx::GFXRenderPass* result = cobj->getRenderPass(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebuffer_getRenderPass : Error processing arguments"); return true; @@ -15679,13 +15679,13 @@ SE_BIND_PROP_GET(js_gfx_GFXFramebuffer_getRenderPass) static bool js_gfx_GFXFramebuffer_getDevice(se::State& s) { - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFramebuffer_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXFramebuffer_getDevice : Error processing arguments"); return true; @@ -15695,37 +15695,37 @@ static bool js_gfx_GFXFramebuffer_getDevice(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXFramebuffer_getDevice) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXFramebuffer_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXFramebuffer_finalize) static bool js_gfx_GFXFramebuffer_constructor(se::State& s) { - //#3 cc::GFXFramebuffer: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXFramebuffer constructor is skipped\")"); + //#3 cc::gfx::GFXFramebuffer: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXFramebuffer constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXFramebuffer_constructor, __jsb_cc_GFXFramebuffer_class, js_cc_GFXFramebuffer_finalize) +SE_BIND_CTOR(js_gfx_GFXFramebuffer_constructor, __jsb_cc_gfx_GFXFramebuffer_class, js_cc_gfx_GFXFramebuffer_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXFramebuffer_finalize(se::State& s) +static bool js_cc_gfx_GFXFramebuffer_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXFramebuffer)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXFramebuffer)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXFramebuffer* cobj = (cc::GFXFramebuffer*)s.nativeThisObject(); + cc::gfx::GFXFramebuffer* cobj = (cc::gfx::GFXFramebuffer*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXFramebuffer_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXFramebuffer_finalize) bool js_register_gfx_GFXFramebuffer(se::Object* obj) { - auto cls = se::Class::create("GFXFramebuffer", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXFramebuffer_constructor)); + auto cls = se::Class::create("GFXFramebuffer", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXFramebuffer_constructor)); cls->defineProperty("device", _SE(js_gfx_GFXFramebuffer_getDevice), nullptr); cls->defineProperty("renderPass", _SE(js_gfx_GFXFramebuffer_getRenderPass), nullptr); @@ -15734,29 +15734,29 @@ bool js_register_gfx_GFXFramebuffer(se::Object* obj) cls->defineProperty("isOffscreen", _SE(js_gfx_GFXFramebuffer_isOffscreen), nullptr); cls->defineFunction("initialize", _SE(js_gfx_GFXFramebuffer_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXFramebuffer_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXFramebuffer_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXFramebuffer_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXFramebuffer_proto = cls->getProto(); - __jsb_cc_GFXFramebuffer_class = cls; + __jsb_cc_gfx_GFXFramebuffer_proto = cls->getProto(); + __jsb_cc_gfx_GFXFramebuffer_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXBindingLayout_proto = nullptr; -se::Class* __jsb_cc_GFXBindingLayout_class = nullptr; +se::Object* __jsb_cc_gfx_GFXBindingLayout_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXBindingLayout_class = nullptr; static bool js_gfx_GFXBindingLayout_getBindingUnits(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_getBindingUnits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getBindingUnits(); + const std::vector& result = cobj->getBindingUnits(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_getBindingUnits : Error processing arguments"); return true; @@ -15768,14 +15768,14 @@ SE_BIND_PROP_GET(js_gfx_GFXBindingLayout_getBindingUnits) static bool js_gfx_GFXBindingLayout_bindBuffer(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_bindBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { unsigned int arg0 = 0; - cc::GFXBuffer* arg1 = nullptr; + cc::gfx::GFXBuffer* arg1 = nullptr; ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); ok &= seval_to_native_ptr(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_bindBuffer : Error processing arguments"); @@ -15789,14 +15789,14 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_bindBuffer) static bool js_gfx_GFXBindingLayout_bindSampler(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_bindSampler : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { unsigned int arg0 = 0; - cc::GFXSampler* arg1 = nullptr; + cc::gfx::GFXSampler* arg1 = nullptr; ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); ok &= seval_to_native_ptr(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_bindSampler : Error processing arguments"); @@ -15810,7 +15810,7 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_bindSampler) static bool js_gfx_GFXBindingLayout_update(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_update : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15825,14 +15825,14 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_update) static bool js_gfx_GFXBindingLayout_bindTexture(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_bindTexture : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { unsigned int arg0 = 0; - cc::GFXTexture* arg1 = nullptr; + cc::gfx::GFXTexture* arg1 = nullptr; ok &= seval_to_uint32(args[0], (uint32_t*)&arg0); ok &= seval_to_native_ptr(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_bindTexture : Error processing arguments"); @@ -15846,13 +15846,13 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_bindTexture) static bool js_gfx_GFXBindingLayout_initialize(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXBindingLayoutInfo* arg0 = nullptr; + cc::gfx::GFXBindingLayoutInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -15867,7 +15867,7 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_initialize) static bool js_gfx_GFXBindingLayout_destroy(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -15882,13 +15882,13 @@ SE_BIND_FUNC(js_gfx_GFXBindingLayout_destroy) static bool js_gfx_GFXBindingLayout_getDevice(se::State& s) { - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBindingLayout_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXBindingLayout_getDevice : Error processing arguments"); return true; @@ -15898,37 +15898,37 @@ static bool js_gfx_GFXBindingLayout_getDevice(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXBindingLayout_getDevice) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXBindingLayout_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXBindingLayout_finalize) static bool js_gfx_GFXBindingLayout_constructor(se::State& s) { - //#3 cc::GFXBindingLayout: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXBindingLayout constructor is skipped\")"); + //#3 cc::gfx::GFXBindingLayout: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXBindingLayout constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXBindingLayout_constructor, __jsb_cc_GFXBindingLayout_class, js_cc_GFXBindingLayout_finalize) +SE_BIND_CTOR(js_gfx_GFXBindingLayout_constructor, __jsb_cc_gfx_GFXBindingLayout_class, js_cc_gfx_GFXBindingLayout_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXBindingLayout_finalize(se::State& s) +static bool js_cc_gfx_GFXBindingLayout_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXBindingLayout)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXBindingLayout)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXBindingLayout* cobj = (cc::GFXBindingLayout*)s.nativeThisObject(); + cc::gfx::GFXBindingLayout* cobj = (cc::gfx::GFXBindingLayout*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXBindingLayout_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXBindingLayout_finalize) bool js_register_gfx_GFXBindingLayout(se::Object* obj) { - auto cls = se::Class::create("GFXBindingLayout", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXBindingLayout_constructor)); + auto cls = se::Class::create("GFXBindingLayout", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXBindingLayout_constructor)); cls->defineProperty("device", _SE(js_gfx_GFXBindingLayout_getDevice), nullptr); cls->defineProperty("bindingUnits", _SE(js_gfx_GFXBindingLayout_getBindingUnits), nullptr); @@ -15938,29 +15938,29 @@ bool js_register_gfx_GFXBindingLayout(se::Object* obj) cls->defineFunction("bindTexture", _SE(js_gfx_GFXBindingLayout_bindTexture)); cls->defineFunction("initialize", _SE(js_gfx_GFXBindingLayout_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXBindingLayout_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXBindingLayout_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXBindingLayout_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXBindingLayout_proto = cls->getProto(); - __jsb_cc_GFXBindingLayout_class = cls; + __jsb_cc_gfx_GFXBindingLayout_proto = cls->getProto(); + __jsb_cc_gfx_GFXBindingLayout_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXPipelineLayout_proto = nullptr; -se::Class* __jsb_cc_GFXPipelineLayout_class = nullptr; +se::Object* __jsb_cc_gfx_GFXPipelineLayout_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXPipelineLayout_class = nullptr; static bool js_gfx_GFXPipelineLayout_getLayouts(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_getLayouts : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getLayouts(); + const std::vector& result = cobj->getLayouts(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayout_getLayouts : Error processing arguments"); return true; @@ -15972,13 +15972,13 @@ SE_BIND_FUNC(js_gfx_GFXPipelineLayout_getLayouts) static bool js_gfx_GFXPipelineLayout_initialize(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXPipelineLayoutInfo* arg0 = nullptr; + cc::gfx::GFXPipelineLayoutInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayout_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -15993,7 +15993,7 @@ SE_BIND_FUNC(js_gfx_GFXPipelineLayout_initialize) static bool js_gfx_GFXPipelineLayout_destroy(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16008,13 +16008,13 @@ SE_BIND_FUNC(js_gfx_GFXPipelineLayout_destroy) static bool js_gfx_GFXPipelineLayout_getDevice(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayout_getDevice : Error processing arguments"); return true; @@ -16026,13 +16026,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineLayout_getDevice) static bool js_gfx_GFXPipelineLayout_getPushConstantsRanges(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_getPushConstantsRanges : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getPushConstantsRanges(); + const std::vector& result = cobj->getPushConstantsRanges(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineLayout_getPushConstantsRanges : Error processing arguments"); return true; @@ -16042,66 +16042,66 @@ static bool js_gfx_GFXPipelineLayout_getPushConstantsRanges(se::State& s) } SE_BIND_FUNC(js_gfx_GFXPipelineLayout_getPushConstantsRanges) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXPipelineLayout_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXPipelineLayout_finalize) static bool js_gfx_GFXPipelineLayout_constructor(se::State& s) { - //#3 cc::GFXPipelineLayout: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXPipelineLayout constructor is skipped\")"); + //#3 cc::gfx::GFXPipelineLayout: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXPipelineLayout constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXPipelineLayout_constructor, __jsb_cc_GFXPipelineLayout_class, js_cc_GFXPipelineLayout_finalize) +SE_BIND_CTOR(js_gfx_GFXPipelineLayout_constructor, __jsb_cc_gfx_GFXPipelineLayout_class, js_cc_gfx_GFXPipelineLayout_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXPipelineLayout_finalize(se::State& s) +static bool js_cc_gfx_GFXPipelineLayout_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXPipelineLayout)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXPipelineLayout)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXPipelineLayout_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXPipelineLayout_finalize) bool js_register_gfx_GFXPipelineLayout(se::Object* obj) { - auto cls = se::Class::create("GFXPipelineLayout", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXPipelineLayout_constructor)); + auto cls = se::Class::create("GFXPipelineLayout", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXPipelineLayout_constructor)); cls->defineProperty("device", _SE(js_gfx_GFXPipelineLayout_getDevice), nullptr); cls->defineFunction("getLayouts", _SE(js_gfx_GFXPipelineLayout_getLayouts)); cls->defineFunction("initialize", _SE(js_gfx_GFXPipelineLayout_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXPipelineLayout_destroy)); cls->defineFunction("getPushConstantsRanges", _SE(js_gfx_GFXPipelineLayout_getPushConstantsRanges)); - cls->defineFinalizeFunction(_SE(js_cc_GFXPipelineLayout_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXPipelineLayout_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXPipelineLayout_proto = cls->getProto(); - __jsb_cc_GFXPipelineLayout_class = cls; + __jsb_cc_gfx_GFXPipelineLayout_proto = cls->getProto(); + __jsb_cc_gfx_GFXPipelineLayout_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXPipelineState_proto = nullptr; -se::Class* __jsb_cc_GFXPipelineState_class = nullptr; +se::Object* __jsb_cc_gfx_GFXPipelineState_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXPipelineState_class = nullptr; static bool js_gfx_GFXPipelineState_getRasterizerState(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getRasterizerState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXRasterizerState& result = cobj->getRasterizerState(); + const cc::gfx::GFXRasterizerState& result = cobj->getRasterizerState(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getRasterizerState : Error processing arguments"); return true; @@ -16113,13 +16113,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getRasterizerState) static bool js_gfx_GFXPipelineState_getShader(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getShader : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXShader* result = cobj->getShader(); + cc::gfx::GFXShader* result = cobj->getShader(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getShader : Error processing arguments"); return true; @@ -16131,13 +16131,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getShader) static bool js_gfx_GFXPipelineState_getInputState(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getInputState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXInputState& result = cobj->getInputState(); + const cc::gfx::GFXInputState& result = cobj->getInputState(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getInputState : Error processing arguments"); return true; @@ -16149,7 +16149,7 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getInputState) static bool js_gfx_GFXPipelineState_getPrimitive(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getPrimitive : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16167,13 +16167,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getPrimitive) static bool js_gfx_GFXPipelineState_getDepthStencilState(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getDepthStencilState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXDepthStencilState& result = cobj->getDepthStencilState(); + const cc::gfx::GFXDepthStencilState& result = cobj->getDepthStencilState(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getDepthStencilState : Error processing arguments"); return true; @@ -16185,13 +16185,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getDepthStencilState) static bool js_gfx_GFXPipelineState_getBlendState(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getBlendState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXBlendState& result = cobj->getBlendState(); + const cc::gfx::GFXBlendState& result = cobj->getBlendState(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getBlendState : Error processing arguments"); return true; @@ -16203,13 +16203,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getBlendState) static bool js_gfx_GFXPipelineState_getPipelineLayout(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getPipelineLayout : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXPipelineLayout* result = cobj->getPipelineLayout(); + const cc::gfx::GFXPipelineLayout* result = cobj->getPipelineLayout(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getPipelineLayout : Error processing arguments"); return true; @@ -16221,13 +16221,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getPipelineLayout) static bool js_gfx_GFXPipelineState_initialize(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXPipelineStateInfo* arg0 = nullptr; + cc::gfx::GFXPipelineStateInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -16242,7 +16242,7 @@ SE_BIND_FUNC(js_gfx_GFXPipelineState_initialize) static bool js_gfx_GFXPipelineState_destroy(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16257,13 +16257,13 @@ SE_BIND_FUNC(js_gfx_GFXPipelineState_destroy) static bool js_gfx_GFXPipelineState_getRenderPass(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getRenderPass : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const cc::GFXRenderPass* result = cobj->getRenderPass(); + const cc::gfx::GFXRenderPass* result = cobj->getRenderPass(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getRenderPass : Error processing arguments"); return true; @@ -16275,13 +16275,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getRenderPass) static bool js_gfx_GFXPipelineState_getDevice(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getDevice : Error processing arguments"); return true; @@ -16293,13 +16293,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineState_getDevice) static bool js_gfx_GFXPipelineState_getDynamicStates(se::State& s) { - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineState_getDynamicStates : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - const std::vector& result = cobj->getDynamicStates(); + const std::vector& result = cobj->getDynamicStates(); ok &= std_vector_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXPipelineState_getDynamicStates : Error processing arguments"); return true; @@ -16309,37 +16309,37 @@ static bool js_gfx_GFXPipelineState_getDynamicStates(se::State& s) } SE_BIND_FUNC(js_gfx_GFXPipelineState_getDynamicStates) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXPipelineState_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXPipelineState_finalize) static bool js_gfx_GFXPipelineState_constructor(se::State& s) { - //#3 cc::GFXPipelineState: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXPipelineState constructor is skipped\")"); + //#3 cc::gfx::GFXPipelineState: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXPipelineState constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXPipelineState_constructor, __jsb_cc_GFXPipelineState_class, js_cc_GFXPipelineState_finalize) +SE_BIND_CTOR(js_gfx_GFXPipelineState_constructor, __jsb_cc_gfx_GFXPipelineState_class, js_cc_gfx_GFXPipelineState_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXPipelineState_finalize(se::State& s) +static bool js_cc_gfx_GFXPipelineState_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXPipelineState)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXPipelineState)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXPipelineState* cobj = (cc::GFXPipelineState*)s.nativeThisObject(); + cc::gfx::GFXPipelineState* cobj = (cc::gfx::GFXPipelineState*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXPipelineState_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXPipelineState_finalize) bool js_register_gfx_GFXPipelineState(se::Object* obj) { - auto cls = se::Class::create("GFXPipelineState", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXPipelineState_constructor)); + auto cls = se::Class::create("GFXPipelineState", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXPipelineState_constructor)); cls->defineProperty("primitive", _SE(js_gfx_GFXPipelineState_getPrimitive), nullptr); cls->defineProperty("rasterizerState", _SE(js_gfx_GFXPipelineState_getRasterizerState), nullptr); @@ -16353,29 +16353,29 @@ bool js_register_gfx_GFXPipelineState(se::Object* obj) cls->defineFunction("initialize", _SE(js_gfx_GFXPipelineState_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXPipelineState_destroy)); cls->defineFunction("getDynamicStates", _SE(js_gfx_GFXPipelineState_getDynamicStates)); - cls->defineFinalizeFunction(_SE(js_cc_GFXPipelineState_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXPipelineState_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXPipelineState_proto = cls->getProto(); - __jsb_cc_GFXPipelineState_class = cls; + __jsb_cc_gfx_GFXPipelineState_proto = cls->getProto(); + __jsb_cc_gfx_GFXPipelineState_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXCommandAllocator_proto = nullptr; -se::Class* __jsb_cc_GFXCommandAllocator_class = nullptr; +se::Object* __jsb_cc_gfx_GFXCommandAllocator_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXCommandAllocator_class = nullptr; static bool js_gfx_GFXCommandAllocator_initialize(se::State& s) { - cc::GFXCommandAllocator* cobj = (cc::GFXCommandAllocator*)s.nativeThisObject(); + cc::gfx::GFXCommandAllocator* cobj = (cc::gfx::GFXCommandAllocator*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandAllocator_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXCommandAllocatorInfo* arg0 = nullptr; + cc::gfx::GFXCommandAllocatorInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandAllocator_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -16390,7 +16390,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandAllocator_initialize) static bool js_gfx_GFXCommandAllocator_destroy(se::State& s) { - cc::GFXCommandAllocator* cobj = (cc::GFXCommandAllocator*)s.nativeThisObject(); + cc::gfx::GFXCommandAllocator* cobj = (cc::gfx::GFXCommandAllocator*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandAllocator_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16405,13 +16405,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandAllocator_destroy) static bool js_gfx_GFXCommandAllocator_getDevice(se::State& s) { - cc::GFXCommandAllocator* cobj = (cc::GFXCommandAllocator*)s.nativeThisObject(); + cc::gfx::GFXCommandAllocator* cobj = (cc::gfx::GFXCommandAllocator*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandAllocator_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandAllocator_getDevice : Error processing arguments"); return true; @@ -16421,64 +16421,64 @@ static bool js_gfx_GFXCommandAllocator_getDevice(se::State& s) } SE_BIND_FUNC(js_gfx_GFXCommandAllocator_getDevice) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXCommandAllocator_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXCommandAllocator_finalize) static bool js_gfx_GFXCommandAllocator_constructor(se::State& s) { - //#3 cc::GFXCommandAllocator: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXCommandAllocator constructor is skipped\")"); + //#3 cc::gfx::GFXCommandAllocator: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXCommandAllocator constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXCommandAllocator_constructor, __jsb_cc_GFXCommandAllocator_class, js_cc_GFXCommandAllocator_finalize) +SE_BIND_CTOR(js_gfx_GFXCommandAllocator_constructor, __jsb_cc_gfx_GFXCommandAllocator_class, js_cc_gfx_GFXCommandAllocator_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXCommandAllocator_finalize(se::State& s) +static bool js_cc_gfx_GFXCommandAllocator_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXCommandAllocator)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXCommandAllocator)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXCommandAllocator* cobj = (cc::GFXCommandAllocator*)s.nativeThisObject(); + cc::gfx::GFXCommandAllocator* cobj = (cc::gfx::GFXCommandAllocator*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXCommandAllocator_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXCommandAllocator_finalize) bool js_register_gfx_GFXCommandAllocator(se::Object* obj) { - auto cls = se::Class::create("GFXCommandAllocator", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXCommandAllocator_constructor)); + auto cls = se::Class::create("GFXCommandAllocator", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXCommandAllocator_constructor)); cls->defineFunction("initialize", _SE(js_gfx_GFXCommandAllocator_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXCommandAllocator_destroy)); cls->defineFunction("getDevice", _SE(js_gfx_GFXCommandAllocator_getDevice)); - cls->defineFinalizeFunction(_SE(js_cc_GFXCommandAllocator_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXCommandAllocator_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXCommandAllocator_proto = cls->getProto(); - __jsb_cc_GFXCommandAllocator_class = cls; + __jsb_cc_gfx_GFXCommandAllocator_proto = cls->getProto(); + __jsb_cc_gfx_GFXCommandAllocator_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXCommandBuffer_proto = nullptr; -se::Class* __jsb_cc_GFXCommandBuffer_class = nullptr; +se::Object* __jsb_cc_gfx_GFXCommandBuffer_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXCommandBuffer_class = nullptr; static bool js_gfx_GFXCommandBuffer_draw(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_draw : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXInputAssembler* arg0 = nullptr; + cc::gfx::GFXInputAssembler* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_draw : Error processing arguments"); cobj->draw(arg0); @@ -16491,13 +16491,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_draw) static bool js_gfx_GFXCommandBuffer_setBlendConstants(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setBlendConstants : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXColor* arg0 = nullptr; + cc::gfx::GFXColor* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_setBlendConstants : Error processing arguments"); cobj->setBlendConstants(*arg0); @@ -16510,7 +16510,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setBlendConstants) static bool js_gfx_GFXCommandBuffer_setDepthBound(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setDepthBound : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16531,13 +16531,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setDepthBound) static bool js_gfx_GFXCommandBuffer_getAllocator(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getAllocator : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXCommandAllocator* result = cobj->getAllocator(); + cc::gfx::GFXCommandAllocator* result = cobj->getAllocator(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_getAllocator : Error processing arguments"); return true; @@ -16549,19 +16549,19 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getAllocator) static bool js_gfx_GFXCommandBuffer_copyBufferToTexture(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_copyBufferToTexture : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 4) { - cc::GFXBuffer* arg0 = nullptr; - cc::GFXTexture* arg1 = nullptr; - cc::GFXTextureLayout arg2; - std::vector arg3; + cc::gfx::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXTexture* arg1 = nullptr; + cc::gfx::GFXTextureLayout arg2; + std::vector arg3; ok &= seval_to_native_ptr(args[0], &arg0); ok &= seval_to_native_ptr(args[1], &arg1); - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXTextureLayout)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXTextureLayout)tmp; } while(false); ok &= seval_to_std_vector(args[3], &arg3); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_copyBufferToTexture : Error processing arguments"); cobj->copyBufferToTexture(arg0, arg1, arg2, arg3); @@ -16574,7 +16574,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_copyBufferToTexture) static bool js_gfx_GFXCommandBuffer_setLineWidth(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setLineWidth : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16593,13 +16593,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setLineWidth) static bool js_gfx_GFXCommandBuffer_updateBuffer(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_updateBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 3) { - cc::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXBuffer* arg0 = nullptr; void* arg1 = nullptr; unsigned int arg2 = 0; ok &= seval_to_native_ptr(args[0], &arg0); @@ -16610,7 +16610,7 @@ static bool js_gfx_GFXCommandBuffer_updateBuffer(se::State& s) return true; } if (argc == 4) { - cc::GFXBuffer* arg0 = nullptr; + cc::gfx::GFXBuffer* arg0 = nullptr; void* arg1 = nullptr; unsigned int arg2 = 0; unsigned int arg3 = 0; @@ -16629,7 +16629,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_updateBuffer) static bool js_gfx_GFXCommandBuffer_end(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_end : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16644,15 +16644,15 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_end) static bool js_gfx_GFXCommandBuffer_setStencilWriteMask(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setStencilWriteMask : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { - cc::GFXStencilFace arg0; + cc::gfx::GFXStencilFace arg0; unsigned int arg1 = 0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilFace)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilFace)tmp; } while(false); ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_setStencilWriteMask : Error processing arguments"); cobj->setStencilWriteMask(arg0, arg1); @@ -16665,7 +16665,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setStencilWriteMask) static bool js_gfx_GFXCommandBuffer_getNumInstances(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getNumInstances : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16683,16 +16683,16 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getNumInstances) static bool js_gfx_GFXCommandBuffer_setStencilCompareMask(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setStencilCompareMask : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 3) { - cc::GFXStencilFace arg0; + cc::gfx::GFXStencilFace arg0; int arg1 = 0; unsigned int arg2 = 0; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXStencilFace)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXStencilFace)tmp; } while(false); do { int32_t tmp = 0; ok &= seval_to_int32(args[1], &tmp); arg1 = (int)tmp; } while(false); ok &= seval_to_uint32(args[2], (uint32_t*)&arg2); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_setStencilCompareMask : Error processing arguments"); @@ -16706,13 +16706,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setStencilCompareMask) static bool js_gfx_GFXCommandBuffer_bindInputAssembler(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_bindInputAssembler : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXInputAssembler* arg0 = nullptr; + cc::gfx::GFXInputAssembler* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_bindInputAssembler : Error processing arguments"); cobj->bindInputAssembler(arg0); @@ -16725,13 +16725,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_bindInputAssembler) static bool js_gfx_GFXCommandBuffer_bindPipelineState(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_bindPipelineState : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXPipelineState* arg0 = nullptr; + cc::gfx::GFXPipelineState* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_bindPipelineState : Error processing arguments"); cobj->bindPipelineState(arg0); @@ -16744,7 +16744,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_bindPipelineState) static bool js_gfx_GFXCommandBuffer_destroy(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16759,13 +16759,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_destroy) static bool js_gfx_GFXCommandBuffer_getDevice(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_getDevice : Error processing arguments"); return true; @@ -16777,7 +16777,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getDevice) static bool js_gfx_GFXCommandBuffer_getNumTris(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getNumTris : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16795,13 +16795,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getNumTris) static bool js_gfx_GFXCommandBuffer_setViewport(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setViewport : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXViewport* arg0 = nullptr; + cc::gfx::GFXViewport* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_setViewport : Error processing arguments"); cobj->setViewport(*arg0); @@ -16814,7 +16814,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setViewport) static bool js_gfx_GFXCommandBuffer_setDepthBias(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setDepthBias : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16837,7 +16837,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setDepthBias) static bool js_gfx_GFXCommandBuffer_begin(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_begin : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16847,14 +16847,14 @@ static bool js_gfx_GFXCommandBuffer_begin(se::State& s) return true; } if (argc == 1) { - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXRenderPass* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_begin : Error processing arguments"); cobj->begin(arg0); return true; } if (argc == 2) { - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXRenderPass* arg0 = nullptr; unsigned int arg1 = 0; ok &= seval_to_native_ptr(args[0], &arg0); ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); @@ -16863,9 +16863,9 @@ static bool js_gfx_GFXCommandBuffer_begin(se::State& s) return true; } if (argc == 3) { - cc::GFXRenderPass* arg0 = nullptr; + cc::gfx::GFXRenderPass* arg0 = nullptr; unsigned int arg1 = 0; - cc::GFXFramebuffer* arg2 = nullptr; + cc::gfx::GFXFramebuffer* arg2 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); ok &= seval_to_uint32(args[1], (uint32_t*)&arg1); ok &= seval_to_native_ptr(args[2], &arg2); @@ -16880,7 +16880,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_begin) static bool js_gfx_GFXCommandBuffer_getType(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getType : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16898,13 +16898,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getType) static bool js_gfx_GFXCommandBuffer_bindBindingLayout(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_bindBindingLayout : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXBindingLayout* arg0 = nullptr; + cc::gfx::GFXBindingLayout* arg0 = nullptr; ok &= seval_to_native_ptr(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_bindBindingLayout : Error processing arguments"); cobj->bindBindingLayout(arg0); @@ -16917,7 +16917,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_bindBindingLayout) static bool js_gfx_GFXCommandBuffer_endRenderPass(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_endRenderPass : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -16932,13 +16932,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_endRenderPass) static bool js_gfx_GFXCommandBuffer_initialize(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXCommandBufferInfo* arg0 = nullptr; + cc::gfx::GFXCommandBufferInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -16953,13 +16953,13 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_initialize) static bool js_gfx_GFXCommandBuffer_setScissor(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_setScissor : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXRect* arg0 = nullptr; + cc::gfx::GFXRect* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXCommandBuffer_setScissor : Error processing arguments"); cobj->setScissor(*arg0); @@ -16972,21 +16972,21 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_setScissor) static bool js_gfx_GFXCommandBuffer_beginRenderPass(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_beginRenderPass : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 6) { - cc::GFXFramebuffer* arg0 = nullptr; - cc::GFXRect* arg1 = nullptr; - cc::GFXClearFlagBit arg2; - std::vector arg3; + cc::gfx::GFXFramebuffer* arg0 = nullptr; + cc::gfx::GFXRect* arg1 = nullptr; + cc::gfx::GFXClearFlagBit arg2; + std::vector arg3; float arg4 = 0; int arg5 = 0; ok &= seval_to_native_ptr(args[0], &arg0); ok &= seval_to_reference(args[1], &arg1); - do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::GFXClearFlagBit)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(args[2], &tmp); arg2 = (cc::gfx::GFXClearFlagBit)tmp; } while(false); ok &= seval_to_std_vector(args[3], &arg3); ok &= seval_to_float(args[4], &arg4); do { int32_t tmp = 0; ok &= seval_to_int32(args[5], &tmp); arg5 = (int)tmp; } while(false); @@ -17001,7 +17001,7 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_beginRenderPass) static bool js_gfx_GFXCommandBuffer_getNumDrawCalls(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_getNumDrawCalls : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17017,37 +17017,37 @@ static bool js_gfx_GFXCommandBuffer_getNumDrawCalls(se::State& s) } SE_BIND_FUNC(js_gfx_GFXCommandBuffer_getNumDrawCalls) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXCommandBuffer_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXCommandBuffer_finalize) static bool js_gfx_GFXCommandBuffer_constructor(se::State& s) { - //#3 cc::GFXCommandBuffer: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXCommandBuffer constructor is skipped\")"); + //#3 cc::gfx::GFXCommandBuffer: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXCommandBuffer constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXCommandBuffer_constructor, __jsb_cc_GFXCommandBuffer_class, js_cc_GFXCommandBuffer_finalize) +SE_BIND_CTOR(js_gfx_GFXCommandBuffer_constructor, __jsb_cc_gfx_GFXCommandBuffer_class, js_cc_gfx_GFXCommandBuffer_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXCommandBuffer_finalize(se::State& s) +static bool js_cc_gfx_GFXCommandBuffer_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXCommandBuffer)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXCommandBuffer)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXCommandBuffer_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXCommandBuffer_finalize) bool js_register_gfx_GFXCommandBuffer(se::Object* obj) { - auto cls = se::Class::create("GFXCommandBuffer", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXCommandBuffer_constructor)); + auto cls = se::Class::create("GFXCommandBuffer", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXCommandBuffer_constructor)); cls->defineFunction("draw", _SE(js_gfx_GFXCommandBuffer_draw)); cls->defineFunction("setBlendConstants", _SE(js_gfx_GFXCommandBuffer_setBlendConstants)); @@ -17075,29 +17075,29 @@ bool js_register_gfx_GFXCommandBuffer(se::Object* obj) cls->defineFunction("setScissor", _SE(js_gfx_GFXCommandBuffer_setScissor)); cls->defineFunction("beginRenderPass", _SE(js_gfx_GFXCommandBuffer_beginRenderPass)); cls->defineFunction("getNumDrawCalls", _SE(js_gfx_GFXCommandBuffer_getNumDrawCalls)); - cls->defineFinalizeFunction(_SE(js_cc_GFXCommandBuffer_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXCommandBuffer_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXCommandBuffer_proto = cls->getProto(); - __jsb_cc_GFXCommandBuffer_class = cls; + __jsb_cc_gfx_GFXCommandBuffer_proto = cls->getProto(); + __jsb_cc_gfx_GFXCommandBuffer_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXFence_proto = nullptr; -se::Class* __jsb_cc_GFXFence_class = nullptr; +se::Object* __jsb_cc_gfx_GFXFence_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXFence_class = nullptr; static bool js_gfx_GFXFence_initialize(se::State& s) { - cc::GFXFence* cobj = (cc::GFXFence*)s.nativeThisObject(); + cc::gfx::GFXFence* cobj = (cc::gfx::GFXFence*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFence_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXFenceInfo* arg0 = nullptr; + cc::gfx::GFXFenceInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXFence_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -17112,7 +17112,7 @@ SE_BIND_FUNC(js_gfx_GFXFence_initialize) static bool js_gfx_GFXFence_destroy(se::State& s) { - cc::GFXFence* cobj = (cc::GFXFence*)s.nativeThisObject(); + cc::gfx::GFXFence* cobj = (cc::gfx::GFXFence*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFence_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17127,7 +17127,7 @@ SE_BIND_FUNC(js_gfx_GFXFence_destroy) static bool js_gfx_GFXFence_wait(se::State& s) { - cc::GFXFence* cobj = (cc::GFXFence*)s.nativeThisObject(); + cc::gfx::GFXFence* cobj = (cc::gfx::GFXFence*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFence_wait : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17142,7 +17142,7 @@ SE_BIND_FUNC(js_gfx_GFXFence_wait) static bool js_gfx_GFXFence_reset(se::State& s) { - cc::GFXFence* cobj = (cc::GFXFence*)s.nativeThisObject(); + cc::gfx::GFXFence* cobj = (cc::gfx::GFXFence*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXFence_reset : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17155,59 +17155,59 @@ static bool js_gfx_GFXFence_reset(se::State& s) } SE_BIND_FUNC(js_gfx_GFXFence_reset) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXFence_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXFence_finalize) static bool js_gfx_GFXFence_constructor(se::State& s) { - //#3 cc::GFXFence: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXFence constructor is skipped\")"); + //#3 cc::gfx::GFXFence: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXFence constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXFence_constructor, __jsb_cc_GFXFence_class, js_cc_GFXFence_finalize) +SE_BIND_CTOR(js_gfx_GFXFence_constructor, __jsb_cc_gfx_GFXFence_class, js_cc_gfx_GFXFence_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXFence_finalize(se::State& s) +static bool js_cc_gfx_GFXFence_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXFence)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXFence)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXFence* cobj = (cc::GFXFence*)s.nativeThisObject(); + cc::gfx::GFXFence* cobj = (cc::gfx::GFXFence*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXFence_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXFence_finalize) bool js_register_gfx_GFXFence(se::Object* obj) { - auto cls = se::Class::create("GFXFence", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXFence_constructor)); + auto cls = se::Class::create("GFXFence", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXFence_constructor)); cls->defineFunction("initialize", _SE(js_gfx_GFXFence_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXFence_destroy)); cls->defineFunction("wait", _SE(js_gfx_GFXFence_wait)); cls->defineFunction("reset", _SE(js_gfx_GFXFence_reset)); - cls->defineFinalizeFunction(_SE(js_cc_GFXFence_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXFence_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXFence_proto = cls->getProto(); - __jsb_cc_GFXFence_class = cls; + __jsb_cc_gfx_GFXFence_proto = cls->getProto(); + __jsb_cc_gfx_GFXFence_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cc_GFXQueue_proto = nullptr; -se::Class* __jsb_cc_GFXQueue_class = nullptr; +se::Object* __jsb_cc_gfx_GFXQueue_proto = nullptr; +se::Class* __jsb_cc_gfx_GFXQueue_class = nullptr; static bool js_gfx_GFXQueue_getType(se::State& s) { - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueue_getType : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17226,13 +17226,13 @@ SE_BIND_PROP_GET(js_gfx_GFXQueue_getType) static bool js_gfx_GFXQueue_submit(se::State& s) { CC_UNUSED bool ok = true; - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); SE_PRECONDITION2( cobj, false, "js_gfx_GFXQueue_submit : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); do { if (argc == 1) { - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); if (!ok) { ok = true; break; } cobj->submit(arg0); @@ -17242,10 +17242,10 @@ static bool js_gfx_GFXQueue_submit(se::State& s) do { if (argc == 2) { - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); if (!ok) { ok = true; break; } - cc::GFXFence* arg1 = nullptr; + cc::gfx::GFXFence* arg1 = nullptr; ok &= seval_to_native_ptr(args[1], &arg1); if (!ok) { ok = true; break; } cobj->submit(arg0, arg1); @@ -17260,13 +17260,13 @@ SE_BIND_FUNC(js_gfx_GFXQueue_submit) static bool js_gfx_GFXQueue_initialize(se::State& s) { - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueue_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::GFXQueueInfo* arg0 = nullptr; + cc::gfx::GFXQueueInfo* arg0 = nullptr; ok &= seval_to_reference(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXQueue_initialize : Error processing arguments"); bool result = cobj->initialize(*arg0); @@ -17281,7 +17281,7 @@ SE_BIND_FUNC(js_gfx_GFXQueue_initialize) static bool js_gfx_GFXQueue_destroy(se::State& s) { - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueue_destroy : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -17296,13 +17296,13 @@ SE_BIND_FUNC(js_gfx_GFXQueue_destroy) static bool js_gfx_GFXQueue_getDevice(se::State& s) { - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXQueue_getDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cc::GFXDevice* result = cobj->getDevice(); + cc::gfx::GFXDevice* result = cobj->getDevice(); ok &= native_ptr_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_gfx_GFXQueue_getDevice : Error processing arguments"); return true; @@ -17312,49 +17312,49 @@ static bool js_gfx_GFXQueue_getDevice(se::State& s) } SE_BIND_PROP_GET(js_gfx_GFXQueue_getDevice) -SE_DECLARE_FINALIZE_FUNC(js_cc_GFXQueue_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GFXQueue_finalize) static bool js_gfx_GFXQueue_constructor(se::State& s) { - //#3 cc::GFXQueue: is_skip_construtor True - se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::GFXQueue constructor is skipped\")"); + //#3 cc::gfx::GFXQueue: is_skip_construtor True + se::ScriptEngine::getInstance()->evalString("throw new Error(\"cc::gfx::GFXQueue constructor is skipped\")"); return false; } -SE_BIND_CTOR(js_gfx_GFXQueue_constructor, __jsb_cc_GFXQueue_class, js_cc_GFXQueue_finalize) +SE_BIND_CTOR(js_gfx_GFXQueue_constructor, __jsb_cc_gfx_GFXQueue_class, js_cc_gfx_GFXQueue_finalize) -extern se::Object* __jsb_cc_GFXObject_proto; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; -static bool js_cc_GFXQueue_finalize(se::State& s) +static bool js_cc_gfx_GFXQueue_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GFXQueue)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GFXQueue)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXQueue* cobj = (cc::GFXQueue*)s.nativeThisObject(); + cc::gfx::GFXQueue* cobj = (cc::gfx::GFXQueue*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GFXQueue_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GFXQueue_finalize) bool js_register_gfx_GFXQueue(se::Object* obj) { - auto cls = se::Class::create("GFXQueue", obj, __jsb_cc_GFXObject_proto, _SE(js_gfx_GFXQueue_constructor)); + auto cls = se::Class::create("GFXQueue", obj, __jsb_cc_gfx_GFXObject_proto, _SE(js_gfx_GFXQueue_constructor)); cls->defineProperty("device", _SE(js_gfx_GFXQueue_getDevice), nullptr); cls->defineProperty("type", _SE(js_gfx_GFXQueue_getType), nullptr); cls->defineFunction("submit", _SE(js_gfx_GFXQueue_submit)); cls->defineFunction("initialize", _SE(js_gfx_GFXQueue_initialize)); cls->defineFunction("destroy", _SE(js_gfx_GFXQueue_destroy)); - cls->defineFinalizeFunction(_SE(js_cc_GFXQueue_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GFXQueue_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GFXQueue_proto = cls->getProto(); - __jsb_cc_GFXQueue_class = cls; + __jsb_cc_gfx_GFXQueue_proto = cls->getProto(); + __jsb_cc_gfx_GFXQueue_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp index f3425e1e15..cf6314d931 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp @@ -3,275 +3,275 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cc_GFXOffset_proto; -extern se::Class* __jsb_cc_GFXOffset_class; +extern se::Object* __jsb_cc_gfx_GFXOffset_proto; +extern se::Class* __jsb_cc_gfx_GFXOffset_class; -bool js_register_cc_GFXOffset(se::Object* obj); +bool js_register_cc_gfx_GFXOffset(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXRect_proto; -extern se::Class* __jsb_cc_GFXRect_class; +extern se::Object* __jsb_cc_gfx_GFXRect_proto; +extern se::Class* __jsb_cc_gfx_GFXRect_class; -bool js_register_cc_GFXRect(se::Object* obj); +bool js_register_cc_gfx_GFXRect(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXExtent_proto; -extern se::Class* __jsb_cc_GFXExtent_class; +extern se::Object* __jsb_cc_gfx_GFXExtent_proto; +extern se::Class* __jsb_cc_gfx_GFXExtent_class; -bool js_register_cc_GFXExtent(se::Object* obj); +bool js_register_cc_gfx_GFXExtent(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXTextureSubres_proto; -extern se::Class* __jsb_cc_GFXTextureSubres_class; +extern se::Object* __jsb_cc_gfx_GFXTextureSubres_proto; +extern se::Class* __jsb_cc_gfx_GFXTextureSubres_class; -bool js_register_cc_GFXTextureSubres(se::Object* obj); +bool js_register_cc_gfx_GFXTextureSubres(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXTextureCopy_proto; -extern se::Class* __jsb_cc_GFXTextureCopy_class; +extern se::Object* __jsb_cc_gfx_GFXTextureCopy_proto; +extern se::Class* __jsb_cc_gfx_GFXTextureCopy_class; -bool js_register_cc_GFXTextureCopy(se::Object* obj); +bool js_register_cc_gfx_GFXTextureCopy(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBufferTextureCopy_proto; -extern se::Class* __jsb_cc_GFXBufferTextureCopy_class; +extern se::Object* __jsb_cc_gfx_GFXBufferTextureCopy_proto; +extern se::Class* __jsb_cc_gfx_GFXBufferTextureCopy_class; -bool js_register_cc_GFXBufferTextureCopy(se::Object* obj); +bool js_register_cc_gfx_GFXBufferTextureCopy(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXViewport_proto; -extern se::Class* __jsb_cc_GFXViewport_class; +extern se::Object* __jsb_cc_gfx_GFXViewport_proto; +extern se::Class* __jsb_cc_gfx_GFXViewport_class; -bool js_register_cc_GFXViewport(se::Object* obj); +bool js_register_cc_gfx_GFXViewport(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXColor_proto; -extern se::Class* __jsb_cc_GFXColor_class; +extern se::Object* __jsb_cc_gfx_GFXColor_proto; +extern se::Class* __jsb_cc_gfx_GFXColor_class; -bool js_register_cc_GFXColor(se::Object* obj); +bool js_register_cc_gfx_GFXColor(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXDeviceInfo_proto; -extern se::Class* __jsb_cc_GFXDeviceInfo_class; +extern se::Object* __jsb_cc_gfx_GFXDeviceInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXDeviceInfo_class; -bool js_register_cc_GFXDeviceInfo(se::Object* obj); +bool js_register_cc_gfx_GFXDeviceInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXContextInfo_proto; -extern se::Class* __jsb_cc_GFXContextInfo_class; +extern se::Object* __jsb_cc_gfx_GFXContextInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXContextInfo_class; -bool js_register_cc_GFXContextInfo(se::Object* obj); +bool js_register_cc_gfx_GFXContextInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBufferInfo_proto; -extern se::Class* __jsb_cc_GFXBufferInfo_class; +extern se::Object* __jsb_cc_gfx_GFXBufferInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXBufferInfo_class; -bool js_register_cc_GFXBufferInfo(se::Object* obj); +bool js_register_cc_gfx_GFXBufferInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXDrawInfo_proto; -extern se::Class* __jsb_cc_GFXDrawInfo_class; +extern se::Object* __jsb_cc_gfx_GFXDrawInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXDrawInfo_class; -bool js_register_cc_GFXDrawInfo(se::Object* obj); +bool js_register_cc_gfx_GFXDrawInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXIndirectBuffer_proto; -extern se::Class* __jsb_cc_GFXIndirectBuffer_class; +extern se::Object* __jsb_cc_gfx_GFXIndirectBuffer_proto; +extern se::Class* __jsb_cc_gfx_GFXIndirectBuffer_class; -bool js_register_cc_GFXIndirectBuffer(se::Object* obj); +bool js_register_cc_gfx_GFXIndirectBuffer(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXTextureInfo_proto; -extern se::Class* __jsb_cc_GFXTextureInfo_class; +extern se::Object* __jsb_cc_gfx_GFXTextureInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXTextureInfo_class; -bool js_register_cc_GFXTextureInfo(se::Object* obj); +bool js_register_cc_gfx_GFXTextureInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXTextureViewInfo_proto; -extern se::Class* __jsb_cc_GFXTextureViewInfo_class; +extern se::Object* __jsb_cc_gfx_GFXTextureViewInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXTextureViewInfo_class; -bool js_register_cc_GFXTextureViewInfo(se::Object* obj); +bool js_register_cc_gfx_GFXTextureViewInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXSamplerInfo_proto; -extern se::Class* __jsb_cc_GFXSamplerInfo_class; +extern se::Object* __jsb_cc_gfx_GFXSamplerInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXSamplerInfo_class; -bool js_register_cc_GFXSamplerInfo(se::Object* obj); +bool js_register_cc_gfx_GFXSamplerInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXShaderMacro_proto; -extern se::Class* __jsb_cc_GFXShaderMacro_class; +extern se::Object* __jsb_cc_gfx_GFXShaderMacro_proto; +extern se::Class* __jsb_cc_gfx_GFXShaderMacro_class; -bool js_register_cc_GFXShaderMacro(se::Object* obj); +bool js_register_cc_gfx_GFXShaderMacro(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXUniform_proto; -extern se::Class* __jsb_cc_GFXUniform_class; +extern se::Object* __jsb_cc_gfx_GFXUniform_proto; +extern se::Class* __jsb_cc_gfx_GFXUniform_class; -bool js_register_cc_GFXUniform(se::Object* obj); +bool js_register_cc_gfx_GFXUniform(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXUniformBlock_proto; -extern se::Class* __jsb_cc_GFXUniformBlock_class; +extern se::Object* __jsb_cc_gfx_GFXUniformBlock_proto; +extern se::Class* __jsb_cc_gfx_GFXUniformBlock_class; -bool js_register_cc_GFXUniformBlock(se::Object* obj); +bool js_register_cc_gfx_GFXUniformBlock(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXUniformSampler_proto; -extern se::Class* __jsb_cc_GFXUniformSampler_class; +extern se::Object* __jsb_cc_gfx_GFXUniformSampler_proto; +extern se::Class* __jsb_cc_gfx_GFXUniformSampler_class; -bool js_register_cc_GFXUniformSampler(se::Object* obj); +bool js_register_cc_gfx_GFXUniformSampler(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXShaderStage_proto; -extern se::Class* __jsb_cc_GFXShaderStage_class; +extern se::Object* __jsb_cc_gfx_GFXShaderStage_proto; +extern se::Class* __jsb_cc_gfx_GFXShaderStage_class; -bool js_register_cc_GFXShaderStage(se::Object* obj); +bool js_register_cc_gfx_GFXShaderStage(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXAttribute_proto; -extern se::Class* __jsb_cc_GFXAttribute_class; +extern se::Object* __jsb_cc_gfx_GFXAttribute_proto; +extern se::Class* __jsb_cc_gfx_GFXAttribute_class; -bool js_register_cc_GFXAttribute(se::Object* obj); +bool js_register_cc_gfx_GFXAttribute(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXShaderInfo_proto; -extern se::Class* __jsb_cc_GFXShaderInfo_class; +extern se::Object* __jsb_cc_gfx_GFXShaderInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXShaderInfo_class; -bool js_register_cc_GFXShaderInfo(se::Object* obj); +bool js_register_cc_gfx_GFXShaderInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXInputAssemblerInfo_proto; -extern se::Class* __jsb_cc_GFXInputAssemblerInfo_class; +extern se::Object* __jsb_cc_gfx_GFXInputAssemblerInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXInputAssemblerInfo_class; -bool js_register_cc_GFXInputAssemblerInfo(se::Object* obj); +bool js_register_cc_gfx_GFXInputAssemblerInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXColorAttachment_proto; -extern se::Class* __jsb_cc_GFXColorAttachment_class; +extern se::Object* __jsb_cc_gfx_GFXColorAttachment_proto; +extern se::Class* __jsb_cc_gfx_GFXColorAttachment_class; -bool js_register_cc_GFXColorAttachment(se::Object* obj); +bool js_register_cc_gfx_GFXColorAttachment(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXDepthStencilAttachment_proto; -extern se::Class* __jsb_cc_GFXDepthStencilAttachment_class; +extern se::Object* __jsb_cc_gfx_GFXDepthStencilAttachment_proto; +extern se::Class* __jsb_cc_gfx_GFXDepthStencilAttachment_class; -bool js_register_cc_GFXDepthStencilAttachment(se::Object* obj); +bool js_register_cc_gfx_GFXDepthStencilAttachment(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXRenderPassInfo_proto; -extern se::Class* __jsb_cc_GFXRenderPassInfo_class; +extern se::Object* __jsb_cc_gfx_GFXRenderPassInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXRenderPassInfo_class; -bool js_register_cc_GFXRenderPassInfo(se::Object* obj); +bool js_register_cc_gfx_GFXRenderPassInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXFramebufferInfo_proto; -extern se::Class* __jsb_cc_GFXFramebufferInfo_class; +extern se::Object* __jsb_cc_gfx_GFXFramebufferInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXFramebufferInfo_class; -bool js_register_cc_GFXFramebufferInfo(se::Object* obj); +bool js_register_cc_gfx_GFXFramebufferInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBinding_proto; -extern se::Class* __jsb_cc_GFXBinding_class; +extern se::Object* __jsb_cc_gfx_GFXBinding_proto; +extern se::Class* __jsb_cc_gfx_GFXBinding_class; -bool js_register_cc_GFXBinding(se::Object* obj); +bool js_register_cc_gfx_GFXBinding(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBindingLayoutInfo_proto; -extern se::Class* __jsb_cc_GFXBindingLayoutInfo_class; +extern se::Object* __jsb_cc_gfx_GFXBindingLayoutInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXBindingLayoutInfo_class; -bool js_register_cc_GFXBindingLayoutInfo(se::Object* obj); +bool js_register_cc_gfx_GFXBindingLayoutInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBindingUnit_proto; -extern se::Class* __jsb_cc_GFXBindingUnit_class; +extern se::Object* __jsb_cc_gfx_GFXBindingUnit_proto; +extern se::Class* __jsb_cc_gfx_GFXBindingUnit_class; -bool js_register_cc_GFXBindingUnit(se::Object* obj); +bool js_register_cc_gfx_GFXBindingUnit(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXPushConstantRange_proto; -extern se::Class* __jsb_cc_GFXPushConstantRange_class; +extern se::Object* __jsb_cc_gfx_GFXPushConstantRange_proto; +extern se::Class* __jsb_cc_gfx_GFXPushConstantRange_class; -bool js_register_cc_GFXPushConstantRange(se::Object* obj); +bool js_register_cc_gfx_GFXPushConstantRange(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXPipelineLayoutInfo_proto; -extern se::Class* __jsb_cc_GFXPipelineLayoutInfo_class; +extern se::Object* __jsb_cc_gfx_GFXPipelineLayoutInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXPipelineLayoutInfo_class; -bool js_register_cc_GFXPipelineLayoutInfo(se::Object* obj); +bool js_register_cc_gfx_GFXPipelineLayoutInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXInputState_proto; -extern se::Class* __jsb_cc_GFXInputState_class; +extern se::Object* __jsb_cc_gfx_GFXInputState_proto; +extern se::Class* __jsb_cc_gfx_GFXInputState_class; -bool js_register_cc_GFXInputState(se::Object* obj); +bool js_register_cc_gfx_GFXInputState(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXRasterizerState_proto; -extern se::Class* __jsb_cc_GFXRasterizerState_class; +extern se::Object* __jsb_cc_gfx_GFXRasterizerState_proto; +extern se::Class* __jsb_cc_gfx_GFXRasterizerState_class; -bool js_register_cc_GFXRasterizerState(se::Object* obj); +bool js_register_cc_gfx_GFXRasterizerState(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXDepthStencilState_proto; -extern se::Class* __jsb_cc_GFXDepthStencilState_class; +extern se::Object* __jsb_cc_gfx_GFXDepthStencilState_proto; +extern se::Class* __jsb_cc_gfx_GFXDepthStencilState_class; -bool js_register_cc_GFXDepthStencilState(se::Object* obj); +bool js_register_cc_gfx_GFXDepthStencilState(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBlendTarget_proto; -extern se::Class* __jsb_cc_GFXBlendTarget_class; +extern se::Object* __jsb_cc_gfx_GFXBlendTarget_proto; +extern se::Class* __jsb_cc_gfx_GFXBlendTarget_class; -bool js_register_cc_GFXBlendTarget(se::Object* obj); +bool js_register_cc_gfx_GFXBlendTarget(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXBlendState_proto; -extern se::Class* __jsb_cc_GFXBlendState_class; +extern se::Object* __jsb_cc_gfx_GFXBlendState_proto; +extern se::Class* __jsb_cc_gfx_GFXBlendState_class; -bool js_register_cc_GFXBlendState(se::Object* obj); +bool js_register_cc_gfx_GFXBlendState(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXPipelineStateInfo_proto; -extern se::Class* __jsb_cc_GFXPipelineStateInfo_class; +extern se::Object* __jsb_cc_gfx_GFXPipelineStateInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXPipelineStateInfo_class; -bool js_register_cc_GFXPipelineStateInfo(se::Object* obj); +bool js_register_cc_gfx_GFXPipelineStateInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXCommandBufferInfo_proto; -extern se::Class* __jsb_cc_GFXCommandBufferInfo_class; +extern se::Object* __jsb_cc_gfx_GFXCommandBufferInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXCommandBufferInfo_class; -bool js_register_cc_GFXCommandBufferInfo(se::Object* obj); +bool js_register_cc_gfx_GFXCommandBufferInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXQueueInfo_proto; -extern se::Class* __jsb_cc_GFXQueueInfo_class; +extern se::Object* __jsb_cc_gfx_GFXQueueInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXQueueInfo_class; -bool js_register_cc_GFXQueueInfo(se::Object* obj); +bool js_register_cc_gfx_GFXQueueInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXFormatInfo_proto; -extern se::Class* __jsb_cc_GFXFormatInfo_class; +extern se::Object* __jsb_cc_gfx_GFXFormatInfo_proto; +extern se::Class* __jsb_cc_gfx_GFXFormatInfo_class; -bool js_register_cc_GFXFormatInfo(se::Object* obj); +bool js_register_cc_gfx_GFXFormatInfo(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXMemoryStatus_proto; -extern se::Class* __jsb_cc_GFXMemoryStatus_class; +extern se::Object* __jsb_cc_gfx_GFXMemoryStatus_proto; +extern se::Class* __jsb_cc_gfx_GFXMemoryStatus_class; -bool js_register_cc_GFXMemoryStatus(se::Object* obj); +bool js_register_cc_gfx_GFXMemoryStatus(se::Object* obj); bool register_all_gfx(se::Object* obj); -extern se::Object* __jsb_cc_GFXObject_proto; -extern se::Class* __jsb_cc_GFXObject_class; +extern se::Object* __jsb_cc_gfx_GFXObject_proto; +extern se::Class* __jsb_cc_gfx_GFXObject_class; -bool js_register_cc_GFXObject(se::Object* obj); +bool js_register_cc_gfx_GFXObject(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXObject_GFXObject); -extern se::Object* __jsb_cc_GFXDevice_proto; -extern se::Class* __jsb_cc_GFXDevice_class; +extern se::Object* __jsb_cc_gfx_GFXDevice_proto; +extern se::Class* __jsb_cc_gfx_GFXDevice_class; -bool js_register_cc_GFXDevice(se::Object* obj); +bool js_register_cc_gfx_GFXDevice(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXDevice_hasFeature); SE_DECLARE_FUNC(js_gfx_GFXDevice_createFence); @@ -294,74 +294,74 @@ SE_DECLARE_FUNC(js_gfx_GFXDevice_resize); SE_DECLARE_FUNC(js_gfx_GFXDevice_createQueue); SE_DECLARE_FUNC(js_gfx_GFXDevice_createBindingLayout); -extern se::Object* __jsb_cc_GFXBuffer_proto; -extern se::Class* __jsb_cc_GFXBuffer_class; +extern se::Object* __jsb_cc_gfx_GFXBuffer_proto; +extern se::Class* __jsb_cc_gfx_GFXBuffer_class; -bool js_register_cc_GFXBuffer(se::Object* obj); +bool js_register_cc_gfx_GFXBuffer(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXBuffer_initialize); SE_DECLARE_FUNC(js_gfx_GFXBuffer_destroy); SE_DECLARE_FUNC(js_gfx_GFXBuffer_resize); SE_DECLARE_FUNC(js_gfx_GFXBuffer_GFXBuffer); -extern se::Object* __jsb_cc_GFXTexture_proto; -extern se::Class* __jsb_cc_GFXTexture_class; +extern se::Object* __jsb_cc_gfx_GFXTexture_proto; +extern se::Class* __jsb_cc_gfx_GFXTexture_class; -bool js_register_cc_GFXTexture(se::Object* obj); +bool js_register_cc_gfx_GFXTexture(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXTexture_destroy); SE_DECLARE_FUNC(js_gfx_GFXTexture_resize); SE_DECLARE_FUNC(js_gfx_GFXTexture_GFXTexture); -extern se::Object* __jsb_cc_GFXSampler_proto; -extern se::Class* __jsb_cc_GFXSampler_class; +extern se::Object* __jsb_cc_gfx_GFXSampler_proto; +extern se::Class* __jsb_cc_gfx_GFXSampler_class; -bool js_register_cc_GFXSampler(se::Object* obj); +bool js_register_cc_gfx_GFXSampler(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXSampler_initialize); SE_DECLARE_FUNC(js_gfx_GFXSampler_destroy); SE_DECLARE_FUNC(js_gfx_GFXSampler_GFXSampler); -extern se::Object* __jsb_cc_GFXShader_proto; -extern se::Class* __jsb_cc_GFXShader_class; +extern se::Object* __jsb_cc_gfx_GFXShader_proto; +extern se::Class* __jsb_cc_gfx_GFXShader_class; -bool js_register_cc_GFXShader(se::Object* obj); +bool js_register_cc_gfx_GFXShader(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXShader_initialize); SE_DECLARE_FUNC(js_gfx_GFXShader_destroy); SE_DECLARE_FUNC(js_gfx_GFXShader_GFXShader); -extern se::Object* __jsb_cc_GFXInputAssembler_proto; -extern se::Class* __jsb_cc_GFXInputAssembler_class; +extern se::Object* __jsb_cc_gfx_GFXInputAssembler_proto; +extern se::Class* __jsb_cc_gfx_GFXInputAssembler_class; -bool js_register_cc_GFXInputAssembler(se::Object* obj); +bool js_register_cc_gfx_GFXInputAssembler(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXInputAssembler_destroy); SE_DECLARE_FUNC(js_gfx_GFXInputAssembler_initialize); SE_DECLARE_FUNC(js_gfx_GFXInputAssembler_GFXInputAssembler); -extern se::Object* __jsb_cc_GFXRenderPass_proto; -extern se::Class* __jsb_cc_GFXRenderPass_class; +extern se::Object* __jsb_cc_gfx_GFXRenderPass_proto; +extern se::Class* __jsb_cc_gfx_GFXRenderPass_class; -bool js_register_cc_GFXRenderPass(se::Object* obj); +bool js_register_cc_gfx_GFXRenderPass(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXRenderPass_initialize); SE_DECLARE_FUNC(js_gfx_GFXRenderPass_destroy); SE_DECLARE_FUNC(js_gfx_GFXRenderPass_GFXRenderPass); -extern se::Object* __jsb_cc_GFXFramebuffer_proto; -extern se::Class* __jsb_cc_GFXFramebuffer_class; +extern se::Object* __jsb_cc_gfx_GFXFramebuffer_proto; +extern se::Class* __jsb_cc_gfx_GFXFramebuffer_class; -bool js_register_cc_GFXFramebuffer(se::Object* obj); +bool js_register_cc_gfx_GFXFramebuffer(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXFramebuffer_initialize); SE_DECLARE_FUNC(js_gfx_GFXFramebuffer_destroy); SE_DECLARE_FUNC(js_gfx_GFXFramebuffer_GFXFramebuffer); -extern se::Object* __jsb_cc_GFXBindingLayout_proto; -extern se::Class* __jsb_cc_GFXBindingLayout_class; +extern se::Object* __jsb_cc_gfx_GFXBindingLayout_proto; +extern se::Class* __jsb_cc_gfx_GFXBindingLayout_class; -bool js_register_cc_GFXBindingLayout(se::Object* obj); +bool js_register_cc_gfx_GFXBindingLayout(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXBindingLayout_bindBuffer); SE_DECLARE_FUNC(js_gfx_GFXBindingLayout_bindSampler); @@ -371,10 +371,10 @@ SE_DECLARE_FUNC(js_gfx_GFXBindingLayout_initialize); SE_DECLARE_FUNC(js_gfx_GFXBindingLayout_destroy); SE_DECLARE_FUNC(js_gfx_GFXBindingLayout_GFXBindingLayout); -extern se::Object* __jsb_cc_GFXPipelineLayout_proto; -extern se::Class* __jsb_cc_GFXPipelineLayout_class; +extern se::Object* __jsb_cc_gfx_GFXPipelineLayout_proto; +extern se::Class* __jsb_cc_gfx_GFXPipelineLayout_class; -bool js_register_cc_GFXPipelineLayout(se::Object* obj); +bool js_register_cc_gfx_GFXPipelineLayout(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXPipelineLayout_getLayouts); SE_DECLARE_FUNC(js_gfx_GFXPipelineLayout_initialize); @@ -382,30 +382,30 @@ SE_DECLARE_FUNC(js_gfx_GFXPipelineLayout_destroy); SE_DECLARE_FUNC(js_gfx_GFXPipelineLayout_getPushConstantsRanges); SE_DECLARE_FUNC(js_gfx_GFXPipelineLayout_GFXPipelineLayout); -extern se::Object* __jsb_cc_GFXPipelineState_proto; -extern se::Class* __jsb_cc_GFXPipelineState_class; +extern se::Object* __jsb_cc_gfx_GFXPipelineState_proto; +extern se::Class* __jsb_cc_gfx_GFXPipelineState_class; -bool js_register_cc_GFXPipelineState(se::Object* obj); +bool js_register_cc_gfx_GFXPipelineState(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXPipelineState_initialize); SE_DECLARE_FUNC(js_gfx_GFXPipelineState_destroy); SE_DECLARE_FUNC(js_gfx_GFXPipelineState_getDynamicStates); SE_DECLARE_FUNC(js_gfx_GFXPipelineState_GFXPipelineState); -extern se::Object* __jsb_cc_GFXCommandAllocator_proto; -extern se::Class* __jsb_cc_GFXCommandAllocator_class; +extern se::Object* __jsb_cc_gfx_GFXCommandAllocator_proto; +extern se::Class* __jsb_cc_gfx_GFXCommandAllocator_class; -bool js_register_cc_GFXCommandAllocator(se::Object* obj); +bool js_register_cc_gfx_GFXCommandAllocator(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXCommandAllocator_initialize); SE_DECLARE_FUNC(js_gfx_GFXCommandAllocator_destroy); SE_DECLARE_FUNC(js_gfx_GFXCommandAllocator_getDevice); SE_DECLARE_FUNC(js_gfx_GFXCommandAllocator_GFXCommandAllocator); -extern se::Object* __jsb_cc_GFXCommandBuffer_proto; -extern se::Class* __jsb_cc_GFXCommandBuffer_class; +extern se::Object* __jsb_cc_gfx_GFXCommandBuffer_proto; +extern se::Class* __jsb_cc_gfx_GFXCommandBuffer_class; -bool js_register_cc_GFXCommandBuffer(se::Object* obj); +bool js_register_cc_gfx_GFXCommandBuffer(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXCommandBuffer_draw); SE_DECLARE_FUNC(js_gfx_GFXCommandBuffer_setBlendConstants); @@ -435,10 +435,10 @@ SE_DECLARE_FUNC(js_gfx_GFXCommandBuffer_beginRenderPass); SE_DECLARE_FUNC(js_gfx_GFXCommandBuffer_getNumDrawCalls); SE_DECLARE_FUNC(js_gfx_GFXCommandBuffer_GFXCommandBuffer); -extern se::Object* __jsb_cc_GFXFence_proto; -extern se::Class* __jsb_cc_GFXFence_class; +extern se::Object* __jsb_cc_gfx_GFXFence_proto; +extern se::Class* __jsb_cc_gfx_GFXFence_class; -bool js_register_cc_GFXFence(se::Object* obj); +bool js_register_cc_gfx_GFXFence(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXFence_initialize); SE_DECLARE_FUNC(js_gfx_GFXFence_destroy); @@ -446,10 +446,10 @@ SE_DECLARE_FUNC(js_gfx_GFXFence_wait); SE_DECLARE_FUNC(js_gfx_GFXFence_reset); SE_DECLARE_FUNC(js_gfx_GFXFence_GFXFence); -extern se::Object* __jsb_cc_GFXQueue_proto; -extern se::Class* __jsb_cc_GFXQueue_class; +extern se::Object* __jsb_cc_gfx_GFXQueue_proto; +extern se::Class* __jsb_cc_gfx_GFXQueue_class; -bool js_register_cc_GFXQueue(se::Object* obj); +bool js_register_cc_gfx_GFXQueue(se::Object* obj); bool register_all_gfx(se::Object* obj); SE_DECLARE_FUNC(js_gfx_GFXQueue_submit); SE_DECLARE_FUNC(js_gfx_GFXQueue_initialize); diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.cpp index 66eeb20aea..16f7d722a1 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.cpp @@ -10,18 +10,18 @@ #ifndef JSB_FREE #define JSB_FREE(ptr) delete ptr #endif -se::Object* __jsb_cc_GLES2Device_proto = nullptr; -se::Class* __jsb_cc_GLES2Device_class = nullptr; +se::Object* __jsb_cc_gfx_GLES2Device_proto = nullptr; +se::Class* __jsb_cc_gfx_GLES2Device_class = nullptr; static bool js_gles2_GLES2Device_checkExtension(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles2_GLES2Device_checkExtension : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gles2_GLES2Device_checkExtension : Error processing arguments"); bool result = cobj->checkExtension(arg0); @@ -36,7 +36,7 @@ SE_BIND_FUNC(js_gles2_GLES2Device_checkExtension) static bool js_gles2_GLES2Device_useInstancedArrays(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles2_GLES2Device_useInstancedArrays : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -54,7 +54,7 @@ SE_BIND_FUNC(js_gles2_GLES2Device_useInstancedArrays) static bool js_gles2_GLES2Device_useVAO(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles2_GLES2Device_useVAO : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -72,7 +72,7 @@ SE_BIND_FUNC(js_gles2_GLES2Device_useVAO) static bool js_gles2_GLES2Device_useDrawInstanced(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles2_GLES2Device_useDrawInstanced : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -90,7 +90,7 @@ SE_BIND_FUNC(js_gles2_GLES2Device_useDrawInstanced) static bool js_gles2_GLES2Device_useDiscardFramebuffer(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles2_GLES2Device_useDiscardFramebuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -106,50 +106,50 @@ static bool js_gles2_GLES2Device_useDiscardFramebuffer(se::State& s) } SE_BIND_FUNC(js_gles2_GLES2Device_useDiscardFramebuffer) -SE_DECLARE_FINALIZE_FUNC(js_cc_GLES2Device_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GLES2Device_finalize) static bool js_gles2_GLES2Device_constructor(se::State& s) { - cc::GLES2Device* cobj = JSB_ALLOC(cc::GLES2Device); + cc::gfx::GLES2Device* cobj = JSB_ALLOC(cc::gfx::GLES2Device); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_gles2_GLES2Device_constructor, __jsb_cc_GLES2Device_class, js_cc_GLES2Device_finalize) +SE_BIND_CTOR(js_gles2_GLES2Device_constructor, __jsb_cc_gfx_GLES2Device_class, js_cc_gfx_GLES2Device_finalize) -extern se::Object* __jsb_cc_GFXDevice_proto; +extern se::Object* __jsb_cc_gfx_GFXDevice_proto; -static bool js_cc_GLES2Device_finalize(se::State& s) +static bool js_cc_gfx_GLES2Device_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GLES2Device)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GLES2Device)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GLES2Device_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GLES2Device_finalize) bool js_register_gles2_GLES2Device(se::Object* obj) { - auto cls = se::Class::create("GLES2Device", obj, __jsb_cc_GFXDevice_proto, _SE(js_gles2_GLES2Device_constructor)); + auto cls = se::Class::create("GLES2Device", obj, __jsb_cc_gfx_GFXDevice_proto, _SE(js_gles2_GLES2Device_constructor)); cls->defineFunction("checkExtension", _SE(js_gles2_GLES2Device_checkExtension)); cls->defineFunction("useInstancedArrays", _SE(js_gles2_GLES2Device_useInstancedArrays)); cls->defineFunction("useVAO", _SE(js_gles2_GLES2Device_useVAO)); cls->defineFunction("useDrawInstanced", _SE(js_gles2_GLES2Device_useDrawInstanced)); cls->defineFunction("useDiscardFramebuffer", _SE(js_gles2_GLES2Device_useDiscardFramebuffer)); - cls->defineFinalizeFunction(_SE(js_cc_GLES2Device_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GLES2Device_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GLES2Device_proto = cls->getProto(); - __jsb_cc_GLES2Device_class = cls; + __jsb_cc_gfx_GLES2Device_proto = cls->getProto(); + __jsb_cc_gfx_GLES2Device_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.hpp index 372690f9c9..15568e45da 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gles2_auto.hpp @@ -3,10 +3,10 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cc_GLES2Device_proto; -extern se::Class* __jsb_cc_GLES2Device_class; +extern se::Object* __jsb_cc_gfx_GLES2Device_proto; +extern se::Class* __jsb_cc_gfx_GLES2Device_class; -bool js_register_cc_GLES2Device(se::Object* obj); +bool js_register_cc_gfx_GLES2Device(se::Object* obj); bool register_all_gles2(se::Object* obj); SE_DECLARE_FUNC(js_gles2_GLES2Device_checkExtension); SE_DECLARE_FUNC(js_gles2_GLES2Device_useInstancedArrays); diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.cpp index af6fcc2efc..49b2f0abd6 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.cpp @@ -10,18 +10,18 @@ #ifndef JSB_FREE #define JSB_FREE(ptr) delete ptr #endif -se::Object* __jsb_cc_GLES3Device_proto = nullptr; -se::Class* __jsb_cc_GLES3Device_class = nullptr; +se::Object* __jsb_cc_gfx_GLES3Device_proto = nullptr; +se::Class* __jsb_cc_gfx_GLES3Device_class = nullptr; static bool js_gles3_GLES3Device_checkExtension(se::State& s) { - cc::GLES3Device* cobj = (cc::GLES3Device*)s.nativeThisObject(); + cc::gfx::GLES3Device* cobj = (cc::gfx::GLES3Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles3_GLES3Device_checkExtension : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_gles3_GLES3Device_checkExtension : Error processing arguments"); bool result = cobj->checkExtension(arg0); @@ -36,7 +36,7 @@ SE_BIND_FUNC(js_gles3_GLES3Device_checkExtension) static bool js_gles3_GLES3Device_useVAO(se::State& s) { - cc::GLES3Device* cobj = (cc::GLES3Device*)s.nativeThisObject(); + cc::gfx::GLES3Device* cobj = (cc::gfx::GLES3Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gles3_GLES3Device_useVAO : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -52,47 +52,47 @@ static bool js_gles3_GLES3Device_useVAO(se::State& s) } SE_BIND_FUNC(js_gles3_GLES3Device_useVAO) -SE_DECLARE_FINALIZE_FUNC(js_cc_GLES3Device_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_GLES3Device_finalize) static bool js_gles3_GLES3Device_constructor(se::State& s) { - cc::GLES3Device* cobj = JSB_ALLOC(cc::GLES3Device); + cc::gfx::GLES3Device* cobj = JSB_ALLOC(cc::gfx::GLES3Device); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_gles3_GLES3Device_constructor, __jsb_cc_GLES3Device_class, js_cc_GLES3Device_finalize) +SE_BIND_CTOR(js_gles3_GLES3Device_constructor, __jsb_cc_gfx_GLES3Device_class, js_cc_gfx_GLES3Device_finalize) -extern se::Object* __jsb_cc_GFXDevice_proto; +extern se::Object* __jsb_cc_gfx_GFXDevice_proto; -static bool js_cc_GLES3Device_finalize(se::State& s) +static bool js_cc_gfx_GLES3Device_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::GLES3Device)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::GLES3Device)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GLES3Device* cobj = (cc::GLES3Device*)s.nativeThisObject(); + cc::gfx::GLES3Device* cobj = (cc::gfx::GLES3Device*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_GLES3Device_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_GLES3Device_finalize) bool js_register_gles3_GLES3Device(se::Object* obj) { - auto cls = se::Class::create("GLES3Device", obj, __jsb_cc_GFXDevice_proto, _SE(js_gles3_GLES3Device_constructor)); + auto cls = se::Class::create("GLES3Device", obj, __jsb_cc_gfx_GFXDevice_proto, _SE(js_gles3_GLES3Device_constructor)); cls->defineFunction("checkExtension", _SE(js_gles3_GLES3Device_checkExtension)); cls->defineFunction("useVAO", _SE(js_gles3_GLES3Device_useVAO)); - cls->defineFinalizeFunction(_SE(js_cc_GLES3Device_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_GLES3Device_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_GLES3Device_proto = cls->getProto(); - __jsb_cc_GLES3Device_class = cls; + __jsb_cc_gfx_GLES3Device_proto = cls->getProto(); + __jsb_cc_gfx_GLES3Device_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.hpp index a1c58f75d2..a2c49d0a7c 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gles3_auto.hpp @@ -3,10 +3,10 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cc_GLES3Device_proto; -extern se::Class* __jsb_cc_GLES3Device_class; +extern se::Object* __jsb_cc_gfx_GLES3Device_proto; +extern se::Class* __jsb_cc_gfx_GLES3Device_class; -bool js_register_cc_GLES3Device(se::Object* obj); +bool js_register_cc_gfx_GLES3Device(se::Object* obj); bool register_all_gles3(se::Object* obj); SE_DECLARE_FUNC(js_gles3_GLES3Device_checkExtension); SE_DECLARE_FUNC(js_gles3_GLES3Device_useVAO); diff --git a/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.cpp index 4b6593050d..dd3afa6280 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.cpp @@ -10,12 +10,12 @@ #ifndef JSB_FREE #define JSB_FREE(ptr) delete ptr #endif -se::Object* __jsb_cc_CCMTLDevice_proto = nullptr; -se::Class* __jsb_cc_CCMTLDevice_class = nullptr; +se::Object* __jsb_cc_gfx_CCMTLDevice_proto = nullptr; +se::Class* __jsb_cc_gfx_CCMTLDevice_class = nullptr; static bool js_mtl_CCMTLDevice_getMTLDevice(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_getMTLDevice : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -33,7 +33,7 @@ SE_BIND_FUNC(js_mtl_CCMTLDevice_getMTLDevice) static bool js_mtl_CCMTLDevice_getMTKView(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_getMTKView : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -51,7 +51,7 @@ SE_BIND_FUNC(js_mtl_CCMTLDevice_getMTKView) static bool js_mtl_CCMTLDevice_getMaximumSamplerUnits(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_getMaximumSamplerUnits : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -69,7 +69,7 @@ SE_BIND_FUNC(js_mtl_CCMTLDevice_getMaximumSamplerUnits) static bool js_mtl_CCMTLDevice_getMaximumColorRenderTargets(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_getMaximumColorRenderTargets : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -87,7 +87,7 @@ SE_BIND_FUNC(js_mtl_CCMTLDevice_getMaximumColorRenderTargets) static bool js_mtl_CCMTLDevice_isIndirectCommandBufferSupported(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_isIndirectCommandBufferSupported : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -105,7 +105,7 @@ SE_BIND_FUNC(js_mtl_CCMTLDevice_isIndirectCommandBufferSupported) static bool js_mtl_CCMTLDevice_blitBuffer(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_mtl_CCMTLDevice_blitBuffer : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -128,38 +128,38 @@ static bool js_mtl_CCMTLDevice_blitBuffer(se::State& s) } SE_BIND_FUNC(js_mtl_CCMTLDevice_blitBuffer) -SE_DECLARE_FINALIZE_FUNC(js_cc_CCMTLDevice_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_CCMTLDevice_finalize) static bool js_mtl_CCMTLDevice_constructor(se::State& s) { - cc::CCMTLDevice* cobj = JSB_ALLOC(cc::CCMTLDevice); + cc::gfx::CCMTLDevice* cobj = JSB_ALLOC(cc::gfx::CCMTLDevice); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_mtl_CCMTLDevice_constructor, __jsb_cc_CCMTLDevice_class, js_cc_CCMTLDevice_finalize) +SE_BIND_CTOR(js_mtl_CCMTLDevice_constructor, __jsb_cc_gfx_CCMTLDevice_class, js_cc_gfx_CCMTLDevice_finalize) -extern se::Object* __jsb_cc_GFXDevice_proto; +extern se::Object* __jsb_cc_gfx_GFXDevice_proto; -static bool js_cc_CCMTLDevice_finalize(se::State& s) +static bool js_cc_gfx_CCMTLDevice_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::CCMTLDevice)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::CCMTLDevice)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_CCMTLDevice_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_CCMTLDevice_finalize) bool js_register_mtl_CCMTLDevice(se::Object* obj) { - auto cls = se::Class::create("CCMTLDevice", obj, __jsb_cc_GFXDevice_proto, _SE(js_mtl_CCMTLDevice_constructor)); + auto cls = se::Class::create("CCMTLDevice", obj, __jsb_cc_gfx_GFXDevice_proto, _SE(js_mtl_CCMTLDevice_constructor)); cls->defineFunction("getMTLDevice", _SE(js_mtl_CCMTLDevice_getMTLDevice)); cls->defineFunction("getMTKView", _SE(js_mtl_CCMTLDevice_getMTKView)); @@ -167,12 +167,12 @@ bool js_register_mtl_CCMTLDevice(se::Object* obj) cls->defineFunction("getMaximumColorRenderTargets", _SE(js_mtl_CCMTLDevice_getMaximumColorRenderTargets)); cls->defineFunction("isIndirectCommandBufferSupported", _SE(js_mtl_CCMTLDevice_isIndirectCommandBufferSupported)); cls->defineFunction("blitBuffer", _SE(js_mtl_CCMTLDevice_blitBuffer)); - cls->defineFinalizeFunction(_SE(js_cc_CCMTLDevice_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_CCMTLDevice_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_CCMTLDevice_proto = cls->getProto(); - __jsb_cc_CCMTLDevice_class = cls; + __jsb_cc_gfx_CCMTLDevice_proto = cls->getProto(); + __jsb_cc_gfx_CCMTLDevice_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.hpp index 918f3f6c11..10011d9aeb 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_mtl_auto.hpp @@ -3,10 +3,10 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cc_CCMTLDevice_proto; -extern se::Class* __jsb_cc_CCMTLDevice_class; +extern se::Object* __jsb_cc_gfx_CCMTLDevice_proto; +extern se::Class* __jsb_cc_gfx_CCMTLDevice_class; -bool js_register_cc_CCMTLDevice(se::Object* obj); +bool js_register_cc_gfx_CCMTLDevice(se::Object* obj); bool register_all_mtl(se::Object* obj); SE_DECLARE_FUNC(js_mtl_CCMTLDevice_getMTLDevice); SE_DECLARE_FUNC(js_mtl_CCMTLDevice_getMTKView); diff --git a/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.cpp index 596be3ddae..2c2ff3b9f8 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.cpp @@ -10,18 +10,18 @@ #ifndef JSB_FREE #define JSB_FREE(ptr) delete ptr #endif -se::Object* __jsb_cc_CCVKDevice_proto = nullptr; -se::Class* __jsb_cc_CCVKDevice_class = nullptr; +se::Object* __jsb_cc_gfx_CCVKDevice_proto = nullptr; +se::Class* __jsb_cc_gfx_CCVKDevice_class = nullptr; static bool js_vk_CCVKDevice_checkExtension(se::State& s) { - cc::CCVKDevice* cobj = (cc::CCVKDevice*)s.nativeThisObject(); + cc::gfx::CCVKDevice* cobj = (cc::gfx::CCVKDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_vk_CCVKDevice_checkExtension : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 1) { - cc::String arg0; + cc::gfx::String arg0; arg0 = args[0].toStringForce().c_str(); SE_PRECONDITION2(ok, false, "js_vk_CCVKDevice_checkExtension : Error processing arguments"); bool result = cobj->checkExtension(arg0); @@ -34,46 +34,46 @@ static bool js_vk_CCVKDevice_checkExtension(se::State& s) } SE_BIND_FUNC(js_vk_CCVKDevice_checkExtension) -SE_DECLARE_FINALIZE_FUNC(js_cc_CCVKDevice_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cc_gfx_CCVKDevice_finalize) static bool js_vk_CCVKDevice_constructor(se::State& s) { - cc::CCVKDevice* cobj = JSB_ALLOC(cc::CCVKDevice); + cc::gfx::CCVKDevice* cobj = JSB_ALLOC(cc::gfx::CCVKDevice); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_vk_CCVKDevice_constructor, __jsb_cc_CCVKDevice_class, js_cc_CCVKDevice_finalize) +SE_BIND_CTOR(js_vk_CCVKDevice_constructor, __jsb_cc_gfx_CCVKDevice_class, js_cc_gfx_CCVKDevice_finalize) -extern se::Object* __jsb_cc_GFXDevice_proto; +extern se::Object* __jsb_cc_gfx_GFXDevice_proto; -static bool js_cc_CCVKDevice_finalize(se::State& s) +static bool js_cc_gfx_CCVKDevice_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cc::CCVKDevice)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cc::gfx::CCVKDevice)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::CCVKDevice* cobj = (cc::CCVKDevice*)s.nativeThisObject(); + cc::gfx::CCVKDevice* cobj = (cc::gfx::CCVKDevice*)s.nativeThisObject(); JSB_FREE(cobj); } return true; } -SE_BIND_FINALIZE_FUNC(js_cc_CCVKDevice_finalize) +SE_BIND_FINALIZE_FUNC(js_cc_gfx_CCVKDevice_finalize) bool js_register_vk_CCVKDevice(se::Object* obj) { - auto cls = se::Class::create("CCVKDevice", obj, __jsb_cc_GFXDevice_proto, _SE(js_vk_CCVKDevice_constructor)); + auto cls = se::Class::create("CCVKDevice", obj, __jsb_cc_gfx_GFXDevice_proto, _SE(js_vk_CCVKDevice_constructor)); cls->defineFunction("checkExtension", _SE(js_vk_CCVKDevice_checkExtension)); - cls->defineFinalizeFunction(_SE(js_cc_CCVKDevice_finalize)); + cls->defineFinalizeFunction(_SE(js_cc_gfx_CCVKDevice_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cc_CCVKDevice_proto = cls->getProto(); - __jsb_cc_CCVKDevice_class = cls; + __jsb_cc_gfx_CCVKDevice_proto = cls->getProto(); + __jsb_cc_gfx_CCVKDevice_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.hpp index 658c900c1e..1b63339854 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_vk_auto.hpp @@ -3,10 +3,10 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cc_CCVKDevice_proto; -extern se::Class* __jsb_cc_CCVKDevice_class; +extern se::Object* __jsb_cc_gfx_CCVKDevice_proto; +extern se::Class* __jsb_cc_gfx_CCVKDevice_class; -bool js_register_cc_CCVKDevice(se::Object* obj); +bool js_register_cc_gfx_CCVKDevice(se::Object* obj); bool register_all_vk(se::Object* obj); SE_DECLARE_FUNC(js_vk_CCVKDevice_checkExtension); SE_DECLARE_FUNC(js_vk_CCVKDevice_CCVKDevice); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp index c47a5d37ac..7fec0dd1bf 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp @@ -49,15 +49,15 @@ #define GFX_INVALID_BINDING ((uint8_t)-1) #define GFX_INVALID_HANDLE ((uint)-1) -bool js_GFXDevice_copyBuffersToTexture(se::State& s, cc::GFXDevice* cobj) +bool js_GFXDevice_copyBuffersToTexture(se::State& s, cc::gfx::GFXDevice* cobj) { const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 3) { - cc::GFXDataArray arg0; - cc::GFXTexture* arg1 = nullptr; - std::vector arg2; + cc::gfx::GFXDataArray arg0; + cc::gfx::GFXTexture* arg1 = nullptr; + std::vector arg2; if (args[0].isObject()) { se::Object* dataObj = args[0].toObject(); @@ -103,15 +103,15 @@ bool js_GFXDevice_copyBuffersToTexture(se::State& s, cc::GFXDevice* cobj) return false; } -bool js_GFXDevice_copyTexImagesToTexture(se::State& s, cc::GFXDevice* cobj) +bool js_GFXDevice_copyTexImagesToTexture(se::State& s, cc::gfx::GFXDevice* cobj) { const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 3) { - cc::GFXDataArray arg0; - cc::GFXTexture* arg1 = nullptr; - std::vector arg2; + cc::gfx::GFXDataArray arg0; + cc::gfx::GFXTexture* arg1 = nullptr; + std::vector arg2; if (args[0].isObject()) { se::Object* dataObj = args[0].toObject(); @@ -148,25 +148,25 @@ bool js_GFXDevice_copyTexImagesToTexture(se::State& s, cc::GFXDevice* cobj) static bool js_gfx_GFXDevice_createTexture(se::State& s) { - cc::GFXDevice* cobj = (cc::GFXDevice*)s.nativeThisObject(); + cc::gfx::GFXDevice* cobj = (cc::gfx::GFXDevice*)s.nativeThisObject(); SE_PRECONDITION2( cobj, false, "js_gfx_GFXDevice_createTexture : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); if (argc == 2) { - cc::GFXTexture* texture = nullptr; + cc::gfx::GFXTexture* texture = nullptr; bool createTextureView = false; seval_to_boolean(args[1], &createTextureView); if (createTextureView) { - auto textureViewInfo = (cc::GFXTextureViewInfo*)(args[0].toObject()->getPrivateData()); + auto textureViewInfo = (cc::gfx::GFXTextureViewInfo*)(args[0].toObject()->getPrivateData()); texture = cobj->createTexture(*textureViewInfo); } else { - auto textureInfo = (cc::GFXTextureInfo*)(args[0].toObject()->getPrivateData()); + auto textureInfo = (cc::gfx::GFXTextureInfo*)(args[0].toObject()->getPrivateData()); texture = cobj->createTexture(*textureInfo); } @@ -183,7 +183,7 @@ SE_BIND_FUNC(js_gfx_GFXDevice_createTexture) static bool js_gfx_GFXTexture_initialize(se::State& s) { CC_UNUSED bool ok = true; - cc::GFXTexture* cobj = (cc::GFXTexture*)s.nativeThisObject(); + cc::gfx::GFXTexture* cobj = (cc::gfx::GFXTexture*)s.nativeThisObject(); SE_PRECONDITION2( cobj, false, "js_gfx_GFXTexture_initialize : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -194,12 +194,12 @@ static bool js_gfx_GFXTexture_initialize(se::State& s) if (initWithTextureViewInfo) { - auto textureViewInfo = (cc::GFXTextureViewInfo*)(args[0].toObject()->getPrivateData()); + auto textureViewInfo = (cc::gfx::GFXTextureViewInfo*)(args[0].toObject()->getPrivateData()); ok &= cobj->initialize(*textureViewInfo); } else { - auto textureInfo = (cc::GFXTextureInfo*)(args[0].toObject()->getPrivateData()); + auto textureInfo = (cc::gfx::GFXTextureInfo*)(args[0].toObject()->getPrivateData()); ok &= cobj->initialize(*textureInfo); } @@ -216,7 +216,7 @@ SE_BIND_FUNC(js_gfx_GFXTexture_initialize) #ifdef USE_VULKAN static bool js_gfx_CCVKDevice_copyBuffersToTexture(se::State& s) { - cc::CCVKDevice* cobj = (cc::CCVKDevice*)s.nativeThisObject(); + cc::gfx::CCVKDevice* cobj = (cc::gfx::CCVKDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_CCVKDevice_copyBuffersToTexture : Invalid Native Object"); return js_GFXDevice_copyBuffersToTexture(s, cobj); } @@ -224,7 +224,7 @@ SE_BIND_FUNC(js_gfx_CCVKDevice_copyBuffersToTexture) static bool js_gfx_CCVKDevice_copyTexImagesToTexture(se::State& s) { - cc::CCVKDevice* cobj = (cc::CCVKDevice*)s.nativeThisObject(); + cc::gfx::CCVKDevice* cobj = (cc::gfx::CCVKDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_CCVKDevice_copyTexImagesToTexture : Invalid Native Object"); return js_GFXDevice_copyTexImagesToTexture(s, cobj); } @@ -234,7 +234,7 @@ SE_BIND_FUNC(js_gfx_CCVKDevice_copyTexImagesToTexture); #ifdef USE_METAL static bool js_gfx_CCMTLDevice_copyBuffersToTexture(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_CCMTLDevice_copyBuffersToTexture : Invalid Native Object"); return js_GFXDevice_copyBuffersToTexture(s, cobj); } @@ -242,7 +242,7 @@ SE_BIND_FUNC(js_gfx_CCMTLDevice_copyBuffersToTexture) static bool js_gfx_CCMTLDevice_copyTexImagesToTexture(se::State& s) { - cc::CCMTLDevice* cobj = (cc::CCMTLDevice*)s.nativeThisObject(); + cc::gfx::CCMTLDevice* cobj = (cc::gfx::CCMTLDevice*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_CCMTLDevice_copyTexImagesToTexture : Invalid Native Object"); return js_GFXDevice_copyTexImagesToTexture(s, cobj); } @@ -252,7 +252,7 @@ SE_BIND_FUNC(js_gfx_CCMTLDevice_copyTexImagesToTexture); #ifdef USE_GLES3 static bool js_gfx_GLES3Device_copyBuffersToTexture(se::State& s) { - cc::GLES3Device* cobj = (cc::GLES3Device*)s.nativeThisObject(); + cc::gfx::GLES3Device* cobj = (cc::gfx::GLES3Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GLES3Device_copyBuffersToTexture : Invalid Native Object"); return js_GFXDevice_copyBuffersToTexture(s, cobj); } @@ -260,7 +260,7 @@ SE_BIND_FUNC(js_gfx_GLES3Device_copyBuffersToTexture) static bool js_gfx_GLES3Device_copyTexImagesToTexture(se::State& s) { - cc::GLES3Device* cobj = (cc::GLES3Device*)s.nativeThisObject(); + cc::gfx::GLES3Device* cobj = (cc::gfx::GLES3Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GLES3Device_copyTexImagesToTexture : Invalid Native Object"); return js_GFXDevice_copyTexImagesToTexture(s, cobj); } @@ -270,7 +270,7 @@ SE_BIND_FUNC(js_gfx_GLES3Device_copyTexImagesToTexture); #ifdef USE_GLES2 static bool js_gfx_GLES2Device_copyBuffersToTexture(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GLES2Device_copyBuffersToTexture : Invalid Native Object"); return js_GFXDevice_copyBuffersToTexture(s, cobj); } @@ -278,7 +278,7 @@ SE_BIND_FUNC(js_gfx_GLES2Device_copyBuffersToTexture) static bool js_gfx_GLES2Device_copyTexImagesToTexture(se::State& s) { - cc::GLES2Device* cobj = (cc::GLES2Device*)s.nativeThisObject(); + cc::gfx::GLES2Device* cobj = (cc::gfx::GLES2Device*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GLES2Device_copyTexImagesToTexture : Invalid Native Object"); return js_GFXDevice_copyTexImagesToTexture(s, cobj); } @@ -287,7 +287,7 @@ SE_BIND_FUNC(js_gfx_GLES2Device_copyTexImagesToTexture); static bool js_gfx_GFXBuffer_update(se::State& s) { - cc::GFXBuffer* cobj = (cc::GFXBuffer*)s.nativeThisObject(); + cc::gfx::GFXBuffer* cobj = (cc::gfx::GFXBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBuffer_update : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); @@ -342,7 +342,7 @@ se::Class* __jsb_cocos2d_GFXSubPass_class = nullptr; static bool js_gfx_GFXSubPass_get_bind_point(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_bind_point : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -356,12 +356,12 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_bind_point) static bool js_gfx_GFXSubPass_set_bind_point(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_bind_point : Invalid Native Object"); CC_UNUSED bool ok = true; - cc::GFXPipelineBindPoint arg0 = cc::GFXPipelineBindPoint::GRAPHICS; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXPipelineBindPoint)tmp; } while(false); + cc::gfx::GFXPipelineBindPoint arg0 = cc::gfx::GFXPipelineBindPoint::GRAPHICS; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXPipelineBindPoint)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_gfx_GFXSubPass_set_bind_point : Error processing new value"); cobj->bindPoint = arg0; return true; @@ -370,7 +370,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSubPass_set_bind_point) static bool js_gfx_GFXSubPass_get_inputs(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_inputs : Invalid Native Object"); se::Value jsret; @@ -387,7 +387,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_inputs) static bool js_gfx_GFXSubPass_set_inputs(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_inputs : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -399,7 +399,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSubPass_set_inputs) static bool js_gfx_GFXSubPass_get_colors(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_colors : Invalid Native Object"); se::Value jsret; @@ -416,7 +416,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_colors) static bool js_gfx_GFXSubPass_set_colors(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_colors : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -428,7 +428,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSubPass_set_colors) static bool js_gfx_GFXSubPass_get_resolves(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_resolves : Invalid Native Object"); se::Value jsret; @@ -445,7 +445,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_resolves) static bool js_gfx_GFXSubPass_set_resolves(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_resolves : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -458,7 +458,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSubPass_set_resolves) static bool js_gfx_GFXSubPass_get_depth_stencil(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_depth_stencil : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -472,7 +472,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_depth_stencil) static bool js_gfx_GFXSubPass_set_depth_stencil(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_depth_stencil : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -486,7 +486,7 @@ SE_BIND_PROP_SET(js_gfx_GFXSubPass_set_depth_stencil) static bool js_gfx_GFXSubPass_get_preserves(se::State& s) { - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_get_preserves : Invalid Native Object"); se::Value jsret; @@ -503,7 +503,7 @@ SE_BIND_PROP_GET(js_gfx_GFXSubPass_get_preserves) static bool js_gfx_GFXSubPass_set_preserves(se::State& s) { const auto& args = s.args(); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXSubPass_set_preserves : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -524,7 +524,7 @@ static bool js_gfx_GFXSubPass_constructor(se::State& s) if(argc == 0) { - cc::GFXSubPass* cobj = new (std::nothrow) cc::GFXSubPass(); + cc::gfx::GFXSubPass* cobj = new (std::nothrow) cc::gfx::GFXSubPass(); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; @@ -534,17 +534,17 @@ static bool js_gfx_GFXSubPass_constructor(se::State& s) se::Object *json = args[0].toObject(); se::Value field; - cc::GFXSubPass* cobj = new (std::nothrow) cc::GFXSubPass(); + cc::gfx::GFXSubPass* cobj = new (std::nothrow) cc::gfx::GFXSubPass(); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); - cc::GFXPipelineBindPoint arg0 = cc::GFXPipelineBindPoint::GRAPHICS; + cc::gfx::GFXPipelineBindPoint arg0 = cc::gfx::GFXPipelineBindPoint::GRAPHICS; json->getProperty("bind_point", &field); if(field.isUndefined()) { SE_REPORT_ERROR("argument Field \".bind_point\" is undefined!"); return false; } - do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::GFXPipelineBindPoint)tmp; } while(false); + do { int32_t tmp = 0; ok &= seval_to_int32(field, &tmp); arg0 = (cc::gfx::GFXPipelineBindPoint)tmp; } while(false); cobj->bindPoint = arg0; json->getProperty("inputs", &field); @@ -591,12 +591,12 @@ static bool js_gfx_GFXSubPass_constructor(se::State& s) } else if(argc == 6) { - cc::GFXSubPass* cobj = new (std::nothrow) cc::GFXSubPass(); + cc::gfx::GFXSubPass* cobj = new (std::nothrow) cc::gfx::GFXSubPass(); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); - cc::GFXPipelineBindPoint arg0 = cc::GFXPipelineBindPoint::GRAPHICS; - do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::GFXPipelineBindPoint)tmp; } while(false); + cc::gfx::GFXPipelineBindPoint arg0 = cc::gfx::GFXPipelineBindPoint::GRAPHICS; + do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (cc::gfx::GFXPipelineBindPoint)tmp; } while(false); cobj->bindPoint = arg0; ok &= seval_to_Uint8Array(args[1], (uint8_t*)&cobj->inputs); @@ -629,7 +629,7 @@ static bool js_cocos2d_GFXSubPass_finalize(se::State& s) if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cc::GFXSubPass* cobj = (cc::GFXSubPass*)s.nativeThisObject(); + cc::gfx::GFXSubPass* cobj = (cc::gfx::GFXSubPass*)s.nativeThisObject(); JSB_FREE(cobj); } return true; @@ -648,7 +648,7 @@ bool js_register_gfx_GFXSubPass(se::Object* obj) cls->defineProperty("preserves", _SE(js_gfx_GFXSubPass_get_preserves), _SE(js_gfx_GFXSubPass_set_preserves)); cls->defineFinalizeFunction(_SE(js_cocos2d_GFXSubPass_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); __jsb_cocos2d_GFXSubPass_proto = cls->getProto(); __jsb_cocos2d_GFXSubPass_class = cls; @@ -659,12 +659,12 @@ bool js_register_gfx_GFXSubPass(se::Object* obj) static bool js_gfx_GFXPipelineLayout_get_layouts(se::State& s) { - cc::GFXPipelineLayout* cobj = (cc::GFXPipelineLayout*)s.nativeThisObject(); + cc::gfx::GFXPipelineLayout* cobj = (cc::gfx::GFXPipelineLayout*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXPipelineLayout_layouts : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - const std::vector& result = cobj->getLayouts(); + const std::vector& result = cobj->getLayouts(); se::Value *layouts = &s.rval(); se::HandleObject arr(se::Object::createArrayObject(result.size())); @@ -688,13 +688,13 @@ SE_BIND_PROP_GET(js_gfx_GFXPipelineLayout_get_layouts) static bool js_gfx_GFXBlendState_get_targets(se::State& s) { - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_get_targets : Invalid Native Object"); CC_UNUSED bool ok = true; se::Value *jsTargets = &s.rval(); - const std::vector& targets = cobj->targets; + const std::vector& targets = cobj->targets; se::HandleObject arr(se::Object::createArrayObject(targets.size())); jsTargets->setObject(arr); @@ -714,11 +714,11 @@ SE_BIND_PROP_GET(js_gfx_GFXBlendState_get_targets) static bool js_gfx_GFXBlendState_set_targets(se::State& s) { const auto& args = s.args(); - cc::GFXBlendState* cobj = (cc::GFXBlendState*)s.nativeThisObject(); + cc::gfx::GFXBlendState* cobj = (cc::gfx::GFXBlendState*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXBlendState_set_targets : Invalid Native Object"); CC_UNUSED bool ok = true; - std::vector arg0; + std::vector arg0; ok &= seval_to_std_vector(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_gfx_GFXBlendState_set_targets : Error processing new value"); cobj->targets = arg0; @@ -728,13 +728,13 @@ SE_BIND_PROP_SET(js_gfx_GFXBlendState_set_targets) static bool js_gfx_GFXCommandBuffer_execute(se::State& s) { - cc::GFXCommandBuffer* cobj = (cc::GFXCommandBuffer*)s.nativeThisObject(); + cc::gfx::GFXCommandBuffer* cobj = (cc::gfx::GFXCommandBuffer*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXCommandBuffer_execute : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 2) { - std::vector cmdBufs; + std::vector cmdBufs; unsigned int count = 0; ok &= seval_to_uint32(args[1], (uint32_t*)&count); @@ -760,7 +760,7 @@ static bool js_gfx_GFXCommandBuffer_execute(se::State& s) break; } - cc::GFXCommandBuffer *cmdBuf = (cc::GFXCommandBuffer*)tmp.toObject()->getPrivateData(); + cc::gfx::GFXCommandBuffer *cmdBuf = (cc::gfx::GFXCommandBuffer*)tmp.toObject()->getPrivateData(); cmdBufs[i] = cmdBuf; } } @@ -776,12 +776,12 @@ SE_BIND_FUNC(js_gfx_GFXCommandBuffer_execute) static bool js_gfx_GFXInputAssembler_extractDrawInfo(se::State& s) { - cc::GFXInputAssembler* cobj = (cc::GFXInputAssembler*)s.nativeThisObject(); + cc::gfx::GFXInputAssembler* cobj = (cc::gfx::GFXInputAssembler*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_gfx_GFXInputAssembler_extractDrawInfo : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); if (argc == 1) { - cc::GFXDrawInfo nativeDrawInfo; + cc::gfx::GFXDrawInfo nativeDrawInfo; cobj->extractDrawInfo(nativeDrawInfo); se::Object* drawInfo = args[0].toObject(); @@ -815,40 +815,40 @@ SE_BIND_FUNC(js_gfx_GFXInputAssembler_extractDrawInfo) bool register_all_gfx_manual(se::Object* obj) { - __jsb_cc_GFXBuffer_proto->defineFunction("update", _SE(js_gfx_GFXBuffer_update)); + __jsb_cc_gfx_GFXBuffer_proto->defineFunction("update", _SE(js_gfx_GFXBuffer_update)); - __jsb_cc_GFXPipelineLayout_proto->defineProperty("layouts", _SE(js_gfx_GFXPipelineLayout_get_layouts), nullptr); + __jsb_cc_gfx_GFXPipelineLayout_proto->defineProperty("layouts", _SE(js_gfx_GFXPipelineLayout_get_layouts), nullptr); - __jsb_cc_GFXBlendState_proto->defineProperty("targets", _SE(js_gfx_GFXBlendState_get_targets), _SE(js_gfx_GFXBlendState_set_targets)); + __jsb_cc_gfx_GFXBlendState_proto->defineProperty("targets", _SE(js_gfx_GFXBlendState_get_targets), _SE(js_gfx_GFXBlendState_set_targets)); - __jsb_cc_GFXCommandBuffer_proto->defineFunction("execute", _SE(js_gfx_GFXCommandBuffer_execute)); + __jsb_cc_gfx_GFXCommandBuffer_proto->defineFunction("execute", _SE(js_gfx_GFXCommandBuffer_execute)); - __jsb_cc_GFXInputAssembler_proto->defineFunction("extractDrawInfo", _SE(js_gfx_GFXInputAssembler_extractDrawInfo)); + __jsb_cc_gfx_GFXInputAssembler_proto->defineFunction("extractDrawInfo", _SE(js_gfx_GFXInputAssembler_extractDrawInfo)); js_register_gfx_GFXSubPass(obj); #if defined USE_VULKAN register_all_vk(obj); - __jsb_cc_CCVKDevice_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_CCVKDevice_copyBuffersToTexture)); - __jsb_cc_CCVKDevice_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_CCVKDevice_copyTexImagesToTexture)); + __jsb_cc_gfx_CCVKDevice_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_CCVKDevice_copyBuffersToTexture)); + __jsb_cc_gfx_CCVKDevice_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_CCVKDevice_copyTexImagesToTexture)); #endif #if defined USE_GLES3 register_all_gles3(obj); - __jsb_cc_GLES3Device_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_GLES3Device_copyBuffersToTexture)); - __jsb_cc_GLES3Device_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_GLES3Device_copyTexImagesToTexture)); + __jsb_cc_gfx_GLES3Device_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_GLES3Device_copyBuffersToTexture)); + __jsb_cc_gfx_GLES3Device_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_GLES3Device_copyTexImagesToTexture)); #endif #ifdef USE_GLES2 register_all_gles2(obj); - __jsb_cc_GLES2Device_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_GLES2Device_copyBuffersToTexture)); - __jsb_cc_GLES2Device_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_GLES2Device_copyTexImagesToTexture)); + __jsb_cc_gfx_GLES2Device_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_GLES2Device_copyBuffersToTexture)); + __jsb_cc_gfx_GLES2Device_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_GLES2Device_copyTexImagesToTexture)); #endif #if defined USE_METAL register_all_mtl(obj); - __jsb_cc_CCMTLDevice_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_CCMTLDevice_copyBuffersToTexture)); - __jsb_cc_CCMTLDevice_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_CCMTLDevice_copyTexImagesToTexture)); + __jsb_cc_gfx_CCMTLDevice_proto->defineFunction("copyBuffersToTexture", _SE(js_gfx_CCMTLDevice_copyBuffersToTexture)); + __jsb_cc_gfx_CCMTLDevice_proto->defineFunction("copyTexImagesToTexture", _SE(js_gfx_CCMTLDevice_copyTexImagesToTexture)); #endif - __jsb_cc_GFXDevice_proto->defineFunction("createTexture", _SE(js_gfx_GFXDevice_createTexture)); - __jsb_cc_GFXTexture_proto->defineFunction("initialize", _SE(js_gfx_GFXTexture_initialize)); + __jsb_cc_gfx_GFXDevice_proto->defineFunction("createTexture", _SE(js_gfx_GFXDevice_createTexture)); + __jsb_cc_gfx_GFXTexture_proto->defineFunction("initialize", _SE(js_gfx_GFXTexture_initialize)); return true; } diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp index 838d154acd..9228a85183 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp @@ -722,7 +722,7 @@ namespace uint32_t width = 0; uint32_t height = 0; uint8_t* data = nullptr; - cc::GFXFormat format = cc::GFXFormat::UNKNOWN; + cc::gfx::GFXFormat format = cc::gfx::GFXFormat::UNKNOWN; uint8_t bpp = 0; uint8_t numberOfMipmaps = 0; bool hasAlpha = false; @@ -783,22 +783,22 @@ namespace // will create a big texture, and update its content with small pictures. // The big texture is RGBA888, then the small picture should be the same // format, or it will cause 0x502 error on OpenGL ES 2. - if (!imgInfo->compressed && imgInfo->format != cc::GFXFormat::RGBA8) { + if (!imgInfo->compressed && imgInfo->format != cc::gfx::GFXFormat::RGBA8) { imgInfo->length = img->getWidth() * img->getHeight() * 4; uint8_t* dst = nullptr; uint32_t length = imgInfo->length; uint8_t* src = imgInfo->data; switch(imgInfo->format) { - case cc::GFXFormat::A8: - case cc::GFXFormat::LA8: + case cc::gfx::GFXFormat::A8: + case cc::gfx::GFXFormat::LA8: dst = convertIA2RGBA(length, src); break; - case cc::GFXFormat::L8: - case cc::GFXFormat::R8: - case cc::GFXFormat::R8I: + case cc::gfx::GFXFormat::L8: + case cc::gfx::GFXFormat::R8: + case cc::gfx::GFXFormat::R8I: dst = convertI2RGBA(length, src); break; - case cc::GFXFormat::RGB8: + case cc::gfx::GFXFormat::RGB8: dst = convertRGB2RGBA(length, src); break; default: diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.h b/native/cocos/scripting/js-bindings/manual/jsb_global.h index 5645024459..ae4d2fdcd9 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.h +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.h @@ -31,7 +31,7 @@ #include template -typename std::enable_if::value, T>::type* +typename std::enable_if::value, T>::type* jsb_override_new(Args &&... args) { //create object in gfx way @@ -39,7 +39,7 @@ jsb_override_new(Args &&... args) } template -typename std::enable_if::value, void>::type +typename std::enable_if::value, void>::type jsb_override_delete(T* arg) { //create object in gfx way @@ -47,7 +47,7 @@ jsb_override_delete(T* arg) } template -typename std::enable_if::value, T>::type* +typename std::enable_if::value, T>::type* jsb_override_new(Args &&... args) { //create object in the default way @@ -55,7 +55,7 @@ jsb_override_new(Args &&... args) } template -typename std::enable_if::value, void>::type +typename std::enable_if::value, void>::type jsb_override_delete(T* arg) { //create object in gfx way diff --git a/native/tools/bindings-generator b/native/tools/bindings-generator index 824baea31e..58b9c31496 160000 --- a/native/tools/bindings-generator +++ b/native/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 824baea31ef9890ec81c0d1a7a8738857ea2a849 +Subproject commit 58b9c3149626e742cfb311ed58dd8bc4ba177240