ULTIMA1: Adjust x2, y2 calculation for TextRects

This commit is contained in:
Paul Gilbert 2020-01-19 17:30:55 -08:00 committed by Paul Gilbert
parent f33a0dc69b
commit 83addc920f
4 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ public:
class TextRect : public Common::Rect {
public:
TextRect() : Common::Rect() {}
TextRect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1 * 8, y1 * 8, x2 * 8, y2 * 8) {}
TextRect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1 * 8, y1 * 8, (x2 + 1) * 8, (y2 + 1) * 8) {}
};
} // End of namespace Shared

View File

@ -42,7 +42,7 @@ public:
/**
* Constructor
*/
Info(TreeItem *parent) : Shared::Info(parent, TextRect(0, 21, 30, 25)) {}
Info(TreeItem *parent) : Shared::Info(parent, TextRect(0, 21, 29, 24)) {}
/**
* Destructor

View File

@ -32,7 +32,7 @@ BEGIN_MESSAGE_MAP(Status, Shared::Gfx::VisualItem)
ON_MESSAGE(FrameMsg)
END_MESSAGE_MAP()
Status::Status(TreeItem *parent) : Shared::Gfx::VisualItem("Status", TextRect(31, 21, 40, 25), parent),
Status::Status(Shared::TreeItem *parent) : Shared::Gfx::VisualItem("Status", TextRect(31, 21, 39, 24), parent),
_hitPoints(0), _food(0), _experience(0), _coins(0) {
}

View File

@ -167,8 +167,8 @@ void ViewCharacterGeneration::drawHelp(Shared::Gfx::VisualSurface &s) {
void ViewCharacterGeneration::drawRace(Shared::Gfx::VisualSurface &s) {
Ultima1Game *game = static_cast<Ultima1Game *>(getGame());
s.fillRect(TextRect(6, 2, 38, 5), game->_bgColor);
s.fillRect(TextRect(2, 16, 38, 22), game->_bgColor);
s.fillRect(TextRect(6, 2, 37, 4), game->_bgColor);
s.fillRect(TextRect(2, 16, 37, 21), game->_bgColor);
s.writeString(game->_res->CHAR_GEN_TEXT[6], TextPoint(3, 17), game->_textColor);
s.writeString(Common::String::format(game->_res->CHAR_GEN_TEXT[4],