diff options
author | Strangerke | 2012-02-21 22:36:45 +0100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:21:44 +0200 |
commit | a988c467a4ef50ee405657ded1fc1c49db061ade (patch) | |
tree | ae8648260ecf3b1a6f36fb6e4801970b201edf51 /engines | |
parent | 77f9e706e50e11d711575a90e18522381d5bac73 (diff) | |
download | scummvm-rg350-a988c467a4ef50ee405657ded1fc1c49db061ade.tar.gz scummvm-rg350-a988c467a4ef50ee405657ded1fc1c49db061ade.tar.bz2 scummvm-rg350-a988c467a4ef50ee405657ded1fc1c49db061ade.zip |
MORTEVIELLE: Rename graphical mode constants
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mortevielle/level15.cpp | 10 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 8 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 46 | ||||
-rw-r--r-- | engines/mortevielle/mouse.cpp | 20 | ||||
-rw-r--r-- | engines/mortevielle/taffich.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.h | 2 |
8 files changed, 55 insertions, 39 deletions
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp index eff7172235..e1bba275e7 100644 --- a/engines/mortevielle/level15.cpp +++ b/engines/mortevielle/level15.cpp @@ -69,15 +69,15 @@ void writepal(int n) { t_nhom pal; switch (_currGraphicalDevice) { - case tan: - case ega: - case ams: + case MODE_TANDY: + case MODE_EGA: + case MODE_AMSTRAD1512: for (int i = 1; i <= 16; ++i) { mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x; mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y; } break; - case cga: + case MODE_CGA: warning("TODO: If this code is needed, resolve the incompatible types"); // pal = palcga[n].a; if (n < 89) @@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) { GfxSurface surface; surface.decode(&mem[seg * 16 + dep]); - if (_currGraphicalDevice == her) { + if (_currGraphicalDevice == MODE_HERCULES) { mem[0x7000 * 16 + 2] = 0; mem[0x7000 * 16 + 32] = 15; } diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index 9f2e83f967..78d9449b03 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -152,7 +152,7 @@ void Menu::menu_aff() { g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10)); col = 28 * res; - if (_currGraphicalDevice == cga) + if (_currGraphicalDevice == MODE_CGA) color = 1; else color = 9; diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index 76ba080c22..6707587184 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -113,7 +113,7 @@ void dessine(int ad, int x, int y) { void dessine_rouleau() { writepal(89); - if (_currGraphicalDevice == her) { + if (_currGraphicalDevice == MODE_HERCULES) { mem[0x7000 * 16 + 14] = 15; } hideMouse(); @@ -266,7 +266,7 @@ void clsf10() { void stop() { hirs(); - _currGraphicalDevice = ams; + _currGraphicalDevice = MODE_AMSTRAD1512; hirs(); g_vm->quitGame(); } @@ -274,7 +274,7 @@ void stop() { void paint_rect(int x, int y, int dx, int dy) { int co; - if (_currGraphicalDevice == cga) + if (_currGraphicalDevice == MODE_CGA) co = 3; else co = 11; @@ -634,7 +634,7 @@ void drawClock() { paint_rect(570, 118, 20, 10); paint_rect(578, 114, 6, 18); - if ((_currGraphicalDevice == cga) || (_currGraphicalDevice == her)) + if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES)) co = 0; else co = 1; diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index fff6917907..9ded5a16f9 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -200,9 +200,9 @@ void fenat(char ans) { int coul; hideMouse(); - if (_currGraphicalDevice == cga) + if (_currGraphicalDevice == MODE_CGA) coul = 2; - else if (_currGraphicalDevice == her) + else if (_currGraphicalDevice == MODE_HERCULES) coul = 1; else coul = 12; diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index e6ecbde4d3..67621d036d 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -120,7 +120,7 @@ Common::ErrorCode MortevielleEngine::initialise() { _screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); // Set the screen mode - _currGraphicalDevice = ega; + _currGraphicalDevice = MODE_EGA; res = 2; // Load the mort.dat resource @@ -134,7 +134,7 @@ Common::ErrorCode MortevielleEngine::initialise() { // Setup the mouse cursor initMouse(); - _currGraphicalDevice = ega; + _currGraphicalDevice = MODE_EGA; _newGraphicalDevice = _currGraphicalDevice; zuul = false; tesok = false; @@ -296,8 +296,8 @@ bool MortevielleEngine::handleEvents() { _mouseClick = true; else if (event.type == Common::EVENT_LBUTTONUP) _mouseClick = false; - break; + break; case Common::EVENT_KEYDOWN: addKeypress(event); break; @@ -445,7 +445,7 @@ Common::Error MortevielleEngine::run() { int loadSlot = 0; if (ConfMan.hasKey("save_slot")) { int gameToLoad = ConfMan.getInt("save_slot"); - if (gameToLoad >= 1 && gameToLoad <= 999) + if ((gameToLoad >= 1) && (gameToLoad <= 999)) loadSlot = gameToLoad; } @@ -487,9 +487,12 @@ void MortevielleEngine::showIntroduction() { * loses, and chooses to start playing the game again. */ void MortevielleEngine::mainGame() { - if (rech_cfiec) charge_cfiec(); + if (rech_cfiec) + charge_cfiec(); + for (crep = 1; crep <= c_zzz; crep ++) zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64); + charge_bruit5(); _menu.initMenu(); @@ -518,6 +521,7 @@ void MortevielleEngine::playGame() { handleAction(); CHECK_QUIT; } while (!((_quitGame) || (_endGame) || (_loseGame))); + if (_endGame) endGame(); else if (_loseGame) @@ -574,9 +578,11 @@ void MortevielleEngine::handleAction() { if ((mnumo != OPCODE_NONE) && ((msg[3] == action) || (msg[3] == saction))) { msg[4] = mnumo; ecr3(g_vm->getString(S_IDEM)); - } else return; + } else + return; } else if (inkey == '\104') { - if ((x != 0) && (y != 0)) num = 9999; + if ((x != 0) && (y != 0)) + num = 9999; return; } } @@ -584,39 +590,49 @@ void MortevielleEngine::handleAction() { _quitGame = true; tmaj3(); } else { - if ((funct) && (inkey != '\77')) return; + if ((funct) && (inkey != '\77')) + return; if (temps > lim) { repon(2, 141); - if (num == 9999) num = 0; + if (num == 9999) + num = 0; } else { mnumo = msg[3]; - if ((msg[3] == action) || (msg[3] == saction)) mnumo = msg[4]; + if ((msg[3] == action) || (msg[3] == saction)) + mnumo = msg[4]; if (! anyone) { if ((fouil) || (obpart)) { - if (y_s < 12) return; + if (y_s < 12) + return; + if ((msg[4] == OPCODE_SOUND) || (msg[4] == OPCODE_LIFT)) { oo = true; if ((msg[4] == OPCODE_LIFT) || (obpart)) { finfouil(); caff = s.mlieu; crep = 998; - } else tsuiv(); + } else + tsuiv(); mennor(); } } } do { - if (! oo) tsitu(); + if (! oo) + tsitu(); + if ((ctrm == 0) && (! _loseGame) && (! _endGame)) { taffich(); if (okdes) { okdes = false; dessin(0); } - if ((! syn) || (col)) repon(2, crep); + if ((! syn) || (col)) + repon(2, crep); } } while (!(! syn)); - if (ctrm != 0) tctrm(); + if (ctrm != 0) + tctrm(); } } } diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp index 2a4ab76efb..c96e92f0a8 100644 --- a/engines/mortevielle/mouse.cpp +++ b/engines/mortevielle/mouse.cpp @@ -90,7 +90,7 @@ void hideMouse() { imp = odd(y_s); j = p_o_s; switch (_currGraphicalDevice) { - case cga: + case MODE_CGA: k = 0; j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2); do { @@ -102,7 +102,7 @@ void hideMouse() { k = succ(int, k); } while (!(k >= 5)); break; - case ams: + case MODE_AMSTRAD1512: for (i = 0; i <= 3; ++i) { port[0x3dd] = 1 << i; k = 0; @@ -120,7 +120,7 @@ void hideMouse() { } while (!(k >= 8)); } break; - case ega: + case MODE_EGA: port[0x3c4] = 2; port[0x3ce] = 8; port[0x3cf] = 255; @@ -140,7 +140,7 @@ void hideMouse() { ++i; } while (!(i == 4)); break; - case her: + case MODE_HERCULES: j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3); for (i = 0; i <= 5; ++i) { for (k = 0; k <= 3; ++k) @@ -148,7 +148,7 @@ void hideMouse() { j += 80; } break; - case tan: + case MODE_TANDY: j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1); k = 0; do { @@ -181,7 +181,7 @@ void showMouse() { imp = odd(y_s); i = x_s & 7; switch (_currGraphicalDevice) { - case cga: + case MODE_CGA: k = 0; j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2); do { @@ -193,7 +193,7 @@ void showMouse() { k = succ(int, k); } while (!(k >= 5)); break; - case ams: + case MODE_AMSTRAD1512: for (i = 0; i <= 3; ++i) { j = p_o_s; imp = odd(y_s); @@ -212,7 +212,7 @@ void showMouse() { } while (!(k >= 8)); } break; - case ega: + case MODE_EGA: port[0x3ce] = 4; l = 0; do { @@ -227,7 +227,7 @@ void showMouse() { ++l; } while (!(l == 4)); break; - case her: + case MODE_HERCULES: j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3); for (i = 0; i <= 5; ++i) { for (k = 0; k <= 3; ++k) @@ -235,7 +235,7 @@ void showMouse() { j += 80; } break; - case tan: + case MODE_TANDY: j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1); k = 0; do { diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 1306f7f1b1..46df0b4e3b 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -208,7 +208,7 @@ void taffich() { npal = a + 37; } chardes(filename, lgt, handle); - if (_currGraphicalDevice == her) { + if (_currGraphicalDevice == MODE_HERCULES) { for (i = 0; i <= 15; ++i) { palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]); alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15); diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index 179c92d6bc..a6d40e5b77 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -223,7 +223,7 @@ typedef int tfxx[108]; /*------------------------------ ENUMS ------------------------------*/ /*---------------------------------------------------------------------------*/ -enum GraphicModes { ams = 0, cga = 1, ega = 2, her = 3, tan = 4 }; +enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 }; /*---------------------------------------------------------------------------*/ /*------------------------------ VARIABLES ------------------------------*/ |