|
@@ -162,7 +162,8 @@ void SkeletonDrawable::draw(SDL_Renderer *renderer) {
|
|
for (int ii = 0; ii < (int) indices->size(); ii++)
|
|
for (int ii = 0; ii < (int) indices->size(); ii++)
|
|
sdlIndices.add((*indices)[ii]);
|
|
sdlIndices.add((*indices)[ii]);
|
|
|
|
|
|
- switch (slot.getData().getBlendMode()) {
|
|
|
|
|
|
+ if (!usePremultipliedAlpha) {
|
|
|
|
+ switch (slot.getData().getBlendMode()) {
|
|
case BlendMode_Normal:
|
|
case BlendMode_Normal:
|
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
|
break;
|
|
break;
|
|
@@ -175,6 +176,27 @@ void SkeletonDrawable::draw(SDL_Renderer *renderer) {
|
|
case BlendMode_Screen:
|
|
case BlendMode_Screen:
|
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
|
break;
|
|
break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ SDL_BlendMode target;
|
|
|
|
+ switch (slot.getData().getBlendMode()) {
|
|
|
|
+ case BlendMode_Normal:
|
|
|
|
+ target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD);
|
|
|
|
+ SDL_SetTextureBlendMode(texture, target);
|
|
|
|
+ break;
|
|
|
|
+ case BlendMode_Multiply:
|
|
|
|
+ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_MOD);
|
|
|
|
+ break;
|
|
|
|
+ case BlendMode_Additive:
|
|
|
|
+ target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD);
|
|
|
|
+ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_ADD);
|
|
|
|
+ break;
|
|
|
|
+ case BlendMode_Screen:
|
|
|
|
+ target = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD);
|
|
|
|
+ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
SDL_RenderGeometry(renderer, texture, sdlVertices.buffer(), sdlVertices.size(), sdlIndices.buffer(),
|
|
SDL_RenderGeometry(renderer, texture, sdlVertices.buffer(), sdlVertices.size(), sdlIndices.buffer(),
|