X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsprite%2Fsprite_data.cpp;h=e8128b27d6de3a822479df5d4a493b0f2cf0e29e;hb=1eb64ffd2a23eea4b399c1bb8b9dc10293c334d7;hp=599e4e1d8c81e7af7bbd3b81bf1a6da21fdd423a;hpb=93a74f493825b4a4c76774f190b2fc39b2488d8f;p=supertux.git diff --git a/src/sprite/sprite_data.cpp b/src/sprite/sprite_data.cpp index 599e4e1d8..e8128b27d 100644 --- a/src/sprite/sprite_data.cpp +++ b/src/sprite/sprite_data.cpp @@ -36,7 +36,7 @@ SpriteData::Action::Action() y_offset = 0; hitbox_w = 0; hitbox_h = 0; - z_order = 0; + z_order = 0; fps = 10; } @@ -60,7 +60,7 @@ SpriteData::SpriteData(const lisp::Lisp* lisp, const std::string& basedir) } } if(actions.empty()) - throw std::runtime_error("Error: Sprite wihtout actions."); + throw std::runtime_error("Error: Sprite without actions."); } SpriteData::~SpriteData() @@ -104,8 +104,8 @@ SpriteData::parse_action(const lisp::Lisp* lisp, const std::string& basedir) i++) { Surface* surface = new Surface(*(act_tmp->surfaces[i])); surface->hflip(); - max_w = std::max(max_w, surface->get_width()); - max_h = std::max(max_h, surface->get_height()); + max_w = std::max(max_w, (float) surface->get_width()); + max_h = std::max(max_h, (float) surface->get_height()); action->surfaces.push_back(surface); } if (action->hitbox_w < 1) action->hitbox_w = max_w; @@ -124,8 +124,8 @@ SpriteData::parse_action(const lisp::Lisp* lisp, const std::string& basedir) float max_h = 0; for(std::vector::size_type i = 0; i < images.size(); i++) { Surface* surface = new Surface(basedir + images[i]); - max_w = std::max(max_w, surface->get_width()); - max_h = std::max(max_h, surface->get_height()); + max_w = std::max(max_w, (float) surface->get_width()); + max_h = std::max(max_h, (float) surface->get_height()); action->surfaces.push_back(surface); } if (action->hitbox_w < 1) action->hitbox_w = max_w; @@ -143,4 +143,3 @@ SpriteData::get_action(std::string act) } return i->second; } -