X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.h;h=684413964d096b77b352f5e31840d97acc47c65e;hb=cded7d136b41e22f363ec702f2288491c0006e3a;hp=df247f348ad1b8110ecae3bcd2bac3528d9e12ff;hpb=3ac8cd5fa819210d36499d908607a82ae82cca0b;p=l2e.git diff --git a/src/battle/PartyLayout.h b/src/battle/PartyLayout.h index df247f3..6844139 100644 --- a/src/battle/PartyLayout.h +++ b/src/battle/PartyLayout.h @@ -10,6 +10,7 @@ #include "../geometry/Point.h" +#include #include #include @@ -28,11 +29,19 @@ public: dest.reserve(positions.size()); for (std::vector >::const_iterator i(positions.begin()), end(positions.end()); i != end; ++i) { dest.push_back(geometry::Point( - i->X() * width / 256, - i->Y() * height / 256 + i->X() * width / 255, + i->Y() * height / 223 )); } } + template + geometry::Point CalculatePosition(std::vector >::size_type index, U width, U height) const { + assert(index >= 0 && index < positions.size()); + return geometry::Point( + positions[index].X() * width / 255, + positions[index].Y() * height / 223 + ); + } public: void AddPosition(const geometry::Point &p) {