aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui.cpp20
-rw-r--r--engines/sci/gui/gui_gfx.cpp7
2 files changed, 23 insertions, 4 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 8def52c46e..9352c6c348 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -53,8 +53,6 @@ SciGui::~SciGui() {
void SciGui::init(bool oldGfxFunctions) {
_usesOldGfxFunctions = oldGfxFunctions;
-
-
}
int16 SciGui::getTimeTicks() {
@@ -109,6 +107,11 @@ void SciGui::localToGlobal(int16 *x, int16 *y) {
reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
GuiWindow *wnd = NULL;
+ if (!_s->resMan->isVGA()) {
+ colorPen |= (colorPen << 4);
+ colorBack |= (colorBack << 4);
+ }
+
if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0)
wnd = _windowMgr->NewWindow(dims, &restoreRect, title, style, priority, false);
else
@@ -194,6 +197,9 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
break;
}
}
+ if (!_s->resMan->isVGA())
+ bgcolor |= (bgcolor << 4);
+
// now drawing the text
_gfx->TextSize(rect, text, -1, width);
_gfx->Move((orect->left <= 320 ? 0 : 320 - orect->left), (orect->top <= 200 ? 0 : 200 - orect->top)); // move port to (0,0)
@@ -234,6 +240,12 @@ void SciGui::textColors(int argc, reg_t *argv) {
void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
GuiPort *oldPort = _gfx->SetPort(_gfx->_menuPort);
+
+ if (!_s->resMan->isVGA()) {
+ colorPen |= colorPen << 4;
+ colorBack |= colorBack << 4;
+ }
+
_gfx->FillRect(_gfx->_menuRect, 1, colorBack);
_gfx->PenColor(colorPen);
_gfx->MoveTo(0, 1);
@@ -311,11 +323,15 @@ void SciGui::graphFillBoxBackground(Common::Rect rect) {
}
void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
+ if (!_s->resMan->isVGA())
+ color |= (color << 4);
_gfx->FillRect(rect, colorMask, color, priority, control);
_screen->copyToScreen();
}
void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
+ if (!_s->resMan->isVGA())
+ color |= (color << 4);
_gfx->Draw_Line(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
_screen->copyToScreen();
}
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 5c9a366d78..06ddac40f3 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -377,13 +377,16 @@ void SciGuiGfx::OpenPort(GuiPort *port) {
port->left = 0;
port->textFace = 0;
port->penClr = 0;
- port->backClr = 0xFF;
+ port->backClr = 255;
port->penMode = 0;
port->rect = _bounds;
}
void SciGuiGfx::PenColor(int16 color) {
- _curPort->penClr = color;
+ if (!_s->resMan->isVGA())
+ _curPort->penClr = color;
+ else
+ _curPort->penClr = color | (color << 4);
}
void SciGuiGfx::PenMode(int16 mode) {