[Scummvm-cvs-logs] scummvm master -> 481aeb0b0b7b831a45092975f56efb68b3a6f119

Strangerke Strangerke at scummvm.org
Fri Aug 16 18:51:52 CEST 2013


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:
481aeb0b0b MORTEVIELLE: Remove code related to unsupported display modes


Commit: 481aeb0b0b7b831a45092975f56efb68b3a6f119
    https://github.com/scummvm/scummvm/commit/481aeb0b0b7b831a45092975f56efb68b3a6f119
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-08-16T09:50:28-07:00

Commit Message:
MORTEVIELLE: Remove code related to unsupported display modes

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index abaf38c..55e7353 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -431,12 +431,6 @@ void DialogManager::checkForF8(int SpeechNum, bool drawFrame2Fl) {
 		_vm->_key = waitForF3F8();
 		if (_vm->shouldQuit())
 			return;
-
-		if (_vm->_newGraphicalDevice != _vm->_currGraphicalDevice) {
-			_vm->_currGraphicalDevice = _vm->_newGraphicalDevice;
-			_vm->clearScreen();
-			displayIntroScreen(drawFrame2Fl);
-		}
 	} while (_vm->_key != 66); // keycode for F8
 }
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 059f5a9..a15195f 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1165,13 +1165,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
  * @remarks	Originally called 'paint_rect'
  */
 void ScreenSurface::drawRectangle(int x, int y, int dx, int dy) {
-	int co;
-
-	if (_vm->_currGraphicalDevice == MODE_CGA)
-		co = 3;
-	else
-		co = 11;
-	_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
+	_vm->_screenSurface.fillRect(11, Common::Rect(x, y, x + dx, y + dy));
 }
 
 void ScreenSurface::setParent(MortevielleEngine *vm) {
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 8fdef34..f815f48 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -272,11 +272,6 @@ void Menu::displayMenu() {
 	_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 
 	int col = 28 * _vm->_resolutionScaler;
-	int color;
-	if (_vm->_currGraphicalDevice == MODE_CGA)
-		color = 1;
-	else
-		color = 9;
 	for (int charNum = 0; charNum < 6; charNum++) {
 	// One character after the other
 		int idx = 0;
@@ -290,7 +285,7 @@ void Menu::displayMenu() {
 					if ((_charArr[charNum][idx] & msk) != 0) {
 						_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
 						_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
-						_vm->_screenSurface.setPixel(Common::Point(x, y), color);
+						_vm->_screenSurface.setPixel(Common::Point(x, y), 9);
 					}
 					msk >>= 1;
 					++x;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 059bde4..fa5683d 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -92,8 +92,6 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescr
 	_uptodatePresence = false;
 
 	_textColor = 0;
-	_currGraphicalDevice = -1;
-	_newGraphicalDevice = -1;
 	_place = -1;
 
 	_x26KeyCount = -1;
@@ -181,7 +179,6 @@ Common::ErrorCode MortevielleEngine::initialize() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	_currGraphicalDevice = MODE_EGA;
 	_resolutionScaler = 2;
 
 	_txxFileFl = false;
@@ -204,8 +201,6 @@ Common::ErrorCode MortevielleEngine::initialize() {
 	// Setup the mouse cursor
 	initMouse();
 
-	_currGraphicalDevice = MODE_EGA;
-	_newGraphicalDevice = _currGraphicalDevice;
 	loadPalette();
 	loadCFIPH();
 	loadCFIEC();
@@ -220,10 +215,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
 
 	testKeyboard();
 	showConfigScreen();
-	_newGraphicalDevice = _currGraphicalDevice;
 	testKeyboard();
-	if (_newGraphicalDevice != _currGraphicalDevice)
-		_currGraphicalDevice = _newGraphicalDevice;
 	clearScreen();
 
 	_soundManager.loadNoise();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index d3930f7..443f588 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -129,8 +129,6 @@ enum Places {
 	DOOR = 25,        ROOM26 = 26,      COAT_ARMS = 27
 };
 
-enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
-
 struct nhom {
 	byte _id;     /* number between 0 and 32 */
 	byte _hom[4];
@@ -278,7 +276,6 @@ private:
 	void getReadDescription(int objId);
 	void getSearchDescription(int objId);
 	int  checkLeaveSecretPassage();
-	void changeGraphicalDevice(int newDevice);
 	void startDialog(int16 rep);
 	void endSearch();
 	int convertCharacterIndexToBitIndex(int characterIndex);
@@ -419,8 +416,6 @@ public:
 	bool _blo;
 	bool _destinationOk;
 	bool _largestClearScreen;
-	int  _currGraphicalDevice;
-	int  _newGraphicalDevice;
 	float _addFix;
 	int  _savedBitIndex;
 	int  _numpal;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index d1cbeea..8246848 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -175,7 +175,6 @@ void TextHandler::taffich() {
 
 	int cx, drawingSize, npal;
 	int32 drawingStartPos;
-	int alllum[16];
 
 	int a = _vm->_caff;
 	if ((a >= 153) && (a <= 161))
@@ -272,21 +271,6 @@ void TextHandler::taffich() {
 		npal = a + 37;
 	}
 	loadPictureFile(filename, altFilename, drawingStartPos, drawingSize);
-	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
-		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&_vm->_curPict[2 + (i << 1)]);
-			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
-		}
-		for (int i = 0; i <= 15; ++i) {
-			int k = 0;
-			for (int j = 0; j <= 15; ++j) {
-				if (alllum[j] > alllum[k])
-					k = j;
-			}
-			_vm->_curPict[2 + (k << 1)] = rang[i];
-			alllum[k] = -1;
-		}
-	}
 	_vm->_numpal = npal;
 	_vm->setPal(npal);
 
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 356b6a8..465de4e 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -283,10 +283,6 @@ void MortevielleEngine::handleAction() {
 
 		_menu.eraseMenu();
 		_menu._menuDisplayed = false;
-		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			changeGraphicalDevice((uint)((int)inkey - 1) >> 1);
-			return;
-		}
 		if (_menu._menuSelected && (_currMenu == MENU_SAVE)) {
 			Common::String saveName = Common::String::format("Savegame #%d", _currAction & 15);
 			_savegameManager.saveGame(_currAction & 15, saveName);
@@ -1450,31 +1446,6 @@ void MortevielleEngine::floodedInWell() {
 }
 
 /**
- * Engine function - Change Graphical Device
- * @remarks	Originally called 'change_gd'
- */
-void MortevielleEngine::changeGraphicalDevice(int newDevice) {
-	_mouse.hideMouse();
-	_currGraphicalDevice = newDevice;
-	clearScreen();
-	_mouse.initMouse();
-	_mouse.showMouse();
-	drawRightFrame();
-	prepareRoom();
-	drawClock();
-	if (_currBitIndex != 0)
-		showPeoplePresent(_currBitIndex);
-	else
-		displayAloneText();
-	clearDescriptionBar();
-	clearVerbBar();
-	_maff = 68;
-	drawPictureWithText();
-	handleDescriptionText(2, _crep);
-	_menu.displayMenu();
-}
-
-/**
  * Called when a savegame has been loaded.
  * @remarks	Originally called 'antegame'
  */
@@ -1980,30 +1951,9 @@ void MortevielleEngine::resetVariables() {
  * @remarks	Originally called 'writepal'
  */
 void MortevielleEngine::setPal(int n) {
-	switch (_currGraphicalDevice) {
-	case MODE_TANDY:
-	case MODE_EGA:
-	case MODE_AMSTRAD1512:
-		for (int i = 1; i <= 16; ++i) {
-			_curPict[(2 * i)] = _stdPal[n][i].x;
-			_curPict[(2 * i) + 1] = _stdPal[n][i].y;
-		}
-		break;
-	case MODE_CGA: {
-		nhom pal[16];
-		for (int i = 0; i < 16; ++i) {
-			pal[i] = _cgaPal[n]._a[i];
-		}
-
-		if (n < 89)
-			palette(_cgaPal[n]._p);
-
-		for (int i = 0; i <= 15; ++i)
-			displayCGAPattern(i, &_patternArr[pal[i]._id], pal);
-		}
-		break;
-	default:
-		break;
+	for (int i = 1; i <= 16; ++i) {
+		_curPict[(2 * i)] = _stdPal[n][i].x;
+		_curPict[(2 * i) + 1] = _stdPal[n][i].y;
 	}
 }
 
@@ -2216,8 +2166,6 @@ void MortevielleEngine::showTitleScreen() {
 	_caff = 51;
 	_text.taffich();
 	testKeyboard();
-	if (_newGraphicalDevice != _currGraphicalDevice)
-		_currGraphicalDevice = _newGraphicalDevice;
 	clearScreen();
 	draw(0, 0);
 
@@ -2243,9 +2191,6 @@ void MortevielleEngine::draw(int x, int y) {
  */
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
-	if (_currGraphicalDevice == MODE_HERCULES)
-		_curPict[14] = 15;
-
 	_mouse.hideMouse();
 	displayPicture(_rightFramePict, 0, 0);
 	_mouse.showMouse();
@@ -2418,21 +2363,16 @@ void MortevielleEngine::drawClock() {
 	const int x = 580;
 	const int y = 123;
 	const int rg = 9;
-	int hourColor;
 
 	_mouse.hideMouse();
 
 	_screenSurface.drawRectangle(570, 118, 20, 10);
 	_screenSurface.drawRectangle(578, 114, 6, 18);
-	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
-		hourColor = 0;
-	else
-		hourColor = 1;
 
 	if (_minute == 0)
-		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y - rg), hourColor);
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y - rg), 1);
 	else
-		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y + rg), hourColor);
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y + rg), 1);
 
 	int hour12 = _hour;
 	if (hour12 > 12)
@@ -2440,7 +2380,7 @@ void MortevielleEngine::drawClock() {
 	if (hour12 == 0)
 		hour12 = 12;
 
-	_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * _resolutionScaler, y + cv[1][hour12 - 1], hourColor);
+	_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * _resolutionScaler, y + cv[1][hour12 - 1], 1);
 	_mouse.showMouse();
 	_screenSurface.putxy(568, 154);
 
@@ -2486,20 +2426,6 @@ Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t
  * @remarks	Originally called 'hirs'
  */
 void MortevielleEngine::clearScreen() {
-	// Note: The original used this to set the graphics mode and clear the screen, both at
-	// the start of the game, and whenever the screen need to be cleared. As such, this
-	// method is deprecated in favour of clearing the screen
-	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
-
-	if (_currGraphicalDevice == MODE_TANDY) {
-		_screenSurface.fillRect(0, Common::Rect(0, 0, 639, 200));
-		_resolutionScaler = 1;
-	} else if (_currGraphicalDevice == MODE_CGA) {
-		palette(1);
-		_resolutionScaler = 1;
-	} else
-		_resolutionScaler = 2;
-
 	_screenSurface.clearScreen();
 }
 
@@ -2540,12 +2466,6 @@ void MortevielleEngine::displayControlMenu() {
 void MortevielleEngine::displayPicture(const byte *pic, int x, int y) {
 	GfxSurface surface;
 	surface.decode(pic);
-
-	if (_currGraphicalDevice == MODE_HERCULES) {
-		_curPict[2] = 0;
-		_curPict[32] = 15;
-	}
-
 	_screenSurface.drawPicture(surface, x, y);
 }
 
@@ -3465,17 +3385,8 @@ int MortevielleEngine::checkLeaveSecretPassage() {
  * @remarks	Originally called 'fenat'
  */
 void MortevielleEngine::displayStatusInDescriptionBar(char stat) {
-	int color;
-
 	_mouse.hideMouse();
-	if (_currGraphicalDevice == MODE_CGA)
-		color = 2;
-	else if (_currGraphicalDevice == MODE_HERCULES)
-		color = 1;
-	else
-		color = 12;
-
-	_screenSurface.writeCharacter(Common::Point(306, 193), stat, color);
+	_screenSurface.writeCharacter(Common::Point(306, 193), stat, 12);
 	_screenSurface.drawBox(300, 191, 16, 8, 15);
 	_mouse.showMouse();
 }






More information about the Scummvm-git-logs mailing list