[Scummvm-git-logs] scummvm master -> 957354353623bac6d3c4b41f0914e7ab770fa501

sev- sev at scummvm.org
Mon Aug 29 23:36:52 CEST 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:
888a4578af FULLPIPE: Fix few bugs in Map code
9573543536 FULLPIPE: Fix arithmetics in MovGraph::putToLink


Commit: 888a4578af7ee7f5d47f59a2b6d8718f88b96eb3
    https://github.com/scummvm/scummvm/commit/888a4578af7ee7f5d47f59a2b6d8718f88b96eb3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-29T23:35:20+02:00

Commit Message:
FULLPIPE: Fix few bugs in Map code

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



diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 9658199..54a7793 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -406,6 +406,7 @@ void FullpipeEngine::updateEvents() {
 				_lastInputTicks = _updateTicks;
 				ex->handle();
 			}
+			_mouseScreenPos = event.mouse;
 			break;
 		case Common::EVENT_LBUTTONDOWN:
 			if (!_inputArFlag && (_updateTicks - _lastInputTicks) >= 2) {
@@ -418,6 +419,7 @@ void FullpipeEngine::updateEvents() {
 				_lastInputTicks = _updateTicks;
 				ex->handle();
 			}
+			_mouseScreenPos = event.mouse;
 			break;
 		case Common::EVENT_LBUTTONUP:
 			if (!_inputArFlag && (_updateTicks - _lastButtonUpTicks) >= 2) {
@@ -426,6 +428,7 @@ void FullpipeEngine::updateEvents() {
 				_lastButtonUpTicks = _updateTicks;
 				ex->handle();
 			}
+			_mouseScreenPos = event.mouse;
 			break;
 		default:
 			break;
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 0963237..382cdfd 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -309,7 +309,7 @@ bool ModalMap::init(int counterdiff) {
 		_rect2.right = _rect2.left + 800;
 		_rect2.bottom = _rect2.top + 600;
 
-		g_fp->_sceneRect =_rect2;
+		g_fp->_sceneRect = _rect2;
 
 		_mapScene->updateScrolling2();
 
@@ -346,17 +346,17 @@ bool ModalMap::handleMessage(ExCommand *cmd) {
 		_mouseX = g_fp->_mouseScreenPos.x;
 		_mouseY = g_fp->_mouseScreenPos.x;
 
-		_field_3C = _rect2.top;
 		_field_38 = _rect2.left;
+		_field_3C = _rect2.top;
 
-		break;
+		return false;
 
 	case 30:
 		_flag = 0;
-		break;
+		return false;
 
 	case 36:
-		if (cmd->_keyCode != 9 && cmd->_keyCode != 27 )
+		if (cmd->_keyCode != 9 && cmd->_keyCode != 27)
 			return false;
 
 		break;
@@ -431,20 +431,20 @@ PictureObject *ModalMap::getScenePicture() {
 
 	switch (g_fp->_currentScene->_sceneId) {
 	case SC_1:
-        picId = PIC_MAP_S01;
-        break;
+		picId = PIC_MAP_S01;
+		break;
 	case SC_2:
-        picId = PIC_MAP_S02;
-        break;
+		picId = PIC_MAP_S02;
+		break;
 	case SC_3:
-        picId = PIC_MAP_S03;
-        break;
+		picId = PIC_MAP_S03;
+		break;
 	case SC_4:
-        picId = PIC_MAP_S04;
-        break;
+		picId = PIC_MAP_S04;
+		break;
 	case SC_5:
-        picId = PIC_MAP_S05;
-        break;
+		picId = PIC_MAP_S05;
+		break;
 	case SC_6:
 		picId = PIC_MAP_S06;
 		break;
@@ -489,7 +489,7 @@ PictureObject *ModalMap::getScenePicture() {
 		picId = PIC_MAP_S20;
 		break;
 	case SC_21:
-        picId = PIC_MAP_S21;
+		picId = PIC_MAP_S21;
 		break;
 	case SC_22:
 		picId = PIC_MAP_S22;


Commit: 957354353623bac6d3c4b41f0914e7ab770fa501
    https://github.com/scummvm/scummvm/commit/957354353623bac6d3c4b41f0914e7ab770fa501
Author: Retro-Junk (bambarbee at yandex.ru)
Date: 2016-08-29T23:36:15+02:00

Commit Message:
FULLPIPE: Fix arithmetics in MovGraph::putToLink

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 87ac98d..81d92cc 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1332,9 +1332,9 @@ double MovGraph::putToLink(Common::Point *point, MovGraphLink *link, int fuzzyMa
 	int n2x = link->_graphDst->_x;
 	int n2y = link->_graphDst->_y;
 	double dist1x = (double)(point->x - n1x);
-	double dist1y = (double)(point->y - n1y);
+	double dist1y = (double)(n1y - point->y);
 	double dist2x = (double)(n2x - n1x);
-	double dist2y = (double)(n2y - n1y);
+	double dist2y = (double)(n1y - n2y);
 	double dist1 = sqrt(dist1x * dist1x + dist1y * dist1y);
 	double dist2 = (dist2y * dist1y + dist2x * dist1x) / link->_length / dist1;
 	double distm = dist2 * dist1;
@@ -1355,8 +1355,8 @@ double MovGraph::putToLink(Common::Point *point, MovGraphLink *link, int fuzzyMa
 			return -1.0;
 		}
 	} else {
-		point->x = (int)(n1x + (dist2x * distm / link->_length));
-		point->y = (int)(n1y + (dist2y * distm / link->_length));
+		point->x = n1x + (int)((double)(n2x - n1x) * distm / link->_length);
+		point->y = n1y + (int)((double)(n2y - n1y) * distm / link->_length);
 	}
 
 	return res;





More information about the Scummvm-git-logs mailing list