mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.6' into 3.7-beta
This commit is contained in:
commit
ac0968b17c
@ -63,6 +63,7 @@
|
|||||||
* Added support for clipping.
|
* Added support for clipping.
|
||||||
* SkeletonRenderer now combines the displayed color of the Node (cascaded from all parents) with the skeleton color for tinting.
|
* 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 support for vertex effects. See `RaptorExample.cpp`.
|
||||||
|
* Added ETC1 support, thanks @halx99!
|
||||||
|
|
||||||
### Cocos2d-Objc
|
### Cocos2d-Objc
|
||||||
* Fixed renderer to work with 3.6 changes
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
|||||||
@ -71,6 +71,34 @@ void SkeletonRenderer::initialize () {
|
|||||||
setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP));
|
setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SkeletonRenderer::setupGLProgramState () {
|
||||||
|
Texture2D *texture = nullptr;
|
||||||
|
for (int i = 0, n = _skeleton->slotsCount; i < n; i++) {
|
||||||
|
spSlot* slot = _skeleton->drawOrder[i];
|
||||||
|
if (!slot->attachment) continue;
|
||||||
|
switch (slot->attachment->type) {
|
||||||
|
case SP_ATTACHMENT_REGION: {
|
||||||
|
spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment;
|
||||||
|
texture = static_cast<AttachmentVertices*>(attachment->rendererObject)->_texture;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SP_ATTACHMENT_MESH: {
|
||||||
|
spMeshAttachment* attachment = (spMeshAttachment*)slot->attachment;
|
||||||
|
texture = static_cast<AttachmentVertices*>(attachment->rendererObject)->_texture;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (texture != nullptr) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP, texture));
|
||||||
|
}
|
||||||
|
|
||||||
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
|
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
|
||||||
_skeleton = spSkeleton_create(skeletonData);
|
_skeleton = spSkeleton_create(skeletonData);
|
||||||
_ownsSkeletonData = ownsSkeletonData;
|
_ownsSkeletonData = ownsSkeletonData;
|
||||||
|
|||||||
@ -124,7 +124,7 @@ CC_CONSTRUCTOR_ACCESS:
|
|||||||
void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
|
void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
|
||||||
|
|
||||||
virtual void initialize ();
|
virtual void initialize ();
|
||||||
|
void setupGLProgramState();
|
||||||
protected:
|
protected:
|
||||||
void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);
|
void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);
|
||||||
virtual AttachmentVertices* getAttachmentVertices (spRegionAttachment* attachment) const;
|
virtual AttachmentVertices* getAttachmentVertices (spRegionAttachment* attachment) const;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user