[Scummvm-git-logs] scummvm master -> de210616cd63e1607230abb95b4b7a816fdaa1da

dreammaster paulfgilbert at gmail.com
Sun Mar 8 16:56:58 UTC 2020


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:
de210616cd ULTIMA8: Break if statements to new lines in CurrentMap


Commit: de210616cd63e1607230abb95b4b7a816fdaa1da
    https://github.com/scummvm/scummvm/commit/de210616cd63e1607230abb95b4b7a816fdaa1da
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-03-08T09:56:54-07:00

Commit Message:
ULTIMA8: Break if statements to new lines in CurrentMap

Changed paths:
    engines/ultima/ultima8/world/current_map.cpp


diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index e5c000c452..4aa7046da2 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -421,7 +421,8 @@ void CurrentMap::updateFastArea(int32 from_x, int32 from_y, int32 from_z, int32
 			bool currently_fast = isChunkFast(cx, cy);
 
 			// Don't do anything, they are the same
-			if (want_fast == currently_fast) continue;
+			if (want_fast == currently_fast)
+				continue;
 
 			// leave _fast area
 			if (!want_fast) unsetChunkFast(cx, cy);
@@ -473,10 +474,14 @@ void CurrentMap::areaSearch(UCList *itemlist, const uint8 *loopscript,
 	maxx = ((x + range) / _mapChunkSize) + 1;
 	miny = ((y - yd - range) / _mapChunkSize) - 1;
 	maxy = ((y + range) / _mapChunkSize) + 1;
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	for (int cx = minx; cx <= maxx; cx++) {
 		for (int cy = miny; cy <= maxy; cy++) {
@@ -486,7 +491,8 @@ void CurrentMap::areaSearch(UCList *itemlist, const uint8 *loopscript,
 
 				const Item *item = *iter;
 
-				if (item->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (item->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				// check if item is in range?
 				int32 ix, iy, iz;
@@ -506,7 +512,8 @@ void CurrentMap::areaSearch(UCList *itemlist, const uint8 *loopscript,
 
 				Rect itemrect(ix - ixd, iy - iyd, ixd, iyd);
 
-				if (!itemrect.Overlaps(searchrange)) continue;
+				if (!itemrect.Overlaps(searchrange))
+					continue;
 
 				// check item against loopscript
 				if ((*iter)->checkLoopScript(loopscript, scriptsize)) {
@@ -553,10 +560,14 @@ void CurrentMap::surfaceSearch(UCList *itemlist, const uint8 *loopscript,
 	maxx = ((origin[0]) / _mapChunkSize) + 1;
 	miny = ((origin[1] - dims[1]) / _mapChunkSize) - 1;
 	maxy = ((origin[1]) / _mapChunkSize) + 1;
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	for (int32 cx = minx; cx <= maxx; cx++) {
 		for (int32 cy = miny; cy <= maxy; cy++) {
@@ -566,8 +577,10 @@ void CurrentMap::surfaceSearch(UCList *itemlist, const uint8 *loopscript,
 
 				Item *item = *iter;
 
-				if (item->getObjId() == check) continue;
-				if (item->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (item->getObjId() == check)
+					continue;
+				if (item->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				// check if item is in range?
 				int32 ix, iy, iz;
@@ -577,7 +590,8 @@ void CurrentMap::surfaceSearch(UCList *itemlist, const uint8 *loopscript,
 
 				Rect itemrect(ix - ixd, iy - iyd, ixd, iyd);
 
-				if (!itemrect.Overlaps(searchrange)) continue;
+				if (!itemrect.Overlaps(searchrange))
+					continue;
 
 				bool ok = false;
 
@@ -595,7 +609,8 @@ void CurrentMap::surfaceSearch(UCList *itemlist, const uint8 *loopscript,
 						surfaceSearch(itemlist, loopscript, scriptsize, item, false, true, true);
 				}
 
-				if (!ok) continue;
+				if (!ok)
+					continue;
 
 				// check item against loopscript
 				if ((*iter)->checkLoopScript(loopscript, scriptsize)) {
@@ -678,19 +693,25 @@ bool CurrentMap::isValidPosition(int32 x, int32 y, int32 z,
 	maxx = (x / _mapChunkSize) + 1;
 	miny = ((y - yd) / _mapChunkSize) - 1;
 	maxy = (y / _mapChunkSize) + 1;
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	for (int cx = minx; cx <= maxx; cx++) {
 		for (int cy = miny; cy <= maxy; cy++) {
 			item_list::const_iterator iter;
 			for (iter = _items[cx][cy].begin();
-			        iter != _items[cx][cy].end(); ++iter) {
+				 iter != _items[cx][cy].end(); ++iter) {
 				const Item *item = *iter;
-				if (item->getObjId() == item_) continue;
-				if (item->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (item->getObjId() == item_)
+					continue;
+				if (item->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				ShapeInfo *si = item->getShapeInfo();
 				//!! need to check is_sea() and is_land() maybe?
@@ -796,10 +817,14 @@ bool CurrentMap::scanForValidPosition(int32 x, int32 y, int32 z, Item *item,
 	maxx = (x / _mapChunkSize) + 1;
 	miny = ((y - yd) / _mapChunkSize) - 1;
 	maxy = (y / _mapChunkSize) + 1;
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	for (int cx = minx; cx <= maxx; cx++) {
 		for (int cy = miny; cy <= maxy; cy++) {
@@ -807,8 +832,10 @@ bool CurrentMap::scanForValidPosition(int32 x, int32 y, int32 z, Item *item,
 			for (iter = _items[cx][cy].begin();
 			        iter != _items[cx][cy].end(); ++iter) {
 				Item *citem = *iter;
-				if (citem->getObjId() == item->getObjId()) continue;
-				if (citem->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (citem->getObjId() == item->getObjId())
+					continue;
+				if (citem->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				ShapeInfo *si = citem->getShapeInfo();
 				//!! need to check is_sea() and is_land() maybe?
@@ -832,8 +859,10 @@ bool CurrentMap::scanForValidPosition(int32 x, int32 y, int32 z, Item *item,
 
 				int minh = -100;
 				int maxh = 100;
-				if (!xdir && (sminx > 0 || smaxx < 0)) continue;
-				if (!ydir && (sminy > 0 || smaxy < 0)) continue;
+				if (!xdir && (sminx > 0 || smaxx < 0))
+					continue;
+				if (!ydir && (sminy > 0 || smaxy < 0))
+					continue;
 
 				if (xdir && minh < sminx)
 					minh = sminx;
@@ -943,16 +972,24 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
 		dmaxx = (end[0] / _mapChunkSize) + 1;
 		dminy = ((end[1] - dims[1]) / _mapChunkSize) - 1;
 		dmaxy = (end[1] / _mapChunkSize) + 1;
-		if (dminx < minx) minx = dminx;
-		if (dmaxx > maxx) maxx = dmaxx;
-		if (dminy < miny) miny = dminy;
-		if (dmaxy > maxy) maxy = dmaxy;
+		if (dminx < minx)
+			minx = dminx;
+		if (dmaxx > maxx)
+			maxx = dmaxx;
+		if (dminy < miny)
+			miny = dminy;
+		if (dmaxy > maxy)
+			maxy = dmaxy;
 	}
 
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	// Get velocity of item
 	int32 vel[3];
@@ -982,8 +1019,10 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
 			for (iter = _items[cx][cy].begin();
 			        iter != _items[cx][cy].end(); ++iter) {
 				Item *other_item = *iter;
-				if (other_item->getObjId() == item) continue;
-				if (other_item->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (other_item->getObjId() == item)
+					continue;
+				if (other_item->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				uint32 othershapeflags = other_item->getShapeInfo()->_flags;
 				bool blocking = (othershapeflags & shapeflags &
@@ -1053,23 +1092,28 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
 						        (i == 2 && ext[i] == 0 && oext[i] == 0 &&
 						         oext[0] == 64 && oext[1] == 64))
 							touch = true; // touch at start
-						if (A_min + vel[i] == B_max) touch = true; // touch at end
+						if (A_min + vel[i] == B_max)
+							touch = true; // touch at end
 
 						// - want to know when rear of A passes front of B
 						u_0[i] = ((B_max - A_min) * 0x4000) / vel[i];
 						// - want to know when front of A passes rear of B
 						u_1[i] = ((B_min - A_max) * 0x4000) / vel[i];
 					} else if (vel[i] > 0 && A_min <= B_max) { // A_min<=B_max not required
-						if (A_min == B_max) touch = true; // touch at start
-						if (A_max + vel[i] == B_min) touch = true; // touch at end
+						if (A_min == B_max)
+							touch = true; // touch at start
+						if (A_max + vel[i] == B_min)
+							touch = true; // touch at end
 
 						// + want to know when front of A passes rear of B
 						u_0[i] = ((B_min - A_max) * 0x4000) / vel[i];
 						// + want to know when rear of A passes front of B
 						u_1[i] = ((B_max - A_min) * 0x4000) / vel[i];
 					} else if (vel[i] == 0 && A_max >= B_min && A_min <= B_max) {
-						if (A_min == B_max || A_max == B_min) touch = true;
-						if (i == 2 && A_min == B_max) touch_floor = true;
+						if (A_min == B_max || A_max == B_min)
+							touch = true;
+						if (i == 2 && A_min == B_max)
+							touch_floor = true;
 
 						u_0[i] = -1;
 						u_1[i] = 0x4000;
@@ -1107,7 +1151,8 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
 				if (first <= last) {
 					//pout << "Hit item " << other_item->getObjId() << " at first: " << first << "  last: " << last << Std::endl;
 
-					if (!hit) return true;
+					if (!hit)
+						return true;
 
 					// Clamp
 					if (first < -1) first = -1;
@@ -1124,7 +1169,8 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
 						sw_it = hit->begin();
 
 					for (; sw_it != hit->end(); ++sw_it)
-						if ((*sw_it)._hitTime > first) break;
+						if ((*sw_it)._hitTime > first)
+							break;
 
 					// Now add it
 					sw_it = hit->insert(sw_it, SweepItem(other_item->getObjId(), first, last, touch, touch_floor, blocking, dirs));
@@ -1156,10 +1202,14 @@ Item *CurrentMap::traceTopItem(int32 x, int32 y, int32 ztop, int32 zbot, ObjId i
 	maxx = (x / _mapChunkSize) + 1;
 	miny = (y / _mapChunkSize);
 	maxy = (y / _mapChunkSize) + 1;
-	if (minx < 0) minx = 0;
-	if (maxx >= MAP_NUM_CHUNKS) maxx = MAP_NUM_CHUNKS - 1;
-	if (miny < 0) miny = 0;
-	if (maxy >= MAP_NUM_CHUNKS) maxy = MAP_NUM_CHUNKS - 1;
+	if (minx < 0)
+		minx = 0;
+	if (maxx >= MAP_NUM_CHUNKS)
+		maxx = MAP_NUM_CHUNKS - 1;
+	if (miny < 0)
+		miny = 0;
+	if (maxy >= MAP_NUM_CHUNKS)
+		maxy = MAP_NUM_CHUNKS - 1;
 
 	for (int cx = minx; cx <= maxx; cx++) {
 		for (int cy = miny; cy <= maxy; cy++) {
@@ -1167,8 +1217,10 @@ Item *CurrentMap::traceTopItem(int32 x, int32 y, int32 ztop, int32 zbot, ObjId i
 			for (iter = _items[cx][cy].begin();
 			        iter != _items[cx][cy].end(); ++iter) {
 				Item *item = *iter;
-				if (item->getObjId() == ignore) continue;
-				if (item->getExtFlags() & Item::EXT_SPRITE) continue;
+				if (item->getObjId() == ignore)
+					continue;
+				if (item->getExtFlags() & Item::EXT_SPRITE)
+					continue;
 
 				ShapeInfo *si = item->getShapeInfo();
 				if (!(si->_flags & shflags) || si->is_editor() || si->is_translucent()) continue;
@@ -1177,9 +1229,12 @@ Item *CurrentMap::traceTopItem(int32 x, int32 y, int32 ztop, int32 zbot, ObjId i
 				item->getLocation(ix, iy, iz);
 				item->getFootpadWorld(ixd, iyd, izd);
 
-				if ((ix - ixd) >= x || ix <= x) continue;
-				if ((iy - iyd) >= y || iy <= y) continue;
-				if (iz >= ztop || (iz + izd) <= zbot) continue;
+				if ((ix - ixd) >= x || ix <= x)
+					continue;
+				if ((iy - iyd) >= y || iy <= y)
+					continue;
+				if (iz >= ztop || (iz + izd) <= zbot)
+					continue;
 
 				if (top) {
 					int32 tix, tiy, tiz, tixd, tiyd, tizd;




More information about the Scummvm-git-logs mailing list