Merge branch 'feature/surface-scaling'
[supertux.git] / src / object / bonus_block.cpp
index 83cab76..e93ddbd 100644 (file)
@@ -1,5 +1,5 @@
 //  SuperTux
-//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
 //
 //  This program is free software: you can redistribute it and/or modify
 //  it under the terms of the GNU General Public License as published by
@@ -45,6 +45,8 @@ BonusBlock::BonusBlock(const Vector& pos, int data) :
   contents(),
   object(0),
   hit_counter(1),
+  sprite_name(),
+  script(),
   lightsprite()
 {
   bbox.set_pos(pos);
@@ -85,6 +87,8 @@ BonusBlock::BonusBlock(const Reader& lisp) :
   contents(),
   object(0),
   hit_counter(1),
+  sprite_name(),
+  script(),
   lightsprite()
 {
   Vector pos;
@@ -470,7 +474,7 @@ BonusBlock::draw(DrawingContext& context){
   Block::draw(context);
   // then Draw the light if on.
   if(sprite->get_action() == "on") {
-    Vector pos = get_pos() + (bbox.get_size() - lightsprite->get_size()) / 2;
+    Vector pos = get_pos() + (Vector(bbox.get_size().as_vector()) - lightsprite->get_size()) / 2;
     context.push_target();
     context.set_target(DrawingContext::LIGHTMAP);
     context.draw_surface(lightsprite, pos, 10);