void Moving2Blocked(int x, int y, int *goes_to_x, int *goes_to_y)
{
int direction = MovDir[x][y];
- int newx = x + (direction & MV_LEFT ? -1 : direction & MV_RIGHT ? +1 : 0);
- int newy = y + (direction & MV_UP ? -1 : direction & MV_DOWN ? +1 : 0);
+ int newx = x + ((direction & MV_LEFT) ? -1 : (direction & MV_RIGHT) ? +1 : 0);
+ int newy = y + ((direction & MV_UP) ? -1 : (direction & MV_DOWN) ? +1 : 0);
*goes_to_x = newx;
*goes_to_y = newy;
void Blocked2Moving(int x, int y, int *comes_from_x, int *comes_from_y)
{
int direction = MovDir[x][y];
- int oldx = x + (direction & MV_LEFT ? +1 : direction & MV_RIGHT ? -1 : 0);
- int oldy = y + (direction & MV_UP ? +1 : direction & MV_DOWN ? -1 : 0);
+ int oldx = x + ((direction & MV_LEFT) ? +1 : (direction & MV_RIGHT) ? -1 : 0);
+ int oldy = y + ((direction & MV_UP) ? +1 : (direction & MV_DOWN) ? -1 : 0);
*comes_from_x = oldx;
*comes_from_y = oldy;
static boolean canPassField(int x, int y, int move_dir)
{
int opposite_dir = MV_DIR_OPPOSITE(move_dir);
- int dx = (move_dir & MV_LEFT ? -1 : move_dir & MV_RIGHT ? +1 : 0);
- int dy = (move_dir & MV_UP ? -1 : move_dir & MV_DOWN ? +1 : 0);
+ int dx = ((move_dir & MV_LEFT) ? -1 : (move_dir & MV_RIGHT) ? +1 : 0);
+ int dy = ((move_dir & MV_UP) ? -1 : (move_dir & MV_DOWN) ? +1 : 0);
int nextx = x + dx;
int nexty = y + dy;
int element = Tile[x][y];
static boolean canMoveToValidFieldWithGravity(int x, int y, int move_dir)
{
int opposite_dir = MV_DIR_OPPOSITE(move_dir);
- int dx = (move_dir & MV_LEFT ? -1 : move_dir & MV_RIGHT ? +1 : 0);
- int dy = (move_dir & MV_UP ? -1 : move_dir & MV_DOWN ? +1 : 0);
+ int dx = ((move_dir & MV_LEFT) ? -1 : (move_dir & MV_RIGHT) ? +1 : 0);
+ int dy = ((move_dir & MV_UP) ? -1 : (move_dir & MV_DOWN) ? +1 : 0);
int newx = x + dx;
int newy = y + dy;
{
if (key & KEY_BUTTON)
{
- return (key & MV_UP ? keySpaceUp :
- key & MV_LEFT ? keySpaceLeft :
- key & MV_DOWN ? keySpaceDown :
- key & MV_RIGHT ? keySpaceRight : keySpace);
+ return ((key & MV_UP) ? keySpaceUp :
+ (key & MV_LEFT) ? keySpaceLeft :
+ (key & MV_DOWN) ? keySpaceDown :
+ (key & MV_RIGHT) ? keySpaceRight : keySpace);
}
else
{
- return (key & MV_UP ? keyUp :
- key & MV_LEFT ? keyLeft :
- key & MV_DOWN ? keyDown :
- key & MV_RIGHT ? keyRight : keyNone);
+ return ((key & MV_UP) ? keyUp :
+ (key & MV_LEFT) ? keyLeft :
+ (key & MV_DOWN) ? keyDown :
+ (key & MV_RIGHT) ? keyRight : keyNone);
}
}
if (draw_outlined)
{
int rect_x = rect.x +
- (outline_border & MV_LEFT ? border_size : 0);
+ ((outline_border & MV_LEFT) ? border_size : 0);
int rect_w = rect.w -
- (outline_border & MV_LEFT ? border_size : 0) -
- (outline_border & MV_RIGHT ? border_size : 0);
+ ((outline_border & MV_LEFT) ? border_size : 0) -
+ ((outline_border & MV_RIGHT) ? border_size : 0);
if (outline_border & MV_LEFT)
RenderFillRectangle(rect.x, rect.y, border_size, rect.h);
#define SOUND_VOLUME_LOOPS(v) SOUND_VOLUME_FROM_PERCENT(v, setup.volume_loops)
#define SOUND_VOLUME_MUSIC(v) SOUND_VOLUME_FROM_PERCENT(v, setup.volume_music)
-#define SETUP_SOUND_VOLUME(v, s) ((s) & SND_CTRL_MUSIC ? \
+#define SETUP_SOUND_VOLUME(v, s) (((s) & SND_CTRL_MUSIC) ? \
SOUND_VOLUME_MUSIC(v) : \
- (s) & SND_CTRL_LOOP ? \
+ ((s) & SND_CTRL_LOOP) ? \
SOUND_VOLUME_LOOPS(v) : \
SOUND_VOLUME_SIMPLE(v))
if (type & TYPE_GHOSTED)
return FONT_OPTION_OFF;
else if (type & TYPE_KEY)
- return (type & TYPE_QUERY ? FONT_INPUT_1_ACTIVE : FONT_VALUE_1);
+ return ((type & TYPE_QUERY) ? FONT_INPUT_1_ACTIVE : FONT_VALUE_1);
else if (type & TYPE_STRING)
return FONT_VALUE_2;
else if (type & TYPE_ECS_AGA)
pos->y == -1)
continue;
- xpos = VX + pos->x + (type & DATETIME_XOFFSET_1 ? pos->xoffset :
- type & DATETIME_XOFFSET_2 ? pos->xoffset2 : 0);
+ xpos = VX + pos->x + ((type & DATETIME_XOFFSET_1) ? pos->xoffset :
+ (type & DATETIME_XOFFSET_2) ? pos->xoffset2 : 0);
ypos = VY + pos->y;
if ((type & DATETIME_DATE) && (state & VIDEO_STATE_DATE_ON))
int month = month_index + 1;
int day = value % 100;
- strcpy(s, (type & DATETIME_DATE_YYYY ? int2str(year4, 4) :
- type & DATETIME_DATE_YY ? int2str(year2, 2) :
- type & DATETIME_DATE_MON ? month_shortnames[month_index] :
- type & DATETIME_DATE_MM ? int2str(month, 2) :
- type & DATETIME_DATE_DD ? int2str(day, 2) : ""));
+ strcpy(s, ((type & DATETIME_DATE_YYYY) ? int2str(year4, 4) :
+ (type & DATETIME_DATE_YY) ? int2str(year2, 2) :
+ (type & DATETIME_DATE_MON) ? month_shortnames[month_index] :
+ (type & DATETIME_DATE_MM) ? int2str(month, 2) :
+ (type & DATETIME_DATE_DD) ? int2str(day, 2) : ""));
DrawText(xpos, ypos, s, pos->font);
}
int mm = (value / 60) % 60;
int ss = value % 60;
- strcpy(s, (type & DATETIME_TIME_HH ? int2str(hh, 2) :
- type & DATETIME_TIME_MIN ? int2str(min, 2) :
- type & DATETIME_TIME_MM ? int2str(mm, 2) :
- type & DATETIME_TIME_SS ? int2str(ss, 2) : ""));
+ strcpy(s, ((type & DATETIME_TIME_HH) ? int2str(hh, 2) :
+ (type & DATETIME_TIME_MIN) ? int2str(min, 2) :
+ (type & DATETIME_TIME_MM) ? int2str(mm, 2) :
+ (type & DATETIME_TIME_SS) ? int2str(ss, 2) : ""));
DrawText(xpos, ypos, s, pos->font);
}