Merge branch '3.6' into 3.7-beta

This commit is contained in:
badlogic 2017-10-13 09:51:15 +02:00
commit d6737858e8
3 changed files with 21 additions and 3 deletions

View File

@ -53,7 +53,6 @@
* Added `spVertexEffect` and corresponding implementations `spJitterVertexEffect` and `spSwirlVertexEffect`. Create/dispose through the corresponding `spXXXVertexEffect_create()/dispose()` functions. Set on framework/engine specific renderer. See changes for spine-c based frameworks/engines below.
* Functions in `extension.h` are not prefixed with `_sp` instead of just `_` to avoid interference with other libraries.
* Introduced `SP_API` macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g. ``__declspec` when compiling to a dll or linking to that dll.
* Added `void* userData` to `spAnimationState` to be consumed in callbacks.
### Cocos2d-X
* Fixed renderer to work with 3.6 changes
@ -65,6 +64,7 @@
* SkeletonRenderer now combines the displayed color of the Node (cascaded from all parents) with the skeleton color for tinting.
* Added support for vertex effects. See `RaptorExample.cpp`.
* Added ETC1 alpha support, thanks @halx99! Does not work when two color tint is enabled.
* Added `spAtlasPage_setCustomTextureLoader()` which let's you do texture loading manually. Thanks @jareguo.
### Cocos2d-Objc
* Fixed renderer to work with 3.6 changes
@ -85,7 +85,6 @@
* Added support for two color tinting. All base materials, e.g. SpineUnlitNormalMaterial, now do proper two color tinting. No material parameters have changed.
* Updated to Unreal Engine 4.16.1. Note that 4.16 has a regression which will make it impossible to compile plain .c files!
* spine-c is now exposed from the plugin shared library on Windows via __declspec.
* `SkeletonRenderComponent` now generates collision meshes by default.
## C#
* **Breaking changes**

View File

@ -31,6 +31,13 @@
#include <spine/spine-cocos2dx.h>
#include <spine/extension.h>
namespace spine {
static CustomTextureLoader _customTextureLoader = nullptr;
void spAtlasPage_setCustomTextureLoader (CustomTextureLoader texLoader) {
_customTextureLoader = texLoader;
}
}
USING_NS_CC;
GLuint wrap (spAtlasWrap wrap) {
@ -60,7 +67,13 @@ GLuint filter (spAtlasFilter filter) {
}
void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) {
Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path);
Texture2D* texture = nullptr;
if (spine::_customTextureLoader) {
texture = spine::_customTextureLoader(path);
}
if (!texture) {
texture = Director::getInstance()->getTextureCache()->addImage(path);
}
CCASSERT(texture != nullptr, "Invalid image");
texture->retain();

View File

@ -38,4 +38,10 @@
#include <spine/SkeletonAnimation.h>
#include <spine/SkeletonBatch.h>
namespace spine {
typedef cocos2d::Texture2D* (*CustomTextureLoader)(const char* path);
// set custom texture loader for _spAtlasPage_createTexture
void spAtlasPage_setCustomTextureLoader(CustomTextureLoader texLoader);
}
#endif /* SPINE_COCOS2DX_H_ */