[Scummvm-cvs-logs] scummvm master -> 926404bd10309e98d353acd5515c678234de28aa

dreammaster dreammaster at scummvm.org
Sun Jan 18 02:53:03 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
926404bd10 MADS: Renamings of Layer and a transition type


Commit: 926404bd10309e98d353acd5515c678234de28aa
    https://github.com/scummvm/scummvm/commit/926404bd10309e98d353acd5515c678234de28aa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-01-17T20:51:52-05:00

Commit Message:
MADS: Renamings of Layer and a transition type

Changed paths:
    engines/mads/dialogs.cpp
    engines/mads/game.cpp
    engines/mads/hotspots.cpp
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/scene.cpp
    engines/mads/scene.h
    engines/mads/screen.cpp
    engines/mads/screen.h
    engines/mads/user_interface.cpp



diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp
index 5e38f34..c02f027 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 94653f9..0ce24da 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 d75d7ae..2af421a 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 f535551..74da378 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 28de4e5..2fdef34 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 d2b4b29..ea3fe2c 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 9fd99ad..05053c3 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 c9a0863..8552eff 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 9d01ca8..6800523 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 1f8d503..822460d 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);
 		}
 	}
 






More information about the Scummvm-git-logs mailing list