From ae8df00f56521841ba438f28c84bf1e2a7a4a1bd Mon Sep 17 00:00:00 2001 From: yinsimei Date: Tue, 11 Jul 2017 00:14:47 +0200 Subject: SLUDGE: replace abs() by scummvm ABS() --- engines/sludge/backdrop.cpp | 2 +- engines/sludge/builtin.cpp | 2 +- engines/sludge/line.cpp | 4 ++-- engines/sludge/movie.cpp | 2 +- engines/sludge/people.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp index bda9f5544e..aada7f110c 100644 --- a/engines/sludge/backdrop.cpp +++ b/engines/sludge/backdrop.cpp @@ -399,7 +399,7 @@ void blankScreen(int x1, int y1, int x2, int y2) { } void hardScroll(int distance) { - if (abs(distance) >= sceneHeight) { + if (ABS(distance) >= sceneHeight) { blankScreen(0, 0, sceneWidth, sceneHeight); return; } diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp index 3a79590420..123841c11f 100644 --- a/engines/sludge/builtin.cpp +++ b/engines/sludge/builtin.cpp @@ -1667,7 +1667,7 @@ builtIn(pasteCharacter) { } int fNum = myAnim->frames[thisPerson->frameNum].frameNum; - fixScaleSprite(thisPerson->x, thisPerson->y, myAnim->theSprites->bank.sprites[abs(fNum)], myAnim->theSprites->bank.myPalette, thisPerson, 0, 0, fNum < 0); + fixScaleSprite(thisPerson->x, thisPerson->y, myAnim->theSprites->bank.sprites[ABS(fNum)], myAnim->theSprites->bank.myPalette, thisPerson, 0, 0, fNum < 0); setVariable(fun->reg, SVT_INT, 1); } else { setVariable(fun->reg, SVT_INT, 0); diff --git a/engines/sludge/line.cpp b/engines/sludge/line.cpp index 2262d9255f..58fd64a59b 100644 --- a/engines/sludge/line.cpp +++ b/engines/sludge/line.cpp @@ -63,8 +63,8 @@ void drawLine(int x1, int y1, int x2, int y2) { } else y = y1; - int diffX = abs(x2 - x1); - int diffY = abs(y2 - y1); + int diffX = ABS(x2 - x1); + int diffY = ABS(y2 - y1); if (!diffX) { diffX = 1; diff --git a/engines/sludge/movie.cpp b/engines/sludge/movie.cpp index da6eb7f203..06defc4620 100644 --- a/engines/sludge/movie.cpp +++ b/engines/sludge/movie.cpp @@ -155,7 +155,7 @@ inline static int audio_queue_get(audioQueue *q, char **buffer) { if (audioBuf) { // Synch video timer to audio Uint32 tick = SDL_GetTicks() + 100; - if (abs((long int)((tick - movieStartTick) - (audioBuf->time_ms))) > 300) { + if (ABS((long int)((tick - movieStartTick) - (audioBuf->time_ms))) > 300) { movieStartTick = tick - audioBuf->time_ms; } diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp index 1fd6931b6f..94663eedf3 100644 --- a/engines/sludge/people.cpp +++ b/engines/sludge/people.cpp @@ -471,7 +471,7 @@ void drawPeople() { } int fNumSign = myAnim->frames[thisPerson->frameNum].frameNum; int m = fNumSign < 0; - int fNum = abs(fNumSign); + int fNum = ABS(fNumSign); if (fNum >= myAnim->theSprites->bank.total) { fNum = 0; m = 2 - m; @@ -643,9 +643,9 @@ bool walkMe(onScreenPerson *thisPerson, bool move = true) { if (s < 0.2) s = 0.2; - maxDiff = (abs(xDiff) >= abs(yDiff)) ? abs(xDiff) : abs(yDiff); + maxDiff = (ABS(xDiff) >= ABS(yDiff)) ? ABS(xDiff) : ABS(yDiff); - if (abs(maxDiff) > s) { + if (ABS(maxDiff) > s) { if (thisPerson->spinning) { spinStep(thisPerson); setFrames(*thisPerson, ANI_WALK); -- cgit v1.2.3