Skip to content

Commit

Permalink
fix glBlendFunc error
Browse files Browse the repository at this point in the history
  • Loading branch information
tommego committed Sep 3, 2020
1 parent bb9c097 commit ae27fbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SpineItemTest/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 11,8 @@ Window {

SpineItem{
id: mySpine
atlasFile: "file:///home/beetom/Desktop/justdance/1.atlas"
skeletonFile: "file:///home/beetom/Desktop/justdance/1.json"
atlasFile: "examples/alien/export/alien-pma.atlas"
skeletonFile: "examples/alien/export/alien-ess.json"
anchors.centerIn: parent
fps: fpsSlider.value
skeletonScale: scaleSlider.value
Expand Down
7 changes: 4 additions & 3 deletions spineplugin/spineitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 246,17 @@ void SpineItem::renderToCache(QQuickFramebufferObject::Renderer *renderer, QShar

if(texture) {
if(hasBlend) {
// cache->cacheTriangleDrawCall();
switch (engineBlendMode) {
case spine::BlendMode_Additive: {
cache->blendFunc(GL_ONE, GL_ONE);
break;
}
case spine::BlendMode_Multiply: {
cache->blendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
cache->blendFunc(GL_DST_COLOR, GL_ZERO);
break;
}
case spine::BlendMode_Screen: {
cache->blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR);
cache->blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;
}
default:{
Expand Down Expand Up @@ -415,6 414,8 @@ void SpineItem::loadResource()
auto skinName = QString(skins[i]->getName().buffer());
m_skins << skinName;
}
if(m_skins.contains("default"))
m_skeleton->setSkin("defualt");
emit skinsChanged(m_skins);
m_loaded = true;
emit isSkeletonReadyChanged(isSkeletonReady());
Expand Down

0 comments on commit ae27fbf

Please sign in to comment.