aboutsummaryrefslogtreecommitdiff
path: root/sword2/router.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-24 06:40:23 +0000
committerTorbjörn Andersson2003-09-24 06:40:23 +0000
commit09a01e4cbeada86167d83608cd0dcd77d7a0168f (patch)
tree060defc05a52b46cd1e055842302355f47eb08bf /sword2/router.cpp
parent570e60a48797efa08ae5a6c7102f16678704bae8 (diff)
downloadscummvm-rg350-09a01e4cbeada86167d83608cd0dcd77d7a0168f.tar.gz
scummvm-rg350-09a01e4cbeada86167d83608cd0dcd77d7a0168f.tar.bz2
scummvm-rg350-09a01e4cbeada86167d83608cd0dcd77d7a0168f.zip
Replaced abs() with ABS and BOOL with bool, plus some minor cleanups.
svn-id: r10391
Diffstat (limited to 'sword2/router.cpp')
-rw-r--r--sword2/router.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sword2/router.cpp b/sword2/router.cpp
index c136258cf5..3c0cf93379 100644
--- a/sword2/router.cpp
+++ b/sword2/router.cpp
@@ -877,7 +877,7 @@ int32 SlidyPath() {
stepX = stepX >> 19; // quarter a step minimum
stepY = stepY >> 19;
- if (abs(deltaX) >= abs(stepX) && abs(deltaY) >= abs(stepY)) {
+ if (ABS(deltaX) >= ABS(stepX) && ABS(deltaY) >= ABS(stepY)) {
modularPath[slidy].x = smoothPath[smooth].x;
modularPath[slidy].y = smoothPath[smooth].y;
modularPath[slidy].dir = smoothPath[smooth].dir;
@@ -1288,7 +1288,7 @@ void SlidyWalkAnimator(_walkData *walkAnim) {
lastErrorY = modularPath[p].y - walkAnim[stepCount - 7].y;
if (stepX == 0) {
- if (3 * abs(lastErrorY) < abs(errorY)) {
+ if (3 * ABS(lastErrorY) < ABS(errorY)) {
// the last stop was
// closest
stepCount -= framesPerStep;
@@ -1298,7 +1298,7 @@ void SlidyWalkAnimator(_walkData *walkAnim) {
left = 0;
}
} else {
- if (3 * abs(lastErrorX) < abs(errorX)) {
+ if (3 * ABS(lastErrorX) < ABS(errorX)) {
//the last stop was
// closest
stepCount -= framesPerStep;
@@ -1560,7 +1560,7 @@ int32 SolidPath() {
stepX = stepX >> 16;
stepY = stepY >> 16;
- if (abs(deltaX) >= abs(stepX) && abs(deltaY) >= abs(stepY)) {
+ if (ABS(deltaX) >= ABS(stepX) && ABS(deltaY) >= ABS(stepY)) {
modularPath[solid].x = smoothPath[smooth].x;
modularPath[solid].y = smoothPath[smooth].y;
modularPath[solid].dir = smoothPath[smooth].dir;
@@ -1954,10 +1954,10 @@ int32 Scan(int32 level) {
x2 = node[k].x;
y2 = node[k].y;
- if (abs(x2 - x1) > 4.5 * abs(y2-y1))
- distance = (8 * abs(x2 - x1) + 18 * abs(y2 - y1)) / (54 * 8) + 1;
+ if (ABS(x2 - x1) > 4.5 * ABS(y2-y1))
+ distance = (8 * ABS(x2 - x1) + 18 * ABS(y2 - y1)) / (54 * 8) + 1;
else
- distance = (6 * abs(x2 - x1) + 36 * abs(y2 - y1)) / (36 * 14) + 1;
+ distance = (6 * ABS(x2 - x1) + 36 * ABS(y2 - y1)) / (36 * 14) + 1;
if (distance + node[i].dist < node[nnodes].dist && distance + node[i].dist < node[k].dist) {
if (NewCheck(0, x1, y1, x2, y2)) {