From: Wolfgang Becker Date: Tue, 4 Jul 2006 22:18:02 +0000 (+0000) Subject: Can set firefly's sprite. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d9cc973d430e93419b0f05f5031cc3f8c5a5fb94;p=supertux.git Can set firefly's sprite. SVN-Revision: 3885 --- diff --git a/src/object/firefly.cpp b/src/object/firefly.cpp index b9b775967..a924e358d 100644 --- a/src/object/firefly.cpp +++ b/src/object/firefly.cpp @@ -31,8 +31,19 @@ #include "object/sprite_particle.hpp" Firefly::Firefly(const lisp::Lisp& lisp) - : MovingSprite(lisp, "images/objects/firefly/firefly.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false) + : MovingSprite(lisp, "images/objects/firefly/firefly.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false) { + + if( !lisp.get( "sprite", sprite_name ) ){ + return; + } + if( sprite_name == "" ){ + sprite_name = "images/objects/firefly/firefly.sprite"; + return; + } + //Replace sprite + sprite = sprite_manager->create( sprite_name ); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); } void