diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/motion.cpp | 2 | ||||
-rw-r--r-- | engines/agi/op_cmd.cpp | 2 | ||||
-rw-r--r-- | engines/cruise/actor.cpp | 2 | ||||
-rw-r--r-- | engines/cruise/ctp.cpp | 5 | ||||
-rw-r--r-- | engines/cruise/function.cpp | 5 | ||||
-rw-r--r-- | engines/cruise/perso.cpp | 5 | ||||
-rw-r--r-- | engines/cruise/polys.cpp | 16 | ||||
-rw-r--r-- | engines/parallaction/intro.cpp | 38 |
8 files changed, 39 insertions, 36 deletions
diff --git a/engines/agi/motion.cpp b/engines/agi/motion.cpp index 864953a81f..3c88c01054 100644 --- a/engines/agi/motion.cpp +++ b/engines/agi/motion.cpp @@ -110,7 +110,7 @@ void AgiEngine::motionFollowEgo(VtEntry *v) { while ((v->direction = _rnd->getRandomNumber(8)) == 0) { } - d = (abs(egoY - objY) + abs(egoX - objX)) / 2; + d = (ABS(egoY - objY) + ABS(egoX - objX)) / 2; if (d < v->stepSize) { v->parm3 = v->stepSize; diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index ade933fb2f..56694c70f1 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1014,7 +1014,7 @@ cmd(distance) { y1 = v0->yPos; x2 = v1->xPos + v1->xSize / 2; y2 = v1->yPos; - d = abs(x1 - x2) + abs(y1 - y2); + d = ABS(x1 - x2) + ABS(y1 - y2); if (d > 0xfe) d = 0xfe; } else { diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 29c818d15f..505817282f 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -717,7 +717,7 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX, void set_anim(int ovl, int obj, int start, int x, int y, int mat, int state) { int newf, zoom; - newf = abs(mat) - 1; + newf = ABS(mat) - 1; zoom = computeZoom(y); if (mat < 0) diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp index f916a3f8a2..a3acbef944 100644 --- a/engines/cruise/ctp.cpp +++ b/engines/cruise/ctp.cpp @@ -23,6 +23,7 @@ */ #include "cruise/cruise_main.h" +#include "common/util.h" namespace Cruise { @@ -44,8 +45,8 @@ int ctpVarUnk; uint8 walkboxTable[0x12]; int ctpProc2(int varX, int varY, int paramX, int paramY) { - int diffX = abs(paramX - varX); - int diffY = abs(paramY - varY); + int diffX = ABS(paramX - varX); + int diffY = ABS(paramY - varY); if (diffX > diffY) { diffY = diffX; diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index f07c8b5a92..1acf330638 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -24,6 +24,7 @@ #include "cruise/cruise_main.h" #include "cruise/cell.h" +#include "common/util.h" namespace Cruise { @@ -857,7 +858,7 @@ int16 Op_InitializeStateB(void) { int sign; if (di) { - sign = di / (abs(di)); + sign = di / (ABS(di)); } else { sign = 0; } @@ -1180,7 +1181,7 @@ int16 Op_AddAnimation(void) { si->stepX = stepX; si->stepY = stepY; - int newFrame = abs(actorTable1[direction].data[0]) - 1; + int newFrame = ABS(actorTable1[direction].data[0]) - 1; int zoom = computeZoom(params.Y); diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp index b1b5ab4068..60867a6dec 100644 --- a/engines/cruise/perso.cpp +++ b/engines/cruise/perso.cpp @@ -23,6 +23,7 @@ */ #include "cruise/cruise_main.h" +#include "common/util.h" namespace Cruise { @@ -62,9 +63,9 @@ int direction(int x1, int y1, int x2, int y2, int inc_jo1, int inc_jo2) { int h, v, h1, v1; h1 = x1 - x2; - h = abs(h1); + h = ABS(h1); v1 = y1 - y2; - v = abs(v1); + v = ABS(v1); if (v > h) { if (h > 30) diff --git a/engines/cruise/polys.cpp b/engines/cruise/polys.cpp index 98d64cdeba..f3860e6b90 100644 --- a/engines/cruise/polys.cpp +++ b/engines/cruise/polys.cpp @@ -50,8 +50,8 @@ void vline(int x, int y1, int y2, char c) { void bsubline_1(int x1, int y1, int x2, int y2, char c) { int x, y, ddx, ddy, e; - ddx = abs(x2 - x1); - ddy = abs(y2 - y1) << 1; + ddx = ABS(x2 - x1); + ddy = ABS(y2 - y1) << 1; e = ddx - ddy; ddx <<= 1; @@ -76,8 +76,8 @@ void bsubline_1(int x1, int y1, int x2, int y2, char c) { void bsubline_2(int x1, int y1, int x2, int y2, char c) { int x, y, ddx, ddy, e; - ddx = abs(x2 - x1) << 1; - ddy = abs(y2 - y1); + ddx = ABS(x2 - x1) << 1; + ddy = ABS(y2 - y1); e = ddy - ddx; ddy <<= 1; @@ -103,8 +103,8 @@ void bsubline_3(int x1, int y1, int x2, int y2, char c) { int x, y, ddx, ddy, e; - ddx = abs(x1 - x2) << 1; - ddy = abs(y2 - y1); + ddx = ABS(x1 - x2) << 1; + ddy = ABS(y2 - y1); e = ddy - ddx; ddy <<= 1; @@ -130,8 +130,8 @@ void bsubline_4(int x1, int y1, int x2, int y2, char c) { int x, y, ddx, ddy, e; - ddy = abs(y2 - y1) << 1; - ddx = abs(x1 - x2); + ddy = ABS(y2 - y1) << 1; + ddx = ABS(x1 - x2); e = ddx - ddy; ddx <<= 1; diff --git a/engines/parallaction/intro.cpp b/engines/parallaction/intro.cpp index efb73cf65f..903b4c97f6 100644 --- a/engines/parallaction/intro.cpp +++ b/engines/parallaction/intro.cpp @@ -210,13 +210,13 @@ void introFunc1(uint16 oldX, uint16 oldY, uint16 newX, uint16 newY) { _vm->_gfx->maskOpNot(oldX, oldY, unused); _vm->_gfx->maskOpNot(newX, newY, unused); - if (abs(dx) >= abs(dy)) { + if (ABS(dx) >= ABS(dy)) { - int16 v4 = abs(dy); + int16 v4 = ABS(dy); if (dx >= 0 && dy >= 0) { for (uint16 i = 1; i < dx; i++) { v4 += dy; - if (abs(dx) < v4) { + if (ABS(dx) < v4) { oldY++; v4 -= dx; } @@ -225,22 +225,22 @@ void introFunc1(uint16 oldX, uint16 oldY, uint16 newX, uint16 newY) { } if (dx < 0 && dy >= 0) { - for (uint16 i = 1; i > abs(dx); i++) { + for (uint16 i = 1; i > ABS(dx); i++) { v4 += dy; - if (abs(dx) < v4) { + if (ABS(dx) < v4) { oldY++; - v4 -= abs(dx); + v4 -= ABS(dx); } _vm->_gfx->maskOpNot(oldX - i, oldY, unused); } } if (dx < 0 && dy < 0) { - for (uint16 i = 1; i > abs(dx); i++) { + for (uint16 i = 1; i > ABS(dx); i++) { v4 += dy; - if (abs(v4) > abs(dx)) { + if (ABS(v4) > ABS(dx)) { oldY--; - v4 -= abs(dx); + v4 -= ABS(dx); } _vm->_gfx->maskOpNot(oldX - i, oldY, unused); } @@ -259,9 +259,9 @@ void introFunc1(uint16 oldX, uint16 oldY, uint16 newX, uint16 newY) { } - if (abs(dy) < abs(dx)) { + if (ABS(dy) < ABS(dx)) { - int16 v4 = abs(dx); + int16 v4 = ABS(dx); if (dx >= 0 && dy >= 0) { for (uint16 i = 1; i < dy; i++) { @@ -286,22 +286,22 @@ void introFunc1(uint16 oldX, uint16 oldY, uint16 newX, uint16 newY) { } if (dx < 0 && dy < 0) { - for (uint16 i = 1; i < abs(dy); i++) { - v4 -= abs(dx); - if (v4 > abs(dy)) { + for (uint16 i = 1; i < ABS(dy); i++) { + v4 -= ABS(dx); + if (v4 > ABS(dy)) { oldX--; - v4 -= abs(dy); + v4 -= ABS(dy); } _vm->_gfx->maskOpNot(oldX, oldY - i, unused); } } if (dx >= 0 && dy < 0) { - for (uint16 i = 1; i < abs(dy); i++) { - v4 += abs(dx); - if (v4 > abs(dy)) { + for (uint16 i = 1; i < ABS(dy); i++) { + v4 += ABS(dx); + if (v4 > ABS(dy)) { oldX++; - v4 -= abs(dy); + v4 -= ABS(dy); } _vm->_gfx->maskOpNot(oldX, oldY - i, unused); } |