Răsfoiți Sursa

Merge branch 'next' of https://github.com/blackberry-gaming/GamePlay into next-dgough

Darryl Gough 13 ani în urmă
părinte
comite
340bb10ea7
1 a modificat fișierele cu 7 adăugiri și 5 ștergeri
  1. 7 5
      gameplay/src/RenderState.cpp

+ 7 - 5
gameplay/src/RenderState.cpp

@@ -361,7 +361,7 @@ void RenderState::cloneInto(RenderState* renderState, NodeCloneContext& context)
 
 
 RenderState::StateBlock::StateBlock()
 RenderState::StateBlock::StateBlock()
     : _cullFaceEnabled(false), _depthTestEnabled(false), _depthWriteEnabled(false),
     : _cullFaceEnabled(false), _depthTestEnabled(false), _depthWriteEnabled(false),
-      _blendEnabled(false), _blendSrc(RenderState::BLEND_ONE), _blendDst(RenderState::BLEND_ONE),
+      _blendEnabled(false), _blendSrc(RenderState::BLEND_ONE), _blendDst(RenderState::BLEND_ZERO),
       _bits(0L)
       _bits(0L)
 {
 {
 }
 }
@@ -455,10 +455,10 @@ void RenderState::StateBlock::restore(long stateOverrideBits)
     }
     }
     if (!(stateOverrideBits & RS_BLEND_FUNC) && (_defaultState->_bits & RS_BLEND_FUNC))
     if (!(stateOverrideBits & RS_BLEND_FUNC) && (_defaultState->_bits & RS_BLEND_FUNC))
     {
     {
-        GL_ASSERT( glBlendFunc(GL_ONE, GL_ONE) );
+        GL_ASSERT( glBlendFunc(GL_ONE, GL_ZERO) );
         _defaultState->_bits &= ~RS_BLEND_FUNC;
         _defaultState->_bits &= ~RS_BLEND_FUNC;
         _defaultState->_blendSrc = RenderState::BLEND_ONE;
         _defaultState->_blendSrc = RenderState::BLEND_ONE;
-        _defaultState->_blendDst = RenderState::BLEND_ONE;
+        _defaultState->_blendDst = RenderState::BLEND_ZERO;
     }
     }
     if (!(stateOverrideBits & RS_CULL_FACE) && (_defaultState->_bits & RS_CULL_FACE))
     if (!(stateOverrideBits & RS_CULL_FACE) && (_defaultState->_bits & RS_CULL_FACE))
     {
     {
@@ -593,8 +593,9 @@ void RenderState::StateBlock::setBlend(bool enabled)
 void RenderState::StateBlock::setBlendSrc(Blend blend)
 void RenderState::StateBlock::setBlendSrc(Blend blend)
 {
 {
     _blendSrc = blend;
     _blendSrc = blend;
-    if (_blendSrc == BLEND_ONE && _blendDst == BLEND_ONE)
+    if (_blendSrc == BLEND_ONE && _blendDst == BLEND_ZERO)
     {
     {
+        // Default blend func
         _bits &= ~RS_BLEND_FUNC;
         _bits &= ~RS_BLEND_FUNC;
     }
     }
     else
     else
@@ -606,8 +607,9 @@ void RenderState::StateBlock::setBlendSrc(Blend blend)
 void RenderState::StateBlock::setBlendDst(Blend blend)
 void RenderState::StateBlock::setBlendDst(Blend blend)
 {
 {
     _blendDst = blend;
     _blendDst = blend;
-    if (_blendSrc == BLEND_ONE && _blendDst == BLEND_ONE)
+    if (_blendSrc == BLEND_ONE && _blendDst == BLEND_ZERO)
     {
     {
+        // Default blend func
         _bits &= ~RS_BLEND_FUNC;
         _bits &= ~RS_BLEND_FUNC;
     }
     }
     else
     else