aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui.cpp6
-rw-r--r--engines/sci/gui/gui_gfx.cpp14
-rw-r--r--engines/sci/gui/gui_gfx.h2
-rw-r--r--engines/sci/gui/gui_picture.cpp2
4 files changed, 12 insertions, 12 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 2f5b499969..d4b0a20b1d 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -64,6 +64,12 @@ SciGui::~SciGui() {
}
void SciGui::init(bool usesOldGfxFunctions) {
+ // Initialize priority bands
+ if (usesOldGfxFunctions) {
+ _gfx->PriorityBandsInit(15, 42, 200);
+ } else {
+ _gfx->PriorityBandsInit(14, 42, 190);
+ }
}
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 15e46390f5..9bf0784887 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -65,15 +65,6 @@ void SciGuiGfx::init() {
SetFont(0);
_menuPort->rect = Common::Rect(0, 0, _screen->_width, _screen->_height);
_menuRect = Common::Rect(0, 0, _screen->_width, 9);
-
- // Initialize priority bands
- if (_s->usesOldGfxFunctions()) {
- _priorityBandCount = 15;
- PriorityBandsInit(42, 200);
- } else {
- _priorityBandCount = 14;
- PriorityBandsInit(42, 190);
- }
}
GuiPort *SciGuiGfx::SetPort(GuiPort *newPort) {
@@ -773,10 +764,13 @@ static inline int sign_extend_byte(int value) {
return value;
}
-void SciGuiGfx::PriorityBandsInit(int16 top, int16 bottom) {
+void SciGuiGfx::PriorityBandsInit(int16 bandCount, int16 top, int16 bottom) {
double bandSize;
int16 y;
+ if (bandCount != -1)
+ _priorityBandCount = bandCount;
+
_priorityTop = top;
_priorityBottom = bottom;
bandSize = (_priorityBottom - _priorityTop) / (_priorityBandCount - 1);
diff --git a/engines/sci/gui/gui_gfx.h b/engines/sci/gui/gui_gfx.h
index 28c9f842ed..7ed3e3baac 100644
--- a/engines/sci/gui/gui_gfx.h
+++ b/engines/sci/gui/gui_gfx.h
@@ -109,7 +109,7 @@ public:
uint16 onControl(uint16 screenMask, Common::Rect rect);
- void PriorityBandsInit(int16 top, int16 bottom);
+ void PriorityBandsInit(int16 bandCount, int16 top, int16 bottom);
void PriorityBandsInit(byte *data);
byte CoordinateToPriority(int16 y);
int16 PriorityToCoordinate(byte priority);
diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp
index ef5d65b95e..d3effcd917 100644
--- a/engines/sci/gui/gui_picture.cpp
+++ b/engines/sci/gui/gui_picture.cpp
@@ -482,7 +482,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
curPos += size;
break;
case PIC_OPX_VGA_PRIORITY_TABLE_EQDIST:
- _gfx->PriorityBandsInit(READ_LE_UINT16(data + curPos), READ_LE_UINT16(data + curPos + 2));
+ _gfx->PriorityBandsInit(-1, READ_LE_UINT16(data + curPos), READ_LE_UINT16(data + curPos + 2));
curPos += 4;
break;
case PIC_OPX_VGA_PRIORITY_TABLE_EXPLICIT: