diff options
author | Eugene Sandulenko | 2014-04-09 23:43:50 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-09 23:43:50 +0300 |
commit | 15c6293128bd45eca9d3783c1201d0b34f239862 (patch) | |
tree | 871cb434ca9e64f992bb369f4866a435296f1722 /engines/fullpipe | |
parent | a73bb7b3f68fbd67a4ea8505e44c81fbe88dfe59 (diff) | |
download | scummvm-rg350-15c6293128bd45eca9d3783c1201d0b34f239862.tar.gz scummvm-rg350-15c6293128bd45eca9d3783c1201d0b34f239862.tar.bz2 scummvm-rg350-15c6293128bd45eca9d3783c1201d0b34f239862.zip |
FULLPIPE: Implement ModalMainMenu constructor
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/constants.h | 13 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 1 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 110 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 24 |
5 files changed, 145 insertions, 4 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 5a291dfdc6..741a55f74c 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -266,6 +266,19 @@ namespace Fullpipe { #define TrubaLeft 474 #define TrubaUp 680 +// Main Menu +#define PIC_MNU_AUTHORS_L 4624 +#define PIC_MNU_CONTINUE_L 4626 +#define PIC_MNU_DEBUG_L 4632 +#define PIC_MNU_EXIT_L 4622 +#define PIC_MNU_LOAD_L 4628 +#define PIC_MNU_MUSICSLIDER_D 4914 +#define PIC_MNU_MUSICSLIDER_L 4915 +#define PIC_MNU_RESTART_L 5299 +#define PIC_MNU_SAVE_L 4630 +#define PIC_MNU_SLIDER_D 4913 +#define PIC_MNU_SLIDER_L 4912 + // Intro #define ANI_IN1MAN 5110 #define MSG_INTR_ENDINTRO 5139 diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 4446af7b60..2b4c90b576 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -95,6 +95,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _gamePaused = false; _inputArFlag = false; _recordEvents = false; + _mainMenu_debugEnabled = false; _flgGameIsRunning = true; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 17a771bd5d..11d7585fa2 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -125,6 +125,7 @@ public: bool _flgGameIsRunning; bool _inputArFlag; bool _recordEvents; + bool _mainMenu_debugEnabled; Common::Rect _sceneRect; int _sceneWidth; 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() { diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 7ed433b125..532d145c2c 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -147,9 +147,26 @@ class ModalCredits : public BaseModalObject { virtual void saveload() {} }; +struct MenuArea { + int picIdL; + PictureObject *picObjD; + PictureObject *picObjL; +}; + class ModalMainMenu : public BaseModalObject { public: - int _field_34; + Scene *_scene; + int _mfield_C; + Common::Array<MenuArea *> _areas; + int _menuSliderIdx; + int _musicSliderIdx; + int _mfield_2C; + int _mfield_30; + int _mfield_34; + Common::Rect _screct; + int _bgX; + int _bgY; + int _mfield_50; public: ModalMainMenu(); @@ -160,6 +177,11 @@ public: virtual bool init(int counterdiff) { return true; } virtual void update() {} virtual void saveload() {} + +private: + bool isSaveAllowed(); + void enableDebugMenuButton(); + void setSliderPos(); }; class ModalHelp : public BaseModalObject { |