@@ -268,6 +268,8 @@ namespace Polycode {
std::vector<LightInfo> getSpotLights() { return spotLights; }
bool doClearBuffer;
+
+ bool blendNormalAsPremultiplied;
protected:
@@ -413,7 +413,11 @@ void OpenGLRenderer::enableFog(bool enable) {
void OpenGLRenderer::setBlendingMode(int blendingMode) {
switch(blendingMode) {
case BLEND_MODE_NORMAL:
+ if(blendNormalAsPremultiplied) {
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ } else{
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
break;
case BLEND_MODE_LIGHTEN:
glBlendFunc (GL_SRC_ALPHA, GL_ONE);
@@ -47,7 +47,7 @@ Renderer::Renderer() : currentTexture(NULL), xRes(0), yRes(0), renderMode(0), or
setAmbientColor(0.0,0.0,0.0);
cullingFrontFaces = false;
scissorEnabled = false;
-
+ blendNormalAsPremultiplied = false;
doClearBuffer = true;
}
@@ -35,8 +35,8 @@ using namespace Polycode;
ScreenEntity::ScreenEntity() : Entity() {
color = Color(1.0f,1.0f,1.0f,1.0f);
- width = 1;
- height = 1;
+ width = 0;
+ height = 0;
setHitbox(1, 1);
backfaceCulled = false;
positionMode = POSITION_TOPLEFT;