int tagHeight(attackTypeMenu.Height());
int tagWidth(attackTypeMenu.Width() * 2 + attackTypeMenu.Width() / 2);
- int xOffset((BackgroundWidth() - 2 * tagWidth) / 2);
- heroTagPositions[0] = Point<int>(xOffset, BackgroundHeight() - 2 * tagHeight);
- heroTagPositions[1] = Point<int>(xOffset + tagWidth, BackgroundHeight() - 2 * tagHeight);
- heroTagPositions[2] = Point<int>(xOffset, BackgroundHeight() - tagHeight);
- heroTagPositions[3] = Point<int>(xOffset + tagWidth, BackgroundHeight() - tagHeight);
+ int xOffset((Width() - 2 * tagWidth) / 2);
+ heroTagPositions[0] = Point<int>(xOffset, Height() - 2 * tagHeight);
+ heroTagPositions[1] = Point<int>(xOffset + tagWidth, Height() - 2 * tagHeight);
+ heroTagPositions[2] = Point<int>(xOffset, Height() - tagHeight);
+ heroTagPositions[3] = Point<int>(xOffset + tagWidth, Height() - tagHeight);
tagHeight = res->normalFont->CharHeight() * 4 + res->smallHeroTagFrame->BorderHeight() * 2;
tagWidth = res->normalFont->CharWidth() * 6 + res->smallHeroTagFrame->BorderWidth() * 2;
- xOffset = (BackgroundWidth() - 4 * tagWidth) / 2;
- int yOffset(BackgroundHeight() - tagHeight);
+ xOffset = (Width() - 4 * tagWidth) / 2;
+ int yOffset(Height() - tagHeight);
smallHeroTagPositions[0] = Point<int>(xOffset, yOffset);
smallHeroTagPositions[1] = Point<int>(xOffset + 2 * tagWidth, yOffset);
smallHeroTagPositions[2] = Point<int>(xOffset + tagWidth, yOffset);
SDL_Rect rect;
rect.x = offset.X();
- rect.y = offset.Y() + BackgroundHeight() - tagHeight;
- rect.w = BackgroundWidth();
+ rect.y = offset.Y() + Height() - tagHeight;
+ rect.w = Width();
rect.h = tagHeight;
SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, 0, 0, 0));
rect.y += res->normalFont->CharHeight() / 8;
(screen->w - background->w) / 2,
(screen->h - background->h) / 2);
}
- int BackgroundWidth() const { return background->w; }
- int BackgroundHeight() const { return background->h; }
+ int Width() const { return background->w; }
+ int Height() const { return background->h; }
void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
if (!titleBarText || !titleBarTimer.Running()) return;
int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight());
- battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->BackgroundWidth(), height);
+ battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->Width(), height);
Point<int> textPosition(
- (battle->BackgroundWidth() - (std::strlen(titleBarText) * battle->Res().titleFont->CharWidth())) / 2,
+ (battle->Width() - (std::strlen(titleBarText) * battle->Res().titleFont->CharWidth())) / 2,
battle->Res().titleFrame->BorderHeight());
battle->Res().titleFont->DrawString(titleBarText, screen, textPosition + offset);
}
void RunState::RenderTitleBar(SDL_Surface *screen, const Vector<int> &offset) {
int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight());
- battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->BackgroundWidth(), height);
+ battle->Res().titleFrame->Draw(screen, Point<int>(offset.X(), offset.Y()), battle->Width(), height);
Point<int> textPosition(
- (battle->BackgroundWidth() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2,
+ (battle->Width() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2,
battle->Res().titleFrame->BorderHeight());
battle->Res().titleFont->DrawString(battle->Res().escapeText, screen, textPosition + offset);
}
void SelectAttackType::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
Point<int> position(
- (battle->BackgroundWidth() - battle->GetAttackTypeMenu().Width()) / 2,
- battle->BackgroundHeight() - battle->GetAttackTypeMenu().Height() - battle->GetAttackTypeMenu().Height() / 2);
+ (battle->Width() - battle->GetAttackTypeMenu().Width()) / 2,
+ battle->Height() - battle->GetAttackTypeMenu().Height() - battle->GetAttackTypeMenu().Height() / 2);
battle->GetAttackTypeMenu().Render(screen, position + offset);
}
void SelectIkari::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
const Frame *frame(battle->Res().selectFrame);
Point<int> position(frame->BorderWidth(), frame->BorderHeight());
- int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+ int width(battle->Width() - 2 * frame->BorderWidth());
int height(battle->Res().normalFont->CharHeight() * 13);
frame->Draw(screen, position + offset, width, height);
}
void SelectItem::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
const Frame *frame(battle->Res().selectFrame);
Point<int> position(frame->BorderWidth(), frame->BorderHeight());
- int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+ int width(battle->Width() - 2 * frame->BorderWidth());
int height(battle->Res().normalFont->CharHeight() * 13);
frame->Draw(screen, position + offset, width, height);
}
void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
Point<int> position(
- (battle->BackgroundWidth() - battle->GetMoveMenu().Width()) / 2,
- battle->BackgroundHeight() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
+ (battle->Width() - battle->GetMoveMenu().Width()) / 2,
+ battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
battle->GetMoveMenu().Render(screen, position + offset);
}
void SelectSpell::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
const Frame *frame(battle->Res().selectFrame);
Point<int> position(frame->BorderWidth(), frame->BorderHeight());
- int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+ int width(battle->Width() - 2 * frame->BorderWidth());
int height(battle->Res().normalFont->CharHeight() * 13);
frame->Draw(screen, position + offset, width, height);
}