Sfoglia il codice sorgente

Added multiply blending mode

Ivan Safrin 13 anni fa
parent
commit
2f7c95aed2

+ 2 - 1
Core/Contents/Include/PolyRenderer.h

@@ -224,7 +224,8 @@ namespace Polycode {
 		static const int BLEND_MODE_LIGHTEN = 1;
 		static const int BLEND_MODE_COLOR = 2;
 		static const int BLEND_MODE_PREMULTIPLIED = 3;
-				
+		static const int BLEND_MODE_MULTIPLY = 4;
+						
 		static const int FOG_LINEAR = 0;
 		static const int FOG_EXP = 1;
 		static const int FOG_EXP2 = 2;

+ 3 - 0
Core/Contents/Source/PolyGLRenderer.cpp

@@ -402,6 +402,9 @@ void OpenGLRenderer::setBlendingMode(int blendingMode) {
 		case BLEND_MODE_PREMULTIPLIED:
 			glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 		break;
+		case BLEND_MODE_MULTIPLY:
+			glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
+		break;		
 		default:
 			glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 		break;

+ 5 - 0
Core/Contents/Source/PolySceneLabel.cpp

@@ -61,6 +61,11 @@ void SceneLabel::setText(const String& newText) {
 	mesh = new Mesh(Mesh::QUAD_MESH);
 	mesh->createVPlane(label->getWidth()*scale,label->getHeight()*scale);
 	
+	bBox.x = label->getWidth()*scale;
+	bBox.y = label->getHeight()*scale;
+	bBox.z = 0;
+	
+	
 	for(int i=0; i < mesh->getPolygonCount(); i++) {
 		mesh->getPolygon(i)->flipUVY();
 	}