aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mads/dialogs.cpp2
-rw-r--r--engines/mads/game.cpp4
-rw-r--r--engines/mads/hotspots.cpp2
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp8
-rw-r--r--engines/mads/nebular/menu_nebular.cpp4
-rw-r--r--engines/mads/scene.cpp2
-rw-r--r--engines/mads/scene.h2
-rw-r--r--engines/mads/screen.cpp20
-rw-r--r--engines/mads/screen.h10
-rw-r--r--engines/mads/user_interface.cpp14
10 files changed, 34 insertions, 34 deletions
diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp
index 5e38f34fc6..c02f027302 100644
--- a/engines/mads/dialogs.cpp
+++ b/engines/mads/dialogs.cpp
@@ -449,7 +449,7 @@ void FullScreenDialog::display() {
}
// Set Fx state and palette entries
- game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition;
+ game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kNullPaletteCopy;
game._trigger = 0;
// Clear the screen and draw the upper and lower horizontal lines
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 94653f9a39..0ce24daf7a 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -240,7 +240,7 @@ void Game::sectionLoop() {
_fx = kTransitionFadeOutIn;
break;
case SCREEN_FADE_FAST:
- _fx = kCenterVertTransition;
+ _fx = kNullPaletteCopy;
break;
default:
_fx = kTransitionNone;
@@ -324,7 +324,7 @@ void Game::initSection(int sectionNumber) {
_vm->_palette->resetGamePalette(18, 10);
_vm->_palette->setLowRange();
- if (_scene._layer == LAYER_GUI)
+ if (_scene._mode == SCREENMODE_VGA)
_vm->_palette->setPalette(_vm->_palette->_mainPalette, 0, 4);
_vm->_events->loadCursors("*CURSOR.SS");
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index d75d7ae13e..2af421a112 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -137,7 +137,7 @@ void DynamicHotspots::refresh() {
switch (scrObjects._inputMode) {
case kInputBuildingSentences:
case kInputLimitedSentences:
- scrObjects.add(dh._bounds, _vm->_game->_scene._layer, CAT_12, dh._descId);
+ scrObjects.add(dh._bounds, _vm->_game->_scene._mode, CAT_12, dh._descId);
scrObjects._forceRescan = true;
break;
default:
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index f5355517bd..74da378128 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -643,14 +643,14 @@ void GameDialog::setClickableLines() {
int maxHeight = _lines[idx]._font->getHeight();
screenObjects.add(Common::Rect(pt.x, pt.y, pt.x + strWidth, pt.y + maxHeight - 1),
- LAYER_GUI, CAT_COMMAND, idx);
+ SCREENMODE_VGA, CAT_COMMAND, idx);
}
}
if (_vm->_dialogs->_pendingDialog == DIALOG_SAVE ||
_vm->_dialogs->_pendingDialog == DIALOG_RESTORE) {
- screenObjects.add(Common::Rect(293, 26, 312, 75), LAYER_GUI, CAT_INV_LIST, 50);
- screenObjects.add(Common::Rect(293, 78, 312, 127), LAYER_GUI, CAT_INV_LIST, 51);
+ screenObjects.add(Common::Rect(293, 26, 312, 75), SCREENMODE_VGA, CAT_INV_LIST, 50);
+ screenObjects.add(Common::Rect(293, 78, 312, 127), SCREENMODE_VGA, CAT_INV_LIST, 51);
}
}
@@ -825,7 +825,7 @@ void GameDialog::handleEvents() {
// Scan for objects in the dialog
Common::Point mousePos = events.currentPos() - Common::Point(0, DIALOG_TOP);
- int objIndex = screenObjects.scan(mousePos, LAYER_GUI);
+ int objIndex = screenObjects.scan(mousePos, SCREENMODE_VGA);
if (_movedFlag) {
int yp = mousePos.y;
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 28de4e5650..2fdef3443d 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -86,7 +86,7 @@ void MainMenu::display() {
frame0->_offset.y - frame0->h);
screenObjects.add(
Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w,
- pt.y + frame0->h + DIALOG_TOP), LAYER_GUI, CAT_COMMAND, i);
+ pt.y + frame0->h + DIALOG_TOP), SCREENMODE_VGA, CAT_COMMAND, i);
}
// Set the cursor for when it's shown
@@ -292,7 +292,7 @@ bool MainMenu::onEvent(Common::Event &event) {
}
int MainMenu::getHighlightedItem(const Common::Point &pt) {
- return _vm->_game->_screenObjects.scan(pt, LAYER_GUI) - 1;
+ return _vm->_game->_screenObjects.scan(pt, SCREENMODE_VGA) - 1;
}
void MainMenu::unhighlightItem() {
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index d2b4b29622..ea3fe2c148 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -52,7 +52,7 @@ Scene::Scene(MADSEngine *vm)
_activeAnimation = nullptr;
_textSpacing = -1;
_frameStartTime = 0;
- _layer = LAYER_GUI;
+ _mode = SCREENMODE_VGA;
_lookFlag = false;
_bandsRange = 0;
_scaleRange = 0;
diff --git a/engines/mads/scene.h b/engines/mads/scene.h
index 9fd99ad8e5..05053c3166 100644
--- a/engines/mads/scene.h
+++ b/engines/mads/scene.h
@@ -121,7 +121,7 @@ public:
bool _reloadSceneFlag;
Common::Point _posAdjust;
uint32 _frameStartTime;
- Layer _layer;
+ ScreenMode _mode;
bool _lookFlag;
Common::Point _customDest;
Common::Array<PaletteUsage::UsageEntry> _paletteUsageF;
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index c9a0863d85..8552effd98 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -244,7 +244,7 @@ void DirtyAreas::reset() {
ScreenObject::ScreenObject() {
_category = CAT_NONE;
_descId = 0;
- _layer = 0;
+ _mode = 0;
_active = false;
}
@@ -265,14 +265,12 @@ ScreenObjects::ScreenObjects(MADSEngine *vm) : _vm(vm) {
_baseTime = 0;
}
-void ScreenObjects::add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId) {
- //assert(size() < 100);
-
+void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) {
ScreenObject so;
so._bounds = bounds;
so._category = category;
so._descId = descId;
- so._layer = layer;
+ so._mode = mode;
so._active = true;
push_back(so);
@@ -288,7 +286,7 @@ void ScreenObjects::check(bool scanFlag) {
if ((_vm->_events->_mouseMoved || userInterface._scrollbarActive
|| _v8332A || _forceRescan) && scanFlag) {
_category = CAT_NONE;
- _selectedObject = scanBackwards(_vm->_events->currentPos(), LAYER_GUI);
+ _selectedObject = scanBackwards(_vm->_events->currentPos(), SCREENMODE_VGA);
if (_selectedObject > 0) {
ScreenObject &scrObject = (*this)[_selectedObject];
_category = (ScrCategory)(scrObject._category & 7);
@@ -365,7 +363,7 @@ void ScreenObjects::check(bool scanFlag) {
int ScreenObjects::scan(const Common::Point &pt, int layer) {
for (uint i = 1; i <= size(); ++i) {
ScreenObject &sObj = (*this)[i];
- if (sObj._active && sObj._bounds.contains(pt) && sObj._layer == layer)
+ if (sObj._active && sObj._bounds.contains(pt) && sObj._mode == layer)
return i;
}
@@ -376,7 +374,7 @@ int ScreenObjects::scan(const Common::Point &pt, int layer) {
int ScreenObjects::scanBackwards(const Common::Point &pt, int layer) {
for (int i = (int)size(); i >= 1; --i) {
ScreenObject &sObj = (*this)[i];
- if (sObj._active && sObj._bounds.contains(pt) && sObj._layer == layer)
+ if (sObj._active && sObj._bounds.contains(pt) && sObj._mode == layer)
return i;
}
@@ -653,8 +651,10 @@ void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag
transition(kTransitionFadeIn, surfaceFlag);
break;
- case kCenterVertTransition:
- warning("TODO: center vert transition");
+ case kNullPaletteCopy:
+ // Original temporarily set the palette to black, copied the scene to the
+ // screen, and then restored the palette. We can give a similiar effect
+ // by doing a standard quick palette fade in
transition(kTransitionFadeIn, surfaceFlag);
break;
diff --git a/engines/mads/screen.h b/engines/mads/screen.h
index 9d01ca82e3..6800523f92 100644
--- a/engines/mads/screen.h
+++ b/engines/mads/screen.h
@@ -33,8 +33,8 @@ namespace MADS {
#define MADS_SCREEN_WIDTH 320
#define MADS_SCREEN_HEIGHT 200
-enum Layer {
- LAYER_GUI = 19
+enum ScreenMode {
+ SCREENMODE_VGA = 19
};
enum ScreenTransition {
@@ -47,7 +47,7 @@ enum ScreenTransition {
kTransitionCircleIn3, kTransitionCircleIn4,
kVertTransition1, kVertTransition2, kVertTransition3,
kVertTransition4, kVertTransition5, kVertTransition6,
- kVertTransition7, kCenterVertTransition
+ kVertTransition7, kNullPaletteCopy
};
enum InputMode {
@@ -130,7 +130,7 @@ public:
Common::Rect _bounds;
ScrCategory _category;
int _descId;
- int _layer;
+ int _mode;
ScreenObject();
};
@@ -162,7 +162,7 @@ public:
/**
* Add a new item to the list
*/
- void add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId);
+ void add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId);
/**
* Check objects on the screen
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index 1f8d5037bc..822460d549 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -673,7 +673,7 @@ void UserInterface::loadElements() {
getBounds(CAT_INV_SCROLLER, idx, bounds);
moveRect(bounds);
- _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_SCROLLER, idx);
+ _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_SCROLLER, idx);
}
// Set up actions
@@ -682,7 +682,7 @@ void UserInterface::loadElements() {
getBounds(CAT_COMMAND, idx, bounds);
moveRect(bounds);
- _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_COMMAND, idx);
+ _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_COMMAND, idx);
}
// Set up inventory list
@@ -691,7 +691,7 @@ void UserInterface::loadElements() {
getBounds(CAT_INV_LIST, _inventoryTopIndex + idx, bounds);
moveRect(bounds);
- _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_LIST, idx);
+ _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_LIST, idx);
}
// Set up the inventory vocab list
@@ -700,12 +700,12 @@ void UserInterface::loadElements() {
getBounds(CAT_INV_VOCAB, idx, bounds);
moveRect(bounds);
- _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_VOCAB, idx);
+ _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_VOCAB, idx);
}
// Set up the inventory item picture
_categoryIndexes[CAT_INV_ANIM - 1] = _vm->_game->_screenObjects.size() + 1;
- _vm->_game->_screenObjects.add(Common::Rect(160, 159, 231, 194), LAYER_GUI,
+ _vm->_game->_screenObjects.add(Common::Rect(160, 159, 231, 194), SCREENMODE_VGA,
CAT_INV_ANIM, 0);
}
@@ -714,7 +714,7 @@ void UserInterface::loadElements() {
_categoryIndexes[CAT_HOTSPOT - 1] = _vm->_game->_screenObjects.size() + 1;
for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) {
Hotspot &hs = scene._hotspots[hotspotIdx];
- _vm->_game->_screenObjects.add(hs._bounds, LAYER_GUI, CAT_HOTSPOT, hotspotIdx);
+ _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA, CAT_HOTSPOT, hotspotIdx);
}
}
@@ -725,7 +725,7 @@ void UserInterface::loadElements() {
getBounds(CAT_TALK_ENTRY, idx, bounds);
moveRect(bounds);
- _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_TALK_ENTRY, idx);
+ _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_TALK_ENTRY, idx);
}
}