X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame.c;h=36e0701e22d50f6470e77b199c934ffa4857c5dd;hb=ec50fda335d6dc628abc56320bfd3a42711edd1d;hp=e0423a0cf4bea429d6ced5eb7ad7ce54bf7a08cf;hpb=3a503b2292cd93a5c67cda25e8912391eb12273b;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index e0423a0c..36e0701e 100644 --- a/src/game.c +++ b/src/game.c @@ -756,8 +756,8 @@ void DrawGameDoorValues() { int i, j; - for (i=0; ichange_events = CE_BITMASK_DEFAULT; - for (j=0; j < NUM_CHANGE_EVENTS; j++) + for (j = 0; j < NUM_CHANGE_EVENTS; j++) { ei->event_page_nr[j] = 0; ei->event_page[j] = &ei->change_page[0]; @@ -844,7 +844,7 @@ static void InitGameEngine() } /* add changing elements from pre-defined list */ - for (i=0; change_delay_list[i].element != EL_UNDEFINED; i++) + for (i = 0; change_delay_list[i].element != EL_UNDEFINED; i++) { struct ChangingElementInfo *ch_delay = &change_delay_list[i]; struct ElementInfo *ei = &element_info[ch_delay->element]; @@ -861,16 +861,16 @@ static void InitGameEngine() #if 1 /* add change events from custom element configuration */ - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { struct ElementInfo *ei = &element_info[EL_CUSTOM_START + i]; - for (j=0; j < ei->num_change_pages; j++) + for (j = 0; j < ei->num_change_pages; j++) { if (!ei->change_page[j].can_change) continue; - for (k=0; k < NUM_CHANGE_EVENTS; k++) + for (k = 0; k < NUM_CHANGE_EVENTS; k++) { /* only add event page for the first page found with this event */ if (ei->change_page[j].events & CH_EVENT_BIT(k) && @@ -887,7 +887,7 @@ static void InitGameEngine() #else /* add change events from custom element configuration */ - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { int element = EL_CUSTOM_START + i; @@ -900,16 +900,16 @@ static void InitGameEngine() /* ---------- initialize trigger events ---------------------------------- */ /* initialize trigger events information */ - for (i=0; inum_change_pages; j++) + for (j = 0; j < ei->num_change_pages; j++) { if (!ei->change_page[j].can_change) continue; @@ -924,7 +924,7 @@ static void InitGameEngine() } #else /* add trigger events from element change event properties */ - for (i=0; itrigger_element] |= element_info[i].change->events; @@ -933,7 +933,7 @@ static void InitGameEngine() /* ---------- initialize push delay -------------------------------------- */ /* initialize push delay values to default */ - for (i=0; ilights_still_needed = 0; player->friends_still_needed = 0; - for (j=0; j < 4; j++) + for (j = 0; j < 4; j++) player->key[j] = FALSE; player->dynabomb_count = 0; @@ -1076,11 +1076,11 @@ void InitGame() player->num_special_action_sleeping = 0; /* determine number of special actions for bored and sleeping animation */ - for (j=ACTION_BORING_1; j <= ACTION_BORING_LAST; j++) + for (j = ACTION_BORING_1; j <= ACTION_BORING_LAST; j++) { boolean found = FALSE; - for (k=0; k < NUM_DIRECTIONS; k++) + for (k = 0; k < NUM_DIRECTIONS; k++) if (el_act_dir2img(player->element_nr, j, k) != el_act_dir2img(player->element_nr, ACTION_DEFAULT, k)) found = TRUE; @@ -1090,11 +1090,11 @@ void InitGame() else break; } - for (j=ACTION_SLEEPING_1; j <= ACTION_SLEEPING_LAST; j++) + for (j = ACTION_SLEEPING_1; j <= ACTION_SLEEPING_LAST; j++) { boolean found = FALSE; - for (k=0; k < NUM_DIRECTIONS; k++) + for (k = 0; k < NUM_DIRECTIONS; k++) if (el_act_dir2img(player->element_nr, j, k) != el_act_dir2img(player->element_nr, ACTION_DEFAULT, k)) found = TRUE; @@ -1166,18 +1166,18 @@ void InitGame() game.envelope_active = FALSE; - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { game.belt_dir[i] = MV_NO_MOVING; game.belt_dir_nr[i] = 3; /* not moving, next moving left */ } - for (i=0; iconnected && !player->present) { - for (j=0; jjx, jy = some_player->jy; @@ -1263,7 +1263,7 @@ void InitGame() { /* when playing a tape, eliminate all players who do not participate */ - for (i=0; iscore < highscore[MAX_SCORE_ENTRIES - 1].Score) return -1; - for (k=0; kscore > highscore[k].Score) { @@ -1840,14 +1840,14 @@ int NewHiScore() int m = MAX_SCORE_ENTRIES - 1; #ifdef ONE_PER_NAME - for (l=k; lk; l--) + for (l = m; l > k; l--) { strcpy(highscore[l].Name, highscore[l - 1].Name); highscore[l].Score = highscore[l - 1].Score; @@ -2236,7 +2236,7 @@ void Explode(int ex, int ey, int phase, int mode) Feld[ex][ey] = center_element; } - for (y = ey - 1; y <= ey + 1; y++) for(x = ex - 1; x <= ex + 1; x++) + for (y = ey - 1; y <= ey + 1; y++) for (x = ex - 1; x <= ex + 1; x++) { int xx = x - ex + 1; int yy = y - ey + 1; @@ -2556,9 +2556,9 @@ void DynaExplode(int ex, int ey) Explode(ex, ey, EX_PHASE_START, EX_CENTER); - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { - for (j=1; j<=dynabomb_size; j++) + for (j = 1; j <= dynabomb_size; j++) { int x = ex + j * xy[i % 4][0]; int y = ey + j * xy[i % 4][1]; @@ -2704,11 +2704,11 @@ static void InitBeltMovement() int x, y, i, j; /* set frame order for belt animation graphic according to belt direction */ - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { int belt_nr = i; - for (j=0; j<3; j++) + for (j = 0; j < 3; j++) { int element = belt_base_active_element[belt_nr] + j; int graphic = el2img(element); @@ -2720,13 +2720,13 @@ static void InitBeltMovement() } } - for(y=0; yjx, jy = player->jy; @@ -3571,7 +3571,7 @@ inline static void TurnRoundExt(int x, int y) { 0, +1 } }; - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { int ex = x + xy[i % 4][0]; int ey = y + xy[i % 4][1]; @@ -3743,7 +3743,7 @@ inline static void TurnRoundExt(int x, int y) { int i; - for (i=0; ijx, jy = player->jy; @@ -3833,7 +3833,7 @@ static boolean JustBeingPushed(int x, int y) { int i; - for (i=0; irandom) return FALSE; - for (yy = 0; yy < 3; yy++) for(xx = 0; xx < 3 ; xx++) + for (yy = 0; yy < 3; yy++) for (xx = 0; xx < 3 ; xx++) { int ex = x + xx - 1; int ey = y + yy - 1; @@ -5897,7 +5897,7 @@ static boolean CheckTriggeredElementSideChange(int lx, int ly, if (!(trigger_events[trigger_element] & CH_EVENT_BIT(trigger_event))) return FALSE; - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { int element = EL_CUSTOM_START + i; @@ -5907,7 +5907,7 @@ static boolean CheckTriggeredElementSideChange(int lx, int ly, if (!CAN_CHANGE(element) || !HAS_ANY_CHANGE_EVENT(element, trigger_event)) continue; - for (j=0; j < element_info[element].num_change_pages; j++) + for (j = 0; j < element_info[element].num_change_pages; j++) { struct ElementChangeInfo *change = &element_info[element].change_page[j]; @@ -5934,7 +5934,7 @@ static boolean CheckTriggeredElementSideChange(int lx, int ly, if (!change_element) continue; - for (y=0; yeffective_action = summarized_player_action; - for (i=0; i < MAX_PLAYERS; i++) + for (i = 0; i < MAX_PLAYERS; i++) { int actual_player_action = stored_player[i].effective_action; @@ -6333,14 +6333,14 @@ void GameActions() FrameCounter++; TimeFrames++; - for (i=0; ijx; @@ -6361,7 +6361,7 @@ void GameActions() } #endif - for (y=0; yinventory_size < MAX_INVENTORY_SIZE) player->inventory_element[player->inventory_size++] = element; @@ -8392,7 +8392,7 @@ int DigField(struct PlayerInfo *player, { int xx, yy; - for (yy=0; yy < lev_fieldy; yy++) for (xx=0; xx < lev_fieldx; xx++) + for (yy = 0; yy < lev_fieldy; yy++) for (xx=0; xx < lev_fieldx; xx++) { if (Feld[xx][yy] == EL_SP_DISK_YELLOW) Bang(xx, yy); @@ -8734,14 +8734,10 @@ static void StopLevelSoundActionIfLoop(int x, int y, int action) static void PlayLevelMusic() { -#if 1 if (levelset.music[level_nr] != MUS_UNDEFINED) PlayMusic(levelset.music[level_nr]); /* from config file */ else - PlayMusic(-(level_nr + 1)); /* from music dir */ -#else - PlayMusic(level_nr); -#endif + PlayMusic(MAP_NOCONF_MUSIC(level_nr)); /* from music dir */ } void RaiseScore(int value) @@ -8905,7 +8901,7 @@ void CreateGameButtons() { int i; - for (i=0; i