diff options
author | Max Horn | 2005-05-25 09:17:35 +0000 |
---|---|---|
committer | Max Horn | 2005-05-25 09:17:35 +0000 |
commit | ef9d595a907fb1b33a9ca7cdf3e1ba26a5991a1b (patch) | |
tree | 70de3973f7e4a5bca23707861140df7fe8a9c9de /scumm | |
parent | 936b3025573c3de041c7365c4f85a515018f3634 (diff) | |
download | scummvm-rg350-ef9d595a907fb1b33a9ca7cdf3e1ba26a5991a1b.tar.gz scummvm-rg350-ef9d595a907fb1b33a9ca7cdf3e1ba26a5991a1b.tar.bz2 scummvm-rg350-ef9d595a907fb1b33a9ca7cdf3e1ba26a5991a1b.zip |
abs -> ABS (code unification)
svn-id: r18246
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/actor.cpp | 16 | ||||
-rw-r--r-- | scumm/camera.cpp | 10 | ||||
-rw-r--r-- | scumm/insane/insane_enemy.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | scumm/smush/codec47.cpp | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 70fb311827..efe355c739 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -176,7 +176,7 @@ int ScummEngine::getAngleFromPos(int x, int y) const { double temp = atan2((double)x, (double)-y); return normalizeAngle((int)(temp * 180 / 3.1415926535)); } else { - if (abs(y) * 2 < abs(x)) { + if (ABS(y) * 2 < ABS(x)) { if (x > 0) return 90; return 270; @@ -210,7 +210,7 @@ int Actor::calcMovementFactor(const Common::Point& next) { deltaYFactor = 0; } - if ((uint) abs((int)(deltaXFactor >> 16)) > _speedx) { + if ((uint) ABS((int)(deltaXFactor >> 16)) > _speedx) { deltaXFactor = _speedx << 16; if (diffX < 0) deltaXFactor = -deltaXFactor; @@ -349,7 +349,7 @@ int Actor::updateActorDirection(bool is_walking) { // Turn left or right, depending on which is shorter. int diff = to - from; - if (abs(diff) > (num >> 1)) + if (ABS(diff) > (num >> 1)) diff = -diff; if (diff > 0) { @@ -391,10 +391,10 @@ int Actor::actorWalkStep() { setBox(_walkdata.curbox); } - distX = abs(_walkdata.next.x - _walkdata.cur.x); - distY = abs(_walkdata.next.y - _walkdata.cur.y); + distX = ABS(_walkdata.next.x - _walkdata.cur.x); + distY = ABS(_walkdata.next.y - _walkdata.cur.y); - if (abs(_actorPos.x - _walkdata.cur.x) >= distX && abs(_actorPos.y - _walkdata.cur.y) >= distY) { + if (ABS(_actorPos.x - _walkdata.cur.x) >= distX && ABS(_actorPos.y - _walkdata.cur.y) >= distY) { _moving &= ~MF_IN_LEG; return 0; } @@ -407,11 +407,11 @@ int Actor::actorWalkStep() { _walkdata.yfrac = (uint16)tmpY; _actorPos.y = (tmpY >> 16); - if (abs(_actorPos.x - _walkdata.cur.x) > distX) { + if (ABS(_actorPos.x - _walkdata.cur.x) > distX) { _actorPos.x = _walkdata.next.x; } - if (abs(_actorPos.y - _walkdata.cur.y) > distY) { + if (ABS(_actorPos.y - _walkdata.cur.y) > distY) { _actorPos.y = _walkdata.next.y; } diff --git a/scumm/camera.cpp b/scumm/camera.cpp index 42e11c72b0..80b95fd74b 100644 --- a/scumm/camera.cpp +++ b/scumm/camera.cpp @@ -37,7 +37,7 @@ void ScummEngine::setCameraAtEx(int at) { } void ScummEngine::setCameraAt(int pos_x, int pos_y) { - if (camera._mode != kFollowActorCameraMode || abs(pos_x - camera._cur.x) > (_screenWidth / 2)) { + if (camera._mode != kFollowActorCameraMode || ABS(pos_x - camera._cur.x) > (_screenWidth / 2)) { camera._cur.x = pos_x; } camera._dest.x = pos_x; @@ -261,8 +261,8 @@ void ScummEngine_v7::setCameraFollows(Actor *a) { startScene(a->getRoom(), 0, 0); } - ax = abs(a->_pos.x - camera._cur.x); - ay = abs(a->_pos.y - camera._cur.y); + ax = ABS(a->_pos.x - camera._cur.x); + ay = ABS(a->_pos.y - camera._cur.y); if (ax > VAR(VAR_CAMERA_THRESHOLD_X) || ay > VAR(VAR_CAMERA_THRESHOLD_Y) || ax > (_screenWidth / 2) || ay > (_screenHeight / 2)) { setCameraAt(a->_pos.x, a->_pos.y); @@ -278,8 +278,8 @@ void ScummEngine_v7::moveCamera() { if (camera._follows) { a = derefActor(camera._follows, "moveCamera"); - if (abs(camera._cur.x - a->_pos.x) > VAR(VAR_CAMERA_THRESHOLD_X) || - abs(camera._cur.y - a->_pos.y) > VAR(VAR_CAMERA_THRESHOLD_Y)) { + if (ABS(camera._cur.x - a->_pos.x) > VAR(VAR_CAMERA_THRESHOLD_X) || + ABS(camera._cur.y - a->_pos.y) > VAR(VAR_CAMERA_THRESHOLD_Y)) { camera._movingToActor = true; if (VAR(VAR_CAMERA_THRESHOLD_X) == 0) camera._cur.x = a->_pos.x; diff --git a/scumm/insane/insane_enemy.cpp b/scumm/insane/insane_enemy.cpp index 7b70747af9..336166132d 100644 --- a/scumm/insane/insane_enemy.cpp +++ b/scumm/insane/insane_enemy.cpp @@ -436,7 +436,7 @@ int32 Insane::enemy2handler(int32 actor1, int32 actor2, int32 probability) { _enHdlVar[EN_ROTT3][2] = _vm->_rnd.getRandomNumber(probability * 2 - 1); } - dist = abs(act1x - act2x); + dist = ABS(act1x - act2x); if (_enHdlVar[EN_ROTT3][3] > _enHdlVar[EN_ROTT3][4]) { if (_enHdlVar[EN_ROTT3][0] == 1) { diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 6ed5c7637f..dddc942343 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2425,8 +2425,8 @@ void ScummEngine_v6::o6_dim2dimArray() { } void ScummEngine_v6::o6_abs() { - int a = pop(); // palmos: prevent multi pop if we use an abs function defined as : #define abs(a) ((a) < 0 ? -(a) : (a)) - push(abs(a)); + int a = pop(); + push(ABS(a)); } void ScummEngine_v6::o6_distObjectObject() { diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp index d30877a389..fa371b8d83 100644 --- a/scumm/smush/codec47.cpp +++ b/scumm/smush/codec47.cpp @@ -215,8 +215,8 @@ void Codec47Decoder::makeTablesInterpolation(int param) { memset(tableSmallBig, 0, param * param * 4); - variable2 = abs(value_table47_2_2 - value_table47_2_1); - tmp = abs(value_table47_1_2 - value_table47_1_1); + variable2 = ABS(value_table47_2_2 - value_table47_2_1); + tmp = ABS(value_table47_1_2 - value_table47_1_1); if (variable2 <= tmp) { variable2 = tmp; } |