Finsih rename

This commit is contained in:
halx99 2020-10-22 10:58:10 +08:00
parent 1c9a9806d8
commit b8834bc086
17 changed files with 47 additions and 46 deletions

View File

@ -28,7 +28,7 @@
cmake_minimum_required(VERSION 3.6)
project(EGNX)
project(cocos-re)
# set default minimum deployment target
# if(XCODE)

View File

@ -82,7 +82,7 @@
5. Notes
a. **The code sign required to run ios app on device, just change bundle identifier until the auto manage siging solved**
b. **EGNX only provide armv7,arm64,x86_64 prebuilt libraries for ios**
b. **cocos-re only provide armv7,arm64,x86_64 prebuilt libraries for ios**
### Pitfalls
* ThreadLocalStorage(TLS)

View File

@ -49,7 +49,7 @@
cd cocos-re
cmake -S . -B build -G "Visual Studio 16 2019" -A Win32
```
4. 之后就可以用vs打开```cocos-re/build/EGNX.sln```启动cpp-tests等测试工程了
4. 之后就可以用vs打开```cocos-re/build/cocos-re.sln```启动cpp-tests等测试工程了
#### Android
1. 安装 Android Studio 4.0或更高版本

View File

@ -96,7 +96,7 @@ endif()
function(use_cocos2dx_compile_define target)
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:COCOS2D_DEBUG=1>)
# !important engine-x not use double precision
# !important cocos-re not use double precision
# target_compile_definitions(${target} PUBLIC CP_USE_CGTYPES=0)
# target_compile_definitions(${target} PUBLIC CP_USE_DOUBLES=0)

View File

@ -59,10 +59,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif()
# The version number
set(EGNX_VERSION 1.0)
set(COCOSRE_VERSION 1.0)
if(NOT DEFINED EGNX_CORE_LIB)
set(EGNX_CORE_LIB cocos2d CACHE INTERNAL "The EGNX core lib name" )
if(NOT DEFINED COCOSRE_CORE_LIB)
set(COCOSRE_CORE_LIB cocos2d CACHE INTERNAL "The EGNX core lib name" )
endif()
if (NOT DEFINED CC_FORCE_USE_GLES)
@ -118,7 +118,7 @@ set(COCOS_SRC cocos2d.cpp
list(APPEND COCOS_SRC ${COCOS_HEADER})
add_library(${EGNX_CORE_LIB} ${COCOS_SRC})
add_library(${COCOSRE_CORE_LIB} ${COCOS_SRC})
# if (NOT APPLE)
# set_source_files_properties("audio/src/AudioEngineImpl.mm" PROPERTIES LANGUAGE CXX)
@ -126,16 +126,16 @@ add_library(${EGNX_CORE_LIB} ${COCOS_SRC})
# use external libs
add_subdirectory(${COCOS2DX_ROOT_PATH}/external ${ENGINE_BINARY_PATH}/external)
target_link_libraries(${EGNX_CORE_LIB} external)
target_link_libraries(${COCOSRE_CORE_LIB} external)
# add base macro define and compile options
use_cocos2dx_compile_define(${EGNX_CORE_LIB})
use_cocos2dx_compile_options(${EGNX_CORE_LIB})
use_cocos2dx_compile_define(${COCOSRE_CORE_LIB})
use_cocos2dx_compile_options(${COCOSRE_CORE_LIB})
# use all platform related system libs
use_cocos2dx_libs_depend(${EGNX_CORE_LIB})
use_cocos2dx_libs_depend(${COCOSRE_CORE_LIB})
target_include_directories(${EGNX_CORE_LIB}
target_include_directories(${COCOSRE_CORE_LIB}
PUBLIC ${COCOS2DX_ROOT_PATH}
PUBLIC ${COCOS2DX_ROOT_PATH}/external
PUBLIC ${COCOS2DX_ROOT_PATH}/extensions
@ -148,12 +148,12 @@ target_include_directories(${EGNX_CORE_LIB}
INTERFACE ${COCOS2DX_ROOT_PATH}/cocos/platform/${PLATFORM_FOLDER}
)
set_target_properties(${EGNX_CORE_LIB}
set_target_properties(${COCOSRE_CORE_LIB}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
VERSION "${EGNX_VERSION}"
VERSION "${COCOSRE_VERSION}"
FOLDER "Internal"
)
@ -163,13 +163,13 @@ set_target_properties(${EGNX_CORE_LIB}
# endif()
if(XCODE OR VS)
cocos_mark_code_files("${EGNX_CORE_LIB}")
cocos_mark_code_files("${COCOSRE_CORE_LIB}")
endif()
if(WINDOWS)
# precompiled header. Compilation time speedup ~4x.
target_sources(${EGNX_CORE_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp")
set_target_properties(${EGNX_CORE_LIB} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h")
target_sources(${COCOSRE_CORE_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp")
set_target_properties(${COCOSRE_CORE_LIB} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h")
# compile c as c++. needed for precompiled header
set_source_files_properties(${COCOS_SPINE_SRC} base/ccFPSImages.c PROPERTIES LANGUAGE CXX)
@ -186,5 +186,5 @@ add_subdirectory(${COCOS2DX_ROOT_PATH}/extensions ${ENGINE_BINARY_PATH}/extensio
#if(XCODE)
# # Later versions of Xcode clang want to compile C++17 with aligned allocation turned on and this is only supported on iOS 11.0+
# # TODO: Only turn this off if ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} < 11.0
# target_compile_options(${EGNX_CORE_LIB} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fno-aligned-allocation>)
# target_compile_options(${COCOSRE_CORE_LIB} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-fno-aligned-allocation>)
#endif()

View File

@ -71,7 +71,7 @@
#endif
// !FIXME: the previous version of cocos2d::log not thread safe
// since egnx make it multi-threading safe by default
// since cocos-re make it multi-threading safe by default
#if !defined(CC_LOG_MULTITHREAD)
#define CC_LOG_MULTITHREAD 1
#endif

View File

@ -71,7 +71,7 @@ namespace utils
* @param afterCaptured specify the callback function which will be invoked after the snapshot is done.
* @param filename specify a filename where the snapshot is stored. This parameter can be either an absolute path or a simple
* base filename ("hello.png" etc.), don't use a relative path containing directory names.("mydir/hello.png" etc.).
* @since v4.0 with egnx
* @since v4.0 with cocos-re
*/
CC_DLL void captureScreen(std::function<void(RefPtr<Image>)> imageCallback);
@ -79,7 +79,7 @@ namespace utils
* @param startNode specify the snapshot Node. It should be cocos2d::Scene
* @param scale
* @returns: return a Image, then can call saveToFile to save the image as "xxx.png or xxx.jpg".
* @since v4.0 with egnx
* @since v4.0 with cocos-re
*/
CC_DLL void captureNode(Node* startNode, std::function<void(RefPtr<Image>)> imageCallback, float scale = 1.0f);

View File

@ -31,9 +31,10 @@ THE SOFTWARE.
// 0x00 HI ME LO
// 00 03 08 00
#define EGNX_VERSION 0x00010000
#define COCOSRE_VERSION 0x00010000
#define COCOSRE_VERSION 0x00010000
#define COCOS2D_VERSION 0x00040000
#define ENGINEX_VERSION EGNX_VERSION
#define ENGINEX_VERSION COCOSRE_VERSION
//
// all cocos2d include files

View File

@ -491,7 +491,7 @@ namespace
}
/*
* Notes: PVR file Specification have many pixel formats, cocos2d-x-v2~v4 and egnx only support pvrtc and etc1
* Notes: PVR file Specification have many pixel formats, cocos2d-x-v2~v4 and cocos-re only support pvrtc and etc1
* see: https://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
*/
static backend::PixelFormat getDevicePVRPixelFormat(backend::PixelFormat format)

View File

@ -144,7 +144,7 @@ enum class PixelFormat : uint32_t
D24S8,
//!!!Please append depth stencil pixel format
/* the count of pixel format supported by egnx */
/* the count of pixel format supported by cocos-re */
COUNT,
NONE = 0xffff

View File

@ -170,7 +170,7 @@ PixelFormat RenderTargetMTL::getColorAttachmentPixelFormat(int index) const
}
PixelFormat RenderTargetMTL::getDepthAttachmentPixelFormat() const
{ // FIXME: egnx only support D24S8
{ // FIXME: cocos-re only support D24S8
if(bitmask::any(_flags, TargetBufferFlags::DEPTH_AND_STENCIL)) {
if(isDefaultRenderTarget() || !_depth)
return PixelFormat::D24S8;
@ -180,7 +180,7 @@ PixelFormat RenderTargetMTL::getDepthAttachmentPixelFormat() const
}
PixelFormat RenderTargetMTL::getStencilAttachmentPixelFormat() const
{ // FIXME: egnx only support D24S8
{ // FIXME: cocos-re only support D24S8
if(bitmask::any(_flags, TargetBufferFlags::DEPTH_AND_STENCIL)) {
if(isDefaultRenderTarget() || !_stencil)
return PixelFormat::D24S8;

View File

@ -32,12 +32,12 @@ function(setup_cocos_extension_config target_name)
"" ${ARGN} )
if(ANDROID)
target_link_libraries(${target_name} INTERFACE ${EGNX_CORE_LIB})
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:${EGNX_CORE_LIB},INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(${target_name} INTERFACE ${COCOSRE_CORE_LIB})
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:${COCOSRE_CORE_LIB},INTERFACE_INCLUDE_DIRECTORIES>)
# target_compile_definitions(${target_name} PRIVATE CP_USE_CGTYPES=0)
# target_compile_definitions(${target_name} PRIVATE CP_USE_DOUBLES=0)
else()
target_link_libraries(${target_name} ${EGNX_CORE_LIB})
target_link_libraries(${target_name} ${COCOSRE_CORE_LIB})
endif()
if(BUILD_SHARED_LIBS)

View File

@ -160,20 +160,20 @@ endif()
list(APPEND lua_bindings_files ${lua_bindings_headers})
set(EGNX_LUA_LIB luacocos2d CACHE INTERNAL "The EGNX lua bindings lib name" )
set(COCOSRE_LUA_LIB luacocos2d CACHE INTERNAL "The EGNX lua bindings lib name" )
add_library(${EGNX_LUA_LIB} STATIC ${lua_bindings_files})
target_link_libraries(${EGNX_LUA_LIB} ${EGNX_CORE_LIB})
add_dependencies(${EGNX_LUA_LIB} ${EGNX_CORE_LIB})
add_library(${COCOSRE_LUA_LIB} STATIC ${lua_bindings_files})
target_link_libraries(${COCOSRE_LUA_LIB} ${COCOSRE_CORE_LIB})
add_dependencies(${COCOSRE_LUA_LIB} ${COCOSRE_CORE_LIB})
if(BUILD_YASIO_LUA)
target_compile_definitions(${EGNX_LUA_LIB} PRIVATE CC_ENABLE_YASIO_LUA=1)
target_compile_definitions(${COCOSRE_LUA_LIB} PRIVATE CC_ENABLE_YASIO_LUA=1)
endif()
get_target_property(lua_ext_depend external CC_LUA_DEPEND)
target_link_libraries(${EGNX_LUA_LIB} ${lua_ext_depend})
target_link_libraries(${COCOSRE_LUA_LIB} ${lua_ext_depend})
target_include_directories(${EGNX_LUA_LIB}
target_include_directories(${COCOSRE_LUA_LIB}
PRIVATE manual/platform/android
PRIVATE manual/platform/android/jni
PRIVATE ${cocos_root}/extensions/spine/runtime/include
@ -183,12 +183,12 @@ target_include_directories(${EGNX_LUA_LIB}
)
if(WINDOWS)
target_compile_definitions(${EGNX_LUA_LIB} PUBLIC _USRLUASTATIC)
target_compile_definitions(${COCOSRE_LUA_LIB} PUBLIC _USRLUASTATIC)
endif()
target_compile_definitions(${EGNX_LUA_LIB} PUBLIC LUA_COMPAT_MODULE)
target_compile_definitions(${COCOSRE_LUA_LIB} PUBLIC LUA_COMPAT_MODULE)
set_target_properties(${EGNX_LUA_LIB}
set_target_properties(${COCOSRE_LUA_LIB}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
@ -196,6 +196,6 @@ set_target_properties(${EGNX_LUA_LIB}
)
if(XCODE OR VS)
cocos_mark_code_files("${EGNX_LUA_LIB}")
cocos_mark_code_files("${COCOSRE_LUA_LIB}")
endif()

View File

@ -136,7 +136,7 @@ else()
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${EGNX_CORE_LIB})
target_link_libraries(${APP_NAME} ${COCOSRE_CORE_LIB})
target_include_directories(${APP_NAME}
PRIVATE Classes
PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/audio/include/

View File

@ -134,7 +134,7 @@ else()
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${EGNX_CORE_LIB})
target_link_libraries(${APP_NAME} ${COCOSRE_CORE_LIB})
target_include_directories(${APP_NAME} PRIVATE Classes)

View File

@ -401,7 +401,7 @@ else()
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${EGNX_CORE_LIB})
target_link_libraries(${APP_NAME} ${COCOSRE_CORE_LIB})
target_include_directories(${APP_NAME}
PRIVATE Classes

View File

@ -123,7 +123,7 @@ else()
config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()
target_link_libraries(${APP_NAME} ${EGNX_CORE_LIB})
target_link_libraries(${APP_NAME} ${COCOSRE_CORE_LIB})
target_include_directories(${APP_NAME} PRIVATE Classes)