From 15c6293128bd45eca9d3783c1201d0b34f239862 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 9 Apr 2014 23:43:50 +0300 Subject: FULLPIPE: Implement ModalMainMenu constructor --- engines/fullpipe/modal.cpp | 110 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 107 insertions(+), 3 deletions(-) (limited to 'engines/fullpipe/modal.cpp') diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 603aaff026..833d47fde1 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -718,7 +718,7 @@ bool ModalCredits::init(int counterdiff) { g_fp->_modalObject = menu; - menu->_field_34 = 1; + menu->_mfield_34 = 1; } return true; @@ -750,9 +750,113 @@ void ModalCredits::update() { } ModalMainMenu::ModalMainMenu() { - warning("STUB: ModalMainMenu::ModalMainMenu()"); + _areas.clear(); + + _mfield_2C = 0; + _mfield_C = 0; + _mfield_34 = 0; + _scene = g_fp->accessScene(SC_MAINMENU); + _mfield_50 = 0; + _screct.left = g_fp->_sceneRect.left; + _screct.top = g_fp->_sceneRect.top; + _screct.right = g_fp->_sceneRect.right; + _screct.bottom = g_fp->_sceneRect.bottom; - _field_34 = 0; + if (g_fp->_currentScene) { + _bgX = g_fp->_currentScene->_x; + _bgY = g_fp->_currentScene->_y; + } else { + _bgX = 0; + _bgY = 0; + } + + g_fp->_sceneRect.top = 0; + g_fp->_sceneRect.left = 0; + g_fp->_sceneRect.right = 800; + g_fp->_sceneRect.bottom = 600; + + MenuArea *area; + + area = new MenuArea(); + area->picIdL = PIC_MNU_EXIT_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(PIC_MNU_EXIT_L, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_CONTINUE_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + if (isSaveAllowed()) { + area = new MenuArea(); + area->picIdL = PIC_MNU_SAVE_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + } + + area = new MenuArea(); + area->picIdL = PIC_MNU_LOAD_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_RESTART_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_AUTHORS_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_SLIDER_L; + area->picObjD = _scene->getPictureObjectById(PIC_MNU_SLIDER_D, 0); + area->picObjD->_flags |= 4; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + _menuSliderIdx = _areas.size() - 1; + + area = new MenuArea(); + area->picIdL = PIC_MNU_MUSICSLIDER_L; + area->picObjD = _scene->getPictureObjectById(PIC_MNU_MUSICSLIDER_D, 0); + area->picObjD->_flags |= 4; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + _musicSliderIdx = _areas.size(); + + if (g_fp->_mainMenu_debugEnabled) + enableDebugMenuButton(); + + setSliderPos(); +} + +bool ModalMainMenu::isSaveAllowed() { + warning("STUB: ModalMainMenu::isSaveAllowed()"); + + return true; +} + +void ModalMainMenu::enableDebugMenuButton() { + warning("STUB: ModalMainMenu::enableDebugMenuButton()"); +} + +void ModalMainMenu::setSliderPos() { + warning("STUB: ModalMainMenu::setSliderPos()"); } ModalHelp::ModalHelp() { -- cgit v1.2.3