X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fthunderstorm.cpp;h=656bd0a14d9f339b5a26b4d16f77461d31e7269b;hb=1dfbd27a41341f26775ca4e2b9ca4864f5744a6f;hp=5a9cb362a9ebda82eb83dd6e4a0c6bf744930278;hpb=fe875e6f18c4ed968f7b1534b4039c8a580b852b;p=supertux.git diff --git a/src/object/thunderstorm.cpp b/src/object/thunderstorm.cpp index 5a9cb362a..656bd0a14 100644 --- a/src/object/thunderstorm.cpp +++ b/src/object/thunderstorm.cpp @@ -37,12 +37,12 @@ #include "log.hpp" namespace { - const float LIGHTNING_DELAY = 2.0; - const float FLASH_DISPLAY_TIME = 0.1; + const float LIGHTNING_DELAY = 2.0f; + const float FLASH_DISPLAY_TIME = 0.1f; } Thunderstorm::Thunderstorm(const lisp::Lisp& reader) - : name(""), running(true), interval(10.0f) + : running(true), interval(10.0f) { reader.get("name", name); reader.get("running", running); @@ -74,8 +74,8 @@ Thunderstorm::update(float ) } } -void -Thunderstorm::draw(DrawingContext& context) +void +Thunderstorm::draw(DrawingContext& context) { if (!flash_display_timer.started()) return; @@ -91,7 +91,7 @@ void Thunderstorm::expose(HSQUIRRELVM vm, SQInteger table_idx) { if (name == "") return; - Scripting::Thunderstorm* interface = static_cast(this); + Scripting::Thunderstorm* interface = new Scripting::Thunderstorm(this); expose_object(vm, table_idx, interface, name, true); } @@ -149,4 +149,3 @@ Thunderstorm::electrify() } IMPLEMENT_FACTORY(Thunderstorm, "thunderstorm"); -