]> git.localhorst.tv Git - l2e.git/commitdiff
fix position calculation in PartyLayout
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 6 Aug 2012 10:11:10 +0000 (12:11 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 6 Aug 2012 10:11:10 +0000 (12:11 +0200)
src/battle/PartyLayout.h

index 1456f15ae89f7cc435ac3ed03df950b41988ad8a..df247f348ad1b8110ecae3bcd2bac3528d9e12ff 100644 (file)
@@ -21,15 +21,15 @@ public:
        PartyLayout() { }
 
 public:
-       int NumPositions() const { return positions.size(); }
+       std::vector<geometry::Point<Uint8> >::size_type NumPositions() const { return positions.size(); }
        template<class U>
        void CalculatePositions(U width, U height, std::vector<geometry::Point<U> > &dest) const {
                dest.clear();
                dest.reserve(positions.size());
                for (std::vector<geometry::Point<Uint8> >::const_iterator i(positions.begin()), end(positions.end()); i != end; ++i) {
                        dest.push_back(geometry::Point<U>(
-                                       i->X() * 256 / width,
-                                       i->Y() * 256 / height
+                                       i->X() * width / 256,
+                                       i->Y() * height / 256
                                        ));
                }
        }