From: <axl...@us...> - 2009-12-29 15:52:14
|
Revision: 646 http://hgengine.svn.sourceforge.net/hgengine/?rev=646&view=rev Author: axlecrusher Date: 2009-12-29 15:52:06 +0000 (Tue, 29 Dec 2009) Log Message: ----------- enable writing blend state Modified Paths: -------------- Mercury2/src/StateChanger.cpp Modified: Mercury2/src/StateChanger.cpp =================================================================== --- Mercury2/src/StateChanger.cpp 2009-12-28 22:26:28 UTC (rev 645) +++ Mercury2/src/StateChanger.cpp 2009-12-29 15:52:06 UTC (rev 646) @@ -167,8 +167,7 @@ void Stringify( MString & sOut ) { - //XXX -// sOut = ssprintf( "%f", bEnable ); + sOut = BlendToString(m_src) + "," + BlendToString(m_dest); } #define STRTOGL(x,s) if (x==#s) return GL_##s; @@ -191,6 +190,29 @@ STRTOGL(s, SRC_ALPHA_SATURATE); } + #define GLTOSTR(x,s) case GL_##s: return #s; + MString BlendToString(int blend) + { + switch (blend) + { + GLTOSTR(blend, ZERO); + GLTOSTR(blend, ONE); + GLTOSTR(blend, SRC_COLOR); + GLTOSTR(blend, ONE_MINUS_SRC_COLOR); + GLTOSTR(blend, DST_COLOR); + GLTOSTR(blend, ONE_MINUS_DST_COLOR); + GLTOSTR(blend, SRC_ALPHA); + GLTOSTR(blend, ONE_MINUS_SRC_ALPHA); + GLTOSTR(blend, DST_ALPHA); + GLTOSTR(blend, ONE_MINUS_DST_ALPHA); + GLTOSTR(blend, CONSTANT_COLOR); + GLTOSTR(blend, ONE_MINUS_CONSTANT_COLOR); + GLTOSTR(blend, CONSTANT_ALPHA); + GLTOSTR(blend, ONE_MINUS_CONSTANT_ALPHA); + GLTOSTR(blend, SRC_ALPHA_SATURATE); + }; + } + void Activate() { GLCALL( glBlendFunc(m_src,m_dest) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |