[Scummvm-cvs-logs] scummvm master -> 0b240ff4a09d2966a181f4368a4a881398bfe379

sev- sev at scummvm.org
Mon May 30 19:33:01 CEST 2016


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

Summary:
1fc54e0086 SCUMM HE: Moonbase FOW rendering fixes
6eba4dd363 PARALLACTION: More string safety
f151845e68 PARALLACTION: Fix object initialization
c8f28986e5 SCUMM HE: Fix object destruction
0b240ff4a0 SCUMM HE: Fixed initialization in Moonbase AI


Commit: 1fc54e0086f6d5de6b85f5be46de8a8068f4046c
    https://github.com/scummvm/scummvm/commit/1fc54e0086f6d5de6b85f5be46de8a8068f4046c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-30T19:32:49+02:00

Commit Message:
SCUMM HE: Moonbase FOW rendering fixes

Changed paths:
    engines/scumm/he/moonbase/moonbase.h
    engines/scumm/he/moonbase/moonbase_fow.cpp



diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h
index 243d53a..1d87eed 100644
--- a/engines/scumm/he/moonbase/moonbase.h
+++ b/engines/scumm/he/moonbase/moonbase.h
@@ -98,7 +98,7 @@ private:
 
 	bool _fowBlackMode;
 
-	int _fowRenderTable[32768];
+	int32 _fowRenderTable[32768];
 
 	Common::PEResources _exe;
 	Common::String _fileName;
diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp
index 48c2219..0c29d57 100644
--- a/engines/scumm/he/moonbase/moonbase_fow.cpp
+++ b/engines/scumm/he/moonbase/moonbase_fow.cpp
@@ -169,6 +169,21 @@ void Moonbase::setFOWInfo(int fowInfoArray, int downDim, int acrossDim, int view
 	if (!_fowImage)
 		return;
 
+	for (int y = 0; y < downDim; y++) {
+		Common::String s;
+
+		for (int x = 0; x < acrossDim; x++)
+			if (readFOWVisibilityArray(fowInfoArray, x, y))
+				s += "@";
+			else
+				s+= " ";
+
+		debug(0, "%s", s.c_str());
+	}
+	debug(0, "");
+
+	memset(_fowRenderTable, 0, sizeof(_fowRenderTable));
+
 	_fowDrawX = clipX1;
 	_fowDrawY = clipY1;
 
@@ -228,7 +243,7 @@ void Moonbase::setFOWInfo(int fowInfoArray, int downDim, int acrossDim, int view
 			int visibility = readFOWVisibilityArray(fowInfoArray, m, c);
 
 			if (visibility == FOW_EMPTY) {
-				int bits = 0;
+				uint32 bits = 0;
 
 				if (readFOWVisibilityArray(fowInfoArray, t, l) != 0) bits |= FF_T_L;
 				if (readFOWVisibilityArray(fowInfoArray, t, c) != 0) bits |= FF_T;
@@ -333,7 +348,7 @@ static void blackRect_16bpp(uint8 *destSurface, int dstPitch, int dstw, int dsth
 	int h = y2 - y1;
 	int w = ((x2 - x1) + 1) * 2;
 
-	while ( --h >= 0 ) {
+	while (--h >= 0) {
 		memset(dst, 0, w);
 		dst += dstPitch;
 	}


Commit: 6eba4dd3632bfb2ae03a566c53a7ea66b7d90444
    https://github.com/scummvm/scummvm/commit/6eba4dd3632bfb2ae03a566c53a7ea66b7d90444
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-30T19:32:49+02:00

Commit Message:
PARALLACTION: More string safety

Changed paths:
    engines/parallaction/parallaction_ns.cpp



diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 5fd6d87..ccf7130 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -352,8 +352,8 @@ void Parallaction_ns::changeLocation() {
 	}
 
 	char location[200];
-	strcpy(location, _newLocationName.c_str());
-	strcpy(_location._name, _newLocationName.c_str());
+	Common::strlcpy(location, _newLocationName.c_str(), 200);
+	Common::strlcpy(_location._name, _newLocationName.c_str(), 100);
 
 	debugC(1, kDebugExec, "changeLocation(%s)", location);
 


Commit: f151845e68b3c3a5246da0c7b1e954e43d74f80a
    https://github.com/scummvm/scummvm/commit/f151845e68b3c3a5246da0c7b1e954e43d74f80a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-30T19:32:49+02:00

Commit Message:
PARALLACTION: Fix object initialization

Changed paths:
    engines/parallaction/dialogue.cpp
    engines/parallaction/font.cpp
    engines/parallaction/input.cpp



diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 771715b..4dbedc8 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -153,6 +153,8 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
 	_downKey = 0;
 
 	_mouseButtons = 0;
+
+	_state = DIALOGUE_START;
 }
 
 void DialogueManager::start() {
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index f1c3b89..0476b15 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -70,6 +70,8 @@ public:
 		_data = (byte *)malloc(size);
 		stream.read(_data, size);
 
+		_cp = 0;
+		_bufPitch = 0;
 	}
 
 	~BraFont() {
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index 2cd85d7..c62e747 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -77,6 +77,8 @@ Input::Input(Parallaction *vm) : _vm(vm) {
 	_dougCursor = 0;
 	_donnaCursor = 0;
 	_comboArrow = 0;
+	_mouseArrow = 0;
+
 	initCursors();
 }
 


Commit: c8f28986e59b9f7bacd46f4928a3575df8bbd40d
    https://github.com/scummvm/scummvm/commit/c8f28986e59b9f7bacd46f4928a3575df8bbd40d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-30T19:32:49+02:00

Commit Message:
SCUMM HE: Fix object destruction

Changed paths:
    engines/scumm/he/moonbase/ai_main.cpp



diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp
index 9c9ff8b..fa13b33 100644
--- a/engines/scumm/he/moonbase/ai_main.cpp
+++ b/engines/scumm/he/moonbase/ai_main.cpp
@@ -606,7 +606,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 				targetX = getHubX(closestHub);
 				targetY = getHubY(closestHub);
 
-				delete launchAction;
+				delete[] launchAction;
 				launchAction = NULL;
 				_aiState = STATE_DEFEND_TARGET;
 				delete myTree;
@@ -647,7 +647,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 				}
 			} else {
 				index++;
-				delete launchAction;
+				delete[] launchAction;
 				launchAction = NULL;
 			}
 		} else {
@@ -667,7 +667,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 				_aiState = STATE_INIT_ACQUIRE_TARGET;
 			} else {
 				index++;
-				delete launchAction;
+				delete[] launchAction;
 				launchAction = NULL;
 			}
 		}
@@ -695,7 +695,7 @@ int AI::masterControlProgram(const int paramCount, const int32 *params) {
 				}
 			} else {
 				index++;
-				delete launchAction;
+				delete[] launchAction;
 				launchAction = NULL;
 			}
 		}


Commit: 0b240ff4a09d2966a181f4368a4a881398bfe379
    https://github.com/scummvm/scummvm/commit/0b240ff4a09d2966a181f4368a4a881398bfe379
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-30T19:32:49+02:00

Commit Message:
SCUMM HE: Fixed initialization in Moonbase AI

Changed paths:
    engines/scumm/he/moonbase/ai_main.cpp
    engines/scumm/he/moonbase/ai_targetacquisition.cpp
    engines/scumm/he/moonbase/ai_targetacquisition.h
    engines/scumm/he/moonbase/ai_traveller.cpp



diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp
index fa13b33..98a577b 100644
--- a/engines/scumm/he/moonbase/ai_main.cpp
+++ b/engines/scumm/he/moonbase/ai_main.cpp
@@ -2110,7 +2110,7 @@ int *AI::energizeTarget(int &targetX, int &targetY, int index) {
 								break;
 							}
 
-							testDist = ((((n - attempt) / n) * .5) + .5) * (getDistance(getHubX(nextUnit), getHubY(nextUnit), targetX, targetY) / .8);
+							testDist = (((((double)n - (double)attempt) / n) * .5) + .5) * (getDistance(getHubX(nextUnit), getHubY(nextUnit), targetX, targetY) / .8);
 							xPos = getHubX(nextUnit) + testDist * cos(degToRad(testAngle));
 							yPos = getHubY(nextUnit) + testDist * sin(degToRad(testAngle));
 						}
diff --git a/engines/scumm/he/moonbase/ai_targetacquisition.cpp b/engines/scumm/he/moonbase/ai_targetacquisition.cpp
index 02c49dc..313ea7a 100644
--- a/engines/scumm/he/moonbase/ai_targetacquisition.cpp
+++ b/engines/scumm/he/moonbase/ai_targetacquisition.cpp
@@ -320,6 +320,15 @@ void Sortie::printEnemyDefenses() {
 	}
 }
 
+Defender::Defender(AI *ai) : _ai(ai) {
+	_sourceX = _sourceY = 0;
+	_targetX = _targetY = 0;
+	_sourceUnit = 0;
+	_power = 0;
+	_angle = 0;
+	_unit = 0;
+}
+
 int Defender::calculateDefenseUnitPosition(int targetX, int targetY, int index) {
 	int currentPlayer = _ai->getCurrentPlayer();
 
diff --git a/engines/scumm/he/moonbase/ai_targetacquisition.h b/engines/scumm/he/moonbase/ai_targetacquisition.h
index 9afe0f5..5e6cfed 100644
--- a/engines/scumm/he/moonbase/ai_targetacquisition.h
+++ b/engines/scumm/he/moonbase/ai_targetacquisition.h
@@ -112,7 +112,7 @@ private:
 	AI *_ai;
 
 public:
-	Defender(AI *ai) : _ai(ai) {}
+	Defender(AI *ai);
 	void setSourceX(int sourceX) { _sourceX = sourceX; }
 	void setSourceY(int sourceY) { _sourceY = sourceY; }
 	void setTargetX(int targetX) { _targetX = targetX; }
diff --git a/engines/scumm/he/moonbase/ai_traveller.cpp b/engines/scumm/he/moonbase/ai_traveller.cpp
index b1c9985..d6eea67 100644
--- a/engines/scumm/he/moonbase/ai_traveller.cpp
+++ b/engines/scumm/he/moonbase/ai_traveller.cpp
@@ -46,6 +46,8 @@ Traveller::Traveller(AI *ai) : _ai(ai) {
 	_waterSourceY = 0;
 	_waterDestX = 0;
 	_waterDestY = 0;
+
+	_posX = _posY = 0;
 }
 
 Traveller::Traveller(int originX, int originY, AI *ai) : _ai(ai) {






More information about the Scummvm-git-logs mailing list