Skip to content

Commit

Permalink
DM: Fix several inclusive boundary errors with Box types
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 485d5f9 commit 1639c2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions engines/dm/champion.cpp
Expand Up @@ -315,20 +315,20 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {

Box box;
box._x1 = champIndex * kChampionStatusBoxSpacing + 46;
box._x2 = box._x1 + 3;
box._x2 = box._x1 + 3 + 1;
box._y1 = 2;
box._y2 = 26;
box._y2 = 26 + 1;

for (int16 AL_0_barGraphIndex = 0; AL_0_barGraphIndex < 3; AL_0_barGraphIndex++) {
int16 barGraphHeight = barGraphHeightArray[AL_0_barGraphIndex];
if (barGraphHeight < 25) {
box._y1 = 2;
box._y1 = 27 - barGraphHeight;
box._y1 = 27 - barGraphHeight + 1;
_vm->_displayMan->clearScreenBox(gChampionColor[champIndex], box);
}
if (barGraphHeight) {
box._y1 = 27 - barGraphHeight;
box._y2 = 26;
box._y2 = 26 + 1;
_vm->_displayMan->clearScreenBox(gChampionColor[champIndex], box);
}
box._x1 += 7;
Expand Down
4 changes: 2 additions & 2 deletions engines/dm/inventory.cpp
Expand Up @@ -102,9 +102,9 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
Box box;
box._x1 = x;
box._x2 = box._x1 + pixelWidth;
box._x2 = box._x1 + pixelWidth + 1;
box._y1 = y;
box._y2 = box._y1 + 6;
box._y2 = box._y1 + 6 + 1;
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->clearScreenBox(color, box);
}
Expand Down

0 comments on commit 1639c2e

Please sign in to comment.