Skip to content

Commit

Permalink
SLUDGE: remove math functions defined in sludge
Browse files Browse the repository at this point in the history
  • Loading branch information
yinsimei authored and sev- committed Jul 13, 2017
1 parent f8e1fe0 commit 2563180
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 2 additions & 8 deletions engines/sludge/people.cpp
Expand Up @@ -61,12 +61,6 @@ int16 scaleHorizon = 75;
int16 scaleDivide = 150;
extern screenRegion *allScreenRegions;

#define TF_max(a, b) ((a > b) ? a : b)

inline int TF_abs(int a) {
return (a > 0) ? a : -a;
}

void setFrames(onScreenPerson &m, int a) {
m.myAnim = m.myPersona->animation[(a * m.myPersona->numDirections) + m.direction];
}
Expand Down Expand Up @@ -649,9 +643,9 @@ bool walkMe(onScreenPerson *thisPerson, bool move = true) {
if (s < 0.2)
s = 0.2;

maxDiff = (TF_abs(xDiff) >= TF_abs(yDiff)) ? TF_abs(xDiff) : TF_abs(yDiff);
maxDiff = (abs(xDiff) >= abs(yDiff)) ? abs(xDiff) : abs(yDiff);

if (TF_abs(maxDiff) > s) {
if (abs(maxDiff) > s) {
if (thisPerson->spinning) {
spinStep(thisPerson);
setFrames(*thisPerson, ANI_WALK);
Expand Down
3 changes: 0 additions & 3 deletions engines/sludge/talk.cpp
Expand Up @@ -75,9 +75,6 @@ void killAllSpeech() {
}
}

#define TF_max(a, b) ((a > b) ? a : b)
#define TF_min(a, b) ((a > b) ? b : a)

inline void setObjFontColour(objectType *t) {
setFontColour(speech->talkCol, t->r, t->g, t->b);
}
Expand Down

0 comments on commit 2563180

Please sign in to comment.