X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fweak_block.cpp;h=261128553acb2857864d38b0524b29a77e0a41b3;hb=1240eda3ac57e6607b206e3c9cf7feb65c3be620;hp=6b89cc18260351b812fc57e22da7cb7e35e7bdb7;hpb=d31cd058683a79db981a2f4fc06956ad71414f26;p=supertux.git diff --git a/src/object/weak_block.cpp b/src/object/weak_block.cpp index 6b89cc182..261128553 100644 --- a/src/object/weak_block.cpp +++ b/src/object/weak_block.cpp @@ -33,14 +33,14 @@ WeakBlock::WeakBlock(const Reader& lisp) : MovingSprite(lisp, "images/objects/weak_block/strawbox.sprite", LAYER_TILES, COLGROUP_STATIC), state(STATE_NORMAL), linked(true), light(0.0f,0.0f,0.0f), - lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")) + lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light-small.sprite")) { sprite->set_action("normal"); //Check if this weakblock destroys adjacent weakblocks if(lisp.get("linked", linked)){ if(! linked){ sprite_name = "images/objects/weak_block/meltbox.sprite"; - sprite = sprite_manager->create(sprite_name); + sprite = SpriteManager::current()->create(sprite_name); sprite->set_action("normal"); } } @@ -48,7 +48,7 @@ WeakBlock::WeakBlock(const Reader& lisp) lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.3f, 0.2f, 0.1f)); } else if(sprite_name == "images/objects/weak_block/meltbox.sprite") - sound_manager->preload("sounds/sizzle.ogg"); + SoundManager::current()->preload("sounds/sizzle.ogg"); } HitResponse @@ -123,13 +123,13 @@ WeakBlock::update(float ) } else lightsprite->set_color(Color(0.3f, 0.2f, 0.1f)); } - + if (sprite->animation_done()) { state = STATE_DISINTEGRATING; sprite->set_action("disintegrating", 1); spreadHit(); set_group(COLGROUP_DISABLED); - lightsprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light-tiny.sprite"); + lightsprite = SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light-tiny.sprite"); lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.3f, 0.2f, 0.1f)); } @@ -162,7 +162,7 @@ WeakBlock::draw(DrawingContext& context) } } } - + void WeakBlock::startBurning() { @@ -170,7 +170,7 @@ WeakBlock::startBurning() state = STATE_BURNING; sprite->set_action("burning", 1); if(sprite_name == "images/objects/weak_block/meltbox.sprite") - sound_manager->play("sounds/sizzle.ogg"); + SoundManager::current()->play("sounds/sizzle.ogg"); } void @@ -184,7 +184,7 @@ WeakBlock::spreadHit() return; } for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) { - WeakBlock* wb = dynamic_cast(*i); + WeakBlock* wb = dynamic_cast(i->get()); if (!wb) continue; if (wb == this) continue; if (wb->state != STATE_NORMAL) continue;