Amazing!!
Thank you very much.
I want to try the lower version again.
spine 3.8
I actually have the spine-cocos2dx runtime structured in such a way that it automatically builds the correct code depending on whether itās v3 or v4 of Cocos2d-x.
Each spine
folder has these files:
The v3 version is just the official release from the spine runtimes repository here
The CMakeLists.txt I use is this:
get_target_property(COCOS2D_X_VERSION cocos2d VERSION)
if (COCOS2D_X_VERSION VERSION_GREATER_EQUAL 4.0)
set(SPINE_COCOS_X_VERSION_DIR "v4")
else()
set(SPINE_COCOS_X_VERSION_DIR "v3")
endif()
set(SPINE_COCOS2DX_HEADER
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/AttachmentVertices.h
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonAnimation.h
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonBatch.h
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonRenderer.h
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonTwoColorBatch.h
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/spine-cocos2dx.h
)
set(SPINE_COCOS2DX_SRC
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/AttachmentVertices.cpp
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonAnimation.cpp
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonBatch.cpp
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonRenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/SkeletonTwoColorBatch.cpp
${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src/spine/spine-cocos2dx.cpp
)
list(APPEND SPINE_COCOS2DX_SRC ${SPINE_COCOS2DX_HEADER})
add_library(spine-cocos2dx-static STATIC ${SPINE_COCOS2DX_SRC})
set_target_properties(spine-cocos2dx-static
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_dependencies(spine-cocos2dx-static spine-static cocos2d)
target_link_libraries(spine-cocos2dx-static
PUBLIC spine-static
PRIVATE cocos2d
)
target_include_directories(spine-cocos2dx-static PUBLIC ${CMAKE_CURRENT_LIST_DIR}/${SPINE_COCOS_X_VERSION_DIR}/src)
This setup works for me, but Iām certain there are other ways to set this all up that would also work.
In your root CMakeLists.txt, just add the spine library this way:
# spine cocos2d-x specific
add_subdirectory(${GAME_ROOT_PATH}/external/spine-cocos2dx ${PROJECT_BINARY_DIR}/spine-cocos2dx)
get_target_property(spine_cocos2dx_INCLUDE_DIRS spine-cocos2dx-static INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${APP_NAME} PRIVATE ${spine_cocos2dx_INCLUDE_DIRS})
target_link_libraries(${APP_NAME} spine-cocos2dx-static)
Hi! Thank you very much for the release, itās great to see a new version! Iāve noticed that on the v4 branch on github the html5/javascript implementation disappeared, is it JS dropped in this version or will it come later?
Happy to contribute to keep things rolling !
JS is dropped in favor of Cocos Creator.
SHADER Shader shader
There are still many problems.
Sprite ----ok
Spine ādonāt work
CocoStuido ā donāt work
LayerColor . āI donāt know
I think Shader has a lot of problemsā¦
example:
This is the cause of shader failure (Dynamic parameters transfer).
_programState->setUniform(_locUTime, &u_Time, sizeof(u_Time));
If the shader(e.gā¦ update CC_Time) fails, comment out the āreset()ā, thatās fine, BUT Leak !
@18180920700 It would be easier if you copied and pasted code segments, rather than screenshots, and use the code formatting tags in the post to make it readable. Itās tough to figure out the context of what you just posted, so what is the old code, and what is the new code with the fixes?
It canāt be changed.
Itās called āwrite to deathā in Chinese.
iāve edited it
Where is that shader? I canāt find it in the Spine code. Is it your own shader?
Commenting out āReset()ā may not be the actual fix. Commenting it out could simply be covering up the actual problem, which is more likely to be related to that shader snippet you posted.
void SkeletonBatch::update (float delta)
{
//++++++++++++++++
_programState->setUniform(_locUTime, &u_Time, sizeof(u_Time));
//++++++++++++++++
//reset();
}
That does not exist in the cocos2d-x spine runtime, so Iām assuming itās your own shader.
Posting up that commenting reset()
is some fix for a very specific issue in your own custom code could mislead others into thinking that itās a problem with the run-time code, when it is in fact not.
No problem with the code. But there are problems with shaderās need for dynamic parameter transfer, such as shader animation, where parameters are not refresh. I looked at the example(ShaderTest initProgram.cpp). Update dynamic parameters like this:
Perhaps you should create a specific thread about your issue as this is a general thread about the RC0 release.
But I donāt know how to do it.:å§ēå“ē¬:
I donāt think thatās a special case. When you use Shader Animation you will encounter it.
Your issue isnāt about the RC0 in general so belongs in its own thread.