Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WeakBlocks draw in front of other objects allowing them to hide objects
  • Loading branch information
LMH0013 authored and tobbi committed Oct 26, 2013
1 parent 023b16d commit e4f3dd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/object/weak_block.cpp
Expand Up @@ -144,15 +144,15 @@ WeakBlock::update(float )
void
WeakBlock::draw(DrawingContext& context)
{
//Draw the Sprite.
sprite->draw(context, get_pos(), LAYER_OBJECTS);
//Draw the Sprite just in front of other objects
sprite->draw(context, get_pos(), LAYER_OBJECTS + 10);
//Draw the light if burning and dark
if(linked && (state != STATE_NORMAL)){
context.get_light( get_bbox().get_middle(), &light );
if (light.red + light.green + light.blue < 3.0){
context.push_target();
context.set_target(DrawingContext::LIGHTMAP);
sprite->draw(context, get_pos(), LAYER_OBJECTS);
sprite->draw(context, get_pos(), LAYER_OBJECTS + 10);
lightsprite->draw(context, get_bbox().get_middle(), 0);
context.pop_target();
}
Expand Down

0 comments on commit e4f3dd5

Please sign in to comment.