aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-10-10 02:02:58 +0000
committerEugene Sandulenko2005-10-10 02:02:58 +0000
commitfc11b60674103b569b9df2599b60f7d99dbdd909 (patch)
treee2f5255497b8099d9238c029ba716f2fbe4ca4ca
parentc79dcadcc0551922ecd6c001e6ef6ef05b46b5b5 (diff)
downloadscummvm-rg350-fc11b60674103b569b9df2599b60f7d99dbdd909.tar.gz
scummvm-rg350-fc11b60674103b569b9df2599b60f7d99dbdd909.tar.bz2
scummvm-rg350-fc11b60674103b569b9df2599b60f7d99dbdd909.zip
Draw main panel. Buttons lack backgorunds and save reminder is buggy atm.
svn-id: r18994
-rw-r--r--saga/game.cpp8
-rw-r--r--saga/interface.cpp39
-rw-r--r--saga/resnames.h1
-rw-r--r--saga/saga.h1
-rw-r--r--saga/sprite.cpp10
5 files changed, 32 insertions, 27 deletions
diff --git a/saga/game.cpp b/saga/game.cpp
index 9593f707d1..0668ba528a 100644
--- a/saga/game.cpp
+++ b/saga/game.cpp
@@ -571,7 +571,7 @@ static GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
0, // status x offset
304, // status y offset
- 640, // status width
+ 616, // status width
24, // status height
8, // status text y offset
186, // status text color
@@ -590,7 +590,7 @@ static GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
-1, -1, // inventory Up & Down button indexies
2, 4, // inventory rows, columns
- 0, 149, // main panel offsets
+ 0, 328, // main panel offsets
ARRAYSIZE(IHNM_MainPanelButtons),
IHNM_MainPanelButtons,
@@ -599,7 +599,7 @@ static GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
IHNM_CONVERSE_MAX_TEXT_WIDTH,
IHNM_CONVERSE_TEXT_HEIGHT,
IHNM_CONVERSE_TEXT_LINES,
- 0, 0, // converse panel offsets
+ 0, 328, // converse panel offsets
ARRAYSIZE(IHNM_ConversePanelButtons),
IHNM_ConversePanelButtons,
@@ -691,7 +691,7 @@ static GameFontDescription IHNMCD_GameFonts[] = {
{3},
{4},
{5},
- {6},
+ {6}, // kIHNMFont8
{7},
{8} // kIHNMMainFont
};
diff --git a/saga/interface.cpp b/saga/interface.cpp
index dc2e5e28e2..e29f31475f 100644
--- a/saga/interface.cpp
+++ b/saga/interface.cpp
@@ -50,8 +50,8 @@
namespace Saga {
-static int verbTypeToTextStringsIdLUT[kVerbTypesMax] = {
- -1,
+static int verbTypeToTextStringsIdLUT[2][kVerbTypesMax] = {
+ {-1,
kTextPickUp,
kTextLookAt,
kTextWalkTo,
@@ -68,7 +68,8 @@ static int verbTypeToTextStringsIdLUT[kVerbTypesMax] = {
-1,
-1,
-1,
- -1
+ -1},
+ {-1, -1, 2, 1, 5, -1, -1, 7, 4, -1, -1, -1, -1, -1, -1, 3, 6, 8}
};
Interface::Interface(SagaEngine *vm) : _vm(vm) {
@@ -595,13 +596,6 @@ void Interface::draw() {
if (_vm->_scene->isInIntro() || _fadeMode == kFadeOut)
return;
- // Disable this for IHNM for now, since that game uses the full screen
- // in some cases.
-
- if (_vm->getGameType() == GType_IHNM) {
- return;
- }
-
drawStatusBar();
if (_panelMode == kPanelMain || _panelMode == kPanelMap) {
@@ -1486,10 +1480,6 @@ void Interface::drawStatusBar() {
// Disable this for IHNM for now, since that game uses the full screen
// in some cases.
- if (_vm->getGameType() == GType_IHNM) {
- return;
- }
-
// Erase background of status bar
rect.left = _vm->getDisplayInfo().statusXOffset;
rect.top = _vm->getDisplayInfo().statusYOffset;
@@ -1917,20 +1907,25 @@ void Interface::drawVerbPanelText(Surface *ds, PanelButton *panelButton, int tex
int textWidth;
Point point;
int textId;
+ FontId font;
- textId = verbTypeToTextStringsIdLUT[panelButton->id];
-
- if (textId == -1)
- error("textId == -1");
+ if (_vm->getGameType() == GType_ITE) {
+ textId = verbTypeToTextStringsIdLUT[0][panelButton->id];
+ text = _vm->getTextString(textId);
+ font = kSmallFont;
+ } else {
+ textId = verbTypeToTextStringsIdLUT[1][panelButton->id];
+ text = _vm->_script->_mainStrings.getString(textId + 1);
+ font = kIHNMFont8;
+ }
- text = _vm->getTextString(textId);
- textWidth = _vm->_font->getStringWidth(kSmallFont, text, 0, kFontNormal);
+ textWidth = _vm->_font->getStringWidth(font, text, 0, kFontNormal);
point.x = _mainPanel.x + panelButton->xOffset + 1 + (panelButton->width - 1 - textWidth) / 2;
point.y = _mainPanel.y + panelButton->yOffset + 1;
- _vm->_font->textDraw(kSmallFont, ds, text, point, textColor, textShadowColor, (textShadowColor != 0) ? kFontShadow : kFontNormal);
+ _vm->_font->textDraw(font, ds, text, point, textColor, textShadowColor, (textShadowColor != 0) ? kFontShadow : kFontNormal);
}
@@ -2331,7 +2326,7 @@ void Interface::keyBoss() {
backBuffer = _vm->_gfx->getBackBuffer();
- rect.left = rect.top = 0;
+ rect.left = rect.top = 20;
_vm->_resource->loadResource(_interfaceContext, RID_IHNM_BOSS_SCREEN, resource, resourceLength);
if (resourceLength == 0) {
diff --git a/saga/resnames.h b/saga/resnames.h
index f6888377c5..4a9e53f40a 100644
--- a/saga/resnames.h
+++ b/saga/resnames.h
@@ -88,6 +88,7 @@ namespace Saga {
#define RID_IHNM_MAIN_SPRITES 12 // TODO: verify this
#define RID_IHNM_MAIN_PANEL_SPRITES 13 // TODO: verify this
#define RID_IHNM_MAIN_STRINGS 21
+#define RID_IHNM_PROFILE_BG 20
#define RID_IHNM_BOSS_SCREEN 19
diff --git a/saga/saga.h b/saga/saga.h
index 787e85d6da..0e441f59e3 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -322,6 +322,7 @@ enum FontId {
kMediumFont,
kBigFont,
+ kIHNMFont8 = 4,
kIHNMMainFont = 6
};
diff --git a/saga/sprite.cpp b/saga/sprite.cpp
index 5e55782327..7ebfb2f01d 100644
--- a/saga/sprite.cpp
+++ b/saga/sprite.cpp
@@ -198,6 +198,14 @@ void Sprite::drawClip(Surface *ds, const Rect &clipRect, const Point &spritePoin
bufRowPointer += ds->pitch * io;
srcRowPointer += width * io;
}
+
+ int traverseSign = 1;
+
+ if (_vm->getGameType() == GType_IHNM) {
+ traverseSign = -1;
+ bufRowPointer += clipHeight * ds->pitch;
+ }
+
for (i = io; i < clipHeight; i++) {
for (j = jo; j < clipWidth; j++) {
assert((byte *)ds->pixels <= (byte *)(bufRowPointer + j + spritePointer.x));
@@ -210,7 +218,7 @@ void Sprite::drawClip(Surface *ds, const Rect &clipRect, const Point &spritePoin
*(bufRowPointer + j + spritePointer.x) = *(srcRowPointer + j);
}
}
- bufRowPointer += ds->pitch;
+ bufRowPointer += ds->pitch * traverseSign;
srcRowPointer += width;
}
}