aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-29 07:51:57 +0300
committerEugene Sandulenko2014-04-29 07:52:32 +0300
commitc81099d3900ceb5e2eacd60770735ae9f6d706f3 (patch)
tree8cd088358746ec2887cabf1359c75d05f4b83449 /engines
parent0698ae4a0728403f6f5140b6521185ff3c007c8c (diff)
downloadscummvm-rg350-c81099d3900ceb5e2eacd60770735ae9f6d706f3.tar.gz
scummvm-rg350-c81099d3900ceb5e2eacd60770735ae9f6d706f3.tar.bz2
scummvm-rg350-c81099d3900ceb5e2eacd60770735ae9f6d706f3.zip
FULLPIPE: Implement ModalSaveGame::setup()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/constants.h42
-rw-r--r--engines/fullpipe/modal.cpp102
-rw-r--r--engines/fullpipe/modal.h16
3 files changed, 154 insertions, 6 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index f76a12fb2b..b257fca949 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -292,6 +292,48 @@ namespace Fullpipe {
#define PIC_MOV_CANCEL 5345
#define PIC_MOV_OK 5344
+// Saveload dialog
+#define PIC_MLD_BGR 4645
+#define PIC_MLD_CANCEL_D 4648
+#define PIC_MLD_CANCEL_L 4649
+#define PIC_MLD_OK_D 4646
+#define PIC_MLD_OK_L 4647
+#define PIC_MSV_0_D 4643
+#define PIC_MSV_0_L 4644
+#define PIC_MSV_1_D 4651
+#define PIC_MSV_1_L 4660
+#define PIC_MSV_2_D 4652
+#define PIC_MSV_2_L 4661
+#define PIC_MSV_3_D 4653
+#define PIC_MSV_3_L 4662
+#define PIC_MSV_4_D 4654
+#define PIC_MSV_4_L 4663
+#define PIC_MSV_5_D 4655
+#define PIC_MSV_5_L 4664
+#define PIC_MSV_6_D 4656
+#define PIC_MSV_6_L 4665
+#define PIC_MSV_7_D 4657
+#define PIC_MSV_7_L 4666
+#define PIC_MSV_8_D 4658
+#define PIC_MSV_8_L 4667
+#define PIC_MSV_9_D 4659
+#define PIC_MSV_9_L 4668
+#define PIC_MSV_BGR 4634
+#define PIC_MSV_CANCEL_D 4637
+#define PIC_MSV_CANCEL_L 4638
+#define PIC_MSV_DOTS_D 4670
+#define PIC_MSV_DOTS_L 4669
+#define PIC_MSV_DOT_D 5188
+#define PIC_MSV_DOT_L 5189
+#define PIC_MSV_EMPTY_D 4639
+#define PIC_MSV_EMPTY_L 4640
+#define PIC_MSV_FULL_D 4641
+#define PIC_MSV_FULL_L 4642
+#define PIC_MSV_OK_D 4635
+#define PIC_MSV_OK_L 4636
+#define PIC_MSV_SPACE_D 5190
+#define PIC_MSV_SPACE_L 5191
+
// Intro
#define ANI_IN1MAN 5110
#define MSG_INTR_ENDINTRO 5139
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 459c714984..906e4e6896 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -1468,10 +1468,10 @@ ModalSaveGame::~ModalSaveGame() {
_arrayD.clear();
_arrayL.clear();
- for (uint i = 0; i < _filenames.size(); i++)
- free(_filenames[i]);
+ for (uint i = 0; i < _files.size(); i++)
+ free(_files[i]);
- _filenames.clear();
+ _files.clear();
}
void ModalSaveGame::setScene(Scene *sc) {
@@ -1526,16 +1526,108 @@ bool ModalSaveGame::init(int counterdiff) {
}
void ModalSaveGame::setup(Scene *sc, int mode) {
- warning("STUB: ModalSaveGame::setup()");
+ _files.clear();
+ _arrayL.clear();
+ _arrayD.clear();
+ _mode = mode;
+
+ if (mode) {
+ _bgr = sc->getPictureObjectById(PIC_MSV_BGR, 0);
+ _cancelD = sc->getPictureObjectById(PIC_MSV_CANCEL_D, 0);
+ _cancelL = sc->getPictureObjectById(PIC_MSV_CANCEL_L, 0);
+ _okD = sc->getPictureObjectById(PIC_MSV_OK_D, 0);
+ _okL = sc->getPictureObjectById(PIC_MSV_OK_L, 0);
+ _emptyD = sc->getPictureObjectById(PIC_MSV_EMPTY_D, 0);
+ _emptyL = sc->getPictureObjectById(PIC_MSV_EMPTY_L, 0);
+ } else {
+ _bgr = sc->getPictureObjectById(PIC_MLD_BGR, 0);
+ _cancelD = sc->getPictureObjectById(PIC_MLD_CANCEL_D, 0);
+ _cancelL = sc->getPictureObjectById(PIC_MLD_CANCEL_L, 0);
+ _okD = sc->getPictureObjectById(PIC_MLD_OK_D, 0);
+ _okL = sc->getPictureObjectById(PIC_MLD_OK_L, 0);
+ _emptyD = sc->getPictureObjectById(PIC_MSV_EMPTY_D, 0);
+ _emptyL = sc->getPictureObjectById(PIC_MSV_EMPTY_D, 0);
+ }
+
+ _fullD = sc->getPictureObjectById(PIC_MSV_FULL_D, 0);
+ _fullL = sc->getPictureObjectById(PIC_MSV_FULL_L, 0);
+ _queryRes = -1;
+
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_0_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_0_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_1_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_1_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_2_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_2_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_3_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_3_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_4_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_4_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_5_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_5_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_6_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_6_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_7_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_7_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_8_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_8_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_9_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_9_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_DOTS_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_DOTS_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_DOT_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_DOT_L, 0));
+ _arrayL.push_back(sc->getPictureObjectById(PIC_MSV_SPACE_D, 0));
+ _arrayD.push_back(sc->getPictureObjectById(PIC_MSV_SPACE_L, 0));
+
+ Common::Point point;
+
+ int x = _bgr->_ox + _bgr->getDimensions(&point)->x / 2;
+ int y = _bgr->_oy + 90;
+ bool flag = false;
+ int w;
+ FileInfo *fileinfo;
+
+ for (int i = 0; i < 7; i++) {
+ fileinfo = new FileInfo;
+
+ snprintf(fileinfo->filename, 160, "save%02d.sav", i);
+
+ if (!getFileInfo(fileinfo->filename, fileinfo) || flag) {
+ flag = true;
+ w = _emptyD->getDimensions(&point)->x;
+ } else {
+ w = 0;
+
+ for (int j = 0; j < 16; j++) {
+ _arrayL[j]->getDimensions(&point);
+ w += point.x + 2;
+ }
+ }
+
+ fileinfo->fx1 = x - w / 2;
+ fileinfo->fx2 = x + w / 2;
+ fileinfo->fy1 = y;
+ fileinfo->fy2 = y + _emptyD->getDimensions(&point)->y;
+
+ _files.push_back(fileinfo);
+
+ y = fileinfo->fy2 + 3;
+ }
}
char *ModalSaveGame::getSaveName() {
if (_queryRes < 0)
return 0;
- return _filenames[_queryRes];
+ return _files[_queryRes]->filename;
}
+bool ModalSaveGame::getFileInfo(char *filename, FileInfo *fileinfo) {
+ warning("STUB: ModalSaveGame::getFileInfo()");
+
+ return false;
+}
void FullpipeEngine::openHelp() {
if (!_modalObject) {
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index e2962ab595..aced31573b 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -29,6 +29,19 @@ class PictureObject;
class Picture;
class Sound;
+struct FileInfo {
+ char filename[260];
+ int fi_104;
+ int day;
+ int month;
+ int year;
+ int time;
+ int fx1;
+ int fx2;
+ int fy1;
+ int fy2;
+};
+
class BaseModalObject {
public:
@@ -253,6 +266,7 @@ public:
void processKey(int key);
char *getSaveName();
+ bool getFileInfo(char *filename, FileInfo *fileinfo);
Common::Rect _rect;
int _oldBgX;
@@ -269,7 +283,7 @@ public:
Scene *_menuScene;
int _mode;
ModalQuery *_queryDlg;
- Common::Array <char *> _filenames;
+ Common::Array <FileInfo *> _files;
Common::Array <PictureObject *> _arrayL;
Common::Array <PictureObject *> _arrayD;
int _queryRes;