aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/screen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r--engines/sherlock/screen.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index cbf18f146f..d9ec1d745d 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -53,6 +53,10 @@ Screen::~Screen() {
* Set the font to use for writing text on the screen
*/
void Screen::setFont(int fontNumb) {
+ // Interactive demo doesn't use fonts
+ if (!_vm->_interactiveFl)
+ return;
+
_fontNumber = fontNumb;
Common::String fname = Common::String::format("FONT%d.VGS", fontNumb + 1);
@@ -112,8 +116,7 @@ int Screen::equalizePalette(const byte palette[PALETTE_SIZE]) {
// For any palette component that doesn't already match the given destination
// palette, change by 1 towards the reference palette component
for (int idx = 0; idx < PALETTE_SIZE; ++idx) {
- if (tempPalette[idx] > palette[idx])
- {
+ if (tempPalette[idx] > palette[idx]) {
tempPalette[idx] = MAX((int)palette[idx], (int)tempPalette[idx] - 4);
++total;
} else if (tempPalette[idx] < palette[idx]) {
@@ -212,7 +215,7 @@ void Screen::randomTransition() {
for (int idx = 0; idx <= 65535 && !_vm->shouldQuit(); ++idx) {
_transitionSeed = _transitionSeed * TRANSITION_MULTIPLIER + 1;
- int offset = _transitionSeed & 65535;
+ int offset = _transitionSeed & 0xFFFF;
if (offset < (SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCREEN_HEIGHT))
*((byte *)getPixels() + offset) = *((const byte *)_backBuffer->getPixels() + offset);
@@ -467,7 +470,7 @@ void Screen::buttonPrint(const Common::Point &pt, byte color, bool slamIt,
}
/**
- * Draw a panel in th eback buffer with a raised area effect around the edges
+ * Draw a panel in the back buffer with a raised area effect around the edges
*/
void Screen::makePanel(const Common::Rect &r) {
_backBuffer->fillRect(r, BUTTON_MIDDLE);
@@ -483,6 +486,18 @@ void Screen::makePanel(const Common::Rect &r) {
}
/**
+ * Draw a field in the back buffer with a raised area effect around the edges,
+ * suitable for text input.
+ */
+void Screen::makeField(const Common::Rect &r) {
+ _backBuffer->fillRect(r, BUTTON_MIDDLE);
+ _backBuffer->hLine(r.left, r.top, r.right - 1, BUTTON_BOTTOM);
+ _backBuffer->hLine(r.left + 1, r.bottom - 1, r.right - 1, BUTTON_TOP);
+ _backBuffer->vLine(r.left, r.top + 1, r.bottom - 1, BUTTON_BOTTOM);
+ _backBuffer->vLine(r.right - 1, r.top + 1, r.bottom - 2, BUTTON_TOP);
+}
+
+/**
* Sets the active back buffer pointer to a restricted sub-area of the first back buffer
*/
void Screen::setDisplayBounds(const Common::Rect &r) {