From 60aec5b9f135058360fce2bb5332d6deceda2799 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 27 Apr 2007 23:11:12 +0000 Subject: SAGA: Moved displayinfo stuff into its own header file svn-id: r26635 --- engines/saga/interface.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 7c37126d59..3ee9d93336 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -28,6 +28,7 @@ #include "saga/gfx.h" #include "saga/actor.h" #include "saga/console.h" +#include "saga/displayinfo.h" #include "saga/events.h" #include "saga/font.h" #include "saga/objectmap.h" -- cgit v1.2.3 From 6ca558f0ff2126a0fbac2cdb789fb8cf2b5e48bd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 1 May 2007 21:48:18 +0000 Subject: Fix for verbs in IHNM svn-id: r26732 --- engines/saga/interface.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 3ee9d93336..abf706310f 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -69,14 +69,14 @@ static int verbTypeToTextStringsIdLUT[2][kVerbTypeIdsMax] = { -1, -1}, {-1, - 3, //TODO:check - 2, - 1, - 5, - 6, //TODO:check - 8, //TODO:check - 7, - 4} + kVerbIHNMWalk, + kVerbIHNMLookAt, + kVerbIHNMTake, + kVerbIHNMUse, + kVerbIHNMTalkTo, + kVerbIHNMSwallow, + kVerbIHNMGive, + kVerbIHNMPush} }; Interface::Interface(SagaEngine *vm) : _vm(vm) { @@ -1939,7 +1939,8 @@ void Interface::drawVerbPanelText(Surface *ds, PanelButton *panelButton, KnownCo textId = verbTypeToTextStringsIdLUT[0][panelButton->id]; text = _vm->getTextString(textId); } else { - textId = verbTypeToTextStringsIdLUT[1][panelButton->id]; + // This -2 has been placed because of the changes in the ids in IHNM_MainPanelButtons + textId = verbTypeToTextStringsIdLUT[1][panelButton->id - 2]; text = _vm->_script->_mainStrings.getString(textId + 1); textShadowKnownColor = kKnownColorTransparent; } -- cgit v1.2.3 From 74f839d6c89289b09fd11666e1abfe90b74fa431 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 2 May 2007 17:12:30 +0000 Subject: IHNM: Added the options dialog and quit dialog with very basic functionality (continue and exit game). The buttons are still wrong and not all the options are implemented yet, but at least the game doesn't freeze when the user tries to open the options dialog and it's now possible to exit normally svn-id: r26735 --- engines/saga/interface.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index abf706310f..08ed30c8a2 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -719,7 +719,6 @@ void Interface::drawOption() { Rect rect2; PanelButton *panelButton; Point textPoint; - if (_optionSaveFileSlider == NULL) return;//TODO:REMOVE backBuffer = _vm->_gfx->getBackBuffer(); @@ -737,9 +736,17 @@ void Interface::drawOption() { } if (_optionSaveRectTop.height() > 0) { - backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); + if (_vm->getGameType() == GType_ITE) { + backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); + } else { + // TODO: Draw the button graphic properly for IHNM + } } + // 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) { @@ -1890,8 +1897,14 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut } text = _vm->getTextString(textId); - textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); - textHeight = _vm->_font->getHeight(kKnownFontMedium); + // TODO: This looks like to be the proper font for IHNM, check for validity + if (_vm->getGameType() == GType_ITE) { + textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); + textHeight = _vm->_font->getHeight(kKnownFontMedium); + } else { + textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal); + textHeight = _vm->_font->getHeight(kKnownFontVerb); + } point.x = panel->x + panelButton->xOffset + (panelButton->width / 2) - (textWidth / 2); point.y = panel->y + panelButton->yOffset + (panelButton->height / 2) - (textHeight / 2); @@ -1905,8 +1918,13 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut panel->calcPanelButtonRect(panelButton, rect); drawButtonBox(ds, rect, kButton, panelButton->state > 0); - _vm->_font->textDraw(kKnownFontMedium, ds, text, point, - _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + // TODO: This looks like to be the proper font for IHNM, check for validity + if (_vm->getGameType() == GType_ITE) + _vm->_font->textDraw(kKnownFontMedium, ds, text, point, + _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + else + _vm->_font->textDraw(kKnownFontVerb, ds, text, point, + _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); } void Interface::drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) { -- cgit v1.2.3 From 463c5fcec840d7bf68b29dfa4be70118255cc5bd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 2 May 2007 23:27:25 +0000 Subject: More IHNM options panel improvements: added text and working widgets for read speed, music and sound, matched the font and the coordinates of the options panel and the widgets with the ones of the original interpreter svn-id: r26738 --- engines/saga/interface.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 08ed30c8a2..fafc36f724 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -697,14 +697,20 @@ void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *p text = _vm->getTextString(panelButton->id); panel->calcPanelButtonRect(panelButton, rect); if (panelButton->xOffset < 0) { - textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); + if (_vm->getGameType() == GType_ITE) + textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); + else + textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal); rect.left += 2 + (panel->imageWidth - 1 - textWidth) / 2; } textPoint.x = rect.left; textPoint.y = rect.top + 1; - _vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + if (_vm->getGameType() == GType_ITE) + _vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + else + _vm->_font->textDraw(kKnownFontVerb, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); } void Interface::drawOption() { @@ -1897,7 +1903,6 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut } text = _vm->getTextString(textId); - // TODO: This looks like to be the proper font for IHNM, check for validity if (_vm->getGameType() == GType_ITE) { textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); textHeight = _vm->_font->getHeight(kKnownFontMedium); @@ -1918,7 +1923,6 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut panel->calcPanelButtonRect(panelButton, rect); drawButtonBox(ds, rect, kButton, panelButton->state > 0); - // TODO: This looks like to be the proper font for IHNM, check for validity if (_vm->getGameType() == GType_ITE) _vm->_font->textDraw(kKnownFontMedium, ds, text, point, _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); -- cgit v1.2.3 From b9cdca27eeefd445be97938577290967ffe0bf32 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 6 May 2007 17:18:11 +0000 Subject: Added (non-functional) save and load buttons in the options panel of IHNM svn-id: r26767 --- engines/saga/interface.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index fafc36f724..60974f4425 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -725,6 +725,7 @@ void Interface::drawOption() { Rect rect2; PanelButton *panelButton; Point textPoint; + Point point; backBuffer = _vm->_gfx->getBackBuffer(); @@ -733,6 +734,15 @@ void Interface::drawOption() { for (i = 0; i < _optionPanel.buttonsCount; i++) { panelButton = &_optionPanel.buttons[i]; + + // TODO: This probably works for the button background, but the resources are still not loeaded + // (_optionPanel.sprites) + /* + point.x = _optionPanel.x + panelButton->xOffset; + point.y = _optionPanel.y + panelButton->yOffset; + _vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _optionPanel.sprites, i, point, 256); + */ + if (panelButton->type == kPanelButtonOption) { drawPanelButtonText(backBuffer, &_optionPanel, panelButton); } -- cgit v1.2.3 From 1880c8739b3ccce65dc709cf1db67a9068270c89 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 11 May 2007 10:35:12 +0000 Subject: Disable the status text in IHNM when the main panel is not shown. Fixes a crash when hovering over a character in the character selection screen svn-id: r26801 --- engines/saga/interface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 60974f4425..19a68d70a4 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -536,6 +536,10 @@ void Interface::setStatusText(const char *text, int statusColor) { assert(text != NULL); assert(strlen(text) < STATUS_TEXT_LEN); + // Disable the status text in IHNM when the main panel is not shown (i.e. when the screen is full) + if (_vm->getGameType() == GType_IHNM && !(_panelMode == kPanelMain || _panelMode == kPanelMap)) + return; + if (_vm->_render->getFlags() & (RF_PLACARD | RF_MAP)) return; @@ -1525,8 +1529,9 @@ void Interface::drawStatusBar() { backBuffer = _vm->_gfx->getBackBuffer(); - // Disable this for IHNM for now, since that game uses the full screen - // in some cases. + // Disable the status bar in IHNM when the main panel is not shown (i.e. when the screen is full) + if (_vm->getGameType() == GType_IHNM && !(_panelMode == kPanelMain || _panelMode == kPanelMap)) + return; // Erase background of status bar rect.left = _vm->getDisplayInfo().statusXOffset; -- cgit v1.2.3 From ff7d48f582eb9dd3ddeb05649cf1a9f780baf17d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 11 May 2007 13:10:13 +0000 Subject: Changed the check for the status bar in IHNM to match the original, removed a relevant hack svn-id: r26802 --- engines/saga/interface.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'engines/saga/interface.cpp') diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 19a68d70a4..2d15db80ee 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -536,8 +536,8 @@ void Interface::setStatusText(const char *text, int statusColor) { assert(text != NULL); assert(strlen(text) < STATUS_TEXT_LEN); - // Disable the status text in IHNM when the main panel is not shown (i.e. when the screen is full) - if (_vm->getGameType() == GType_IHNM && !(_panelMode == kPanelMain || _panelMode == kPanelMap)) + // Disable the status text in IHNM when the chapter is 8 + if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8) return; if (_vm->_render->getFlags() & (RF_PLACARD | RF_MAP)) @@ -1524,15 +1524,12 @@ void Interface::drawStatusBar() { int stringWidth; int color; - if (_panelMode == kPanelChapterSelection) + // Disable the status text in IHNM when the chapter is 8 + if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8) return; backBuffer = _vm->_gfx->getBackBuffer(); - // Disable the status bar in IHNM when the main panel is not shown (i.e. when the screen is full) - if (_vm->getGameType() == GType_IHNM && !(_panelMode == kPanelMain || _panelMode == kPanelMap)) - return; - // Erase background of status bar rect.left = _vm->getDisplayInfo().statusXOffset; rect.top = _vm->getDisplayInfo().statusYOffset; -- cgit v1.2.3