diff --git a/native/cocos/base/CCAutoreleasePool.cpp b/native/cocos/base/CCAutoreleasePool.cpp index c93ce1cf8e..ed2c63ee06 100644 --- a/native/cocos/base/CCAutoreleasePool.cpp +++ b/native/cocos/base/CCAutoreleasePool.cpp @@ -113,7 +113,7 @@ PoolManager* PoolManager::getInstance() { s_singleInstance = new (std::nothrow) PoolManager(); // Add the first auto release pool - new (std::nothrow) AutoreleasePool("cocos2d autorelease pool"); + new (std::nothrow) AutoreleasePool("autorelease pool"); } return s_singleInstance; } diff --git a/native/cocos/base/CCConfiguration.cpp b/native/cocos/base/CCConfiguration.cpp index a512e3b388..fa68e88fd6 100644 --- a/native/cocos/base/CCConfiguration.cpp +++ b/native/cocos/base/CCConfiguration.cpp @@ -64,21 +64,21 @@ bool Configuration::init() gatherGPUInfo(); #if CC_ENABLE_PROFILERS - _valueDict["cocos2d.x.compiled_with_profiler"] = Value(true); + _valueDict["compiled_with_profiler"] = Value(true); #else - _valueDict["cocos2d.x.compiled_with_profiler"] = Value(false); + _valueDict["compiled_with_profiler"] = Value(false); #endif #if CC_ENABLE_GL_STATE_CACHE == 0 - _valueDict["cocos2d.x.compiled_with_gl_state_cache"] = Value(false); + _valueDict["compiled_with_gl_state_cache"] = Value(false); #else - _valueDict["cocos2d.x.compiled_with_gl_state_cache"] = Value(true); + _valueDict["compiled_with_gl_state_cache"] = Value(true); #endif #if COCOS2D_DEBUG - _valueDict["cocos2d.x.build_type"] = Value("DEBUG"); + _valueDict["build_type"] = Value("DEBUG"); #else - _valueDict["cocos2d.x.build_type"] = Value("RELEASE"); + _valueDict["build_type"] = Value("RELEASE"); #endif return true; @@ -92,11 +92,11 @@ std::string Configuration::getInfo() const { // And Dump some warnings as well #if CC_ENABLE_PROFILERS - CCLOG("cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from ccConfig.h)\n"); + CCLOG("**** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from ccConfig.h)\n"); #endif #if CC_ENABLE_GL_STATE_CACHE == 0 - CCLOG("cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from ccConfig.h)\n"); + CCLOG("**** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from ccConfig.h)\n"); #endif // Dump @@ -357,24 +357,6 @@ void Configuration::loadConfigFile(const std::string& filename) CCLOG("Key already present. Ignoring '%s'",dataMapIter->first.c_str()); } - //light info - std::string name = "cocos2d.x.3d.max_dir_light_in_shader"; - if (_valueDict.find(name) != _valueDict.end()) - _maxDirLightInShader = _valueDict[name].asInt(); - else - _valueDict[name] = Value(_maxDirLightInShader); - - name = "cocos2d.x.3d.max_point_light_in_shader"; - if (_valueDict.find(name) != _valueDict.end()) - _maxPointLightInShader = _valueDict[name].asInt(); - else - _valueDict[name] = Value(_maxPointLightInShader); - - name = "cocos2d.x.3d.max_spot_light_in_shader"; - if (_valueDict.find(name) != _valueDict.end()) - _maxSpotLightInShader = _valueDict[name].asInt(); - else - _valueDict[name] = Value(_maxSpotLightInShader); //cjh Director::getInstance()->getEventDispatcher()->dispatchEvent(_loadedEvent); } diff --git a/native/cocos/base/CCLog.cpp b/native/cocos/base/CCLog.cpp index d5f61d9b54..dc9130fb19 100644 --- a/native/cocos/base/CCLog.cpp +++ b/native/cocos/base/CCLog.cpp @@ -72,7 +72,7 @@ namespace #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #include - __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf); + __android_log_print(ANDROID_LOG_DEBUG, "debug info", "%s", buf); #elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 int pos = 0; int len = strlen(buf); diff --git a/native/cocos/base/CCRenderTexture.cpp b/native/cocos/base/CCRenderTexture.cpp index 158dbb2d3d..e7cbf7bf7e 100644 --- a/native/cocos/base/CCRenderTexture.cpp +++ b/native/cocos/base/CCRenderTexture.cpp @@ -210,14 +210,14 @@ bool RenderTexture::parseVertexAttribs() _vertAttributePositionLocation = glGetAttribLocation(_program, "a_position"); if (-1 == _vertAttributePositionLocation) { - CCLOG("Cocos2d: %s: can not find vertex attribute of a_position", __FUNCTION__); + CCLOG("RenderTexture: %s: can not find vertex attribute of a_position", __FUNCTION__); return false; } _vertAttributeTextureCoordLocation = glGetAttribLocation(_program, "a_texCoord"); if (-1 == _vertAttributeTextureCoordLocation) { - CCLOG("Cocos2d: %s: can not find vertex attribute of a_texCoord", __FUNCTION__); + CCLOG("RenderTexture: %s: can not find vertex attribute of a_texCoord", __FUNCTION__); return false; } @@ -229,7 +229,7 @@ bool RenderTexture::parseUniforms() _fragUniformTextureLocation = glGetUniformLocation(_program, "u_texture"); if (-1 == _fragUniformTextureLocation) { - CCLOG("Cocos2d: %s: can not find uniform location of u_texture", __FUNCTION__); + CCLOG("RenderTexture: %s: can not find uniform location of u_texture", __FUNCTION__); return false; } else @@ -246,8 +246,8 @@ bool RenderTexture::compileShader(GLuint& shader, GLenum type, const GLchar* sou glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (! status) { - CCLOG("cocos2d: ERROR: Failed to compile shader:\n%s", source); - CCLOG("cocos2d: %s", logForOpenGLShader(shader).c_str()); + CCLOG("RenderTexture: ERROR: Failed to compile shader:\n%s", source); + CCLOG("RenderTexture: %s", logForOpenGLShader(shader).c_str()); return false; } @@ -276,7 +276,7 @@ bool RenderTexture::initProgram() )"; if (! compileShader(vertShader, GL_VERTEX_SHADER, vert)) { - CCLOG("cocos2d: ERROR: Failed to compile vertex shader"); + CCLOG("RenderTexture: ERROR: Failed to compile vertex shader"); return false; } @@ -294,7 +294,7 @@ bool RenderTexture::initProgram() )"; if (! compileShader(fragShader, GL_FRAGMENT_SHADER, frag)) { - CCLOG("cocos2d: ERROR: Failed to compile fragment shader"); + CCLOG("RenderTexture: ERROR: Failed to compile fragment shader"); glDeleteShader(vertShader); return false; } @@ -318,7 +318,7 @@ bool RenderTexture::initProgram() glGetProgramiv(_program, GL_LINK_STATUS, &status); if (GL_FALSE == status) { - CCLOG("cocos2d: ERROR: %s: failed to link program ", __FUNCTION__); + CCLOG("RenderTexture: ERROR: %s: failed to link program ", __FUNCTION__); glDeleteProgram(_program); _program = 0; return false; @@ -485,7 +485,7 @@ void RenderTexture::initFramebuffer() if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - CCLOG("Cocos2d: %s : frame buffer is not complete.", __FUNCTION__); + CCLOG("RenderTexture: %s : frame buffer is not complete.", __FUNCTION__); glBindFramebuffer(GL_FRAMEBUFFER, _mainFBO); } diff --git a/native/cocos/base/ZipUtils.cpp b/native/cocos/base/ZipUtils.cpp index ae6fbf1985..7607849f3f 100644 --- a/native/cocos/base/ZipUtils.cpp +++ b/native/cocos/base/ZipUtils.cpp @@ -64,10 +64,10 @@ inline void ZipUtils::decodeEncodedPvr(unsigned int *data, ssize_t len) // check if key was set // make sure to call caw_setkey_part() for all 4 key parts - CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, "Cocos2D: CCZ file is encrypted but key part 0 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, "Cocos2D: CCZ file is encrypted but key part 1 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, "Cocos2D: CCZ file is encrypted but key part 2 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, "Cocos2D: CCZ file is encrypted but key part 3 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, "ZipUtils: CCZ file is encrypted but key part 0 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, "ZipUtils: CCZ file is encrypted but key part 1 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, "ZipUtils: CCZ file is encrypted but key part 2 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, "ZipUtils: CCZ file is encrypted but key part 3 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); // create long key if(!s_bEncryptionKeyIsValid) @@ -193,7 +193,7 @@ int ZipUtils::inflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigne /* not enough memory, ouch */ if (! *out ) { - CCLOG("cocos2d: ZipUtils: realloc failed"); + CCLOG("ZipUtils: realloc failed"); inflateEnd(&d_stream); return Z_MEM_ERROR; } @@ -217,19 +217,19 @@ ssize_t ZipUtils::inflateMemoryWithHint(unsigned char *in, ssize_t inLength, uns if (err != Z_OK || *out == nullptr) { if (err == Z_MEM_ERROR) { - CCLOG("cocos2d: ZipUtils: Out of memory while decompressing map data!"); + CCLOG("ZipUtils: Out of memory while decompressing map data!"); } else if (err == Z_VERSION_ERROR) { - CCLOG("cocos2d: ZipUtils: Incompatible zlib version!"); + CCLOG("ZipUtils: Incompatible zlib version!"); } else if (err == Z_DATA_ERROR) { - CCLOG("cocos2d: ZipUtils: Incorrect zlib compressed data!"); + CCLOG("ZipUtils: Incorrect zlib compressed data!"); } else { - CCLOG("cocos2d: ZipUtils: Unknown error while decompressing map data!"); + CCLOG("ZipUtils: Unknown error while decompressing map data!"); } if(*out) { @@ -258,7 +258,7 @@ int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) gzFile inFile = gzopen(FileUtils::getInstance()->getSuitableFOpen(path).c_str(), "rb"); if( inFile == nullptr ) { - CCLOG("cocos2d: ZipUtils: error open gzip file: %s", path); + CCLOG("ZipUtils: error open gzip file: %s", path); return -1; } @@ -269,7 +269,7 @@ int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) *out = (unsigned char*)malloc( bufferSize ); if( ! out ) { - CCLOG("cocos2d: ZipUtils: out of memory"); + CCLOG("ZipUtils: out of memory"); return -1; } @@ -277,7 +277,7 @@ int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) len = gzread(inFile, *out + offset, bufferSize); if (len < 0) { - CCLOG("cocos2d: ZipUtils: error in gzread"); + CCLOG("ZipUtils: error in gzread"); free( *out ); *out = nullptr; return -1; @@ -301,7 +301,7 @@ int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) if( ! tmp ) { - CCLOG("cocos2d: ZipUtils: out of memory"); + CCLOG("ZipUtils: out of memory"); free( *out ); *out = nullptr; return -1; @@ -312,7 +312,7 @@ int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) if (gzclose(inFile) != Z_OK) { - CCLOG("cocos2d: ZipUtils: gzclose failed"); + CCLOG("ZipUtils: gzclose failed"); } return offset; @@ -325,7 +325,7 @@ bool ZipUtils::isCCZFile(const char *path) if (compressedData.isNull()) { - CCLOG("cocos2d: ZipUtils: loading file failed"); + CCLOG("ZipUtils: loading file failed"); return false; } @@ -351,7 +351,7 @@ bool ZipUtils::isGZipFile(const char *path) if (compressedData.isNull()) { - CCLOG("cocos2d: ZipUtils: loading file failed"); + CCLOG("ZipUtils: loading file failed"); return false; } @@ -380,14 +380,14 @@ int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, u unsigned int version = CC_SWAP_INT16_BIG_TO_HOST( header->version ); if( version > 2 ) { - CCLOG("cocos2d: Unsupported CCZ header format"); + CCLOG("Unsupported CCZ header format"); return -1; } // verify compression format if( CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB ) { - CCLOG("cocos2d: CCZ Unsupported compression method"); + CCLOG("CCZ Unsupported compression method"); return -1; } } @@ -400,14 +400,14 @@ int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, u unsigned int version = CC_SWAP_INT16_BIG_TO_HOST( header->version ); if( version > 0 ) { - CCLOG("cocos2d: Unsupported CCZ header format"); + CCLOG("Unsupported CCZ header format"); return -1; } // verify compression format if( CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB ) { - CCLOG("cocos2d: CCZ Unsupported compression method"); + CCLOG("CCZ Unsupported compression method"); return -1; } @@ -424,14 +424,14 @@ int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, u if(calculated != required) { - CCLOG("cocos2d: Can't decrypt image file. Is the decryption key valid?"); + CCLOG("Can't decrypt image file. Is the decryption key valid?"); return -1; } #endif } else { - CCLOG("cocos2d: Invalid CCZ file"); + CCLOG("Invalid CCZ file"); return -1; } @@ -440,7 +440,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, u *out = (unsigned char*)malloc( len ); if(! *out ) { - CCLOG("cocos2d: CCZ: Failed to allocate memory for texture"); + CCLOG("CCZ: Failed to allocate memory for texture"); return -1; } @@ -450,7 +450,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, u if( ret != Z_OK ) { - CCLOG("cocos2d: CCZ: Failed to uncompress data"); + CCLOG("CCZ: Failed to uncompress data"); free( *out ); *out = nullptr; return -1; @@ -468,7 +468,7 @@ int ZipUtils::inflateCCZFile(const char *path, unsigned char **out) if (compressedData.isNull()) { - CCLOG("cocos2d: Error loading CCZ compressed file"); + CCLOG("Error loading CCZ compressed file"); return -1; } @@ -477,8 +477,8 @@ int ZipUtils::inflateCCZFile(const char *path, unsigned char **out) void ZipUtils::setPvrEncryptionKeyPart(int index, unsigned int value) { - CCASSERT(index >= 0, "Cocos2d: key part index cannot be less than 0"); - CCASSERT(index <= 3, "Cocos2d: key part index cannot be greater than 3"); + CCASSERT(index >= 0, "key part index cannot be less than 0"); + CCASSERT(index <= 3, "key part index cannot be greater than 3"); if(s_uEncryptedPvrKeyParts[index] != value) { diff --git a/native/cocos/base/ccCArray.cpp b/native/cocos/base/ccCArray.cpp index 4d4077fc4e..dcbd3fdd09 100644 --- a/native/cocos/base/ccCArray.cpp +++ b/native/cocos/base/ccCArray.cpp @@ -72,7 +72,7 @@ void ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra) { while (arr->max < arr->num + extra) { - CCLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].", + CCLOGINFO("ccCArray: resizing ccArray capacity from [%d] to [%d].", static_cast(arr->max), static_cast(arr->max*2)); diff --git a/native/cocos/platform/CCImage.cpp b/native/cocos/platform/CCImage.cpp index babbc88195..0d3059eaa8 100644 --- a/native/cocos/platform/CCImage.cpp +++ b/native/cocos/platform/CCImage.cpp @@ -598,7 +598,7 @@ bool Image::initWithImageData(const unsigned char * data, ssize_t dataLen) } else { - CCLOG("cocos2d: unsupported image format!"); + CCLOG("Image: unsupported image format!"); } free(tgaData); @@ -1304,26 +1304,26 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false; if (flipped) { - CCLOG("cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool"); + CCLOG("initWithPVRv2Data: WARNING: Image is flipped. Regenerate it using PVRTexTool"); } if (! configuration->supportsNPOT() && (static_cast(header->width) != utils::nextPOT(header->width) || static_cast(header->height) != utils::nextPOT(header->height))) { - CCLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height); + CCLOG("initWithPVRv2Data: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height); return false; } if (!testFormatForPvr2TCSupport(formatFlags)) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); + CCLOG("initWithPVRv2Data: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } if (v2_pixel_formathash.find(formatFlags) == v2_pixel_formathash.end()) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); + CCLOG("initWithPVRv2Data: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } @@ -1331,7 +1331,7 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) if (it == getPixelFormatInfoMap().end()) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); + CCLOG("initWithPVRv2Data: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant", (int)formatFlags); return false; } @@ -1372,7 +1372,7 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) case PVR2TexturePixelFormat::BGRA8888: if (Configuration::getInstance()->supportsBGRA8888() == false) { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + CCLOG("initWithPVRv2Data: Image. BGRA8888 not supported on this device"); return false; } default: @@ -1424,7 +1424,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) // validate version if (CC_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203) { - CCLOG("cocos2d: WARNING: pvr file version mismatch"); + CCLOG("initWithPVRv3Data: WARNING: pvr file version mismatch"); return false; } @@ -1433,7 +1433,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) if (!testFormatForPvr3TCSupport(pixelFormat)) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", + CCLOG("initWithPVRv3Data: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", static_cast(pixelFormat)); return false; } @@ -1441,7 +1441,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) if (v3_pixel_formathash.find(pixelFormat) == v3_pixel_formathash.end()) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", + CCLOG("initWithPVRv3Data: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", static_cast(pixelFormat)); return false; } @@ -1450,7 +1450,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) if (it == getPixelFormatInfoMap().end()) { - CCLOG("cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", + CCLOG("initWithPVRv3Data: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant", static_cast(pixelFormat)); return false; } @@ -1512,7 +1512,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) case PVR3TexturePixelFormat::BGRA8888: if (! Configuration::getInstance()->supportsBGRA8888()) { - CCLOG("cocos2d: Image. BGRA8888 not supported on this device"); + CCLOG("initWithPVRv3Data: Image. BGRA8888 not supported on this device"); return false; } default: @@ -1828,7 +1828,7 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB) //only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data if (isCompressed() || (_renderFormat != Image::PixelFormat::RGB888 && _renderFormat != Image::PixelFormat::RGBA8888)) { - CCLOG("cocos2d: Image: saveToFile is only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data for now"); + CCLOG("saveToFile: Image: saveToFile is only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data for now"); return false; } @@ -1844,7 +1844,7 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB) } else { - CCLOG("cocos2d: Image: saveToFile no support file extension(only .png or .jpg) for file: %s", filename.c_str()); + CCLOG("saveToFile: Image: saveToFile no support file extension(only .png or .jpg) for file: %s", filename.c_str()); return false; } } diff --git a/native/cocos/platform/android/CCPlatformDefine-android.h b/native/cocos/platform/android/CCPlatformDefine-android.h index 49abace9cb..3183f394c5 100644 --- a/native/cocos/platform/android/CCPlatformDefine-android.h +++ b/native/cocos/platform/android/CCPlatformDefine-android.h @@ -37,7 +37,7 @@ THE SOFTWARE. #define CC_NO_MESSAGE_PSEUDOASSERT(cond) \ if (!(cond)) { \ __android_log_print(ANDROID_LOG_ERROR, \ - "cocos2d-x assert", \ + "assert", \ "%s function:%s line:%d", \ __FILE__, __FUNCTION__, __LINE__); \ } @@ -45,7 +45,7 @@ THE SOFTWARE. #define CC_MESSAGE_PSEUDOASSERT(cond, msg) \ if (!(cond)) { \ __android_log_print(ANDROID_LOG_ERROR, \ - "cocos2d-x assert", \ + "assert", \ "file:%s function:%s line:%d, %s", \ __FILE__, __FUNCTION__, __LINE__, msg); \ } diff --git a/native/cocos/platform/android/jni/JniImp.cpp b/native/cocos/platform/android/jni/JniImp.cpp index f4058d5dd7..156a4c4af1 100644 --- a/native/cocos/platform/android/jni/JniImp.cpp +++ b/native/cocos/platform/android/jni/JniImp.cpp @@ -163,7 +163,7 @@ extern "C" g_isGameFinished = false; ccInvalidateStateCache(); std::string defaultResourcePath = JniHelper::jstring2string(jDefaultResourcePath); - LOGD("CocosRenderer.nativeInit: %d, %d, %s", w, h, defaultResourcePath.c_str()); + LOGD("nativeInit: %d, %d, %s", w, h, defaultResourcePath.c_str()); if (!defaultResourcePath.empty()) diff --git a/native/cocos/scripting/js-bindings/manual/JavaScriptJavaBridge.cpp b/native/cocos/scripting/js-bindings/manual/JavaScriptJavaBridge.cpp index e98647e649..03225cc1cf 100644 --- a/native/cocos/scripting/js-bindings/manual/JavaScriptJavaBridge.cpp +++ b/native/cocos/scripting/js-bindings/manual/JavaScriptJavaBridge.cpp @@ -52,7 +52,7 @@ JNIEXPORT jint JNICALL JNI_JSJAVABRIDGE(evalString) std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(env, value, &strFlag); if (!strFlag) { - CCLOG("Cocos2dxJavaScriptJavaBridge_evalString error, invalid string code"); + CCLOG("JavaScriptJavaBridge_evalString error, invalid string code"); return 0; } se::ScriptEngine::getInstance()->evalString(strValue.c_str()); @@ -583,7 +583,7 @@ static bool JavaScriptJavaBridge_callStaticMethod(se::State& s) int errorCode = call.getErrorCode(); if (!ok || errorCode < 0) { - SE_REPORT_ERROR("js_cocos2dx_JSJavaBridge : call result code: %d", errorCode); + SE_REPORT_ERROR("js_JSJavaBridge : call result code: %d", errorCode); return false; } diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp index 561616ec21..81d43ee741 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp @@ -196,7 +196,7 @@ static bool js_cocos2dx_extension_initRemoteImage(se::State& s) } else { - CCLOGERROR("js_cocos2dx_extension_loadRemoteImageOn: Failed to initWithImage."); + CCLOGERROR("js_extension_loadRemoteImageOn: Failed to initWithImage."); } } CC_SAFE_RELEASE_NULL(image); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp index a905da9379..10249caa1f 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp @@ -368,33 +368,33 @@ static bool register_sys_localStorage(se::Object* obj) } #define BIND_PROP_WITH_TYPE__CONV_FUNC__RETURN(cls, property, type, convertFunc, returnFunc) \ -static bool js_cocos2dx_##cls_set_##property(se::State& s) \ +static bool js_##cls_set_##property(se::State& s) \ { \ cocos2d::cls* cobj = (cocos2d::cls*)s.nativeThisObject(); \ - SE_PRECONDITION2(cobj, false, "js_cocos2dx_#cls_set_#property : Invalid Native Object"); \ + SE_PRECONDITION2(cobj, false, "js_#cls_set_#property : Invalid Native Object"); \ const auto& args = s.args(); \ size_t argc = args.size(); \ bool ok = true; \ if (argc == 1) { \ type arg0; \ ok &= convertFunc(args[0], &arg0); \ - SE_PRECONDITION2(ok, false, "js_cocos2dx_#cls_set_#property : Error processing arguments"); \ + SE_PRECONDITION2(ok, false, "js_#cls_set_#property : Error processing arguments"); \ cobj->set_##property(arg0); \ return true; \ } \ SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); \ return false; \ } \ -SE_BIND_PROP_SET(js_cocos2dx_##cls_set_##property) \ +SE_BIND_PROP_SET(js_##cls_set_##property) \ \ -static bool js_cocos2dx_##cls_get_##property(se::State& s) \ +static bool js_##cls_get_##property(se::State& s) \ { \ cocos2d::cls* cobj = (cocos2d::cls*)s.nativeThisObject(); \ - SE_PRECONDITION2(cobj, false, "js_cocos2dx_#cls_get_#property : Invalid Native Object"); \ + SE_PRECONDITION2(cobj, false, "js_#cls_get_#property : Invalid Native Object"); \ s.rval().returnFunc(cobj->_##property); \ return true; \ } \ -SE_BIND_PROP_GET(js_cocos2dx_##cls_get_##property) +SE_BIND_PROP_GET(js_##cls_get_##property) BIND_PROP_WITH_TYPE__CONV_FUNC__RETURN(CanvasRenderingContext2D, _width, float, seval_to_float, setFloat) BIND_PROP_WITH_TYPE__CONV_FUNC__RETURN(CanvasRenderingContext2D, _height, float, seval_to_float, setFloat) @@ -409,13 +409,13 @@ BIND_PROP_WITH_TYPE__CONV_FUNC__RETURN(CanvasRenderingContext2D, globalComposite #define _SE_DEFINE_PROP(cls, property) \ - __jsb_cocos2d_##cls##_proto->defineProperty(#property, _SE(js_cocos2dx_##cls_get_##property), _SE(js_cocos2dx_##cls_set_##property)); + __jsb_cocos2d_##cls##_proto->defineProperty(#property, _SE(js_##cls_get_##property), _SE(js_##cls_set_##property)); //IDEA: move to auto bindings. -static bool js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback(se::State& s) +static bool js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback(se::State& s) { cocos2d::CanvasRenderingContext2D* cobj = (cocos2d::CanvasRenderingContext2D*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback : Invalid Native Object"); + SE_PRECONDITION2(cobj, false, "js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback : Invalid Native Object"); const auto& args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; @@ -451,14 +451,14 @@ static bool js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback( } } while(false) ; - SE_PRECONDITION2(ok, false, "js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback : Error processing arguments"); + SE_PRECONDITION2(ok, false, "js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback : Error processing arguments"); cobj->setCanvasBufferUpdatedCallback(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); return false; } -SE_BIND_FUNC(js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback) +SE_BIND_FUNC(js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback) static se::Object* __deviceMotionObject = nullptr; static bool JSB_getDeviceMotionValue(se::State& s) @@ -524,7 +524,7 @@ static bool register_canvas_context2d(se::Object* obj) _SE_DEFINE_PROP(CanvasRenderingContext2D, strokeStyle) _SE_DEFINE_PROP(CanvasRenderingContext2D, globalCompositeOperation) - __jsb_cocos2d_CanvasRenderingContext2D_proto->defineFunction("_setCanvasBufferUpdatedCallback", _SE(js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback)); + __jsb_cocos2d_CanvasRenderingContext2D_proto->defineFunction("_setCanvasBufferUpdatedCallback", _SE(js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback)); se::ScriptEngine::getInstance()->clearException(); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp index 09bebbf7b1..a89a258850 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp @@ -32,7 +32,7 @@ static bool js_cocos2dx_network_Downloader_createDownloadFileTask(se::State &s) { cocos2d::network::Downloader *cobj = (cocos2d::network::Downloader *) s.nativeThisObject(); SE_PRECONDITION2(cobj, false, - "js_cocos2dx_network_Downloader_createDownloadFileTask : Invalid Native Object"); + "js_network_Downloader_createDownloadFileTask : Invalid Native Object"); const auto &args = s.args(); size_t argc = args.size(); CC_UNUSED bool ok = true; @@ -42,12 +42,12 @@ static bool js_cocos2dx_network_Downloader_createDownloadFileTask(se::State &s) ok &= seval_to_std_string(args[0], &arg0); ok &= seval_to_std_string(args[1], &arg1); SE_PRECONDITION2(ok, false, - "js_cocos2dx_network_Downloader_createDownloadFileTask : Error processing arguments"); + "js_network_Downloader_createDownloadFileTask : Error processing arguments"); std::shared_ptr result = cobj->createDownloadFileTask( arg0, arg1); ok &= DownloadTask_to_seval(*result, &s.rval()); SE_PRECONDITION2(ok, false, - "js_cocos2dx_network_Downloader_createDownloadFileTask : Error processing arguments"); + "js_network_Downloader_createDownloadFileTask : Error processing arguments"); return true; } if (argc == 3) { @@ -58,12 +58,12 @@ static bool js_cocos2dx_network_Downloader_createDownloadFileTask(se::State &s) ok &= seval_to_std_string(args[1], &arg1); ok &= seval_to_std_string(args[2], &arg2); SE_PRECONDITION2(ok, false, - "js_cocos2dx_network_Downloader_createDownloadFileTask : Error processing arguments"); + "js_network_Downloader_createDownloadFileTask : Error processing arguments"); std::shared_ptr result = cobj->createDownloadFileTask( arg0, arg1, arg2); ok &= DownloadTask_to_seval(*result, &s.rval()); SE_PRECONDITION2(ok, false, - "js_cocos2dx_network_Downloader_createDownloadFileTask : Error processing arguments"); + "js_network_Downloader_createDownloadFileTask : Error processing arguments"); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int) argc, 3);