Skip to content

Commit

Permalink
SLUDGE: replace abs() by scummvm ABS()
Browse files Browse the repository at this point in the history
  • Loading branch information
yinsimei authored and sev- committed Jul 13, 2017
1 parent 9d349e7 commit ae8df00
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion engines/sludge/backdrop.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/sludge/builtin.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions engines/sludge/line.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/sludge/movie.cpp
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions engines/sludge/people.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ae8df00

Please sign in to comment.