diff options
author | Filippos Karapetis | 2007-06-17 02:59:56 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-06-17 02:59:56 +0000 |
commit | 65a39ab0d03de94be58d3c4db74ee15d812b23c3 (patch) | |
tree | dd198c182e1238835351b70cbc55236b4872222d /engines/saga | |
parent | 3c24b118b4c4512f40e0a73bd4157747900d4c14 (diff) | |
download | scummvm-rg350-65a39ab0d03de94be58d3c4db74ee15d812b23c3.tar.gz scummvm-rg350-65a39ab0d03de94be58d3c4db74ee15d812b23c3.tar.bz2 scummvm-rg350-65a39ab0d03de94be58d3c4db74ee15d812b23c3.zip |
Some updates on the save/load system in IHNM. It still needs work, though
svn-id: r27505
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/displayinfo.h | 29 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 53 |
2 files changed, 62 insertions, 20 deletions
diff --git a/engines/saga/displayinfo.h b/engines/saga/displayinfo.h index 40792adc37..3e1845abba 100644 --- a/engines/saga/displayinfo.h +++ b/engines/saga/displayinfo.h @@ -323,6 +323,7 @@ static PanelButton IHNM_ConversePanelButtons[] = { }; static PanelButton IHNM_OptionPanelButtons[] = { + {kPanelButtonOptionSlider, 421,16, 16,138, 0,'-',0, 0,0,0}, //slider-scroller {kPanelButtonOptionText,28,36, 0,0, kTextReadingSpeed,'-',0, 0,0,0}, // text: read speed {kPanelButtonOptionText,60,61, 0,0, kTextMusic,'-',0, 0,0,0}, // text: music {kPanelButtonOptionText,60,86, 0,0, kTextSound,'-',0, 0,0,0}, // text: noise @@ -333,7 +334,7 @@ static PanelButton IHNM_OptionPanelButtons[] = { {kPanelButtonOption, 153,104,79,23, kTextVoices,'v',0, 0,0,0}, //voices {kPanelButtonOption, 19,149, 200,25, kTextQuitGame,'q',0, 0,0,0}, //quit {kPanelButtonOption, 19,177, 200,25, kTextContinuePlaying,'c',0, 0,0,0}, //continue - // TODO: Implement load/save + {kPanelButtonOptionSaveFiles, 244,18, 170,138, 0,'-',0, 0,0,0}, //savefiles {kPanelButtonOption, 242,162, 79,23, kTextLoad,'l',0, 0,0,0}, //load {kPanelButtonOption, 333,162, 79,23, kTextSave,'s',0, 0,0,0}, //save }; @@ -345,15 +346,21 @@ static PanelButton IHNM_QuitPanelButtons[] = { }; static PanelButton IHNM_LoadPanelButtons[] = { - {kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO + // TODO + {kPanelButtonLoad, 101,19, 60,16, kTextOK,'o',0, 0,0,0}, + {kPanelButtonLoadText, -1,5, 0,0, kTextLoadSuccessful,'-',0, 0,0,0}, }; static PanelButton IHNM_SavePanelButtons[] = { - {kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO + // TODO + {kPanelButtonSave, 25,79, 80,25, kTextSave,'s',0, 0,0,0}, + {kPanelButtonSave, 155,79, 80,25, kTextCancel,'c',0, 0,0,0}, + {kPanelButtonSaveEdit, 26,57, 209,17, 0,'-',0, 0,0,0}, + {kPanelButtonSaveText, 75,30, 0,0, kTextEnterSaveGameName,'-',0, 0,0,0}, }; -static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all +static const GameDisplayInfo IHNM_DisplayInfo = { 640, 480, // logical width&height 0, // scene path y offset @@ -388,8 +395,8 @@ static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all ARRAYSIZE(IHNM_ConversePanelButtons), IHNM_ConversePanelButtons, - -1, -1, // save file index - 0, // optionSaveFileVisible + 11, 0, // save file index + 15, // optionSaveFileVisible 92, 46, // option panel offsets ARRAYSIZE(IHNM_OptionPanelButtons), IHNM_OptionPanelButtons, @@ -399,14 +406,14 @@ static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all ARRAYSIZE(IHNM_QuitPanelButtons), IHNM_QuitPanelButtons, - 0, 0, // load panel offsets - 0, 0, // load panel width & height + 190, 94, // load panel offsets + 260, 115, // load panel width & height ARRAYSIZE(IHNM_LoadPanelButtons), IHNM_LoadPanelButtons, - -1, // save edit index - 0, 0, // save panel offsets - 0, 0, // save panel width & height + 2, // save edit index + 190, 94, // save panel offsets + 260, 115, // save panel width & height ARRAYSIZE(IHNM_SavePanelButtons), IHNM_SavePanelButtons, diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 8194f14b05..03fc0beb7a 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -203,6 +203,28 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) { free(resource); } + // Save panel + if (_vm->getGameType() == GType_IHNM) { + _savePanel.buttons = _vm->getDisplayInfo().savePanelButtons; + _savePanel.buttonsCount = _vm->getDisplayInfo().savePanelButtonsCount; + + _vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->warningPanelResourceId, resource, resourceLength); + _vm->decodeBGImage(resource, resourceLength, &_savePanel.image, + &_savePanel.imageLength, &_savePanel.imageWidth, &_savePanel.imageHeight); + free(resource); + } + + // Load panel + if (_vm->getGameType() == GType_IHNM) { + _loadPanel.buttons = _vm->getDisplayInfo().loadPanelButtons; + _loadPanel.buttonsCount = _vm->getDisplayInfo().loadPanelButtonsCount; + + _vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->warningPanelResourceId, resource, resourceLength); + _vm->decodeBGImage(resource, resourceLength, &_loadPanel.image, + &_loadPanel.imageLength, &_loadPanel.imageWidth, &_loadPanel.imageHeight); + free(resource); + } + // Main panel sprites _vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites); // Option panel sprites @@ -750,7 +772,6 @@ void Interface::draw() { void Interface::calcOptionSaveSlider() { int totalFiles = _vm->getSaveFilesCount(); int visibleFiles = _vm->getDisplayInfo().optionSaveFileVisible; - if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE int height = _optionSaveFileSlider->height; int sliderHeight; int pos; @@ -870,10 +891,6 @@ void Interface::drawOption() { backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); } - // FIXME: The _optionSaveFileSlider checks exist for IHNM, where - // _optionSaveFileSlider is not initialized correctly yet - if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE - drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0); if (_optionSaveRectBottom.height() > 0) { @@ -899,7 +916,10 @@ void Interface::drawOption() { text = _vm->getSaveFile(idx)->name; textPoint.x = rect.left + 1; textPoint.y = rect2.top; - _vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal); + if (_vm->getGameType() == GType_ITE) + _vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal); + else + _vm->_font->textDraw(kKnownFontVerb, backBuffer, text, textPoint, fgColor, 0, kFontNormal); } } @@ -978,7 +998,11 @@ void Interface::drawLoad() { backBuffer = _vm->_gfx->getBackBuffer(); _loadPanel.getRect(rect); - drawButtonBox(backBuffer, rect, kButton, false); + if (_vm->getGameType() == GType_ITE) + drawButtonBox(backBuffer, rect, kButton, false); + else + backBuffer->blit(rect, _loadPanel.image); + for (i = 0; i < _loadPanel.buttonsCount; i++) { panelButton = &_loadPanel.buttons[i]; if (panelButton->type == kPanelButtonLoad) { @@ -1178,7 +1202,11 @@ void Interface::drawSave() { backBuffer = _vm->_gfx->getBackBuffer(); _savePanel.getRect(rect); - drawButtonBox(backBuffer, rect, kButton, false); + if (_vm->getGameType() == GType_ITE) + drawButtonBox(backBuffer, rect, kButton, false); + else + backBuffer->blit(rect, _savePanel.image); + for (i = 0; i < _savePanel.buttonsCount; i++) { panelButton = &_savePanel.buttons[i]; if (panelButton->type == kPanelButtonSave) { @@ -1291,7 +1319,6 @@ void Interface::handleOptionUpdate(const Point& mousePoint) { bool releasedButton; if (_vm->mouseButtonPressed()) { - if (_optionSaveFileSlider != NULL) //TODO:REMOVE if (_optionSaveFileSlider->state > 0) { _optionPanel.calcPanelButtonRect(_optionSaveFileSlider, rect); @@ -2117,6 +2144,14 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut texturePoint.x = _quitPanel.x + panelButton->xOffset; texturePoint.y = _quitPanel.y + panelButton->yOffset; _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); + } else if (panel == &_savePanel) { + texturePoint.x = _savePanel.x + panelButton->xOffset; + texturePoint.y = _savePanel.y + panelButton->yOffset; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); + } else if (panel == &_loadPanel) { + texturePoint.x = _loadPanel.x + panelButton->xOffset; + texturePoint.y = _loadPanel.y + panelButton->yOffset; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); } else { // revert to default behavior drawButtonBox(ds, rect, kButton, panelButton->state > 0); |