Capitalized "max" and "min" macros.

This commit is contained in:
onpon4 2015-03-17 16:54:00 -04:00
parent 6610cddeac
commit 05c370feb4
7 changed files with 18 additions and 15 deletions

View File

@ -108,7 +108,7 @@ void bullet_add(object *theWeapon, object *attacker, int y, int dy)
{
tempX = (int)fabsf(attacker->target->x - attacker->x);
tempY = (int)fabsf(attacker->target->y - attacker->y);
steps = max(tempX, tempY);
steps = MAX(tempX, tempY);
if (steps < 12)
steps = 12;

View File

@ -72,7 +72,7 @@ void addCollectable(float x, float y, int type, int value, int life)
}
if (type == P_SUPER)
value = max(value, 1);
value = MAX(value, 1);
if (value == 0)
return; // don't bother!

View File

@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef DEFS_H
#define DEFS_H
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
// ALL
#define NONE 0

View File

@ -529,11 +529,12 @@ int galaxyMap()
// Remove the Supercharge, if it is there
if (currentGame.difficulty > DIFFICULTY_EASY)
{
weapon[W_PLAYER_WEAPON].reload[0] = max(weapon[W_PLAYER_WEAPON].reload[0],
weapon[W_PLAYER_WEAPON].reload[0] = MAX(
weapon[W_PLAYER_WEAPON].reload[0],
rate2reload[currentGame.maxPlasmaRate]);
weapon[W_PLAYER_WEAPON].ammo[0] = min(weapon[W_PLAYER_WEAPON].ammo[0],
weapon[W_PLAYER_WEAPON].ammo[0] = MIN(weapon[W_PLAYER_WEAPON].ammo[0],
currentGame.maxPlasmaOutput);
weapon[W_PLAYER_WEAPON].damage = min(weapon[W_PLAYER_WEAPON].damage,
weapon[W_PLAYER_WEAPON].damage = MIN(weapon[W_PLAYER_WEAPON].damage,
currentGame.maxPlasmaDamage);
}

View File

@ -97,7 +97,7 @@ static void doArrow(int i)
float sx = fabsf((x - (screen->w / 2)) / (screen->w / 2.0));
float sy = fabsf((y - (screen->h / 2)) / (screen->h / 2.0));
float sxy = max(sx, sy);
float sxy = MAX(sx, sy);
if (sxy < 1)
return;

View File

@ -249,13 +249,13 @@ void doPlayer()
cd = player.x - screen->w / 2;
if (cd < 0)
{
cc = max(cd / 10, max(0, engine.ssx) - cameraMaxSpeed);
cc = MAX(cd / 10, MAX(0, engine.ssx) - cameraMaxSpeed);
player.x -= cc;
engine.smx -= cc;
}
else if (cd > 0)
{
cc = min(cd / 10, cameraMaxSpeed + min(0, engine.ssx));
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssx));
player.x -= cc;
engine.smx -= cc;
}
@ -278,13 +278,13 @@ void doPlayer()
cd = player.y - screen->h / 2;
if (cd < 0)
{
cc = max(cd / 10, max(0, engine.ssy) - cameraMaxSpeed);
cc = MAX(cd / 10, MAX(0, engine.ssy) - cameraMaxSpeed);
player.y -= cc;
engine.smy -= cc;
}
else if (cd > 0)
{
cc = min(cd / 10, cameraMaxSpeed + min(0, engine.ssy));
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssy));
player.y -= cc;
engine.smy -= cc;
}

View File

@ -787,7 +787,8 @@ static void sell(int i)
sell(SHOP_PLASMA_MIN_OUTPUT);
currentGame.maxPlasmaOutput--;
weapon[W_PLAYER_WEAPON].ammo[0] = min(weapon[W_PLAYER_WEAPON].ammo[0],
weapon[W_PLAYER_WEAPON].ammo[0] = MIN(
weapon[W_PLAYER_WEAPON].ammo[0],
currentGame.maxPlasmaOutput);
break;
@ -802,7 +803,8 @@ static void sell(int i)
sell(SHOP_PLASMA_MIN_DAMAGE);
currentGame.maxPlasmaDamage--;
weapon[W_PLAYER_WEAPON].damage = min(weapon[W_PLAYER_WEAPON].damage,
weapon[W_PLAYER_WEAPON].damage = MIN(
weapon[W_PLAYER_WEAPON].damage,
currentGame.maxPlasmaDamage);
break;
@ -817,7 +819,7 @@ static void sell(int i)
sell(SHOP_PLASMA_MIN_OUTPUT);
currentGame.maxPlasmaRate--;
weapon[W_PLAYER_WEAPON].reload[0] = max(
weapon[W_PLAYER_WEAPON].reload[0] = MAX(
weapon[W_PLAYER_WEAPON].reload[0],
rate2reload[currentGame.maxPlasmaRate]);
break;