Fix the quit panel in IHNM

svn-id: r27387
This commit is contained in:
Filippos Karapetis 2007-06-13 15:31:45 +00:00
parent cbb378de1f
commit 7af7e3f192
4 changed files with 28 additions and 7 deletions

View file

@ -31,6 +31,7 @@ static const GameResourceDescription ITE_Resources = {
RID_ITE_MAIN_PANEL,
RID_ITE_CONVERSE_PANEL,
RID_ITE_OPTION_PANEL,
0,
RID_ITE_MAIN_SPRITES,
RID_ITE_MAIN_PANEL_SPRITES,
RID_ITE_DEFAULT_PORTRAITS,
@ -44,6 +45,7 @@ static const GameResourceDescription ITEDemo_Resources = {
RID_ITEDEMO_MAIN_PANEL,
RID_ITEDEMO_CONVERSE_PANEL,
RID_ITEDEMO_OPTION_PANEL,
0,
RID_ITEDEMO_MAIN_SPRITES,
RID_ITEDEMO_MAIN_PANEL_SPRITES,
RID_ITEDEMO_DEFAULT_PORTRAITS,
@ -287,6 +289,7 @@ static const GameResourceDescription IHNM_Resources = {
RID_IHNM_MAIN_PANEL,
RID_IHNM_CONVERSE_PANEL,
RID_IHNM_OPTION_PANEL,
RID_IHNM_WARNING_PANEL,
RID_IHNM_MAIN_SPRITES,
RID_IHNM_MAIN_PANEL_SPRITES,
0,

View file

@ -340,11 +340,9 @@ static PanelButton IHNM_OptionPanelButtons[] = {
};
static PanelButton IHNM_QuitPanelButtons[] = {
//FIXME: Show the correct quit dialog background
//TODO: Those coordinates might not be pixel perfect, check with the original interpreter
{kPanelButtonQuit, 25,80, 80,25, kTextQuit,'q',0, 0,0,0},
{kPanelButtonQuit, 155,80, 80,25, kTextCancel,'c',0, 0,0,0},
{kPanelButtonQuitText, -1,5, 0,0, kTextQuitTheGameQuestion,'-',0, 0,0,0},
{kPanelButtonQuit, 25,79, 80,25, kTextQuit,'q',0, 0,0,0},
{kPanelButtonQuit, 155,79, 80,25, kTextCancel,'c',0, 0,0,0},
{kPanelButtonQuitText, 75,30, 0,0, kTextQuitTheGameQuestion,'-',0, 0,0,0},
};
static PanelButton IHNM_LoadPanelButtons[] = {
@ -397,7 +395,7 @@ static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
ARRAYSIZE(IHNM_OptionPanelButtons),
IHNM_OptionPanelButtons,
190,180, // quit panel offsets
190,94, // quit panel offsets
260,115, // quit panel width & height
ARRAYSIZE(IHNM_QuitPanelButtons),
IHNM_QuitPanelButtons,

View file

@ -91,6 +91,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
error("Interface::Interface() resource context not found");
}
// Main panel
_mainPanel.buttons = _vm->getDisplayInfo().mainPanelButtons;
_mainPanel.buttonsCount = _vm->getDisplayInfo().mainPanelButtonsCount;
@ -110,6 +111,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
free(resource);
// Converse panel
_conversePanel.buttons = _vm->getDisplayInfo().conversePanelButtons;
_conversePanel.buttonsCount = _vm->getDisplayInfo().conversePanelButtonsCount;
@ -118,6 +120,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
&_conversePanel.imageLength, &_conversePanel.imageWidth, &_conversePanel.imageHeight);
free(resource);
// Option panel
_optionPanel.buttons = _vm->getDisplayInfo().optionPanelButtons;
_optionPanel.buttonsCount = _vm->getDisplayInfo().optionPanelButtonsCount;
@ -126,6 +129,18 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
&_optionPanel.imageLength, &_optionPanel.imageWidth, &_optionPanel.imageHeight);
free(resource);
// Quit panel
if (_vm->getGameType() == GType_IHNM) {
_quitPanel.buttons = _vm->getDisplayInfo().quitPanelButtons;
_quitPanel.buttonsCount = _vm->getDisplayInfo().quitPanelButtonsCount;
_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->warningPanelResourceId, resource, resourceLength);
_vm->decodeBGImage(resource, resourceLength, &_quitPanel.image,
&_quitPanel.imageLength, &_quitPanel.imageWidth, &_quitPanel.imageHeight);
free(resource);
}
// Main panel sprites
_vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites);
if (_vm->getGameType() == GType_ITE) {
@ -817,7 +832,11 @@ void Interface::drawQuit() {
backBuffer = _vm->_gfx->getBackBuffer();
_quitPanel.getRect(rect);
drawButtonBox(backBuffer, rect, kButton, false);
if (_vm->getGameType() == GType_ITE)
drawButtonBox(backBuffer, rect, kButton, false);
else
backBuffer->blit(rect, _quitPanel.image);
for (i = 0; i < _quitPanel.buttonsCount; i++) {
panelButton = &_quitPanel.buttons[i];
if (panelButton->type == kPanelButtonQuit) {

View file

@ -289,6 +289,7 @@ struct GameResourceDescription {
uint32 mainPanelResourceId;
uint32 conversePanelResourceId;
uint32 optionPanelResourceId;
uint32 warningPanelResourceId;
uint32 mainSpritesResourceId;
uint32 mainPanelSpritesResourceId;
uint32 defaultPortraitsResourceId;