X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbadguy%2Fwillowisp.cpp;h=8e582a90e5faa9b6c0d2a787b0fd60d9f8e9330d;hb=1ca8026695fc4a10187178c91616c38fecfcc755;hp=3ed8f9f1a398418891fccc950ca7c07645e9c61f;hpb=18c69f4aa24d496f84a088d60c18b180c293dace;p=supertux.git diff --git a/src/badguy/willowisp.cpp b/src/badguy/willowisp.cpp index 3ed8f9f1a..8e582a90e 100644 --- a/src/badguy/willowisp.cpp +++ b/src/badguy/willowisp.cpp @@ -23,6 +23,7 @@ #include "object/player.hpp" #include "scripting/squirrel_util.hpp" #include "sprite/sprite.hpp" +#include "sprite/sprite_manager.hpp" #include "supertux/game_session.hpp" #include "supertux/object_factory.hpp" #include "supertux/sector.hpp" @@ -44,7 +45,8 @@ WillOWisp::WillOWisp(const Reader& reader) : walker(), flyspeed(), track_range(), - vanish_range() + vanish_range(), + lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")) { bool running = false; flyspeed = FLYSPEED; @@ -73,6 +75,9 @@ WillOWisp::WillOWisp(const Reader& reader) : sound_manager->preload(SOUNDFILE); sound_manager->preload("sounds/warp.wav"); + lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); + lightsprite->set_color(Color(0.0f, 0.2f, 0.0f)); + sprite->set_action("idle"); } @@ -85,6 +90,7 @@ WillOWisp::draw(DrawingContext& context) context.set_target(DrawingContext::LIGHTMAP); sprite->draw(context, get_pos(), layer); + lightsprite->draw(context, get_bbox().get_middle(), 0); context.pop_target(); } @@ -278,8 +284,8 @@ WillOWisp::expose(HSQUIRRELVM vm, SQInteger table_idx) return; std::cout << "Expose me '" << name << "'\n"; - Scripting::WillOWisp* interface = static_cast (this); - expose_object(vm, table_idx, interface, name); + scripting::WillOWisp* _this = static_cast (this); + expose_object(vm, table_idx, _this, name); } void @@ -289,9 +295,7 @@ WillOWisp::unexpose(HSQUIRRELVM vm, SQInteger table_idx) return; std::cout << "UnExpose me '" << name << "'\n"; - Scripting::unexpose_object(vm, table_idx, name); + scripting::unexpose_object(vm, table_idx, name); } -IMPLEMENT_FACTORY(WillOWisp, "willowisp"); - /* EOF */