Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.8.5] Reduce package size for spine module #17783

Merged
merged 82 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
53844c9
AOT test
dumganhar Oct 23, 2024
e150e61
Add size_type, value_type for spine::Vector
dumganhar Oct 25, 2024
befaa70
spine::Vector getX/Y should be const functions.
dumganhar Oct 25, 2024
83a596e
spine::Vector getX/Y should be const functions.
dumganhar Oct 25, 2024
f8ffec0
cleanup spine-wasm/CMakeLists.txt
dumganhar Oct 25, 2024
ccb8ddf
Refactor spine-type-export.cpp, remove unused apply binding.
dumganhar Oct 25, 2024
a46a5dd
Remove extra spine:: namespace in SkeletonData.h
dumganhar Oct 25, 2024
93d649b
Update spine-type-export.cpp
dumganhar Oct 25, 2024
31445e1
Don't using namespace in header files.
dumganhar Oct 23, 2024
b7f87e5
Update spine-wasm/CMakeLists.txt
dumganhar Oct 25, 2024
d5f1d86
Use select_overload
dumganhar Oct 25, 2024
09d6f22
Bind spine::String, treat it as std::string.
dumganhar Oct 23, 2024
96d95a8
Fix setFrame binding
dumganhar Oct 25, 2024
4d613ae
fix spine::String binding
dumganhar Oct 25, 2024
de446fd
Move implementation of spine::String to .cpp
dumganhar Oct 25, 2024
564e677
opt start.
dumganhar Oct 25, 2024
c6838d8
disable RTTI
dumganhar Oct 25, 2024
aa9f33e
update sp[ine-define.ts, don't hack String.
dumganhar Oct 25, 2024
0a5d159
embind property
dumganhar Oct 28, 2024
e6a72db
Temp
dumganhar Oct 28, 2024
4f8aa6c
Add ENABLE_JSON_PARSER configuration
dumganhar Oct 28, 2024
88e1e61
Update
dumganhar Oct 28, 2024
6fd4e42
Update
dumganhar Oct 28, 2024
5b59d17
Update
dumganhar Oct 28, 2024
bf60723
Add ENABLE_BINARY_PARSER and fix the binding of addAnimationWith
dumganhar Oct 29, 2024
c823316
Check whether skin name is valid.
dumganhar Oct 29, 2024
bf87c3d
Use malloc/free to implement WasmSpineExtension.
dumganhar Oct 29, 2024
865a444
update spine_new
dumganhar Oct 29, 2024
e130811
virtual function, isActive, setActive
dumganhar Oct 29, 2024
22b7e19
fix a typo in spine.-core.d.ts
dumganhar Oct 29, 2024
420e513
Use c calloc, malloc, free directly in wasmSpineExtension.cpp
dumganhar Oct 29, 2024
1a9774e
Update, use malloc
dumganhar Oct 29, 2024
6bb7eed
Update CMakeLists.txt
dumganhar Oct 29, 2024
782766d
Update getPropertyId binding, fix AttachmentTimeline::getFrames binding
dumganhar Oct 29, 2024
7a35797
Remove unused virtual getPropertyId in CurveTimeline.h
dumganhar Oct 29, 2024
500e72e
Revert SkeletonJson.h/.cpp
dumganhar Oct 29, 2024
0dcd70d
Revert override -> virtual for spine runtime, it may support lower ve…
dumganhar Oct 29, 2024
fccaca2
Fix property binding by mistake.
dumganhar Oct 29, 2024
08cb4ab
Using spine::Vector instead.
dumganhar Oct 29, 2024
f228aad
Fix binding of apply.
dumganhar Oct 29, 2024
36f0534
Remove unused code
dumganhar Oct 29, 2024
673f0f3
Cleanup
dumganhar Oct 29, 2024
d89106e
Cleanup
dumganhar Oct 29, 2024
07f9547
Revert
dumganhar Oct 29, 2024
75e95a6
cleanup spine-define.ts
dumganhar Oct 29, 2024
f3cfe22
Update external
dumganhar Oct 29, 2024
3c48bf6
Fix compile errors.
dumganhar Oct 29, 2024
ed2bd99
Don't use std types.
dumganhar Oct 30, 2024
bd721e0
Update CMAKE
dumganhar Oct 30, 2024
a5431a0
Update CMakeLists.header.txt
dumganhar Oct 30, 2024
31d7b7c
Update property binding, reduce property binding size.
dumganhar Oct 30, 2024
5348e7b
inline MathUtil
dumganhar Oct 30, 2024
889e8b9
Add missing include
dumganhar Oct 30, 2024
d0b5f45
[CI] interface-check use the latest spine wasm
dumganhar Oct 30, 2024
62f614b
Update ci
dumganhar Oct 30, 2024
4c0b57d
cleanup
dumganhar Oct 30, 2024
dc9a5f4
Cleanup
dumganhar Oct 30, 2024
89b3dba
Add spine::Json test.
dumganhar Oct 30, 2024
b6cfcdd
update cmake
dumganhar Oct 30, 2024
d1b9b68
More inline and code refactors
dumganhar Oct 30, 2024
6ad4a43
Merge branch '385-spine-aot-2' of github.com:dumganhar/cocos-engine i…
dumganhar Oct 31, 2024
1b4d2a0
Add -Oz support
dumganhar Oct 31, 2024
a61c834
Remove inline for Vector::clear
dumganhar Oct 31, 2024
ff56150
Refactor WasmSpineExtension
dumganhar Oct 31, 2024
7ae611d
more inlines
dumganhar Oct 31, 2024
0de18c9
getUVs return reference, so don't copy it.
dumganhar Oct 31, 2024
1fa6629
Refactor logic in Skeleton.cpp, avoid some invocations.
dumganhar Oct 31, 2024
0a2a3a1
Tweak Skin.cpp
dumganhar Oct 31, 2024
cf2e54d
Using ::abs
dumganhar Oct 31, 2024
66a73f6
More inline for Vector getter.
dumganhar Oct 31, 2024
66b3e15
Update CMakeLists.txt
dumganhar Oct 31, 2024
b149905
revert
dumganhar Oct 31, 2024
78e1435
Optimize Vector<SpineDebugShape>
dumganhar Nov 1, 2024
5c94b34
Add MathUtil::ipow which is depended by Json.cpp.
dumganhar Nov 1, 2024
01fdec9
Fix asmjs build
dumganhar Nov 1, 2024
2aed5fa
Fix missing #include <cstdint>
dumganhar Nov 1, 2024
564d356
Update CMakeLists.txt
dumganhar Nov 1, 2024
1bcd914
Update Extension.cpp
dumganhar Nov 1, 2024
c6439cc
Revert wasmSpineExtension.cpp, return nullptr if size is zero.
dumganhar Nov 5, 2024
492ae95
Fix memory leak in _realloc if size is zero.
dumganhar Nov 5, 2024
bd05c2b
Update external
dumganhar Nov 5, 2024
9247851
Merge branch 'v3.8.5' of https://github.com/cocos/cocos-engine into 3…
dumganhar Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ENABLE_JSON_PARSER configuration
  • Loading branch information
dumganhar committed Oct 28, 2024
commit 4f8aa6c4f5b4a798517cec19ee8b6b99800aeafd
6 changes: 4 additions & 2 deletions native/cocos/editor-support/spine-wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.8)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(BUILD_WASM 1)
set(ENABLE_JSON_PARSER 1)

set(CMAKE_BUILD_TYPE "MinSizeRel")
# set(CMAKE_BUILD_TYPE "Debug")
Expand All @@ -20,13 +21,14 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(APP_NAME "spine" CACHE STRING "Project Name")
project(${APP_NAME}_wasm)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -DENABLE_JSON_PARSER=${ENABLE_JSON_PARSER}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -DENABLE_JSON_PARSER=${ENABLE_JSON_PARSER}")

message(">>> --------------------------------------------------------------")
message(">>> Current directory: ${CMAKE_CURRENT_LIST_DIR}")
message(">>> CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(">>> ENABLE_CLOSURE_COMPILER: ${ENABLE_CLOSURE_COMPILER}")
message(">>> ENABLE_JSON_PARSER: ${ENABLE_JSON_PARSER}")
message(">>> --------------------------------------------------------------")

include_directories(${CMAKE_CURRENT_LIST_DIR}/..)
Expand Down
4 changes: 4 additions & 0 deletions native/cocos/editor-support/spine-wasm/spine-wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ SkeletonData* SpineWasmUtil::querySpineSkeletonDataByUUID(const std::string& uui
}

SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithJson(const std::string& jsonStr, const std::string& altasStr) {
#if ENABLE_JSON_PARSER
auto* atlas = new Atlas(altasStr.c_str(), altasStr.size(), "", nullptr, false);
if (!atlas) {
return nullptr;
Expand All @@ -54,6 +55,9 @@ SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithJson(const std::string&
SkeletonData* skeletonData = json.readSkeletonData(jsonStr.c_str());

return skeletonData;
#else
return nullptr;
#endif
}

SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithBinary(uint32_t byteSize, const std::string& altasStr) {
Expand Down