Boss key like in original. Press F9. Palette seems to be wrong though and

cursor does not reappear.

svn-id: r18985
This commit is contained in:
Eugene Sandulenko 2005-10-09 03:35:45 +00:00
parent 6cd35f7507
commit c11575c99c
4 changed files with 96 additions and 1 deletions

View File

@ -100,6 +100,9 @@ int SagaEngine::processInput() {
break;
case 289: // F8
break;
case 290: // F9
_interface->keyBoss();
break;
// Actual game keys
case 32: // space

View File

@ -177,6 +177,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_active = true;
_panelMode = _lockedMode = kPanelNull;
_savedMode = -1;
_bossMode = -1;
_fadeMode = kNoFade;
_inMainMode = false;
*_statusText = 0;
@ -313,6 +314,9 @@ void Interface::setMode(int mode) {
break;
case kPanelChapterSelection:
break;
case kPanelBoss:
_vm->_render->setFlag(RF_DEMO_SUBST);
break;
}
draw();
@ -487,6 +491,10 @@ bool Interface::processAscii(uint16 ascii, bool synthetic) {
_vm->shutDown();
}
break;
case kPanelBoss:
_vm->_render->clearFlag(RF_DEMO_SUBST);
keyBossExit();
break;
}
return false;
}
@ -2298,4 +2306,81 @@ void Interface::mapPanelDrawCrossHair() {
}
}
void Interface::keyBoss() {
if (_vm->getGameType() != GType_IHNM)
return;
if (_bossMode != -1 || _fadeMode != kNoFade)
return;
_vm->_sound->pauseVoice();
_vm->_sound->pauseSound();
_vm->_music->pause();
int i;
byte *resource;
size_t resourceLength, imageLength;
Surface *backBuffer;
Rect rect;
byte *image;
int imageWidth, imageHeight;
const byte *pal;
PalEntry cPal[PAL_ENTRIES];
_vm->_gfx->showCursor(false);
backBuffer = _vm->_gfx->getBackBuffer();
rect.left = rect.top = 0;
_vm->_resource->loadResource(_interfaceContext, RID_IHNM_BOSS_SCREEN, resource, resourceLength);
if (resourceLength == 0) {
error("Interface::bossKey() unable to load Boss image resource");
}
_bossMode = _panelMode;
setMode(kPanelBoss);
_vm->decodeBGImage(resource, resourceLength, &image, &imageLength, &imageWidth, &imageHeight);
rect.setWidth(imageWidth);
rect.setHeight(imageHeight);
_vm->_gfx->getCurrentPal(_mapSavedPal);
pal = _vm->getImagePal(resource, resourceLength);
for (i = 0; i < PAL_ENTRIES; i++) {
cPal[i].red = *pal++;
cPal[i].green = *pal++;
cPal[i].blue = *pal++;
}
backBuffer->blit(rect, image);
_vm->_gfx->setPalette(cPal);
free(resource);
free(image);
}
void Interface::keyBossExit() {
PalEntry pal[PAL_ENTRIES];
_vm->_sound->resumeVoice();
_vm->_sound->resumeSound();
_vm->_music->resume();
_vm->_gfx->getCurrentPal(pal);
_vm->_gfx->palToBlack(pal, 1);
setMode(_bossMode);
_vm->_render->drawScene();
_vm->_gfx->blackToPal(_mapSavedPal, 1);
_bossMode = -1;
}
} // End of namespace Saga

View File

@ -70,7 +70,8 @@ enum PanelModes {
kPanelSceneSubstitute,
kPanelChapterSelection,
kPanelCutaway,
kPanelVideo
kPanelVideo,
kPanelBoss
// kPanelInventory
};
@ -243,6 +244,9 @@ public:
bool processAscii(uint16 ascii, bool synthetic = false);
void processKeyUp(uint16 ascii);
void keyBoss();
void keyBossExit();
void disableAbortSpeeches(bool d) { _disableAbortSpeeches = d; }
bool _textInput;
@ -423,6 +427,7 @@ private:
int _panelMode;
int _savedMode;
int _lockedMode;
int _bossMode;
bool _inMainMode;
char _statusText[STATUS_TEXT_LEN];
int _statusOnceColor;

View File

@ -87,6 +87,8 @@ namespace Saga {
#define RID_IHNM_MAIN_PANEL_SPRITES 13 // TODO: verify this
#define RID_IHNM_MAIN_STRINGS 21
#define RID_IHNM_BOSS_SCREEN 19
// Puzzle portraits
#define RID_ITE_SAKKA_APPRAISING 6
#define RID_ITE_SAKKA_DENIAL 7