From: Holger Schemel Date: Mon, 19 Feb 2024 23:55:41 +0000 (+0100) Subject: white space changes X-Git-Tag: 4.4.0.0-test-1~332 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=646498771246351aaf243f5ab889179bd9684991;p=rocksndiamonds.git white space changes --- diff --git a/src/game_bd/bd_bdcff.c b/src/game_bd/bd_bdcff.c index 235938b7..490dc1af 100644 --- a/src/game_bd/bd_bdcff.c +++ b/src/game_bd/bd_bdcff.c @@ -107,17 +107,17 @@ static boolean attrib_is_valid_for_cave(const char *attrib) 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 */ diff --git a/src/game_bd/bd_c64import.c b/src/game_bd/bd_c64import.c index 36e2dc08..327de812 100644 --- a/src/game_bd/bd_c64import.c +++ b/src/game_bd/bd_c64import.c @@ -813,7 +813,7 @@ static int cave_copy_from_bd2(GdCave *cave, const guint8 *data, int remaining_by 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 */ @@ -829,11 +829,11 @@ static int cave_copy_from_bd2(GdCave *cave, const guint8 *data, int remaining_by 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]; } @@ -1231,7 +1231,7 @@ static int cave_copy_from_plck(GdCave *cave, const guint8 *data, 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; */ @@ -2194,7 +2194,7 @@ static int cave_copy_from_crli(GdCave *cave, const guint8 *data, int remaining_b } 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); @@ -2320,7 +2320,7 @@ GList *gd_caveset_import_from_buffer (const guint8 *buf, gsize length) } 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; @@ -2496,7 +2496,7 @@ GList *gd_caveset_import_from_buffer (const guint8 *buf, gsize length) /* 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) { diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index 2ffb071e..9e281798 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -548,7 +548,7 @@ void gd_cave_free(GdCave *cave) /* 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 */ @@ -596,7 +596,7 @@ void gd_cave_copy(GdCave *dest, const GdCave *src) /* 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); @@ -879,9 +879,9 @@ void gd_cave_auto_shrink(GdCave *cave) 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; @@ -914,9 +914,9 @@ void gd_cave_auto_shrink(GdCave *cave) 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; @@ -951,9 +951,9 @@ void gd_cave_auto_shrink(GdCave *cave) 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; diff --git a/src/game_bd/bd_cavedb.c b/src/game_bd/bd_cavedb.c index f8d4b878..781deab5 100644 --- a/src/game_bd/bd_cavedb.c +++ b/src/game_bd/bd_cavedb.c @@ -994,7 +994,7 @@ void gd_cave_db_init(void) 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"); */ diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 3019aeca..ab4becd4 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -1347,10 +1347,10 @@ static boolean do_fall_try_magic(GdCave *cave, int x, int y, { 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 @@ -1856,10 +1856,10 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, 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 = @@ -2636,7 +2636,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, /* 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); @@ -2754,7 +2754,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, } /* 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) { @@ -2918,8 +2918,8 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, 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)) @@ -3044,13 +3044,13 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, 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); @@ -3367,7 +3367,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, /* 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) { diff --git a/src/game_bd/bd_caveobject.c b/src/game_bd/bd_caveobject.c index 69e88617..dc105cda 100644 --- a/src/game_bd/bd_caveobject.c +++ b/src/game_bd/bd_caveobject.c @@ -1318,7 +1318,7 @@ static void draw_random_fill(GdCave *cave, const GdObject *object, int level) 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); } diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index fd3cf9ff..20592f1b 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -1624,7 +1624,7 @@ void DrawLaser(int start_edge, int mode) 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 diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 12ca83ce..3deac033 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -165,35 +165,35 @@ void DrawGraphicShifted_MM(int x, int y, int dx, int dy, int graphic, 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; @@ -201,13 +201,13 @@ void DrawGraphicShifted_MM(int x, int y, int dx, int dy, int graphic, 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; @@ -215,19 +215,19 @@ void DrawGraphicShifted_MM(int x, int y, int dx, int dy, int graphic, } 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)); }