From 042011a3fed84ff7290feb44788932c6bbba89e8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 20 Jul 2013 23:58:47 +0200 Subject: MORTEVIELLE: Remove one more magic value, simplify draw() --- engines/mortevielle/dialogs.cpp | 2 +- engines/mortevielle/mortevielle.h | 4 +++- engines/mortevielle/utils.cpp | 18 +++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index d992fa0cce..29722a1b59 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -465,7 +465,7 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) { _vm->_caff = 50; _vm->_maff = 0; _vm->_text.taffich(); - _vm->draw(kAdrPictureComp, 63, 12); + _vm->draw(63, 12); if (drawFrame2Fl) displayIntroFrame2(); else diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index 28aa018f93..44db0d24c3 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -67,6 +67,8 @@ const int kAdrMusic = 0x5000; const int kAdrPictureDecomp = 0x6000; const int kAdrPictureComp = 0x7000; +const int kAdrDecBuffer = 0x73A2; + const int kAdrEGA = 0xA000; const int kAdrHERC = 0xB000; const int kAdrCGA1 = 0xB800; @@ -520,7 +522,7 @@ public: void gameLoaded(); void initGame(); void displayAloneText(); - void draw(int ad, int x, int y); + void draw(int x, int y); void charToHour(); void hourToChar(); Common::String getString(int num); diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp index 20ba38b969..d5b777bab1 100644 --- a/engines/mortevielle/utils.cpp +++ b/engines/mortevielle/utils.cpp @@ -2245,7 +2245,7 @@ void MortevielleEngine::showTitleScreen() { if (_newGraphicalDevice != _currGraphicalDevice) _currGraphicalDevice = _newGraphicalDevice; hirs(); - draw(kAdrPictureComp, 0, 0); + draw(0, 0); Common::String cpr = "COPYRIGHT 1989 : LANKHOR"; _screenSurface.putxy(104 + 72 * _resolutionScaler, 185); @@ -2256,10 +2256,10 @@ void MortevielleEngine::showTitleScreen() { * Draw picture * @remarks Originally called 'dessine' */ -void MortevielleEngine::draw(int ad, int x, int y) { +void MortevielleEngine::draw(int x, int y) { _mouse.hideMouse(); setPal(_numpal); - pictout(ad, 0, x, y); + pictout(kAdrPictureComp, 0, x, y); _mouse.showMouse(); } @@ -2273,7 +2273,7 @@ void MortevielleEngine::drawRightFrame() { _mem[(kAdrPictureComp * 16) + 14] = 15; } _mouse.hideMouse(); - pictout(0x73a2, 0, 0, 0); + pictout(kAdrDecBuffer, 0, 0, 0); _mouse.showMouse(); } @@ -2589,7 +2589,7 @@ void MortevielleEngine::adzon() { if (!f.open("dec.mor")) error("Missing file - dec.mor"); - f.read(&_mem[0x73a2 * 16], 1664); + f.read(&_mem[kAdrDecBuffer * 16], 1664); f.close(); } @@ -2997,13 +2997,13 @@ void MortevielleEngine::aniof(int ouf, int num) { void MortevielleEngine::drawPicture() { clearUpperLeftPart(); if (_caff > 99) { - draw(kAdrPictureComp, 60, 33); + draw(60, 33); _screenSurface.drawBox(118, 32, 291, 121, 15); // Medium box } else if (_caff > 69) { - draw(kAdrPictureComp, 112, 48); // Heads + draw(112, 48); // Heads _screenSurface.drawBox(222, 47, 155, 92, 15); } else { - draw(kAdrPictureComp, 0, 12); + draw(0, 12); prepareScreenType1(); if ((_caff < 30) || (_caff > 32)) { for (int cx = 1; cx <= 6; ++cx) { @@ -3176,7 +3176,7 @@ void MortevielleEngine::mennor() { } void MortevielleEngine::premtet() { - draw(kAdrPictureComp, 10, 80); + draw(10, 80); _screenSurface.drawBox(18, 79, 155, 91, 15); } -- cgit v1.2.3