diff options
Diffstat (limited to 'engines/sci/graphics/gui.cpp')
-rw-r--r-- | engines/sci/graphics/gui.cpp | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 44bf96eba6..4796659203 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -104,111 +104,6 @@ void SciGui::wait(int16 ticks) { kernel_sleep(_s->_event, ticks * 1000 / 60); } -#define SCI_DISPLAY_MOVEPEN 100 -#define SCI_DISPLAY_SETALIGNMENT 101 -#define SCI_DISPLAY_SETPENCOLOR 102 -#define SCI_DISPLAY_SETBACKGROUNDCOLOR 103 -#define SCI_DISPLAY_SETGREYEDOUTPUT 104 -#define SCI_DISPLAY_SETFONT 105 -#define SCI_DISPLAY_WIDTH 106 -#define SCI_DISPLAY_SAVEUNDER 107 -#define SCI_DISPLAY_RESTOREUNDER 108 -#define SCI_DISPLAY_DONTSHOWBITS 121 - -void SciGui::display(const char *text, int argc, reg_t *argv) { - int displayArg; - TextAlignment alignment = SCI_TEXT16_ALIGNMENT_LEFT; - int16 colorPen = -1, colorBack = -1, width = -1, bRedraw = 1; - bool doSaveUnder = false; - Common::Rect rect; - - // Make a "backup" of the port settings - Port oldPort = *_ports->getPort(); - - // setting defaults - _ports->penMode(0); - _ports->penColor(0); - _ports->textGreyedOutput(false); - // processing codes in argv - while (argc > 0) { - displayArg = argv[0].toUint16(); - argc--; argv++; - switch (displayArg) { - case SCI_DISPLAY_MOVEPEN: - _ports->moveTo(argv[0].toUint16(), argv[1].toUint16()); - argc -= 2; argv += 2; - break; - case SCI_DISPLAY_SETALIGNMENT: - alignment = argv[0].toSint16(); - argc--; argv++; - break; - case SCI_DISPLAY_SETPENCOLOR: - colorPen = argv[0].toUint16(); - _ports->penColor(colorPen); - argc--; argv++; - break; - case SCI_DISPLAY_SETBACKGROUNDCOLOR: - colorBack = argv[0].toUint16(); - argc--; argv++; - break; - case SCI_DISPLAY_SETGREYEDOUTPUT: - _ports->textGreyedOutput(argv[0].isNull() ? false : true); - argc--; argv++; - break; - case SCI_DISPLAY_SETFONT: - _text16->SetFont(argv[0].toUint16()); - argc--; argv++; - break; - case SCI_DISPLAY_WIDTH: - width = argv[0].toUint16(); - argc--; argv++; - break; - case SCI_DISPLAY_SAVEUNDER: - doSaveUnder = true; - break; - case SCI_DISPLAY_RESTOREUNDER: - _paint16->bitsGetRect(argv[0], &rect); - rect.translate(-_ports->getPort()->left, -_ports->getPort()->top); - _paint16->bitsRestore(argv[0]); - _paint16->kernelGraphRedrawBox(rect); - // finishing loop - argc = 0; - break; - case SCI_DISPLAY_DONTSHOWBITS: - bRedraw = 0; - break; - default: - warning("Unknown kDisplay argument %X", displayArg); - break; - } - } - - // now drawing the text - _text16->Size(rect, text, -1, width); - rect.moveTo(_ports->getPort()->curLeft, _ports->getPort()->curTop); - if (getSciVersion() >= SCI_VERSION_1_LATE) { - int16 leftPos = rect.right <= _screen->getWidth() ? 0 : _screen->getWidth() - rect.right; - int16 topPos = rect.bottom <= _screen->getHeight() ? 0 : _screen->getHeight() - rect.bottom; - _ports->move(leftPos, topPos); - rect.moveTo(_ports->getPort()->curLeft, _ports->getPort()->curTop); - } - - if (doSaveUnder) - _s->r_acc = _paint16->bitsSave(rect, SCI_SCREEN_MASK_VISUAL); - if (colorBack != -1) - _paint16->fillRect(rect, SCI_SCREEN_MASK_VISUAL, colorBack, 0, 0); - _text16->Box(text, 0, rect, alignment, -1); - if (_screen->_picNotValid == 0 && bRedraw) - _paint16->bitsShow(rect); - // restoring port and cursor pos - Port *currport = _ports->getPort(); - uint16 tTop = currport->curTop; - uint16 tLeft = currport->curLeft; - *currport = oldPort; - currport->curTop = tTop; - currport->curLeft = tLeft; -} - void SciGui::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) { Common::Rect rect(0, 0, *textWidth, *textHeight); _text16->Size(rect, text, font, maxWidth); |