int i;
/* bdcff engine flag............ */
- if (strcasecmp(attrib, "Engine")==0)
+ if (strcasecmp(attrib, "Engine") == 0)
return TRUE;
/* old flags - for compatibility */
- if (strcasecmp(attrib, "BD1Scheduling")==0)
+ if (strcasecmp(attrib, "BD1Scheduling") == 0)
return TRUE;
- if (strcasecmp(attrib, "SnapExplosions")==0)
+ if (strcasecmp(attrib, "SnapExplosions") == 0)
return TRUE;
- if (strcasecmp(attrib, "AmoebaProperties")==0)
+ if (strcasecmp(attrib, "AmoebaProperties") == 0)
return TRUE;
/* search in property database */
gd_cave_set_engine_defaults(cave, GD_ENGINE_BD2);
- if (format==GD_FORMAT_BD2_ATARI)
+ if (format == GD_FORMAT_BD2_ATARI)
cave->scheduling = GD_SCHEDULING_BD2_PLCK_ATARI;
/* set visible size for intermission */
for (i = 0; i < 5; i++)
{
/* 0 immediately underflowed to 999, so we use 999. example: sendydash 3, cave 02. */
- cave->level_amoeba_time[i] = data[0]==0 ? 999 : data[0];
+ cave->level_amoeba_time[i] = data[0] == 0 ? 999 : data[0];
cave->level_rand[i] = data[13 + i];
/* gate opening is checked AFTER adding to diamonds collected, so 0 here is 1000 needed */
- cave->level_diamonds[i] = data[8 + i]==0 ? 1000 : data[8 + i];
+ cave->level_diamonds[i] = data[8 + i] == 0 ? 1000 : data[8 + i];
cave->level_time[i] = data[3 + i];
cave->level_magic_wall_time[i] = data[0];
}
cave->map[cave->h - 1][x] = O_STEEL;
/*
- if (steels && data[0]==0x55)
+ if (steels && data[0] == 0x55)
cave->map[cave->h - 1][0] = cave->map[cave->h - 1][1] = O_STEEL;
*/
}
cave->biter_delay_frame = uncompressed[0x394];
- cave->magic_wall_stops_amoeba = uncompressed[0x395]==0; /* negated!! */
+ cave->magic_wall_stops_amoeba = uncompressed[0x395] == 0; /* negated!! */
cave->bomb_explosion_effect = import(uncompressed[0x396], 0x396);
cave->explosion_effect = import(uncompressed[0x397], 0x397);
cave->stone_bouncing_effect = import(uncompressed[0x398], 0x398);
}
format = gd_caveset_imported_get_format(buf);
- if (format==GD_FORMAT_UNKNOWN)
+ if (format == GD_FORMAT_UNKNOWN)
{
Warn("buffer does not contain a GDash datafile");
return NULL;
/* use numbering instead of letters, if following formats or too many caves
(as we would run out of letters) */
- numbering = format == GD_FORMAT_PLC || format==GD_FORMAT_CRLI || g_list_length(caveset) > 26;
+ numbering = format == GD_FORMAT_PLC || format == GD_FORMAT_CRLI || g_list_length(caveset) > 26;
for (iter = caveset; iter != NULL; iter = iter->next)
{
/* free GStrings */
for (i = 0; gd_cave_properties[i].identifier != NULL; i++)
- if (gd_cave_properties[i].type==GD_TYPE_LONGSTRING)
+ if (gd_cave_properties[i].type == GD_TYPE_LONGSTRING)
g_string_free(G_STRUCT_MEMBER(GString *, cave, gd_cave_properties[i].offset), TRUE);
/* map */
/* for longstrings */
for (i = 0; gd_cave_properties[i].identifier != NULL; i++)
- if (gd_cave_properties[i].type==GD_TYPE_LONGSTRING)
+ if (gd_cave_properties[i].type == GD_TYPE_LONGSTRING)
G_STRUCT_MEMBER(GString *, dest, gd_cave_properties[i].offset) =
g_string_new(G_STRUCT_MEMBER(GString *, src, gd_cave_properties[i].offset)->str);
case O_INBOX:
/* shrink only lines, which have only ONE player or outbox.
this is for bd4 intermission 2, for example. */
- if (empty==STEEL_OR_OTHER)
+ if (empty == STEEL_OR_OTHER)
empty = NO_SHRINK;
- if (empty==STEEL_ONLY)
+ if (empty == STEEL_ONLY)
empty = STEEL_OR_OTHER;
break;
case O_PRE_OUTBOX:
case O_PRE_INVIS_OUTBOX:
case O_INBOX:
- if (empty==STEEL_OR_OTHER)
+ if (empty == STEEL_OR_OTHER)
empty = NO_SHRINK;
- if (empty==STEEL_ONLY)
+ if (empty == STEEL_ONLY)
empty = STEEL_OR_OTHER;
break;
case O_PRE_OUTBOX:
case O_PRE_INVIS_OUTBOX:
case O_INBOX:
- if (empty==STEEL_OR_OTHER)
+ if (empty == STEEL_OR_OTHER)
empty = NO_SHRINK;
- if (empty==STEEL_ONLY)
+ if (empty == STEEL_ONLY)
empty = STEEL_OR_OTHER;
break;
gd_create_char_to_element_table();
g_print("Free characters: ");
for (i = 32; i < 128; i++)
- if (gd_char_to_element[i]==O_UNKNOWN)
+ if (gd_char_to_element[i] == O_UNKNOWN)
g_print("%c", i);
g_print("\n");
*/
{
play_sound_of_element(cave, O_DIAMOND, x, y); /* always play diamond sound */
- if (cave->magic_wall_state==GD_MW_DORMANT)
+ if (cave->magic_wall_state == GD_MW_DORMANT)
cave->magic_wall_state = GD_MW_ACTIVE;
- if (cave->magic_wall_state==GD_MW_ACTIVE &&
+ if (cave->magic_wall_state == GD_MW_ACTIVE &&
is_space_dir(cave, x, y, GD_MV_TWICE+fall_dir))
{
/* if magic wall active and place underneath, it turns element
player_move parameter) */
/* only allow changing direction if the new dir is not diagonal */
if (cave->gravity_switch_active &&
- (player_move==GD_MV_LEFT ||
- player_move==GD_MV_RIGHT ||
- player_move==GD_MV_UP ||
- player_move==GD_MV_DOWN))
+ (player_move == GD_MV_LEFT ||
+ player_move == GD_MV_RIGHT ||
+ player_move == GD_MV_UP ||
+ player_move == GD_MV_DOWN))
{
gd_sound_play(cave, GD_S_SWITCH_GRAVITY, what, x, y);
cave->gravity_will_change =
/* is space over the bladder? */
if (is_space_dir(cave, x, y, opposite[grav_compat]))
{
- if (get(cave, x, y)==O_BLADDER_8)
+ if (get(cave, x, y) == O_BLADDER_8)
{
/* if it is a bladder 8, really move up */
move(cave, x, y, opposite[grav_compat], O_BLADDER_1);
}
/* if alive, check in which dir to grow (or not) */
- if (cave->amoeba_state==GD_AM_AWAKE)
+ if (cave->amoeba_state == GD_AM_AWAKE)
{
if (g_rand_int_range(cave->random, 0, 1000000) < cave->amoeba_growth_prob)
{
if (((get(cave, x, y) == O_H_EXPANDING_WALL ||
get(cave, x, y) == O_H_EXPANDING_STEEL_WALL) &&
!cave->expanding_wall_changed) ||
- ((get(cave, x, y)==O_V_EXPANDING_WALL ||
- get(cave, x, y)==O_V_EXPANDING_STEEL_WALL) &&
+ ((get(cave, x, y) == O_V_EXPANDING_WALL ||
+ get(cave, x, y) == O_V_EXPANDING_STEEL_WALL) &&
cave->expanding_wall_changed))
{
if (is_space_dir(cave, x, y, GD_MV_LEFT))
store_dir(cave, x, y, oppos, O_BLADDER_1);
play_sound_of_element(cave, O_SLIME, x, y);
}
- else if (get_dir(cave, x, y, grav)==O_FLYING_STONE)
+ else if (get_dir(cave, x, y, grav) == O_FLYING_STONE)
{
store_dir(cave, x, y, grav, O_SPACE);
store_dir(cave, x, y, oppos, O_FLYING_STONE_F);
play_sound_of_element(cave, O_SLIME, x, y);
}
- else if (get_dir(cave, x, y, grav)==O_FLYING_DIAMOND)
+ else if (get_dir(cave, x, y, grav) == O_FLYING_DIAMOND)
{
store_dir(cave, x, y, grav, O_SPACE);
store_dir(cave, x, y, oppos, O_FLYING_DIAMOND_F);
/* this loop finds the coordinates of the player. needed for scrolling and chasing stone.*/
/* but we only do this, if a living player was found. if not yet, the setup
routine coordinates are used */
- if (cave->player_state==GD_PL_LIVING)
+ if (cave->player_state == GD_PL_LIVING)
{
if (cave->active_is_first_found)
{
if (randm < object->random_fill_probability[3])
element = object->random_fill[3];
- if (object->element==O_NONE ||
+ if (object->element == O_NONE ||
gd_cave_get_rc(cave, x, y) == object->element)
gd_cave_store_rc(cave, x, y, element, object);
}
continue;
#if 0
- Debug("game:mm:DrawLaser", "DL_LASER_ENABLED: i==%d: %d, %d",
+ Debug("game:mm:DrawLaser", "DL_LASER_ENABLED: i == %d: %d, %d",
i, laser.beamer_edge[i], tmp_start_edge);
#endif
return;
}
- if (dx || dy) // Verschiebung der Grafik?
+ if (dx || dy) // Verschiebung der Grafik?
{
- if (x < BX1) // Element kommt von links ins Bild
+ if (x < BX1) // Element kommt von links ins Bild
{
x = BX1;
width = dx;
cx = TILEX - dx;
dx = 0;
}
- else if (x > BX2) // Element kommt von rechts ins Bild
+ else if (x > BX2) // Element kommt von rechts ins Bild
{
x = BX2;
width = -dx;
dx = TILEX + dx;
}
- else if (x==BX1 && dx < 0) // Element verläßt links das Bild
+ else if (x == BX1 && dx < 0) // Element verläßt links das Bild
{
width += dx;
cx = -dx;
dx = 0;
}
- else if (x==BX2 && dx > 0) // Element verläßt rechts das Bild
+ else if (x == BX2 && dx > 0) // Element verläßt rechts das Bild
width -= dx;
- else if (dx) // allg. Bewegung in x-Richtung
+ else if (dx) // allg. Bewegung in x-Richtung
MarkTileDirty(x + SIGN(dx), y);
- if (y < BY1) // Element kommt von oben ins Bild
+ if (y < BY1) // Element kommt von oben ins Bild
{
- if (cut_mode==CUT_BELOW) // Element oberhalb des Bildes
+ if (cut_mode == CUT_BELOW) // Element oberhalb des Bildes
return;
y = BY1;
cy = TILEY - dy;
dy = 0;
}
- else if (y > BY2) // Element kommt von unten ins Bild
+ else if (y > BY2) // Element kommt von unten ins Bild
{
y = BY2;
height = -dy;
dy = TILEY + dy;
}
- else if (y==BY1 && dy < 0) // Element verläßt oben das Bild
+ else if (y == BY1 && dy < 0) // Element verläßt oben das Bild
{
height += dy;
cy = -dy;
}
else if (dy > 0 && cut_mode == CUT_ABOVE)
{
- if (y == BY2) // Element unterhalb des Bildes
+ if (y == BY2) // Element unterhalb des Bildes
return;
height = dy;
cy = TILEY - dy;
dy = TILEY;
MarkTileDirty(x, y + 1);
- } // Element verläßt unten das Bild
+ } // Element verläßt unten das Bild
else if (dy > 0 && (y == BY2 || cut_mode == CUT_BELOW))
{
height -= dy;
}
- else if (dy) // allg. Bewegung in y-Richtung
+ else if (dy) // allg. Bewegung in y-Richtung
{
MarkTileDirty(x, y + SIGN(dy));
}