[Scummvm-git-logs] scummvm master -> 6a3ee9a00884c36f3f591ac4bb410565f4caf31b
sev-
sev at scummvm.org
Thu Dec 8 18:13:07 CET 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
55b6e7f090 FULLPIPE: Implement ModalMap::init2()
6a3ee9a008 FULLPIPE: Implement ModalMap::findMapSceneId() and plug new map code in
Commit: 55b6e7f0902ee30c371cde5ab916d7a8d9972fa8
https://github.com/scummvm/scummvm/commit/55b6e7f0902ee30c371cde5ab916d7a8d9972fa8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-12-08T18:12:57+01:00
Commit Message:
FULLPIPE: Implement ModalMap::init2()
Changed paths:
engines/fullpipe/modal.cpp
engines/fullpipe/modal.h
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 34cdfbf..d46ffad 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -275,6 +275,7 @@ ModalMap::ModalMap() {
_mapScene = 0;
_pic = NULL;
_picI03 = NULL;
+ _highlightedPic = NULL;
_isRunning = false;
_rect1 = g_fp->_sceneRect;
_x = g_fp->_currentScene->_x;
@@ -328,6 +329,98 @@ bool ModalMap::init(int counterdiff) {
return _isRunning;
}
+bool ModalMap::init2(int counterdiff) {
+ g_fp->setCursor(PIC_CSR_DEFAULT);
+
+ _dragX = (int)((double)_dragX * 0.6666666666666666);
+ _dragY = (int)((double)_dragY * 0.6666666666666666);
+
+ if (800 - g_fp->_mouseScreenPos.x < 67) {
+ g_fp->setCursor(PIC_CSR_GOR);
+
+ _dragX = g_fp->_mouseScreenPos.x - 733;
+ _dragY = (int)((double)_dragY * 0.6666666666666666);
+ }
+
+ if (g_fp->_mouseScreenPos.x < 67) {
+ g_fp->setCursor(PIC_CSR_GOL);
+
+ this->_dragX = g_fp->_mouseScreenPos.x - 67;
+ this->_dragY = (int)((double)_dragY * 0.6666666666666666);
+ }
+
+ if (g_fp->_mouseScreenPos.y < 67) {
+ g_fp->setCursor(PIC_CSR_GOU);
+
+ _dragX = (int)((double)_dragX * 0.6666666666666666);
+ _dragY = g_fp->_mouseScreenPos.y - 67;
+ }
+
+ if (600 - g_fp->_mouseScreenPos.y < 87) {
+ g_fp->setCursor(PIC_CSR_GOD);
+
+ _dragX = (int)((double)_dragX * 0.6666666666666666);
+ _dragY = g_fp->_mouseScreenPos.y - 513;
+ }
+
+ g_fp->_sceneRect.translate(_dragX, _dragY);
+ _mapScene->updateScrolling2();
+ _rect2 = g_fp->_sceneRect;
+
+ PictureObject *hpic = getSceneHPicture(_mapScene->getPictureObjectAtPos(g_fp->_mouseVirtX, g_fp->_mouseVirtY));
+
+ if (hpic != _highlightedPic) {
+ if (_highlightedPic) {
+ _highlightedPic->_flags &= 0xFFFB;
+ _picI03->_flags &= 0xFFFB;
+ }
+
+ _highlightedPic = hpic;
+
+ if (hpic) {
+ PreloadItem pitem;
+
+ pitem.preloadId1 = g_fp->_currentScene->_sceneId;
+ pitem.sceneId = findMapSceneId(hpic->_id);
+
+ if (pitem.preloadId1 == pitem.sceneId || checkScenePass(&pitem)) {
+ _highlightedPic->_flags |= 4;
+
+ g_fp->playSound(SND_CMN_070, 0);
+ } else {
+ Common::Point p1, p2;
+
+ _picI03->getDimensions(&p1);
+ _highlightedPic->getDimensions(&p2);
+
+ _picI03->setOXY(_highlightedPic->_ox + p2.x / 2 - p1.x / 2, _highlightedPic->_oy + p2.y / 2 - p1.y / 2);
+ _picI03->_flags |= 4;
+ }
+ }
+ }
+
+ if (this->_highlightedPic) {
+ g_fp->setCursor(PIC_CSR_ITN);
+
+ _hotSpotDelay--;
+
+ if (_hotSpotDelay <= 0) {
+ _hotSpotDelay = 12;
+
+ if (_pic)
+ _pic->_flags ^= 4;
+ }
+ }
+
+ return _isRunning;
+}
+
+int ModalMap::findMapSceneId(int picId) {
+ warning("STUB: ModalMap::findMapSceneId()");
+ return 0;
+}
+
+
void ModalMap::update() {
g_fp->_sceneRect = _rect2;
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index ebbe1f1..5eed7e7 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -94,6 +94,7 @@ class ModalMap : public BaseModalObject {
Scene *_mapScene;
PictureObject *_pic;
PictureObject *_picI03;
+ PictureObject *_highlightedPic;
bool _isRunning;
Common::Rect _rect1;
int _x;
@@ -113,6 +114,7 @@ class ModalMap : public BaseModalObject {
virtual bool pollEvent() { return true; }
virtual bool handleMessage(ExCommand *message);
virtual bool init(int counterdiff);
+ virtual bool init2(int counterdiff);
virtual void update();
virtual void saveload() {}
@@ -124,6 +126,7 @@ private:
bool checkScenePass(PreloadItem *item);
bool isSceneEnabled(int sceneId);
+ int findMapSceneId(int picId);
};
class ModalFinal : public BaseModalObject {
Commit: 6a3ee9a00884c36f3f591ac4bb410565f4caf31b
https://github.com/scummvm/scummvm/commit/6a3ee9a00884c36f3f591ac4bb410565f4caf31b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-12-08T18:12:57+01:00
Commit Message:
FULLPIPE: Implement ModalMap::findMapSceneId() and plug new map code in
Changed paths:
engines/fullpipe/modal.cpp
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index d46ffad..05b719a 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -302,6 +302,9 @@ ModalMap::~ModalMap() {
}
bool ModalMap::init(int counterdiff) {
+ if (_picI03)
+ return init2(counterdiff);
+
g_fp->setCursor(PIC_CSR_ITN);
if (_flag) {
@@ -416,7 +419,14 @@ bool ModalMap::init2(int counterdiff) {
}
int ModalMap::findMapSceneId(int picId) {
- warning("STUB: ModalMap::findMapSceneId()");
+ for (uint i = 0; i < g_fp->_gameLoader->_preloadItems.size(); i++) {
+ PreloadItem *pitem = g_fp->_gameLoader->_preloadItems[i];
+
+ if (pitem->preloadId1 == SC_MAP && pitem->preloadId2 == picId) {
+ return pitem->sceneId;
+ }
+ }
+
return 0;
}
@@ -520,8 +530,6 @@ void ModalMap::initMap() {
if (_picI03) {
_picI03->_flags &= 0xFFFB;
- } else {
- warning("No PIC_MAP_I03");
}
g_system->warpMouse(400, 300);
More information about the Scummvm-git-logs
mailing list