[Scummvm-cvs-logs] scummvm master -> 15c6293128bd45eca9d3783c1201d0b34f239862

sev- sev at scummvm.org
Wed Apr 9 22:45:02 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
15c6293128 FULLPIPE: Implement ModalMainMenu constructor


Commit: 15c6293128bd45eca9d3783c1201d0b34f239862
    https://github.com/scummvm/scummvm/commit/15c6293128bd45eca9d3783c1201d0b34f239862
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-04-09T23:43:50+03:00

Commit Message:
FULLPIPE: Implement ModalMainMenu constructor

Changed paths:
    engines/fullpipe/constants.h
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/modal.cpp
    engines/fullpipe/modal.h



diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 5a291df..741a55f 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 4446af7..2b4c90b 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 17a771b..11d7585 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 603aaff..833d47f 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 7ed433b..532d145 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 {






More information about the Scummvm-git-logs mailing list