[Scummvm-git-logs] scummvm master -> 19dfebf7be12dd577650b3b04592d0f3a7af7975

sev- noreply at scummvm.org
Mon Jan 8 01:56:34 UTC 2024


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:
49b68d6756 ENGINES: Make use of M_PI where possible
19dfebf7be GRAPHICS: Rename variables in PM scaler to avoid clashing with system headers


Commit: 49b68d675635d88db8c1ed90e34376e085acec16
    https://github.com/scummvm/scummvm/commit/49b68d675635d88db8c1ed90e34376e085acec16
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-01-08T02:56:30+01:00

Commit Message:
ENGINES: Make use of M_PI where possible

Changed paths:
    engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
    engines/ags/plugins/ags_pal_render/raycast.cpp
    engines/ags/plugins/ags_snow_rain/weather.cpp
    engines/griffon/dialogs.cpp
    engines/trecision/actor.cpp
    engines/trecision/defines.h
    engines/trecision/pathfinding3d.cpp
    engines/trecision/renderer3d.cpp
    engines/trecision/utils.cpp
    engines/ultima/nuvie/sound/adplug/fm_opl.cpp
    engines/ultima/nuvie/sound/adplug/opl_class.cpp
    engines/ultima/nuvie/sound/decoder/pc_speaker.cpp


diff --git a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
index 14fa164bc62..1fe2ecd2e46 100644
--- a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
+++ b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
@@ -33,16 +33,16 @@ namespace AGSPalRender {
 #define MAX_STARS 1024
 #define MAX_DEPTH 64
 
-#define PI         (3.1415926535f)
-#define HALF_PI    (0.5f * PI)
-#define TWO_PI     (2.0f * PI)
+#define ONE_PI     ((float)M_PI)
+#define HALF_PI    (0.5f * ONE_PI)
+#define TWO_PI     (2.0f * ONE_PI)
 #define TWO_PI_INV (1.0f / TWO_PI)
 
-const float halfpi = (0.5f * PI);
-const float twopi  = (2.0f * PI);
+const float halfpi = (0.5f * ONE_PI);
+const float twopi  = (2.0f * ONE_PI);
 const float twopi_inv = (1.0f / TWO_PI);
-const float pisquared = PI * PI;
-const float picubed = PI * PI * PI;
+const float pisquared = ONE_PI * ONE_PI;
+const float picubed = ONE_PI * ONE_PI * ONE_PI;
 
 IAGSEngine *engine;
 //unsigned char clut[256][256];
@@ -171,7 +171,7 @@ float  q3sqrt(const float x) {
 
 void Make_Sin_Lut() {
 	for (int angle = 0; angle < 360; angle++) {
-		double rad = (angle * PI) / 180.0;
+		double rad = (angle * ONE_PI) / 180.0;
 		rot_sine_LUT [angle] = static_cast<float>(sin(rad));
 		rot_cos_LUT [angle]  = static_cast<float>(cos(rad));
 	}
@@ -206,7 +206,7 @@ unsigned short root(unsigned short x) {
 
 float Hill(float x) {
 	const float a0 = 1.0f;
-	const float a2 = 2.0f / PI - 12.0f / (pisquared);
+	const float a2 = 2.0f / ONE_PI - 12.0f / (pisquared);
 	const float a3 = 16.0f / (picubed) - 4.0f / (pisquared);
 	const float xx = x * x;
 	const float xxx = xx * x;
@@ -224,7 +224,7 @@ float FastSin(float x) {
 	// 4 pieces of hills
 	if (x < halfpi)
 		return Hill(halfpi - x);
-	else if (x < PI)
+	else if (x < ONE_PI)
 		return Hill(x - halfpi);
 	else if (x < 3.0f * halfpi)
 		return -Hill(3.0f * halfpi - x);
diff --git a/engines/ags/plugins/ags_pal_render/raycast.cpp b/engines/ags/plugins/ags_pal_render/raycast.cpp
index 0653f3a67e8..bd8626146f7 100644
--- a/engines/ags/plugins/ags_pal_render/raycast.cpp
+++ b/engines/ags/plugins/ags_pal_render/raycast.cpp
@@ -27,7 +27,6 @@ namespace AGS3 {
 namespace Plugins {
 namespace AGSPalRender {
 
-#define PI         (3.1415926535f)
 #define S_WIDTH 320
 #define S_HEIGHT 160
 
@@ -333,7 +332,7 @@ void AGSPalRender::Ray_GetPlayerY(ScriptMethodParams &params) {
 
 void AGSPalRender::Ray_GetPlayerAngle(ScriptMethodParams &params) {
 	double bgrad = atan2(dirY, dirX);
-	int bgdeg = (int)(bgrad / PI * 180.0) + 180;
+	int bgdeg = (int)(bgrad / M_PI * 180.0) + 180;
 	params._result = bgdeg % 360;
 }
 
@@ -747,7 +746,7 @@ void AGSPalRender::Raycast_Render(ScriptMethodParams &params) {
 	PARAMS1(int, slot);
 	ambientweight = 0;
 	raycastOn = true;
-	double playerrad = atan2(dirY, dirX) + (2.0 * PI);
+	double playerrad = atan2(dirY, dirX) + (2.0 * M_PI);
 	rendering = true;
 	int32 w = S_WIDTH, h = S_HEIGHT;
 	BITMAP *screen = engine->GetSpriteGraphic(slot);
@@ -756,7 +755,7 @@ void AGSPalRender::Raycast_Render(ScriptMethodParams &params) {
 	BITMAP *sbBm = engine->GetSpriteGraphic(skybox);
 	if (!sbBm) engine->AbortGame("Raycast_Render: No valid skybox sprite.");
 	if (skybox > 0) {
-		//int bgdeg = (int)((playerrad / PI) * 180.0) + 180;
+		//int bgdeg = (int)((playerrad / M_PI) * 180.0) + 180;
 		int xoffset = (int)(playerrad * 320.0);
 		BITMAP *virtsc = engine->GetVirtualScreen();
 		engine->SetVirtualScreen(screen);
diff --git a/engines/ags/plugins/ags_snow_rain/weather.cpp b/engines/ags/plugins/ags_snow_rain/weather.cpp
index 149806ad827..3d76ae6d6a9 100644
--- a/engines/ags/plugins/ags_snow_rain/weather.cpp
+++ b/engines/ags/plugins/ags_snow_rain/weather.cpp
@@ -33,7 +33,6 @@ namespace AGSSnowRain {
 const unsigned int Magic = 0xCAFE0000;
 const unsigned int Version = 2;
 const unsigned int SaveMagic = Magic + Version;
-const float PI = 3.14159265f;
 
 
 void View::syncGame(Serializer &s) {
@@ -99,7 +98,7 @@ void Weather::UpdateWithDrift() {
 	for (i = 0; i < _mAmount * 2; i++) {
 		_mParticles[i].y += _mParticles[i].speed;
 		drift = _mParticles[i].drift * sin((float)(_mParticles[i].y +
-		                                   _mParticles[i].drift_offset) * _mParticles[i].drift_speed * 2.0f * PI / 360.0f);
+		                                   _mParticles[i].drift_offset) * _mParticles[i].drift_speed * 2.0f * M_PI / 360.0f);
 
 		if (signum(_mWindSpeed) == signum(drift))
 			_mParticles[i].x += _mWindSpeed;
diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp
index f18d06c6147..255b6ba050b 100644
--- a/engines/griffon/dialogs.cpp
+++ b/engines/griffon/dialogs.cpp
@@ -45,7 +45,6 @@ namespace Griffon {
 #define MINCURSEL 7
 #define MAXCURSEL 16
 #define SY 25
-#define PI 3.141593
 
 void GriffonEngine::title(int mode) {
 	const char *optionTitles[4] = {
@@ -128,7 +127,7 @@ void GriffonEngine::title(int mode) {
 		else
 			drawString(_videoBuffer, "(c) 2005 by Daniel 'Syn9' Kennedy", 28, 224, 4);
 
-		rc.left = (int16)(x - 16 - 4 * cos(2 * PI * _itemyloc / 16));
+		rc.left = (int16)(x - 16 - 4 * cos(2 * M_PI * _itemyloc / 16));
 		rc.top = (int16)(y - 4 + 16 * cursel);
 
 		_itemImg[15]->blendBlitTo(*_videoBuffer, rc.left, rc.top);
@@ -311,8 +310,8 @@ void GriffonEngine::configMenu() {
 		_videoBuffer->fillRect(Common::Rect(0, 0, _videoBuffer->w, _videoBuffer->h), 0);
 		_videoBuffer2->fillRect(Common::Rect(0, 0, _videoBuffer2->w, _videoBuffer2->h), 0);
 
-		rcDest.left = 256 + 256 * cos(PI / 180 * _cloudAngle * 40);
-		rcDest.top = 192 + 192 * sin(PI / 180 * _cloudAngle * 40);
+		rcDest.left = 256 + 256 * cos(M_PI / 180 * _cloudAngle * 40);
+		rcDest.top = 192 + 192 * sin(M_PI / 180 * _cloudAngle * 40);
 		rcDest.setWidth(320);
 		rcDest.setHeight(240);
 
@@ -374,7 +373,7 @@ void GriffonEngine::configMenu() {
 			curselt += 1;
 
 		Common::Rect rc;
-		rc.left = 148 + 3 * cos(2 * PI * _itemyloc / 16.0);
+		rc.left = 148 + 3 * cos(2 * M_PI * _itemyloc / 16.0);
 		rc.top = sy + 8 * curselt - 4;
 
 		_itemImg[15]->blendBlitTo(*_videoBuffer, rc.left, rc.top);
@@ -656,8 +655,8 @@ void GriffonEngine::saveLoadNew() {
 	do {
 		_videoBuffer->fillRect(Common::Rect(0, 0, _videoBuffer->w, _videoBuffer->h), 0);
 
-		rcDest.left = 256 + 256 * cos(PI / 180 * _cloudAngle * 40);
-		rcDest.top = 192 + 192 * sin(PI / 180 * _cloudAngle * 40);
+		rcDest.left = 256 + 256 * cos(M_PI / 180 * _cloudAngle * 40);
+		rcDest.top = 192 + 192 * sin(M_PI / 180 * _cloudAngle * 40);
 		rcDest.setWidth(320);
 		rcDest.setHeight(240);
 
@@ -812,11 +811,11 @@ void GriffonEngine::saveLoadNew() {
 					break;
 			}
 
-			rcDest.left += (int16)(2 + 2 * sin(2 * PI * _itemyloc / 16));
+			rcDest.left += (int16)(2 + 2 * sin(2 * M_PI * _itemyloc / 16));
 		}
 
 		if (curRow > 0) {
-			rcDest.left = (int16)(0 + 2 * sin(2 * PI * _itemyloc / 16));
+			rcDest.left = (int16)(0 + 2 * sin(2 * M_PI * _itemyloc / 16));
 			rcDest.top = (int16)(53 + (curRow - 1) * 48);
 		}
 
diff --git a/engines/trecision/actor.cpp b/engines/trecision/actor.cpp
index 4d09f7c70a8..d0b73f65bb2 100644
--- a/engines/trecision/actor.cpp
+++ b/engines/trecision/actor.cpp
@@ -372,7 +372,7 @@ void Actor::actorDoAction(int action) {
 
 	_vm->_pathFind->reset(0, px, pz, theta);
 
-	float t = ((270.0f - theta) * PI2) / 360.0f;
+	float t = ((270.0f - theta) * M_PI * 2) / 360.0f;
 	float ox = cos(t);
 	float oz = sin(t);
 
diff --git a/engines/trecision/defines.h b/engines/trecision/defines.h
index ff7ed8758cf..a641fff1148 100644
--- a/engines/trecision/defines.h
+++ b/engines/trecision/defines.h
@@ -2401,8 +2401,6 @@ Management of "Use with"
 #define WITH 1
 
 
-#define PI 3.1415927f
-#define PI2 6.2831853f
 #define EPSILON 0.007f
 #define MAXSTEP 1000
 #define MAXPATHNODES 50
diff --git a/engines/trecision/pathfinding3d.cpp b/engines/trecision/pathfinding3d.cpp
index 4f291183b2c..3fcef96f6be 100644
--- a/engines/trecision/pathfinding3d.cpp
+++ b/engines/trecision/pathfinding3d.cpp
@@ -699,7 +699,7 @@ void PathFinding3D::setPosition(int num) {
 		ox /= t;
 		oz /= t;
 
-		float theta = _vm->sinCosAngle(ox, oz) * 180.0f / PI;
+		float theta = _vm->sinCosAngle(ox, oz) * 180.0f / M_PI;
 		if (_vm->floatComp(theta, 360.0f) >= 0) // theta >= 360.0f
 			theta -= 360.0f;
 		if (_vm->floatComp(theta, 0.0f) == -1) // theta < 0.0f
@@ -764,7 +764,7 @@ void PathFinding3D::lookAt(float x, float z) {
 	ox /= t;
 	oz /= t;
 
-	float theta = _vm->sinCosAngle(ox, oz) * 180.0f / PI;
+	float theta = _vm->sinCosAngle(ox, oz) * 180.0f / M_PI;
 	if (_vm->floatComp(theta, 360.0f) >= 0) //theta >= 360.0f
 		theta -= 360.0f;
 	if (_vm->floatComp(theta, 0.0f) == -1) // theta < 0.0f
@@ -1004,7 +1004,7 @@ void PathFinding3D::buildFramelist() {
 		ox /= approx;
 		oz /= approx;
 
-		theta = _vm->sinCosAngle(ox, oz) * 180.0f / PI + 180.0f;
+		theta = _vm->sinCosAngle(ox, oz) * 180.0f / M_PI + 180.0f;
 		if (_vm->floatComp(theta, 360.0f) >= 0)
 			theta -= 360.0f;
 		if (_vm->floatComp(theta, 0.0f) == -1)
@@ -1055,7 +1055,7 @@ void PathFinding3D::buildFramelist() {
 
 			curLen = sqrt(_step[index]._dx * _step[index]._dx + _step[index]._dz * _step[index]._dz);
 
-			theta = ((270.0f - theta) * PI) / 180.0f;
+			theta = ((270.0f - theta) * M_PI) / 180.0f;
 			ox = cos(theta) * curLen;
 			oz = sin(theta) * curLen;
 
@@ -1094,7 +1094,7 @@ void PathFinding3D::buildFramelist() {
 
 			curLen = sqrt(_step[index - 1]._dx * _step[index - 1]._dx + _step[index - 1]._dz * _step[index - 1]._dz);
 
-			oldTheta = ((270.0f - oldTheta) * PI) / 180.0f;
+			oldTheta = ((270.0f - oldTheta) * M_PI) / 180.0f;
 			ox = cos(oldTheta) * curLen;
 			oz = sin(oldTheta) * curLen;
 
@@ -1116,7 +1116,7 @@ void PathFinding3D::buildFramelist() {
 
 			curLen = sqrt(_step[index]._dx * _step[index]._dx + _step[index]._dz * _step[index]._dz);
 
-			theta = ((270.0f - theta) * PI) / 180.0f;
+			theta = ((270.0f - theta) * M_PI) / 180.0f;
 			ox = cos(theta) * curLen;
 			oz = sin(theta) * curLen;
 
diff --git a/engines/trecision/renderer3d.cpp b/engines/trecision/renderer3d.cpp
index 892b13a65ec..5bd95dd5249 100644
--- a/engines/trecision/renderer3d.cpp
+++ b/engines/trecision/renderer3d.cpp
@@ -502,7 +502,7 @@ void Renderer3D::calcCharacterPoints() {
 	actor->_area[4] = 32000;
 	actor->_area[5] = -32000;
 
-	float t = (actor->_theta * PI2) / 360.0;
+	float t = (actor->_theta * M_PI * 2) / 360.0;
 	float cost = cos(t);
 	float sint = sin(t);
 
@@ -561,7 +561,7 @@ void Renderer3D::calcCharacterPoints() {
 				pa1 /= t;
 				pa2 /= t;
 
-				tz = acos((pa0 * l0) + (pa1 * l1) + (pa2 * l2)) * 360.0 / PI2;
+				tz = acos((pa0 * l0) + (pa1 * l1) + (pa2 * l2)) * 360.0 / (M_PI * 2);
 				tz = CLIP(tz, 0.f, 180.f);
 
 				// tx falloff
@@ -613,7 +613,7 @@ void Renderer3D::calcCharacterPoints() {
 				pa1 = curVertex->_ny;
 				pa2 = curVertex->_nz;
 
-				lint = (int)((acos(pa0 * l0 + pa1 * l1 + pa2 * l2) * 360.0) / PI);
+				lint = (int)((acos(pa0 * l0 + pa1 * l1 + pa2 * l2) * 360.0) / M_PI);
 				lint = CLIP(lint, 0, 180);
 
 				_vVertex[j]._angle -= (180 - lint);
diff --git a/engines/trecision/utils.cpp b/engines/trecision/utils.cpp
index 9ad268f27f2..aeef29e2ef0 100644
--- a/engines/trecision/utils.cpp
+++ b/engines/trecision/utils.cpp
@@ -184,7 +184,7 @@ float TrecisionEngine::sinCosAngle(float sinus, float cosinus) {
 		return (float)acos(cosinus);
 
 	// 3 quad
-	return PI2 - (float)acos(cosinus);
+	return (M_PI * 2) - (float)acos(cosinus);
 }
 
 void TrecisionEngine::processTime() {
diff --git a/engines/ultima/nuvie/sound/adplug/fm_opl.cpp b/engines/ultima/nuvie/sound/adplug/fm_opl.cpp
index 25aa78f40c9..b8baf88e63f 100644
--- a/engines/ultima/nuvie/sound/adplug/fm_opl.cpp
+++ b/engines/ultima/nuvie/sound/adplug/fm_opl.cpp
@@ -25,10 +25,6 @@
 namespace Ultima {
 namespace Nuvie {
 
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
 #ifdef _MSC_VER
 #  define INLINE __inline
 #elif defined(__GNUC__)
@@ -1127,7 +1123,7 @@ static int init_tables(void)
 	for (i=0; i<SIN_LEN; i++)
 	{
 		/* non-standard sinus */
-		m = sin( ((i*2)+1) * PI / SIN_LEN ); /* checked against the real chip */
+		m = sin( ((i*2)+1) * M_PI / SIN_LEN ); /* checked against the real chip */
 
 		/* we never reach zero here due to ((i*2)+1) */
 
diff --git a/engines/ultima/nuvie/sound/adplug/opl_class.cpp b/engines/ultima/nuvie/sound/adplug/opl_class.cpp
index 31783249cc9..e2551de9509 100644
--- a/engines/ultima/nuvie/sound/adplug/opl_class.cpp
+++ b/engines/ultima/nuvie/sound/adplug/opl_class.cpp
@@ -25,10 +25,6 @@
 namespace Ultima {
 namespace Nuvie {
 
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
 #ifdef _MSC_VER
 #  define INLINE __inline
 #elif defined(__GNUC__)
@@ -936,7 +932,7 @@ int OplClass::init_tables(void) {
 
 	for (i = 0; i < SIN_LEN; i++) {
 		/* non-standard sinus */
-		m = sin(((i * 2) + 1) * PI / SIN_LEN); /* checked against the real chip */
+		m = sin(((i * 2) + 1) * M_PI / SIN_LEN); /* checked against the real chip */
 
 		/* we never reach zero here due to ((i*2)+1) */
 
diff --git a/engines/ultima/nuvie/sound/decoder/pc_speaker.cpp b/engines/ultima/nuvie/sound/decoder/pc_speaker.cpp
index be7ff0271f4..11d611b8678 100644
--- a/engines/ultima/nuvie/sound/decoder/pc_speaker.cpp
+++ b/engines/ultima/nuvie/sound/decoder/pc_speaker.cpp
@@ -28,11 +28,6 @@
 namespace Ultima {
 namespace Nuvie {
 
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
-
 #define SPKR_VOLUME 5000
 //#define SPKR_SHIFT 8
 #define SPKR_SPEED (float)((SPKR_VOLUME*2)/0.070f)


Commit: 19dfebf7be12dd577650b3b04592d0f3a7af7975
    https://github.com/scummvm/scummvm/commit/19dfebf7be12dd577650b3b04592d0f3a7af7975
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-01-08T02:56:30+01:00

Commit Message:
GRAPHICS: Rename variables in PM scaler to avoid clashing with system headers

Changed paths:
    graphics/scaler/pm.cpp


diff --git a/graphics/scaler/pm.cpp b/graphics/scaler/pm.cpp
index ead008aee85..0b05982355c 100644
--- a/graphics/scaler/pm.cpp
+++ b/graphics/scaler/pm.cpp
@@ -54,70 +54,70 @@ void scaleIntern(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dst
 
 		while (x--) {
 			//
-			// PA PB PC
-			// PD PE PF
-			// PG PH PI
+			// pA pB pC
+			// pD pE pF
+			// pG pH pI
 			//
-			Pixel PB = startAddr1[0];
-			Pixel PE = startAddr2[0];
-			Pixel PH = startAddr3[0];
+			Pixel pB = startAddr1[0];
+			Pixel pE = startAddr2[0];
+			Pixel pH = startAddr3[0];
 
-			Pixel PA = startAddr1[-1];
-			Pixel PD = startAddr2[-1];
-			Pixel PG = startAddr3[-1];
+			Pixel pA = startAddr1[-1];
+			Pixel pD = startAddr2[-1];
+			Pixel pG = startAddr3[-1];
 
-			Pixel PC = startAddr1[1];
-			Pixel PF = startAddr2[1];
-			Pixel PI = startAddr3[1];
+			Pixel pC = startAddr1[1];
+			Pixel pF = startAddr2[1];
+			Pixel pI = startAddr3[1];
 
 			bool doNotReblit = false;
-			E[0] = E[1] = E[2] = E[3] = PE;
+			E[0] = E[1] = E[2] = E[3] = pE;
 
 			if (!doNotReblit) {
-				if (PD != PF) {
-					if ((PE != PD) && (PD == PH) && (PD == PI) && (PE != PG)
-						&& ((PD != PG) || (PE != PF) || (PA != PD))
-						&& (!((PD == PA) && (PD == PG) && (PE == PB) && (PE == PF)))) {
-						E[2] = PH;
-						E[3] = interpolate_1_1(E[3], PH);
+				if (pD != pF) {
+					if ((pE != pD) && (pD == pH) && (pD == pI) && (pE != pG)
+						&& ((pD != pG) || (pE != pF) || (pA != pD))
+						&& (!((pD == pA) && (pD == pG) && (pE == pB) && (pE == pF)))) {
+						E[2] = pH;
+						E[3] = interpolate_1_1(E[3], pH);
 						doNotReblit = true;
-					} else if ((PE != PF) && (PF == PH) && (PF == PG) && (PE != PI)
-						&& ((PF != PI) || (PE != PD) || (PC != PF))
-						&& (!((PF == PC) && (PF == PI) && (PE == PB) && (PE == PD)))) {
-						E[2] = interpolate_1_1(E[2], PH);
-						E[3] = PH;
+					} else if ((pE != pF) && (pF == pH) && (pF == pG) && (pE != pI)
+						&& ((pF != pI) || (pE != pD) || (pC != pF))
+						&& (!((pF == pC) && (pF == pI) && (pE == pB) && (pE == pD)))) {
+						E[2] = interpolate_1_1(E[2], pH);
+						E[3] = pH;
 						doNotReblit = true;
 					}
 				}
 
-				if (PB != PH) {
-					if (PE != PB) {
-						if ((PA != PB) || (PB != PC) || (PE != PH)) {
-							if ((PB == PD) && (PB == PG) && (PE != PA)
-								&& (!((PD == PA) && (PD == PC) && (PE == PH) && (PE == PF)))) {
-								E[0] = interpolate_3_1( PB,E[0]);
-								E[2] = interpolate_3_1(E[2], PB);
+				if (pB != pH) {
+					if (pE != pB) {
+						if ((pA != pB) || (pB != pC) || (pE != pH)) {
+							if ((pB == pD) && (pB == pG) && (pE != pA)
+								&& (!((pD == pA) && (pD == pC) && (pE == pH) && (pE == pF)))) {
+								E[0] = interpolate_3_1( pB,E[0]);
+								E[2] = interpolate_3_1(E[2], pB);
 								doNotReblit = true;
-							} else if ((PB == PF) && (PB == PI) && (PE != PC)
-								&& (!((PF == PC) && (PF == PA) && (PE == PH) && (PE == PD)))) {
-								E[1] = interpolate_3_1(PB, E[1]);
-								E[3] = interpolate_3_1(E[3], PB);
+							} else if ((pB == pF) && (pB == pI) && (pE != pC)
+								&& (!((pF == pC) && (pF == pA) && (pE == pH) && (pE == pD)))) {
+								E[1] = interpolate_3_1(pB, E[1]);
+								E[3] = interpolate_3_1(E[3], pB);
 								doNotReblit = true;
 							}
 						}
 					}
 
-					if (PE != PH) {
-						if ((PG != PH) || (PE != PB) || (PH != PI)) {
-							if ((PH == PD) && (PH == PA) && (PE != PG)
-								&& (!((PD == PG) && (PD == PI) && (PE == PB) && (PE == PF)))) {
-								E[2] = interpolate_3_1( PH,E[2]);
-								E[0] = interpolate_3_1(E[0], PH);
+					if (pE != pH) {
+						if ((pG != pH) || (pE != pB) || (pH != pI)) {
+							if ((pH == pD) && (pH == pA) && (pE != pG)
+								&& (!((pD == pG) && (pD == pI) && (pE == pB) && (pE == pF)))) {
+								E[2] = interpolate_3_1( pH,E[2]);
+								E[0] = interpolate_3_1(E[0], pH);
 								doNotReblit = true;
-							} else if ((PH == PF) && (PH == PC) && (PE != PI)
-								&& (!((PF == PI) && (PF == PG) && (PE == PB) && (PE == PD)))) {
-								E[3] = interpolate_3_1( PH,E[3]);
-								E[1] = interpolate_3_1(E[1], PH);
+							} else if ((pH == pF) && (pH == pC) && (pE != pI)
+								&& (!((pF == pI) && (pF == pG) && (pE == pB) && (pE == pD)))) {
+								E[3] = interpolate_3_1( pH,E[3]);
+								E[1] = interpolate_3_1(E[1], pH);
 								doNotReblit = true;
 							}
 						}
@@ -126,40 +126,40 @@ void scaleIntern(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dst
 			}
 
 			if (!doNotReblit) {
-				if ((PB != PH) && (PD != PF)) {
-
-					if ((PB == PD) && (PE != PD)
-						&& (!((PE == PA) && (PB == PC) && (PE == PF))) // Block
-						&& (!((PB == PA) && (PB == PG)))
-						&& (!((PD == PA) && (PD == PC) && (PE == PF) && (PG != PD) && (PG != PE))))
-						E[0] = interpolate_1_1(E[0], PB);
-
-					if ((PB == PF) && (PE != PF)
-						&& (!((PE == PC) && (PB == PA) && (PE == PD))) // Block
-						&& (!((PB == PC) && (PB == PI)))
-						&& (!((PF == PA) && (PF == PC) && (PE == PD) && (PI != PF) && (PI != PE))))
-						E[1] = interpolate_1_1(E[1], PB);
-
-					if ((PH == PD) && ((PE != PG) || (PE != PD))
-						&& (!((PE == PG) && (PH == PI) && (PE == PF))) // Block
-						&& (!((PH == PG) && (PH == PA)))
-						&& (!((PD == PG) && (PD == PI) && (PE == PF) && (PA != PD) && (PA != PE))))
-						E[2] = interpolate_1_1(E[2], PH);
-
-					if ((PH == PF) && ((PE != PI) || (PE != PF))
-						&& (!((PE == PI) && (PH == PG) && (PE == PD))) // Block
-						&& (!((PH == PI) && (PH == PC)))
-						&& (!((PF == PG) && (PF == PI) && (PE == PD) && (PC != PF) && (PI != PE))))
-						E[3] = interpolate_1_1(E[3], PH);
-
-				} else if ((PD == PB) && (PD == PF) && (PD == PH) && (PD != PE)) {
-					if ((PD == PG) || (PD == PC)) {
-						E[1] = interpolate_1_1(E[1], PD);
+				if ((pB != pH) && (pD != pF)) {
+
+					if ((pB == pD) && (pE != pD)
+						&& (!((pE == pA) && (pB == pC) && (pE == pF))) // Block
+						&& (!((pB == pA) && (pB == pG)))
+						&& (!((pD == pA) && (pD == pC) && (pE == pF) && (pG != pD) && (pG != pE))))
+						E[0] = interpolate_1_1(E[0], pB);
+
+					if ((pB == pF) && (pE != pF)
+						&& (!((pE == pC) && (pB == pA) && (pE == pD))) // Block
+						&& (!((pB == pC) && (pB == pI)))
+						&& (!((pF == pA) && (pF == pC) && (pE == pD) && (pI != pF) && (pI != pE))))
+						E[1] = interpolate_1_1(E[1], pB);
+
+					if ((pH == pD) && ((pE != pG) || (pE != pD))
+						&& (!((pE == pG) && (pH == pI) && (pE == pF))) // Block
+						&& (!((pH == pG) && (pH == pA)))
+						&& (!((pD == pG) && (pD == pI) && (pE == pF) && (pA != pD) && (pA != pE))))
+						E[2] = interpolate_1_1(E[2], pH);
+
+					if ((pH == pF) && ((pE != pI) || (pE != pF))
+						&& (!((pE == pI) && (pH == pG) && (pE == pD))) // Block
+						&& (!((pH == pI) && (pH == pC)))
+						&& (!((pF == pG) && (pF == pI) && (pE == pD) && (pC != pF) && (pI != pE))))
+						E[3] = interpolate_1_1(E[3], pH);
+
+				} else if ((pD == pB) && (pD == pF) && (pD == pH) && (pD != pE)) {
+					if ((pD == pG) || (pD == pC)) {
+						E[1] = interpolate_1_1(E[1], pD);
 						E[2] = E[1];
 					}
 
-					if ((PD == PA) || (PD == PI)) {
-						E[0] = interpolate_1_1(E[0], PD);
+					if ((pD == pA) || (pD == pI)) {
+						E[0] = interpolate_1_1(E[0], pD);
 						E[3] = E[0];
 					}
 				}




More information about the Scummvm-git-logs mailing list