X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.cpp;h=fe1b309a3a65b36543de7d8585290f6503b9139f;hb=9718062e6ed305d9f8f1674ff172079688e78088;hp=aae4635be3687bf578533a925778cc20ef0e7f4b;hpb=cded7d136b41e22f363ec702f2288491c0006e3a;p=l2e.git diff --git a/src/battle/BattleState.cpp b/src/battle/BattleState.cpp index aae4635..fe1b309 100644 --- a/src/battle/BattleState.cpp +++ b/src/battle/BattleState.cpp @@ -78,7 +78,6 @@ void BattleState::Resize(int w, int h) { void BattleState::EnterState(Application &ctrl, SDL_Surface *screen) { - monstersLayout->CalculatePositions(background->w, background->h, monsterPositions); for (int i(0); i < 4; ++i) { heroes[i].Position() = heroesLayout->CalculatePosition(i, background->w, background->h); heroes[i].SpellMenu() = res->spellMenuPrototype; @@ -89,6 +88,10 @@ void BattleState::EnterState(Application &ctrl, SDL_Surface *screen) { smallHeroTags[i] = SmallHeroTag(this, i); } + for (int i(0); i < int(monsters.size()); ++i) { + monsters[i].Position() = monstersLayout->CalculatePosition(i, background->w, background->h); + } + int tagHeight(attackTypeMenu.Height()); int tagWidth(attackTypeMenu.Width() * 2 + attackTypeMenu.Width() / 2); int xOffset((Width() - 2 * tagWidth) / 2); @@ -369,9 +372,9 @@ void BattleState::RenderMonsters(SDL_Surface *screen, const Vector &offset) for (vector::size_type i(0), end(monsters.size()); i < end; ++i) { if (MonsterPositionOccupied(i)) { if (monsters[i].GetAnimation().Running()) { - monsters[i].GetAnimation().DrawCenter(screen, monsterPositions[i] + offset); + monsters[i].GetAnimation().DrawCenter(screen, monsters[i].Position() + offset); } else { - monsters[i].Sprite()->DrawCenter(screen, monsterPositions[i] + offset); + monsters[i].Sprite()->DrawCenter(screen, monsters[i].Position() + offset); } } }