Skip to content

Commit

Permalink
Revert "Working solution for #49, needs verification."
Browse files Browse the repository at this point in the history
This reverts commit 73cc391.
  • Loading branch information
moly committed Mar 16, 2014
1 parent 73cc391 commit 431c040
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
29 changes: 20 additions & 9 deletions flixel-core/src/org/flixel/FlxCamera.java
Expand Up @@ -1031,15 +1031,26 @@ public OrthographicCamera getCamera()
public void fill(int Color, boolean BlendAlpha)
{
int color = FlxU.multiplyColors(Color, _color);
FlxG._gl.glEnable(GL10.GL_BLEND);
FlxG._gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
ShapeRenderer flashGfx = ((GdxGraphics) FlxG.flashGfx).getShapeRenderer();
flashGfx.setProjectionMatrix(_glCamera.combined);
flashGfx.begin(ShapeType.Filled);

flashGfx.setColor(((color >> 16) & 0xFF) * 0.00392f, ((color >> 8) & 0xFF) * 0.00392f, (color & 0xFF) * 0.00392f, ((Color >> 24) & 0xFF) * 0.00392f);
flashGfx.rect(0, 0, width, height);
flashGfx.end();

if(((Color >> 24) & 0xff) == 0xFF || !BlendAlpha)
{
FlxG._gl.glDisable(GL10.GL_BLEND);
FlxG._gl.glClearColor(((color >> 16) & 0xFF) * 0.00392f, ((color >> 8) & 0xFF) * 0.00392f, (color & 0xFF) * 0.00392f, ((Color >> 24) & 0xFF) * 0.00392f);
FlxG._gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
}
else
{
FlxG._gl.glEnable(GL10.GL_BLEND);
FlxG._gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

ShapeRenderer flashGfx = ((GdxGraphics) FlxG.flashGfx).getShapeRenderer();
flashGfx.setProjectionMatrix(_glCamera.combined);
flashGfx.begin(ShapeType.Filled);

flashGfx.setColor(((color >> 16) & 0xFF) * 0.00392f, ((color >> 8) & 0xFF) * 0.00392f, (color & 0xFF) * 0.00392f, ((Color >> 24) & 0xFF) * 0.00392f);
flashGfx.rect(0, 0, width, height);
flashGfx.end();
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion flixel-core/src/org/flixel/FlxGame.java
Expand Up @@ -856,7 +856,7 @@ protected void draw()
_stringBuffer.delete(0, _stringBuffer.length());
_stringBuffer.append("fps:");
_stringBuffer.append(Gdx.graphics.getFramesPerSecond());
_font.draw(FlxG.batch, _stringBuffer.toString(), Gdx.graphics.getWidth() - 80, 0);
_font.draw(FlxG.batch, _stringBuffer, Gdx.graphics.getWidth() - 80, 0);
}
FlxG.batch.end();
if(_debuggerUp)
Expand Down

0 comments on commit 431c040

Please sign in to comment.