mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 11:05:24 +00:00
[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
#include <hilog/log.h>
|
||||
#endif
|
||||
|
||||
#ifndef RENDERER_BEGIN
|
||||
#define RENDERER_BEGIN namespace cocos2d { namespace renderer {
|
||||
#endif // RENDERER_BEGIN
|
||||
@@ -53,6 +57,8 @@
|
||||
#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#define RENDERER_LOGV(fmt, ...) __android_log_print(ANDROID_LOG_VERBOSE, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
#define RENDERER_LOGV(fmt, ...) ((void) OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, "HMG_LOG", " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#else
|
||||
#define RENDERER_LOGV(fmt, ...) printf("V/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
@@ -65,6 +71,11 @@
|
||||
#define RENDERER_LOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGW(fmt, ...) __android_log_print(ANDROID_LOG_WARN, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
#define RENDERER_LOGD(fmt, ...) OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, "HMG_LOG", " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGI(fmt, ...) OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "HMG_LOG", " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGW(fmt, ...) OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, "HMG_LOG", " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGE(fmt, ...) OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, "HMG_LOG", " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#else
|
||||
#define RENDERER_LOGD(fmt, ...) printf("D/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
#define RENDERER_LOGI(fmt, ...) printf("I/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__)
|
||||
|
@@ -613,7 +613,7 @@ void DeviceGraphics::initCaps()
|
||||
|
||||
GL_CHECK(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &_caps.maxTextureUnits));
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS ||CC_TARGET_PLATFORM == CC_PLATFORM_OPENHARMONY)
|
||||
// IDEA: how to get these infomations
|
||||
_caps.maxColorAttatchments = 1;
|
||||
_caps.maxDrawBuffers = 1;
|
||||
@@ -760,13 +760,12 @@ void DeviceGraphics::commitBlendStates()
|
||||
ENUM_CLASS_TO_GLENUM(_nextState->blendSrcAlpha),
|
||||
ENUM_CLASS_TO_GLENUM(_nextState->blendDstAlpha)));
|
||||
}
|
||||
}
|
||||
|
||||
if (_currentState->blendEq != _nextState->blendEq ||
|
||||
if (_currentState->blendEq != _nextState->blendEq ||
|
||||
_currentState->blendAlphaEq != _nextState->blendAlphaEq)
|
||||
{
|
||||
GL_CHECK(glBlendEquationSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendEq),
|
||||
ENUM_CLASS_TO_GLENUM(_nextState->blendAlphaEq)));
|
||||
{
|
||||
GL_CHECK(glBlendEquationSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendEq),
|
||||
ENUM_CLASS_TO_GLENUM(_nextState->blendAlphaEq)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user