diff options
author | Johannes Schickel | 2010-08-24 13:41:24 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-08-24 13:41:24 +0000 |
commit | feff6fecdffa16a541f9658ad611745188596692 (patch) | |
tree | dc50567f9c4ed48f0637fbd6424c3c5028ec65a4 | |
parent | 10a1806f32a3fc67f8deb6adb496919793977440 (diff) | |
download | scummvm-rg350-feff6fecdffa16a541f9658ad611745188596692.tar.gz scummvm-rg350-feff6fecdffa16a541f9658ad611745188596692.tar.bz2 scummvm-rg350-feff6fecdffa16a541f9658ad611745188596692.zip |
KYRA: Cleanup.
svn-id: r52340
-rw-r--r-- | engines/kyra/debugger.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/gui.cpp | 18 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/screen_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/script_tim.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound_midi.cpp | 10 |
7 files changed, 27 insertions, 27 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 225b44b3f4..fc509700d7 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -76,7 +76,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) { return true; } - if (_vm->gameFlags().gameID != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) { + if (_vm->game() != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) { uint8 buffer[320*200]; _vm->screen()->copyRegionToBuffer(5, 0, 0, 320, 200, buffer); _vm->screen()->loadBitmap(argv[1], 5, 5, 0); diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 9f5d29d7b9..f0eb25190b 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -92,7 +92,7 @@ void GUI::initMenu(Menu &menu) { textY = menu.y + menu.titleY; - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { printMenuText(getMenuTitle(menu), textX, textY, menu.textColor, 0, 9); } else { if (_vm->gameFlags().platform != Common::kPlatformAmiga) @@ -136,7 +136,7 @@ void GUI::initMenu(Menu &menu) { textX = getMenuCenterStringX(getMenuItemTitle(menu.item[i]), x1, x2); textY = y1 + 2; - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { textY++; if (i == menu.highlightedItem) printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 8); @@ -162,7 +162,7 @@ void GUI::initMenu(Menu &menu) { for (int i = 0; i < menu.numberOfItems; ++i) { if (getMenuItemLabel(menu.item[i])) { - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { menu.item[i].labelX = menu.item[i].x - 1; menu.item[i].labelY = menu.item[i].y + 3; printMenuText(getMenuItemLabel(menu.item[i]), menu.x + menu.item[i].labelX, menu.y + menu.item[i].labelY, menu.item[i].textColor, 0, 10); @@ -206,7 +206,7 @@ void GUI::processHighlights(Menu &menu) { int mouseX = p.x; int mouseY = p.y; - if (_vm->_flags.gameID == GI_LOL && menu.highlightedItem != 255) { + if (_vm->game() == GI_LOL && menu.highlightedItem != 255) { // LoL doesnt't have default highlighted items. // We use a highlightedItem value of 255 for this. @@ -230,8 +230,8 @@ void GUI::processHighlights(Menu &menu) { if (mouseX > x1 && mouseX < x2 && mouseY > y1 && mouseY < y2) { - if (menu.highlightedItem != i || _vm->_flags.gameID == GI_LOL) { - if (_vm->_flags.gameID != GI_LOL) { + if (menu.highlightedItem != i || _vm->game() == GI_LOL) { + if (_vm->game() != GI_LOL) { if (menu.item[menu.highlightedItem].enabled) redrawText(menu); } @@ -260,7 +260,7 @@ void GUI::redrawText(const Menu &menu) { textX = getMenuCenterStringX(getMenuItemTitle(menu.item[i]), x1, x2); int textY = y1 + 2; - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { textY++; printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 8); } else { @@ -290,7 +290,7 @@ void GUI::redrawHighlight(const Menu &menu) { int textY = y1 + 2; - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { textY++; printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 8); } else { @@ -399,7 +399,7 @@ void GUI::updateSaveList(bool excludeQuickSaves) { int GUI::getNextSavegameSlot() { Common::InSaveFile *in; - int start = _vm->gameFlags().gameID == GI_LOL ? 0 : 1; + int start = _vm->game() == GI_LOL ? 0 : 1; for (int i = start; i < 990; i++) { if ((in = _vm->_saveFileMan->openForLoading(_vm->getSavegameFilename(i)))) diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index ade9886c2e..e09cc8123c 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -40,7 +40,7 @@ namespace Kyra { Screen::Screen(KyraEngine_v1 *vm, OSystem *system) : _system(system), _vm(vm), _sjisInvisibleColor(0), - _cursorColorKey((vm->gameFlags().gameID == GI_KYRA1) ? 0xFF : 0x00) { + _cursorColorKey((vm->game() == GI_KYRA1) ? 0xFF : 0x00) { _debugEnabled = false; _maskMinY = _maskMaxY = -1; @@ -86,7 +86,7 @@ bool Screen::init() { if (_vm->gameFlags().useHiResOverlay) { _useOverlays = true; _useSJIS = (_vm->gameFlags().lang == Common::JA_JPN); - _sjisInvisibleColor = (_vm->gameFlags().gameID == GI_KYRA1) ? 0x80 : 0xF6; + _sjisInvisibleColor = (_vm->game() == GI_KYRA1) ? 0x80 : 0xF6; for (int i = 0; i < SCREEN_OVLS_NUM; ++i) { if (!_sjisOverlayPtrs[i]) { @@ -1300,7 +1300,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int _dsScaleH = 0x100; } - if ((flags & 0x2000) && _vm->gameFlags().gameID != GI_KYRA1) + if ((flags & 0x2000) && _vm->game() != GI_KYRA1) _dsTable5 = va_arg(args, uint8 *); static const DsMarginSkipFunc dsMarginFunc[] = { @@ -1436,7 +1436,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int uint16 frameSize = READ_LE_UINT16(src); src += 2; - int colorTableColors = ((_vm->gameFlags().gameID != GI_KYRA1) && (shapeFlags & 4)) ? *src++ : 16; + int colorTableColors = ((_vm->game() != GI_KYRA1) && (shapeFlags & 4)) ? *src++ : 16; if (!(flags & 0x8000) && (shapeFlags & 1)) _dsTable2 = src; @@ -3016,10 +3016,10 @@ byte *Screen::getOverlayPtr(int page) { else if (page == 2 || page == 3) return _sjisOverlayPtrs[2]; - if (_vm->gameFlags().gameID == GI_KYRA2) { + if (_vm->game() == GI_KYRA2) { if (page == 12 || page == 13) return _sjisOverlayPtrs[3]; - } else if (_vm->gameFlags().gameID == GI_LOL) { + } else if (_vm->game() == GI_LOL) { if (page == 4 || page == 5) return _sjisOverlayPtrs[3]; if (page == 6 || page == 7) diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index 3907f844cb..216bf07f6f 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -53,7 +53,7 @@ uint8 *Screen_v2::generateOverlay(const Palette &pal, uint8 *buffer, int opColor int maxIndex = maxColor; if (maxIndex == -1) { - if (_vm->gameFlags().gameID == GI_LOL) { + if (_vm->game() == GI_LOL) { if (_use16ColorMode) maxIndex = 255; else diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 20bc8abec5..907c5ee7bd 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -95,7 +95,7 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys _textDisplayed = false; _textAreaBuffer = new uint8[320*40]; assert(_textAreaBuffer); - if ((_vm->gameFlags().platform == Common::kPlatformPC98 || _vm->gameFlags().isDemo) && _vm->gameFlags().gameID == GI_LOL) + if ((_vm->gameFlags().platform == Common::kPlatformPC98 || _vm->gameFlags().isDemo) && _vm->game() == GI_LOL) _drawPage2 = 0; else _drawPage2 = 8; @@ -176,7 +176,7 @@ TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpc Common::strlcpy(_tim->filename, filename, 13); - _tim->isLoLOutro = (_vm->gameFlags().gameID == GI_LOL) && !scumm_stricmp(filename, "LOLFINAL.TIM"); + _tim->isLoLOutro = (_vm->game() == GI_LOL) && !scumm_stricmp(filename, "LOLFINAL.TIM"); _tim->lolCharacter = 0; TIM *r = _tim; @@ -467,7 +467,7 @@ void TIMInterpreter::setupTextPalette(uint index, int fadePalette) { int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y, int, int offscreenBuffer, uint16 wsaFlags) { Movie *wsa = 0; - const bool isLoLDemo = _vm->gameFlags().isDemo && _vm->gameFlags().gameID == GI_LOL; + const bool isLoLDemo = _vm->gameFlags().isDemo && _vm->game() == GI_LOL; if (isLoLDemo || _vm->gameFlags().platform == Common::kPlatformPC98 || _currentTim->isLoLOutro) _drawPage2 = 0; @@ -755,7 +755,7 @@ int TIMInterpreter::cmd_loadSoundFile(const uint16 *param) { const char *file = (const char *)(_currentTim->text + READ_LE_UINT16(_currentTim->text + (param[0]<<1))); _vm->sound()->loadSoundFile(file); - if (_vm->gameFlags().gameID == GI_LOL) + if (_vm->game() == GI_LOL) _vm->sound()->loadSfxFile(file); return 1; diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 9ab4aa0053..8458d751de 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -2241,7 +2241,7 @@ const int SoundAdLibPC::_kyra1NumSoundTriggers = ARRAYSIZE(SoundAdLibPC::_kyra1S SoundAdLibPC::SoundAdLibPC(KyraEngine_v1 *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _driver(0), _trackEntries(), _soundDataPtr(0) { memset(_trackEntries, 0, sizeof(_trackEntries)); - _v2 = (_vm->gameFlags().gameID == GI_KYRA2) || (_vm->gameFlags().gameID == GI_LOL && !_vm->gameFlags().isDemo); + _v2 = (_vm->game() == GI_KYRA2) || (_vm->game() == GI_LOL && !_vm->gameFlags().isDemo); _driver = new AdLibDriver(mixer, _v2); assert(_driver); diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 026c72de26..57da51ab5a 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -519,12 +519,12 @@ bool SoundMidiPC::init() { if (_nativeMT32 && _type == kMidiMT32) { const char *midiFile = 0; const char *pakFile = 0; - if (_vm->gameFlags().gameID == GI_KYRA1) { + if (_vm->game() == GI_KYRA1) { midiFile = "INTRO"; - } else if (_vm->gameFlags().gameID == GI_KYRA2) { + } else if (_vm->game() == GI_KYRA2) { midiFile = "HOF_SYX"; pakFile = "AUDIO.PAK"; - } else if (_vm->gameFlags().gameID == GI_LOL) { + } else if (_vm->game() == GI_LOL) { midiFile = "LOREINTR"; if (_vm->gameFlags().isDemo) { @@ -618,7 +618,7 @@ void SoundMidiPC::loadSoundFile(Common::String file) { // Since KYRA1 uses the same file for SFX and Music // we setup sfx to play from music file as well - if (_vm->gameFlags().gameID == GI_KYRA1) { + if (_vm->game() == GI_KYRA1) { for (int i = 0; i < 3; ++i) { _output->setSoundSource(i+1); _sfx[i]->loadMusic(_musicFile, fileSize); @@ -631,7 +631,7 @@ void SoundMidiPC::loadSfxFile(Common::String file) { Common::StackLock lock(_mutex); // Kyrandia 1 doesn't use a special sfx file - if (_vm->gameFlags().gameID == GI_KYRA1) + if (_vm->game() == GI_KYRA1) return; file = getFileName(file); |