/* Fill empty backbuffer for animation functions */
if (setup.direct_draw && game_status == GAME_MODE_PLAYING)
{
- int xx,yy;
+ int xx, yy;
SetDrawtoField(DRAW_BACKBUFFER);
- for(xx=0; xx<SCR_FIELDX; xx++)
- for(yy=0; yy<SCR_FIELDY; yy++)
- DrawScreenField(xx,yy);
+ for (xx = 0; xx < SCR_FIELDX; xx++)
+ for (yy = 0; yy < SCR_FIELDY; yy++)
+ DrawScreenField(xx, yy);
DrawAllPlayers();
SetDrawtoField(DRAW_DIRECT);
fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
- BlitBitmap(fieldbuffer, backbuffer, fx,fy, SXSIZE,SYSIZE, SX,SY);
+ BlitBitmap(fieldbuffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
}
}
-#define COMPILE_DATE_STRING "[2003-11-29 14:53]"
+#define COMPILE_DATE_STRING "[2003-11-29 19:53]"
&num_editor_el_user_defined);
/* initialize list of empty elements (used for padding, if needed) */
- for (i=0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
editor_el_empty[i] = EL_EMPTY;
/* do some sanity checks for each element from element list */
- for (i=0; editor_elements_info[i].setup_value != NULL; i++)
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
{
- for (j=0; j < *editor_elements_info[i].element_list_size; j++)
+ for (j = 0; j < *editor_elements_info[i].element_list_size; j++)
{
int element = (*editor_elements_info[i].element_list)[j];
use_el_empty = FALSE;
/* determine size of element list */
- for (i=0; editor_elements_info[i].setup_value != NULL; i++)
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
{
if (*editor_elements_info[i].setup_value)
{
editor_elements = checked_malloc(num_editor_elements * sizeof(int));
/* fill element list */
- for (i=0; editor_elements_info[i].setup_value != NULL; i++)
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
{
if (*editor_elements_info[i].setup_value)
{
if (setup.editor.el_headlines)
- for (j=0; j < *editor_elements_info[i].headline_list_size; j++)
+ for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
editor_elements[pos++] = (*editor_elements_info[i].headline_list)[j];
- for (j=0; j < *editor_elements_info[i].element_list_size; j++)
+ for (j = 0; j < *editor_elements_info[i].element_list_size; j++)
editor_elements[pos++] = (*editor_elements_info[i].element_list)[j];
}
}
boolean *stop = &setup.editor.el_user_defined;
int i, j;
- for (i=0; editor_elements_info[i].setup_value != stop; i++)
+ for (i = 0; editor_elements_info[i].setup_value != stop; i++)
{
- for (j=0; j < *editor_elements_info[i].headline_list_size; j++)
+ for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
{
int element = (*editor_elements_info[i].headline_list)[j];
if (j > 0)
printf("#\n");
- for (j=0; j < *editor_elements_info[i].element_list_size; j++)
+ for (j = 0; j < *editor_elements_info[i].element_list_size; j++)
{
int element = (*editor_elements_info[i].element_list)[j];
if (last_setup_value_headlines != setup.editor.el_headlines)
initialization_needed = TRUE;
- for (i=0; editor_elements_info[i].setup_value != NULL; i++)
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
if (editor_elements_info[i].last_setup_value !=
*editor_elements_info[i].setup_value)
initialization_needed = TRUE;
/* store current setup values for next invocation of this function */
last_setup_value_headlines = setup.editor.el_headlines;
- for (i=0; editor_elements_info[i].setup_value != NULL; i++)
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
editor_elements_info[i].last_setup_value =
*editor_elements_info[i].setup_value;
getMiniGraphicSource(border_graphic, &src_bitmap, &src_x, &src_y);
- for (y=0; y < num_mini_tiley; y++)
- for (x=0; x < num_mini_tilex; x++)
+ for (y = 0; y < num_mini_tiley; y++)
+ for (x = 0; x < num_mini_tilex; x++)
BlitBitmap(src_bitmap, drawto, src_x, src_y, MINI_TILEX, MINI_TILEY,
dest_x - MINI_TILEX / 2 + x * MINI_TILEX,
dest_y - MINI_TILEY / 2 + y * MINI_TILEY);
DrawMiniGraphicExt(drawto, gi->x, gi->y,
el2edimg(custom_element.gfx_element));
else if (id == ED_DRAWING_ID_CUSTOM_CONTENT)
- for (y=0; y<3; y++)
- for (x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
DrawMiniGraphicExt(drawto,
gi->x + x * MINI_TILEX, gi->y + y * MINI_TILEY,
el2edimg(custom_element.content[x][y]));
DrawMiniGraphicExt(drawto, gi->x, gi->y,
el2edimg(custom_element_change.target_element));
else if (id == ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT)
- for (y=0; y < 3; y++)
- for (x=0; x < 3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
DrawMiniGraphicExt(drawto,
gi->x + x * MINI_TILEX, gi->y + y * MINI_TILEY,
el2edimg(custom_element_change.content[x][y]));
{
int nr = id - ED_DRAWING_ID_ELEMENT_CONTENT_0;
- for (y=0; y < 3; y++)
- for (x=0; x < 3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
DrawMiniGraphicExt(drawto,
gi->x + x * MINI_TILEX, gi->y + y * MINI_TILEY,
el2edimg(level.yamyam_content[nr][x][y]));
if (dx)
{
x = (dx == 1 ? 0 : ed_fieldx - 1);
- for(y=0; y<ed_fieldy; y++)
+ for (y = 0; y < ed_fieldy; y++)
DrawMiniElementOrWall(x, y, from_x, from_y);
}
else if (dy)
{
y = (dy == 1 ? 0 : ed_fieldy - 1);
- for(x=0; x<ed_fieldx; x++)
+ for (x = 0; x < ed_fieldx; x++)
DrawMiniElementOrWall(x, y, from_x, from_y);
}
int i;
/* create toolbox buttons */
- for (i=0; i < ED_NUM_CTRL_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_CTRL_BUTTONS; i++)
{
int id = i;
int width, height;
}
/* create buttons for scrolling of drawing area and element list */
- for (i=0; i<ED_NUM_SCROLLBUTTONS; i++)
+ for (i = 0; i < ED_NUM_SCROLLBUTTONS; i++)
{
int id = scrollbutton_info[i].gadget_id;
int x, y, width, height;
}
/* create buttons for element list */
- for (i=0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
{
Bitmap *deco_bitmap;
int deco_x, deco_y, deco_xpos, deco_ypos;
int max_infotext_len = getMaxInfoTextLength();
int i;
- for (i=0; i<ED_NUM_COUNTERBUTTONS; i++)
+ for (i = 0; i < ED_NUM_COUNTERBUTTONS; i++)
{
int j;
int x = SX + counterbutton_info[i].x; /* down count button */
if (counterbutton_info[i].text_left != NULL)
x += getTextWidthForGadget(counterbutton_info[i].text_left);
- for (j=0; j<2; j++)
+ for (j = 0; j < 2; j++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
struct GadgetInfo *gi;
{
int i;
- for (i=0; i<ED_NUM_DRAWING_AREAS; i++)
+ for (i = 0; i < ED_NUM_DRAWING_AREAS; i++)
{
struct GadgetInfo *gi;
unsigned long event_mask;
int max_infotext_len = getMaxInfoTextLength();
int i;
- for (i=0; i<ED_NUM_TEXTINPUT; i++)
+ for (i = 0; i < ED_NUM_TEXTINPUT; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
int gd_x, gd_y;
int max_infotext_len = getMaxInfoTextLength();
int i;
- for (i=0; i<ED_NUM_TEXTAREAS; i++)
+ for (i = 0; i < ED_NUM_TEXTAREAS; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
int gd_x, gd_y;
int max_infotext_len = getMaxInfoTextLength();
int i, j;
- for (i=0; i<ED_NUM_SELECTBOX; i++)
+ for (i = 0; i < ED_NUM_SELECTBOX; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
int gd_x, gd_y;
implicitely cast -1 to an unsigned integer value!) */
selectbox_info[i].size = 0;
- for (j=0; selectbox_info[i].options[j].text != NULL; j++)
+ for (j = 0; selectbox_info[i].options[j].text != NULL; j++)
if (strlen(selectbox_info[i].options[j].text) > selectbox_info[i].size)
selectbox_info[i].size = strlen(selectbox_info[i].options[j].text);
int max_infotext_len = getMaxInfoTextLength();
int i;
- for (i=0; i<ED_NUM_TEXTBUTTONS; i++)
+ for (i = 0; i < ED_NUM_TEXTBUTTONS; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
int gd_x1, gd_x2, gd_y1, gd_y2;
int i;
/* create buttons for scrolling of drawing area and element list */
- for (i=0; i < ED_NUM_GRAPHICBUTTONS; i++)
+ for (i = 0; i < ED_NUM_GRAPHICBUTTONS; i++)
{
int id = graphicbutton_info[i].gadget_id;
int gd_x1, gd_x2, gd_y1, gd_y2;
{
int i;
- for (i=0; i<ED_NUM_SCROLLBARS; i++)
+ for (i = 0; i < ED_NUM_SCROLLBARS; i++)
{
int id = scrollbar_info[i].gadget_id;
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
gd_x4 = DOOR_GFX_PAGEX3 + ED_CHECKBUTTON_CHECKED_XPOS;
gd_y = DOOR_GFX_PAGEY1 + ED_RADIOBUTTON_YPOS;
- for (i=0; i<ED_NUM_CHECKBUTTONS; i++)
+ for (i = 0; i < ED_NUM_CHECKBUTTONS; i++)
{
int id = checkbutton_info[i].gadget_id;
int x = SX + checkbutton_info[i].x;
gd_x4 = DOOR_GFX_PAGEX3 + ED_CHECKBUTTON_CHECKED_XPOS;
gd_y = DOOR_GFX_PAGEY1 + ED_RADIOBUTTON_YPOS;
- for (i=0; i<ED_NUM_RADIOBUTTONS; i++)
+ for (i = 0; i < ED_NUM_RADIOBUTTONS; i++)
{
int id = radiobutton_info[i].gadget_id;
int x = SX + radiobutton_info[i].x;
{
int i;
- for (i=0; i < NUM_EDITOR_GADGETS; i++)
+ for (i = 0; i < NUM_EDITOR_GADGETS; i++)
FreeGadget(level_editor_gadget[i]);
}
int i;
/* map toolbox buttons (excluding special CE toolbox buttons) */
- for (i=0; i < ED_NUM_CTRL1_2_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_CTRL1_2_BUTTONS; i++)
MapGadget(level_editor_gadget[i]);
/* map buttons to select elements */
- for (i=0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
MapGadget(level_editor_gadget[GADGET_ID_ELEMENTLIST_FIRST + i]);
MapGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL]);
MapGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_UP]);
boolean no_vertical_scrollbar = (lev_fieldy + 2 <= ed_fieldy);
int i;
- for (i=ED_SCROLLBUTTON_ID_AREA_FIRST; i<=ED_SCROLLBUTTON_ID_AREA_LAST; i++)
+ for (i=ED_SCROLLBUTTON_ID_AREA_FIRST; i <= ED_SCROLLBUTTON_ID_AREA_LAST; i++)
{
if (((i == ED_SCROLLBUTTON_ID_AREA_LEFT ||
i == ED_SCROLLBUTTON_ID_AREA_RIGHT) &&
MapGadget(level_editor_gadget[scrollbutton_info[i].gadget_id]);
}
- for (i=ED_SCROLLBAR_ID_AREA_FIRST; i<=ED_SCROLLBAR_ID_AREA_LAST; i++)
+ for (i = ED_SCROLLBAR_ID_AREA_FIRST; i <= ED_SCROLLBAR_ID_AREA_LAST; i++)
{
if ((i == ED_SCROLLBAR_ID_AREA_HORIZONTAL && no_horizontal_scrollbar) ||
(i == ED_SCROLLBAR_ID_AREA_VERTICAL && no_vertical_scrollbar))
{
int i;
- for (i=0; i < ED_NUM_CTRL_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_CTRL_BUTTONS; i++)
{
if (i == GADGET_ID_CUSTOM_COPY_FROM ||
i == GADGET_ID_CUSTOM_COPY_TO ||
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
int i;
- for (i=0; i < ED_NUM_CTRL1_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_CTRL1_BUTTONS; i++)
{
if (i != GADGET_ID_SINGLE_ITEMS &&
i != GADGET_ID_PROPERTIES &&
{
int i;
- for (i=0; i < NUM_EDITOR_GADGETS; i++)
+ for (i = 0; i < NUM_EDITOR_GADGETS; i++)
if (level_editor_gadget[i]->x < SX + SXSIZE)
UnmapGadget(level_editor_gadget[i]);
}
{
int i;
- for (i=0; i < NUM_EDITOR_GADGETS; i++)
+ for (i = 0; i < NUM_EDITOR_GADGETS; i++)
UnmapGadget(level_editor_gadget[i]);
}
boolean level_changed = FALSE;
int x, y;
- for(y=0; y<lev_fieldy; y++)
- for(x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
if (Feld[x][y] != level.field[x][y])
level_changed = TRUE;
boolean player_found = FALSE;
int x, y;
- for(y=0; y<lev_fieldy; y++)
- for(x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
if (Feld[x][y] == EL_PLAYER_1 ||
Feld[x][y] == EL_SP_MURPHY)
player_found = TRUE;
{
int x, y;
- for(x=0; x<lev_fieldx; x++)
- for(y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
dst[x][y] = src[x][y];
}
int new_index_value = 0;
int i;
- for(i=0; selectbox_info[selectbox_id].options[i].text != NULL; i++)
+ for (i = 0; selectbox_info[selectbox_id].options[i].text != NULL; i++)
if (selectbox_info[selectbox_id].options[i].value == new_value)
new_index_value = i;
int i, x, y;
/* ---------- copy element description ---------- */
- for (i=0; i < MAX_ELEMENT_NAME_LEN + 1; i++)
+ for (i = 0; i < MAX_ELEMENT_NAME_LEN + 1; i++)
ei_to->description[i] = ei_from->description[i];
/* ---------- copy element properties ---------- */
ei_to->slippery_type = ei_from->slippery_type;
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
ei_to->content[x][y] = ei_from->content[x][y];
ei_to->num_change_pages = ei_from->num_change_pages;
change_to->random = change_from->random;
change_to->power = change_from->power;
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
change_to->content[x][y] = change_from->content[x][y];
change_to->can_change = change_from->can_change;
{
int i, j, x, y;
- for (i=0; i < NUM_FILE_ELEMENTS; i++)
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
{
struct ElementInfo *ei = &element_info[i];
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
if (ei->content[x][y] == element_from)
ei->content[x][y] = element_to;
if (change->trigger_element == element_from)
change->trigger_element = element_to;
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
if (change->content[x][y] == element_from)
change->content[x][y] = element_to;
}
{
int x, y;
- for(x=0; x < lev_fieldx; x++)
- for(y=0; y < lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
if (Feld[x][y] == element_from)
Feld[x][y] = element_to;
}
int current_change_page = element_info[element].current_change_page;
/* dynamically (re)build selectbox for selecting change page */
- for (i=0; i < element_info[element].num_change_pages; i++)
+ for (i = 0; i < element_info[element].num_change_pages; i++)
{
sprintf(options_change_page_strings[i], "%d", i + 1);
custom_element_change = *element_info[element].change;
/* needed to initially set selectbox value variables to reliable defaults */
- for (i=0; i < ED_NUM_SELECTBOX; i++)
+ for (i = 0; i < ED_NUM_SELECTBOX; i++)
setSelectboxValue(i, *selectbox_info[i].value);
- for (i=0; i < NUM_ELEMENT_PROPERTIES; i++)
+ for (i = 0; i < NUM_ELEMENT_PROPERTIES; i++)
custom_element_properties[i] = HAS_PROPERTY(element, i);
- for (i=0; i < NUM_CHANGE_EVENTS; i++)
+ for (i = 0; i < NUM_CHANGE_EVENTS; i++)
custom_element_change_events[i] = HAS_CHANGE_EVENT(element, i);
/* ---------- element settings: configure (custom elements) ------------- */
custom_element_change_events[custom_element_change.other_action] =
custom_element_change_events[CE_BY_OTHER_ACTION];
- for (i=0; i < NUM_ELEMENT_PROPERTIES; i++)
+ for (i = 0; i < NUM_ELEMENT_PROPERTIES; i++)
SET_PROPERTY(element, i, custom_element_properties[i]);
- for (i=0; i < NUM_CHANGE_EVENTS; i++)
+ for (i = 0; i < NUM_CHANGE_EVENTS; i++)
SET_CHANGE_EVENT(element, i, custom_element_change_events[i]);
/* copy change events also to special level editor variable */
{
int i;
- for (i=0; i<ED_NUM_ELEMENTLIST_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
{
int gadget_id = GADGET_ID_ELEMENTLIST_FIRST + i;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
"Editor Settings", FONT_TITLE_1);
/* draw counter gadgets */
- for (i=ED_COUNTER_ID_LEVEL_FIRST; i<=ED_COUNTER_ID_LEVEL_LAST; i++)
+ for (i = ED_COUNTER_ID_LEVEL_FIRST; i <= ED_COUNTER_ID_LEVEL_LAST; i++)
MapCounterButtons(i);
/* draw checkbutton gadgets */
- for (i=ED_CHECKBUTTON_ID_LEVEL_FIRST; i<=ED_CHECKBUTTON_ID_LEVEL_LAST; i++)
+ for (i=ED_CHECKBUTTON_ID_LEVEL_FIRST; i <= ED_CHECKBUTTON_ID_LEVEL_LAST; i++)
MapCheckbuttonGadget(i);
/* draw radiobutton gadgets */
- for (i=ED_RADIOBUTTON_ID_LEVEL_FIRST; i<=ED_RADIOBUTTON_ID_LEVEL_LAST; i++)
+ for (i=ED_RADIOBUTTON_ID_LEVEL_FIRST; i <= ED_RADIOBUTTON_ID_LEVEL_LAST; i++)
MapRadiobuttonGadget(i);
/* draw text input gadgets */
- for (i=ED_TEXTINPUT_ID_LEVEL_FIRST; i<=ED_TEXTINPUT_ID_LEVEL_LAST; i++)
+ for (i = ED_TEXTINPUT_ID_LEVEL_FIRST; i <= ED_TEXTINPUT_ID_LEVEL_LAST; i++)
MapTextInputGadget(i);
/* draw drawing area */
/* display counter to choose number of element content areas */
MapCounterButtons(ED_COUNTER_ID_ELEMENT_CONTENT);
- for (i=0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
{
int id = ED_DRAWING_ID_ELEMENT_CONTENT_0 + i;
int font_height = getFontHeight(FONT_TEXT_1);
buffer[0] = '\0';
buffer_len = 0;
- while(!feof(file) && current_line < max_lines_per_screen)
+ while (!feof(file) && current_line < max_lines_per_screen)
{
char *line_ptr;
boolean last_line_was_empty = TRUE;
if (IS_CUSTOM_ELEMENT(properties_element))
id_last = ED_TEXTBUTTON_ID_PROPERTIES_ADVANCED;
- for (i=id_first; i <= id_last; i++)
+ for (i = id_first; i <= id_last; i++)
{
int gadget_id = textbutton_info[i].gadget_id;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
/* ----- print number of elements / percentage of this element in level */
num_elements_in_level = 0;
- for (y=0; y<lev_fieldy; y++)
- for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
if (Feld[x][y] == properties_element)
num_elements_in_level++;
percentage = num_elements_in_level * 100.0 / (lev_fieldx * lev_fieldy);
DrawTextS(pad_x, pad_y + screen_line++ * font2_height, font1_nr,
properties_text);
- for (i=0; properties[i].value != -1; i++)
+ for (i = 0; properties[i].value != -1; i++)
{
if (!HAS_PROPERTY(properties_element, properties[i].value))
continue;
HAS_CONTENT(properties_element))
return TRUE;
else
- for (i=0; elements_with_counter[i].element != -1; i++)
+ for (i = 0; elements_with_counter[i].element != -1; i++)
if (elements_with_counter[i].element == properties_element)
return TRUE;
}
/* check if there are elements where a score can be chosen for */
- for (i=0; elements_with_counter[i].element != -1; i++)
+ for (i = 0; elements_with_counter[i].element != -1; i++)
{
if (elements_with_counter[i].element == properties_element)
{
MapCheckbuttonGadget(i);
/* draw counter gadgets */
- for (i=ED_COUNTER_ID_CUSTOM_FIRST; i<=ED_COUNTER_ID_CUSTOM_LAST; i++)
+ for (i = ED_COUNTER_ID_CUSTOM_FIRST; i <= ED_COUNTER_ID_CUSTOM_LAST; i++)
MapCounterButtons(i);
/* draw selectbox gadgets */
MapCheckbuttonGadget(i);
/* draw counter gadgets */
- for (i=ED_COUNTER_ID_CHANGE_FIRST; i<=ED_COUNTER_ID_CHANGE_LAST; i++)
+ for (i = ED_COUNTER_ID_CHANGE_FIRST; i <= ED_COUNTER_ID_CHANGE_LAST; i++)
MapCounterButtons(i);
/* draw selectbox gadgets */
- for (i=ED_SELECTBOX_ID_CHANGE_FIRST; i<=ED_SELECTBOX_ID_CHANGE_LAST; i++)
+ for (i = ED_SELECTBOX_ID_CHANGE_FIRST; i <= ED_SELECTBOX_ID_CHANGE_LAST; i++)
MapSelectboxGadget(i);
/* draw textbutton gadgets */
- for (i=ED_TEXTBUTTON_ID_CHANGE_FIRST; i<=ED_TEXTBUTTON_ID_CHANGE_LAST; i++)
+ for (i=ED_TEXTBUTTON_ID_CHANGE_FIRST; i <= ED_TEXTBUTTON_ID_CHANGE_LAST; i++)
MapTextbuttonGadget(i);
/* draw graphicbutton gadgets */
if (from_x > to_x)
swap_numbers(&from_x, &to_x);
- for (x=from_x; x<=to_x; x++)
+ for (x = from_x; x <= to_x; x++)
DrawLineElement(x, y, element, change_level);
}
else if (from_x == to_x) /* vertical line */
if (from_y > to_y)
swap_numbers(&from_y, &to_y);
- for (y=from_y; y<=to_y; y++)
+ for (y = from_y; y <= to_y; y++)
DrawLineElement(x, y, element, change_level);
}
else /* diagonal line */
if (from_x > to_x)
swap_number_pairs(&from_x, &from_y, &to_x, &to_y);
- for (x=0; x<=len_x; x++)
+ for (x = 0; x <= len_x; x++)
{
y = (int)(a * x + 0.5) * (to_y < from_y ? -1 : +1);
DrawLineElement(from_x + x, from_y + y, element, change_level);
if (from_y > to_y)
swap_number_pairs(&from_x, &from_y, &to_x, &to_y);
- for (y=0; y<=len_y; y++)
+ for (y = 0; y <= len_y; y++)
{
x = (int)(a * y + 0.5) * (to_x < from_x ? -1 : +1);
DrawLineElement(from_x + x, from_y + y, element, change_level);
if (from_y > to_y)
swap_number_pairs(&from_x, &from_y, &to_x, &to_y);
- for (y=from_y; y<=to_y; y++)
+ for (y = from_y; y <= to_y; y++)
DrawLine(from_x, y, to_x, y, element, change_level);
}
/* not optimal (some points get drawn twice) but simple,
and fast enough for the few points we are drawing */
- for (x=0; x<=radius; x++)
+ for (x = 0; x <= radius; x++)
{
int sx, sy, lx, ly;
DrawLineElement(sx, sy, element, change_level);
}
- for (y=0; y<=radius; y++)
+ for (y = 0; y <= radius; y++)
{
int sx, sy, lx, ly;
from_lx = from_x + level_xpos;
from_ly = from_y + level_ypos;
- for (y=0; y<brush_height; y++)
+ for (y = 0; y < brush_height; y++)
{
- for (x=0; x<brush_width; x++)
+ for (x=0; x < brush_width; x++)
{
brush_buffer[x][y] = Feld[from_lx + x][from_ly + y];
return;
}
- for (y=0; y<brush_height; y++)
+ for (y = 0; y < brush_height; y++)
{
- for (x=0; x<brush_width; x++)
+ for (x = 0; x < brush_width; x++)
{
int sx = cursor_from_x + x;
int sy = cursor_from_y + y;
old_element = Feld[from_x][from_y];
Feld[from_x][from_y] = fill_element;
- for(i=0;i<4;i++)
+ for (i = 0; i < 4; i++)
{
x = from_x + check[i][0];
y = from_y + check[i][1];
undo_buffer_steps++;
}
- for(x=0; x<lev_fieldx; x++)
- for(y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
UndoBuffer[undo_buffer_position][x][y] = Feld[x][y];
/* check if drawing operation forces change of border style */
/* determine number of free positions for the new elements */
/* (maybe this statement should be formatted a bit more readable...) */
num_free_positions = 0;
- for (x=0; x<lev_fieldx; x++)
- for (y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
if ((free_position[x][y] =
((random_placement_background_restricted &&
Feld[x][y] == random_placement_background_element) ||
/* if not more free positions than elements to place, fill whole level */
if (num_elements >= num_free_positions)
{
- for (x=0; x<lev_fieldx; x++)
- for (y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
Feld[x][y] = new_element;
DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos);
int wrap_dy = lev_fieldy - dy;
int x, y;
- for(x=0; x<lev_fieldx; x++)
- for(y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
FieldBackup[x][y] = Feld[x][y];
- for(x=0; x<lev_fieldx; x++)
- for(y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
Feld[x][y] =
FieldBackup[(x + wrap_dx) % lev_fieldx][(y + wrap_dy) % lev_fieldy];
if (new_element == EL_PLAYER_1)
{
/* remove player at old position */
- for(y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for(x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
if (Feld[x][y] == EL_PLAYER_1)
{
(undo_buffer_position - 1 + NUM_UNDO_STEPS) % NUM_UNDO_STEPS;
undo_buffer_steps--;
- for(x=0; x<lev_fieldx; x++)
- for(y=0; y<lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
Feld[x][y] = UndoBuffer[undo_buffer_position][x][y];
DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos,level_ypos);
break;
edit_mode = ED_MODE_DRAWING;
}
- for(x=0; x<MAX_LEV_FIELDX; x++)
- for(y=0; y<MAX_LEV_FIELDY; y++)
+ for (x = 0; x < MAX_LEV_FIELDX; x++)
+ for (y = 0; y < MAX_LEV_FIELDY; y++)
Feld[x][y] = (button == 1 ? EL_EMPTY : new_element);
CopyLevelToUndoBuffer(GADGET_ID_CLEAR);
else if (key == KSYM_Return || key == setup.shortcut.toggle_pause)
ClickOnGadget(level_editor_gadget[GADGET_ID_TEST], button);
else
- for (i=0; i<ED_NUM_CTRL_BUTTONS; i++)
+ for (i = 0; i < ED_NUM_CTRL_BUTTONS; i++)
if (letter && letter == control_info[i].shortcut)
if (!anyTextGadgetActive())
ClickOnGadget(level_editor_gadget[i], button);
void EventLoop(void)
{
- while(1)
+ while (1)
{
if (PendingEvent()) /* got event */
{
/* simulate key release events for still pressed keys */
key_joystick_mapping = 0;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].action = 0;
}
KeyboardAutoRepeatOn();
- while(window_unmapped)
+ while (window_unmapped)
{
Event event;
static boolean bomb_placed[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE };
int pnr;
- for (pnr=0; pnr<MAX_PLAYERS; pnr++)
+ for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
{
int i;
byte key_action = 0;
custom_key = setup.input[pnr].key;
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
if (key == *key_info[i].key_custom)
key_action |= key_info[i].action;
{
int i;
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
if (key == key_info[i].key_default)
joy |= key_info[i].action;
}
{
int i;
- for (i=0; i < MAX_INVENTORY_SIZE; i++)
+ for (i = 0; i < MAX_INVENTORY_SIZE; i++)
if (local_player->inventory_size < MAX_INVENTORY_SIZE)
local_player->inventory_element[local_player->inventory_size++] =
EL_DYNAMITE;
{
int i;
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
printf("Player %d:\n", i);
printf(" jx == %d, jy == %d\n",
int i;
int result = 0;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
byte joy_action = 0;
change->random = 100;
change->power = CP_NON_DESTRUCTIVE;
- for(x=0; x<3; x++)
- for(y=0; y<3; y++)
+ for (x = 0; x < 3; x++)
+ for (y = 0; y < 3; y++)
change->content[x][y] = EL_EMPTY_SPACE;
change->direct_action = 0;
level->fieldx = STD_LEV_FIELDX;
level->fieldy = STD_LEV_FIELDY;
- for(x=0; x<MAX_LEV_FIELDX; x++)
- for(y=0; y<MAX_LEV_FIELDY; y++)
+ for (x = 0; x < MAX_LEV_FIELDX; x++)
+ for (y = 0; y < MAX_LEV_FIELDY; y++)
level->field[x][y] = EL_SAND;
level->time = 100;
level->use_custom_template = FALSE;
- for(i=0; i<MAX_LEVEL_NAME_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
level->name[i] = '\0';
- for(i=0; i<MAX_LEVEL_AUTHOR_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_AUTHOR_LEN; i++)
level->author[i] = '\0';
strcpy(level->name, NAMELESS_LEVEL_NAME);
strcpy(level->author, ANONYMOUS_NAME);
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
level->envelope_text[i][0] = '\0';
level->envelope_xsize[i] = MAX_ENVELOPE_XSIZE;
level->envelope_ysize[i] = MAX_ENVELOPE_YSIZE;
}
- for(i=0; i<LEVEL_SCORE_ELEMENTS; i++)
+ for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
level->score[i] = 10;
level->num_yamyam_contents = STD_ELEMENT_CONTENTS;
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(x=0; x<3; x++)
- for(y=0; y<3; y++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (x = 0; x < 3; x++)
+ for (y = 0; y < 3; y++)
level->yamyam_content[i][x][y] =
(i < STD_ELEMENT_CONTENTS ? EL_ROCK : EL_EMPTY);
level->field[0][0] = EL_PLAYER_1;
level->field[STD_LEV_FIELDX - 1][STD_LEV_FIELDY - 1] = EL_EXIT_CLOSED;
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
setElementChangePages(&element_info[i], 1);
setElementChangeInfoToDefaults(element_info[i].change);
}
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
- for(j=0; j < MAX_ELEMENT_NAME_LEN + 1; j++)
+ for (j = 0; j < MAX_ELEMENT_NAME_LEN + 1; j++)
element_info[element].description[j] = '\0';
if (element_info[element].custom_description != NULL)
strncpy(element_info[element].description,
element_info[element].slippery_type = SLIPPERY_ANY_RANDOM;
- for(x=0; x<3; x++)
- for(y=0; y<3; y++)
+ for (x = 0; x < 3; x++)
+ for (y = 0; y < 3; y++)
element_info[element].content[x][y] = EL_EMPTY_SPACE;
element_info[element].access_type = 0;
element_info[element].current_change_page = 0;
/* start with no properties at all */
- for (j=0; j < NUM_EP_BITFIELDS; j++)
+ for (j = 0; j < NUM_EP_BITFIELDS; j++)
Properties[element][j] = EP_BITMASK_DEFAULT;
element_info[element].modified_settings = FALSE;
level->time = getFile16BitBE(file);
level->gems_needed = getFile16BitBE(file);
- for(i=0; i<MAX_LEVEL_NAME_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
level->name[i] = getFile8Bit(file);
level->name[MAX_LEVEL_NAME_LEN] = 0;
- for(i=0; i<LEVEL_SCORE_ELEMENTS; i++)
+ for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
level->score[i] = getFile8Bit(file);
level->num_yamyam_contents = STD_ELEMENT_CONTENTS;
- for(i=0; i<STD_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < STD_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
level->yamyam_content[i][x][y] = checkLevelElement(getFile8Bit(file));
level->amoeba_speed = getFile8Bit(file);
{
int i;
- for(i=0; i<MAX_LEVEL_AUTHOR_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_AUTHOR_LEN; i++)
level->author[i] = getFile8Bit(file);
level->author[MAX_LEVEL_NAME_LEN] = 0;
return chunk_size_expected;
}
- for(y=0; y<level->fieldy; y++)
- for(x=0; x<level->fieldx; x++)
+ for (y = 0; y < level->fieldy; y++)
+ for (x = 0; x < level->fieldx; x++)
level->field[x][y] =
checkLevelElement(level->encoding_16bit_field ? getFile16BitBE(file) :
getFile8Bit(file));
level->num_yamyam_contents > MAX_ELEMENT_CONTENTS)
level->num_yamyam_contents = STD_ELEMENT_CONTENTS;
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
level->yamyam_content[i][x][y] =
checkLevelElement(level->encoding_16bit_field ?
getFile16BitBE(file) : getFile8Bit(file));
ReadUnusedBytesFromFile(file, LEVEL_CHUNK_CNT2_UNUSED);
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
content_array[i][x][y] = checkLevelElement(getFile16BitBE(file));
/* correct invalid number of content fields -- should never happen */
{
level->num_yamyam_contents = num_contents;
- for(i=0; i<num_contents; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < num_contents; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
level->yamyam_content[i][x][y] = content_array[i][x][y];
}
else if (element == EL_BD_AMOEBA)
return chunk_size_expected;
}
- for(i=0; i < envelope_len; i++)
+ for (i = 0; i < envelope_len; i++)
level->envelope_text[envelope_nr][i] = getFile8Bit(file);
return chunk_size;
return chunk_size_expected;
}
- for (i=0; i < num_changed_custom_elements; i++)
+ for (i = 0; i < num_changed_custom_elements; i++)
{
int element = getFile16BitBE(file);
int properties = getFile32BitBE(file);
return chunk_size_expected;
}
- for (i=0; i < num_changed_custom_elements; i++)
+ for (i = 0; i < num_changed_custom_elements; i++)
{
int element = getFile16BitBE(file);
int custom_target_element = getFile16BitBE(file);
return chunk_size_expected;
}
- for (i=0; i < num_changed_custom_elements; i++)
+ for (i = 0; i < num_changed_custom_elements; i++)
{
int element = getFile16BitBE(file);
element = EL_DUMMY;
}
- for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ for (j = 0; j < MAX_ELEMENT_NAME_LEN; j++)
element_info[element].description[j] = getFile8Bit(file);
element_info[element].description[MAX_ELEMENT_NAME_LEN] = 0;
element_info[element].move_direction_initial = getFile8Bit(file);
element_info[element].move_stepsize = getFile8Bit(file);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
element_info[element].content[x][y] =
checkLevelElement(getFile16BitBE(file));
element_info[element].change->random = getFile8Bit(file);
element_info[element].change->power = getFile8Bit(file);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
element_info[element].change->content[x][y] =
checkLevelElement(getFile16BitBE(file));
ei = &element_info[element];
- for(i=0; i < MAX_ELEMENT_NAME_LEN; i++)
+ for (i = 0; i < MAX_ELEMENT_NAME_LEN; i++)
ei->description[i] = getFile8Bit(file);
ei->description[MAX_ELEMENT_NAME_LEN] = 0;
ei->slippery_type = getFile8Bit(file);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
ei->content[x][y] = checkLevelElement(getFile16BitBE(file));
/* some free bytes for future custom property values and padding */
setElementChangePages(ei, ei->num_change_pages);
- for (i=0; i < ei->num_change_pages; i++)
+ for (i = 0; i < ei->num_change_pages; i++)
{
struct ElementChangeInfo *change = &ei->change_page[i];
change->random = getFile8Bit(file);
change->power = getFile8Bit(file);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
change->content[x][y] = checkLevelElement(getFile16BitBE(file));
change->can_change = getFile8Bit(file);
(these following values were accidentally changed in version 3.0.1) */
if (level->game_version <= VERSION_IDENT(3,0,0,0))
{
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
/* order of checking and copying events to be mapped is important */
- for (j=CE_BY_OTHER_ACTION; j >= CE_BY_PLAYER; j--)
+ for (j = CE_BY_OTHER_ACTION; j >= CE_BY_PLAYER; j--)
{
if (HAS_CHANGE_EVENT(element, j - 2))
{
}
/* order of checking and copying events to be mapped is important */
- for (j=CE_OTHER_GETS_COLLECTED; j >= CE_COLLISION; j--)
+ for (j = CE_OTHER_GETS_COLLECTED; j >= CE_COLLISION; j--)
{
if (HAS_CHANGE_EVENT(element, j - 1))
{
}
/* some custom element change events get mapped since version 3.0.3 */
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
/* initialize "can_change" field for old levels with only one change page */
if (level->game_version <= VERSION_IDENT(3,0,2,0))
{
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
}
/* set uninitialized push delay values of custom elements in older levels */
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
int x, y;
/* map elements that have changed in newer versions */
- for(y=0; y<level->fieldy; y++)
+ for (y = 0; y < level->fieldy; y++)
{
- for(x=0; x<level->fieldx; x++)
+ for (x = 0; x < level->fieldx; x++)
{
int element = level->field[x][y];
}
/* copy elements to runtime playfield array */
- for(x=0; x<MAX_LEV_FIELDX; x++)
- for(y=0; y<MAX_LEV_FIELDY; y++)
+ for (x = 0; x < MAX_LEV_FIELDX; x++)
+ for (y = 0; y < MAX_LEV_FIELDY; y++)
Feld[x][y] = level->field[x][y];
/* initialize level size variables for faster access */
putFile16BitBE(file, level->time);
putFile16BitBE(file, level->gems_needed);
- for(i=0; i<MAX_LEVEL_NAME_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
putFile8Bit(file, level->name[i]);
- for(i=0; i<LEVEL_SCORE_ELEMENTS; i++)
+ for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
putFile8Bit(file, level->score[i]);
- for(i=0; i<STD_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < STD_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile8Bit(file, (level->encoding_16bit_yamyam ? EL_EMPTY :
level->yamyam_content[i][x][y]));
putFile8Bit(file, level->amoeba_speed);
{
int i;
- for(i=0; i<MAX_LEVEL_AUTHOR_LEN; i++)
+ for (i = 0; i < MAX_LEVEL_AUTHOR_LEN; i++)
putFile8Bit(file, level->author[i]);
}
{
int x, y;
- for(y=0; y<level->fieldy; y++)
- for(x=0; x<level->fieldx; x++)
+ for (y = 0; y < level->fieldy; y++)
+ for (x = 0; x < level->fieldx; x++)
if (level->encoding_16bit_field)
putFile16BitBE(file, level->field[x][y]);
else
putFile8Bit(file, 0);
putFile8Bit(file, 0);
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
if (level->encoding_16bit_field)
putFile16BitBE(file, level->yamyam_content[i][x][y]);
else
content_xsize = 3;
content_ysize = 3;
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
content_array[i][x][y] = level->yamyam_content[i][x][y];
}
else if (element == EL_BD_AMOEBA)
content_xsize = 1;
content_ysize = 1;
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
content_array[i][x][y] = EL_EMPTY;
content_array[0][0][0] = level->amoeba_content;
}
WriteUnusedBytesToFile(file, LEVEL_CHUNK_CNT2_UNUSED);
- for(i=0; i<MAX_ELEMENT_CONTENTS; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile16BitBE(file, content_array[i][x][y]);
}
WriteUnusedBytesToFile(file, LEVEL_CHUNK_CNT3_UNUSED);
- for(i=0; i < envelope_len; i++)
+ for (i = 0; i < envelope_len; i++)
putFile8Bit(file, level->envelope_text[envelope_nr][i]);
}
putFile16BitBE(file, num_changed_custom_elements);
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
putFile16BitBE(file, num_changed_custom_elements);
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
putFile16BitBE(file, num_changed_custom_elements);
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
{
putFile16BitBE(file, element);
- for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ for (j = 0; j < MAX_ELEMENT_NAME_LEN; j++)
putFile8Bit(file, element_info[element].description[j]);
putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]);
putFile8Bit(file, element_info[element].move_direction_initial);
putFile8Bit(file, element_info[element].move_stepsize);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile16BitBE(file, element_info[element].content[x][y]);
putFile32BitBE(file, element_info[element].change->events);
putFile8Bit(file, element_info[element].change->random);
putFile8Bit(file, element_info[element].change->power);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile16BitBE(file, element_info[element].change->content[x][y]);
putFile8Bit(file, element_info[element].slippery_type);
putFile16BitBE(file, element);
- for(i=0; i < MAX_ELEMENT_NAME_LEN; i++)
+ for (i = 0; i < MAX_ELEMENT_NAME_LEN; i++)
putFile8Bit(file, ei->description[i]);
putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]);
putFile8Bit(file, ei->slippery_type);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile16BitBE(file, ei->content[x][y]);
/* some free bytes for future custom property values and padding */
/* write change property values */
- for (i=0; i < ei->num_change_pages; i++)
+ for (i = 0; i < ei->num_change_pages; i++)
{
struct ElementChangeInfo *change = &ei->change_page[i];
putFile8Bit(file, change->random);
putFile8Bit(file, change->power);
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
putFile16BitBE(file, change->content[x][y]);
putFile8Bit(file, change->can_change);
/* check level field for 16-bit elements */
level->encoding_16bit_field = FALSE;
- for(y=0; y<level->fieldy; y++)
- for(x=0; x<level->fieldx; x++)
+ for (y = 0; y < level->fieldy; y++)
+ for (x = 0; x < level->fieldx; x++)
if (level->field[x][y] > 255)
level->encoding_16bit_field = TRUE;
/* check yamyam content for 16-bit elements */
level->encoding_16bit_yamyam = FALSE;
- for(i=0; i<level->num_yamyam_contents; i++)
- for(y=0; y<3; y++)
- for(x=0; x<3; x++)
+ for (i = 0; i < level->num_yamyam_contents; i++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
if (level->yamyam_content[i][x][y] > 255)
level->encoding_16bit_yamyam = TRUE;
}
/* check for envelope content */
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
if (strlen(level->envelope_text[i]) > 0)
{
/* check for non-default custom elements (unless using template level) */
if (!level->use_custom_template)
{
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
/* default values (also for pre-1.2 tapes) with only the first player */
tape.player_participates[0] = TRUE;
- for(i=1; i<MAX_PLAYERS; i++)
+ for (i = 1; i < MAX_PLAYERS; i++)
tape.player_participates[i] = FALSE;
/* at least one (default: the first) player participates in every tape */
/* since version 1.2, tapes store which players participate in the tape */
tape->num_participating_players = 0;
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
tape->player_participates[i] = FALSE;
tape->level_identifier =
checked_realloc(tape->level_identifier, level_identifier_size);
- for(i=0; i < level_identifier_size; i++)
+ for (i = 0; i < level_identifier_size; i++)
tape->level_identifier[i] = getFile8Bit(file);
tape->level_nr = getFile16BitBE(file);
return chunk_size_expected;
}
- for(i=0; i<tape->length; i++)
+ for (i = 0; i < tape->length; i++)
{
if (i >= MAX_TAPELEN)
break;
- for(j=0; j<MAX_PLAYERS; j++)
+ for (j = 0; j < MAX_PLAYERS; j++)
{
tape->pos[i].action[j] = MV_NO_MOVING;
byte action = tape->pos[i].action[0];
int k, num_moves = 0;
- for (k=0; k<4; k++)
+ for (k = 0; k<4; k++)
{
if (action & joy_dir[k])
{
tape->pos[i + 1].delay = 1;
/* delay part */
- for(j=0; j<MAX_PLAYERS; j++)
+ for (j = 0; j < MAX_PLAYERS; j++)
tape->pos[i].action[j] = MV_NO_MOVING;
tape->pos[i].delay--;
byte store_participating_players = 0;
/* set bits for participating players for compact storage */
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (tape->player_participates[i])
store_participating_players |= (1 << i);
putFile16BitBE(file, level_identifier_size);
- for(i=0; i < level_identifier_size; i++)
+ for (i = 0; i < level_identifier_size; i++)
putFile8Bit(file, tape->level_identifier[i]);
putFile16BitBE(file, tape->level_nr);
{
int i, j;
- for(i=0; i<tape->length; i++)
+ for (i = 0; i < tape->length; i++)
{
- for(j=0; j<MAX_PLAYERS; j++)
+ for (j = 0; j < MAX_PLAYERS; j++)
if (tape->player_participates[j])
putFile8Bit(file, tape->pos[i].action[j]);
tape.game_version = GAME_VERSION_ACTUAL;
/* count number of participating players */
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (tape.player_participates[i])
num_participating_players++;
printf("Level series identifier: '%s'\n", tape->level_identifier);
printf_line("-", 79);
- for(i=0; i<tape->length; i++)
+ for (i = 0; i < tape->length; i++)
{
if (i >= MAX_TAPELEN)
break;
printf("%03d: ", i);
- for(j=0; j<MAX_PLAYERS; j++)
+ for (j = 0; j < MAX_PLAYERS; j++)
{
if (tape->player_participates[j])
{
FILE *file;
/* always start with reliable default values */
- for(i=0; i<MAX_SCORE_ENTRIES; i++)
+ for (i = 0; i < MAX_SCORE_ENTRIES; i++)
{
strcpy(highscore[i].Name, EMPTY_PLAYER_NAME);
highscore[i].Score = 0;
return;
}
- for(i=0; i<MAX_SCORE_ENTRIES; i++)
+ for (i = 0; i < MAX_SCORE_ENTRIES; i++)
{
fscanf(file, "%d", &highscore[i].Score);
fgets(line, MAX_LINE_LEN, file);
fprintf(file, "%s\n\n", SCORE_COOKIE);
- for(i=0; i<MAX_SCORE_ENTRIES; i++)
+ for (i = 0; i < MAX_SCORE_ENTRIES; i++)
fprintf(file, "%d %s\n", highscore[i].Score, highscore[i].Name);
fclose(file);
si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME;
si->shortcut.toggle_pause = DEFAULT_KEY_TOGGLE_PAUSE;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
si->input[i].use_joystick = FALSE;
si->input[i].joy.device_name=getStringCopy(getDeviceNameFromJoystickNr(i));
/* global setup */
si = setup;
- for (i=0; i<NUM_GLOBAL_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_GLOBAL_SETUP_TOKENS; i++)
setSetupInfo(global_setup_tokens, i,
getHashEntry(setup_file_hash, global_setup_tokens[i].text));
setup = si;
/* editor setup */
sei = setup.editor;
- for (i=0; i<NUM_EDITOR_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_EDITOR_SETUP_TOKENS; i++)
setSetupInfo(editor_setup_tokens, i,
getHashEntry(setup_file_hash,editor_setup_tokens[i].text));
setup.editor = sei;
/* shortcut setup */
ssi = setup.shortcut;
- for (i=0; i<NUM_SHORTCUT_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_SHORTCUT_SETUP_TOKENS; i++)
setSetupInfo(shortcut_setup_tokens, i,
getHashEntry(setup_file_hash,shortcut_setup_tokens[i].text));
setup.shortcut = ssi;
/* player setup */
- for (pnr=0; pnr<MAX_PLAYERS; pnr++)
+ for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
{
char prefix[30];
sprintf(prefix, "%s%d", TOKEN_STR_PLAYER_PREFIX, pnr + 1);
sii = setup.input[pnr];
- for (i=0; i<NUM_PLAYER_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_PLAYER_SETUP_TOKENS; i++)
{
char full_token[100];
/* system setup */
syi = setup.system;
- for (i=0; i<NUM_SYSTEM_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_SYSTEM_SETUP_TOKENS; i++)
setSetupInfo(system_setup_tokens, i,
getHashEntry(setup_file_hash, system_setup_tokens[i].text));
setup.system = syi;
/* options setup */
soi = setup.options;
- for (i=0; i<NUM_OPTIONS_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_OPTIONS_SETUP_TOKENS; i++)
setSetupInfo(options_setup_tokens, i,
getHashEntry(setup_file_hash, options_setup_tokens[i].text));
setup.options = soi;
/* global setup */
si = setup;
- for (i=0; i<NUM_GLOBAL_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_GLOBAL_SETUP_TOKENS; i++)
{
/* just to make things nicer :) */
if (i == SETUP_TOKEN_PLAYER_NAME + 1 ||
/* editor setup */
sei = setup.editor;
fprintf(file, "\n");
- for (i=0; i<NUM_EDITOR_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_EDITOR_SETUP_TOKENS; i++)
fprintf(file, "%s\n", getSetupLine(editor_setup_tokens, "", i));
/* shortcut setup */
ssi = setup.shortcut;
fprintf(file, "\n");
- for (i=0; i<NUM_SHORTCUT_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_SHORTCUT_SETUP_TOKENS; i++)
fprintf(file, "%s\n", getSetupLine(shortcut_setup_tokens, "", i));
/* player setup */
- for (pnr=0; pnr<MAX_PLAYERS; pnr++)
+ for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
{
char prefix[30];
fprintf(file, "\n");
sii = setup.input[pnr];
- for (i=0; i<NUM_PLAYER_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_PLAYER_SETUP_TOKENS; i++)
fprintf(file, "%s\n", getSetupLine(player_setup_tokens, prefix, i));
}
/* system setup */
syi = setup.system;
fprintf(file, "\n");
- for (i=0; i<NUM_SYSTEM_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_SYSTEM_SETUP_TOKENS; i++)
fprintf(file, "%s\n", getSetupLine(system_setup_tokens, "", i));
/* options setup */
soi = setup.options;
fprintf(file, "\n");
- for (i=0; i<NUM_OPTIONS_SETUP_TOKENS; i++)
+ for (i = 0; i < NUM_OPTIONS_SETUP_TOKENS; i++)
fprintf(file, "%s\n", getSetupLine(options_setup_tokens, "", i));
fclose(file);
SetupFileHash *setup_file_hash;
int i;
- for (i=0; i<NUM_FILE_ELEMENTS; i++)
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
{
if (element_info[i].custom_description != NULL)
{
if ((setup_file_hash = loadSetupFileHash(filename)) == NULL)
return;
- for (i=0; i<NUM_FILE_ELEMENTS; i++)
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
{
char *token = getStringCat2(element_info[i].token_name, ".name");
char *value = getHashEntry(setup_file_hash, token);
int i, j;
/* always start with reliable default values from default config */
- for (i=0; image_config_vars[i].token != NULL; i++)
- for (j=0; image_config[j].token != NULL; j++)
+ for (i = 0; image_config_vars[i].token != NULL; i++)
+ for (j = 0; image_config[j].token != NULL; j++)
if (strcmp(image_config_vars[i].token, image_config[j].token) == 0)
*image_config_vars[i].value =
get_auto_parameter_value(image_config_vars[i].token,
return;
/* special case: initialize with default values that may be overwritten */
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
{
char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset");
char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset");
}
/* read (and overwrite with) values that may be specified in config file */
- for (i=0; image_config_vars[i].token != NULL; i++)
+ for (i = 0; image_config_vars[i].token != NULL; i++)
{
char *value = getHashEntry(setup_file_hash, image_config_vars[i].token);
element_hash = newSetupFileHash();
- for (i=0; i < NUM_FILE_ELEMENTS; i++)
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
setHashEntry(element_hash, element_info[i].token_name, itoa(i));
/* determined size may be larger than needed (due to unknown elements) */
#if 0
/* TEST-ONLY */
- for (i=0; i < *num_elements; i++)
+ for (i = 0; i < *num_elements; i++)
printf("editor: element '%s' [%d]\n",
element_info[(*elements)[i]].token_name, (*elements)[i]);
#endif
new = &music_file_info;
- for (i=0; i < num_music; i++)
+ for (i = 0; i < num_music; i++)
{
music = getMusicListEntry(i);
boolean music_already_used = FALSE;
int i;
- for (i=0; i < num_music; i++)
+ for (i = 0; i < num_music; i++)
{
music = getMusicListEntry(i);
newSetupFileList(helpanim_config[0].token,
helpanim_config[0].value);
- for (i=1; helpanim_config[i].token; i++)
+ for (i = 1; helpanim_config[i].token; i++)
insert_ptr = addListEntry(insert_ptr,
helpanim_config[i].token,
helpanim_config[i].value);
action_hash = newSetupFileHash();
direction_hash = newSetupFileHash();
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
setHashEntry(element_hash, element_info[i].token_name, itoa(i));
- for (i=0; i < NUM_ACTIONS; i++)
+ for (i = 0; i < NUM_ACTIONS; i++)
setHashEntry(action_hash, element_action_info[i].suffix,
itoa(element_action_info[i].value));
/* do not store direction index (bit) here, but direction value! */
- for (i=0; i < NUM_DIRECTIONS; i++)
+ for (i = 0; i < NUM_DIRECTIONS; i++)
setHashEntry(direction_hash, element_direction_info[i].suffix,
itoa(1 << element_direction_info[i].value));
#if 0
/* TEST ONLY */
- for (i=0; i < num_list_entries; i++)
+ for (i = 0; i < num_list_entries; i++)
printf("::: %d, %d, %d => %d\n",
helpanim_info[i].element,
helpanim_info[i].action,
/* use reliable default values from static configuration */
helptext_info = newSetupFileHash();
- for (i=0; helptext_config[i].token; i++)
+ for (i = 0; helptext_config[i].token; i++)
setHashEntry(helptext_info,
helptext_config[i].token,
helptext_config[i].value);
{
int i, j;
- for (i=0; i<MAX_PLAYERS; i++)
- for (j=0; j<4; j++)
+ for (i = 0; i < MAX_PLAYERS; i++)
+ for (j = 0; j < 4; j++)
if (stored_player[i].key[j])
DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS,
el2edimg(EL_KEY_1 + j));
/* ---------- initialize changing elements ------------------------------- */
/* initialize changing elements information */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
struct ElementInfo *ei = &element_info[i];
}
ei->change_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];
}
/* 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];
#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) &&
#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;
/* ---------- initialize trigger events ---------------------------------- */
/* initialize trigger events information */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
trigger_events[i] = EP_BITMASK_DEFAULT;
#if 1
/* add trigger events from element change event properties */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
struct ElementInfo *ei = &element_info[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;
}
#else
/* add trigger events from element change event properties */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
if (HAS_CHANGE_EVENT(i, CE_BY_OTHER_ACTION))
trigger_events[element_info[i].change->trigger_element] |=
element_info[i].change->events;
/* ---------- initialize push delay -------------------------------------- */
/* initialize push delay values to default */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
if (!IS_CUSTOM_ELEMENT(i))
{
}
/* set push delay value for certain elements from pre-defined list */
- for (i=0; push_delay_list[i].element != EL_UNDEFINED; i++)
+ for (i = 0; push_delay_list[i].element != EL_UNDEFINED; i++)
{
int e = push_delay_list[i].element;
/* ---------- initialize move stepsize ----------------------------------- */
/* initialize move stepsize values to default */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
if (!IS_CUSTOM_ELEMENT(i))
element_info[i].move_stepsize = MOVE_STEPSIZE_NORMAL;
/* set move stepsize value for certain elements from pre-defined list */
- for (i=0; move_stepsize_list[i].element != EL_UNDEFINED; i++)
+ for (i = 0; move_stepsize_list[i].element != EL_UNDEFINED; i++)
{
int e = move_stepsize_list[i].element;
/* ---------- initialize gem count --------------------------------------- */
/* initialize gem count values for each element */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
if (!IS_CUSTOM_ELEMENT(i))
element_info[i].collect_count = 0;
/* add gem count values for all elements from pre-defined list */
- for (i=0; collect_count_list[i].element != EL_UNDEFINED; i++)
+ for (i = 0; collect_count_list[i].element != EL_UNDEFINED; i++)
element_info[collect_count_list[i].element].collect_count =
collect_count_list[i].count;
}
/* don't play tapes over network */
network_playing = (options.network && !tape.playing);
- for (i=0; i < MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
player->lights_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;
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;
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;
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; i<MAX_NUM_AMOEBA; i++)
+ for (i = 0; i < MAX_NUM_AMOEBA; i++)
AmoebaCnt[i] = AmoebaCnt2[i] = 0;
- for (x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
- for (y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
Feld[x][y] = level.field[x][y];
MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0;
}
}
- for(y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for(x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
if (emulate_bd && !IS_BD_ELEMENT(Feld[x][y]))
emulate_bd = FALSE;
emulate_sp ? EMU_SUPAPLEX : EMU_NONE);
/* correct non-moving belts to start moving left */
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
if (game.belt_dir[i] == MV_NO_MOVING)
game.belt_dir_nr[i] = 3; /* not moving, next moving left */
/* check if any connected player was not found in playfield */
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
if (player->connected && !player->present)
{
- for (j=0; j<MAX_PLAYERS; j++)
+ for (j = 0; j < MAX_PLAYERS; j++)
{
struct PlayerInfo *some_player = &stored_player[j];
int jx = some_player->jx, jy = some_player->jy;
{
/* when playing a tape, eliminate all players who do not participate */
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
if (stored_player[i].active && !tape.player_participates[i])
{
{
/* when in single player mode, eliminate all but the first active player */
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
if (stored_player[i].active)
{
- for (j=i+1; j<MAX_PLAYERS; j++)
+ for (j = i + 1; j < MAX_PLAYERS; j++)
{
if (stored_player[j].active)
{
/* when recording the game, store which players take part in the game */
if (tape.recording)
{
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (stored_player[i].active)
tape.player_participates[i] = TRUE;
}
if (options.debug)
{
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
int found_rating = 0;
int found_element = EL_UNDEFINED;
- for(y=0; y < lev_fieldy; y++) for(x=0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
int element = Feld[x][y];
int content;
if (CAN_CHANGE(element))
{
- for (i=0; i < element_info[element].num_change_pages; i++)
+ for (i = 0; i < element_info[element].num_change_pages; i++)
{
content = element_info[element].change_page[i].target_element;
is_player = ELEM_IS_PLAYER(content);
}
}
- for(yy=0; yy < 3; yy++) for(xx=0; xx < 3; xx++)
+ for (yy = 0; yy < 3; yy++) for (xx = 0; xx < 3; xx++)
{
content = element_info[element].content[xx][yy];
is_player = ELEM_IS_PLAYER(content);
if (!CAN_CHANGE(element))
continue;
- for (i=0; i < element_info[element].num_change_pages; i++)
+ for (i = 0; i < element_info[element].num_change_pages; i++)
{
content = element_info[element].change_page[i].content[xx][yy];
is_player = ELEM_IS_PLAYER(content);
if (options.debug)
{
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
printf("Player %d %sactive.\n",
i + 1, (stored_player[i].active ? "" : "not "));
}
else if (element_info[element].move_pattern == MV_ALONG_LEFT_SIDE ||
element_info[element].move_pattern == MV_ALONG_RIGHT_SIDE)
{
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int x1 = x + xy[i][0];
int y1 = y + xy[i][1];
element != EL_BD_FIREFLY)
break;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int x1 = x + xy[i][0];
int y1 = y + xy[i][1];
if (group_nr == 0)
{
- for (i=1; i<MAX_NUM_AMOEBA; i++)
+ for (i = 1; i < MAX_NUM_AMOEBA; i++)
{
if (AmoebaCnt[i] == 0)
{
local_player->score < highscore[MAX_SCORE_ENTRIES - 1].Score)
return -1;
- for (k=0; k<MAX_SCORE_ENTRIES; k++)
+ for (k = 0; k < MAX_SCORE_ENTRIES; k++)
{
if (local_player->score > highscore[k].Score)
{
int m = MAX_SCORE_ENTRIES - 1;
#ifdef ONE_PER_NAME
- for (l=k; l<MAX_SCORE_ENTRIES; l++)
+ for (l = k; l < MAX_SCORE_ENTRIES; l++)
if (!strcmp(setup.player_name, highscore[l].Name))
m = l;
if (m == k) /* player's new highscore overwrites his old one */
goto put_into_list;
#endif
- for (l=m; l>k; l--)
+ for (l = m; l > k; l--)
{
strcpy(highscore[l].Name, highscore[l - 1].Name);
highscore[l].Score = highscore[l - 1].Score;
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;
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];
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);
}
}
- for(y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for(x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
int element = Feld[x][y];
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
if (IS_BELT(element) && game.belt_dir[i] != MV_NO_MOVING)
{
belt_dir_nr = 1;
/* set frame order for belt animation graphic according to belt direction */
- for (i=0; i<3; i++)
+ for (i = 0; i < 3; i++)
{
int element = belt_base_active_element[belt_nr] + i;
int graphic = el2img(element);
graphic_info[graphic].anim_mode |= ANIM_REVERSE;
}
- for (yy=0; yy<lev_fieldy; yy++)
+ for (yy = 0; yy < lev_fieldy; yy++)
{
- for (xx=0; xx<lev_fieldx; xx++)
+ for (xx = 0; xx < lev_fieldx; xx++)
{
int element = Feld[xx][yy];
game.switchgate_pos = !game.switchgate_pos;
- for (yy=0; yy<lev_fieldy; yy++)
+ for (yy = 0; yy < lev_fieldy; yy++)
{
- for (xx=0; xx<lev_fieldx; xx++)
+ for (xx = 0; xx < lev_fieldx; xx++)
{
int element = Feld[xx][yy];
{
int x, y;
- for (y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for (x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
int element = Feld[x][y];
game.timegate_time_left = level.time_timegate * FRAMES_PER_SECOND;
- for (yy=0; yy<lev_fieldy; yy++)
+ for (yy = 0; yy < lev_fieldy; yy++)
{
- for (xx=0; xx<lev_fieldx; xx++)
+ for (xx = 0; xx < lev_fieldx; xx++)
{
int element = Feld[xx][yy];
EL_BD_MAGIC_WALL_ACTIVE);
/* activate magic wall / mill */
- 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] == smashed)
Feld[xx][yy] = activated_magic_wall;
{
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
int jx = player->jx, jy = player->jy;
{ 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];
{
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
int jx = player->jx, jy = player->jy;
{
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
PlayLevelSoundActionIfLoop(x, y, ACTION_ATTACKING);
- for (i=1; i <= 3; i++)
+ for (i = 1; i <= 3; i++)
{
int xx = x + i * dx;
int yy = y + i * dy;
{ 0, +1 }
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int x = ax + xy[i][0];
int y = ay + xy[i][1];
if (new_group_nr == 0)
return;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
x = ax + xy[i][0];
y = ay + xy[i][1];
AmoebaCnt2[new_group_nr] += AmoebaCnt2[old_group_nr];
AmoebaCnt2[old_group_nr] = 0;
- for (yy=0; yy<lev_fieldy; yy++)
+ for (yy = 0; yy < lev_fieldy; yy++)
{
- for (xx=0; xx<lev_fieldx; xx++)
+ for (xx = 0; xx < lev_fieldx; xx++)
{
if (AmoebaNr[xx][yy] == old_group_nr)
AmoebaNr[xx][yy] = new_group_nr;
}
#endif
- for (y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for (x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
if (Feld[x][y] == EL_AMOEBA_DEAD && AmoebaNr[x][y] == group_nr)
{
{ 0, +1 }
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
x = ax + xy[i][0];
y = ay + xy[i][1];
}
#endif
- for (y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for (x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
if (AmoebaNr[x][y] == group_nr &&
(Feld[x][y] == EL_AMOEBA_DEAD ||
int start = RND(4);
boolean waiting_for_player = FALSE;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int j = (start + i) % 4;
int x = ax + xy[j][0];
return;
}
- for (y1=-1; y1<2; y1++) for(x1=-1; x1<2; x1++)
+ for (y1 = -1; y1 < 2; y1++) for (x1 = -1; x1 < 2; x1++)
{
int xx = ax+x1, yy = ay+y1;
int nachbarn = 0;
if (!IN_LEV_FIELD(xx, yy))
continue;
- for (y2=-1; y2<2; y2++) for (x2=-1; x2<2; x2++)
+ for (y2 = -1; y2 < 2; y2++) for (x2 = -1; x2 < 2; x2++)
{
int x = xx+x2, y = yy+y2;
{
int x, y;
- for (y=0; y<lev_fieldy; y++)
+ for (y = 0; y < lev_fieldy; y++)
{
- for (x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
int element = Feld[x][y];
{ 0, +1 }
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
- for (j=0; j<4; j++)
+ for (j = 0; j < 4; j++)
{
int xx = x + j*xy[i][0], yy = y + j*xy[i][1];
if (!dragon_found)
{
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
- for (j=0; j<3; j++)
+ for (j = 0; j < 3; j++)
{
int xx = x + j*xy[i][0], yy = y + j*xy[i][1];
{ 0, +1 }
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0], yy = y + xy[i][1];
boolean can_change[3][3];
int xx, yy;
- for (yy = 0; yy < 3; yy++) for(xx = 0; xx < 3 ; xx++)
+ for (yy = 0; yy < 3; yy++) for (xx = 0; xx < 3 ; xx++)
{
boolean half_destructible;
int ex = x + xx - 1;
RND(100) < change->random)
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;
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;
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];
if (!change_element)
continue;
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
#if 0
if (x == lx && y == ly) /* do not change trigger element itself */
recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
summarized_player_action |= stored_player[i].action;
if (!options.network && !setup.team_mode)
local_player->effective_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;
FrameCounter++;
TimeFrames++;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].Frame++;
#endif
#if 1
if (game.engine_version < VERSION_IDENT(2,2,0,7))
{
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
int x = player->jx;
}
#endif
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
Changed[x][y] = CE_BITMASK_DEFAULT;
ChangeEvent[x][y] = CE_BITMASK_DEFAULT;
#endif
}
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
element = Feld[x][y];
#if 1
{
game.explosions_delayed = FALSE;
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
element = Feld[x][y];
game.magic_wall_time_left--;
if (!game.magic_wall_time_left)
{
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
{
element = Feld[x][y];
CloseAllOpenTimegates();
}
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
TimeFrames = 0;
TimePlayed++;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
struct PlayerInfo *player = &stored_player[i];
DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
if (!TimeLeft && setup.time_limit)
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
KillHero(&stored_player[i]);
}
else if (level.time == 0 && !AllPlayersGone) /* level without time limit */
FrameCounter++;
TimeFrames++;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
int move_frames =
MOVE_DELAY_NORMAL_SPEED / stored_player[i].move_delay_value;
int min_x = x, min_y = y, max_x = x, max_y = y;
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
int jx = stored_player[i].jx, jy = stored_player[i].jy;
{
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
int jx = stored_player[i].jx, jy = stored_player[i].jy;
if (dx)
{
x = (dx == 1 ? BX1 : BX2);
- for (y=BY1; y <= BY2; y++)
+ for (y = BY1; y <= BY2; y++)
DrawScreenField(x, y);
}
if (dy)
{
y = (dy == 1 ? BY1 : BY2);
- for (x=BX1; x <= BX2; x++)
+ for (x = BX1; x <= BX2; x++)
DrawScreenField(x, y);
}
int center_element = Feld[x][y]; /* should always be non-moving! */
int i;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0];
int yy = y + xy[i][1];
int center_element = Feld[x][y]; /* should always be non-moving! */
int i, j;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0];
int yy = y + xy[i][1];
HAS_ANY_CHANGE_EVENT(center_element, CE_OTHER_IS_TOUCHING) &&
!change_center_element)
{
- for (j=0; j < element_info[center_element].num_change_pages; j++)
+ for (j = 0; j < element_info[center_element].num_change_pages; j++)
{
struct ElementChangeInfo *change =
&element_info[center_element].change_page[j];
if (IS_CUSTOM_ELEMENT(border_element) &&
HAS_ANY_CHANGE_EVENT(border_element, CE_OTHER_IS_TOUCHING))
{
- for (j=0; j < element_info[border_element].num_change_pages; j++)
+ for (j = 0; j < element_info[border_element].num_change_pages; j++)
{
struct ElementChangeInfo *change =
&element_info[border_element].change_page[j];
MV_DOWN
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int test_x, test_y, test_move_dir, test_element;
if (bad_element == EL_EXPLOSION) /* skip just exploding bad things */
return;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int test_x, test_y, test_move_dir, test_element;
{ 0, +1 }
};
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int x, y, element;
if (!ExplodeField[jx][jy])
StorePlayer[jx][jy] = 0;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (stored_player[i].active)
found = TRUE;
{
int i;
- for (i=0; i < element_info[element].collect_count; i++)
+ for (i = 0; i < element_info[element].collect_count; i++)
if (player->inventory_size < MAX_INVENTORY_SIZE)
player->inventory_element[player->inventory_size++] = element;
{
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);
{
int i;
- for (i=0; i<NUM_GAME_BUTTONS; i++)
+ for (i = 0; i < NUM_GAME_BUTTONS; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
struct GadgetInfo *gi;
{
int i;
- for (i=0; i<NUM_GAME_BUTTONS; i++)
+ for (i = 0; i < NUM_GAME_BUTTONS; i++)
FreeGadget(game_gadget[i]);
}
{
int i;
- for (i=0; i<NUM_GAME_BUTTONS; i++)
+ for (i = 0; i < NUM_GAME_BUTTONS; i++)
MapGadget(game_gadget[i]);
}
{
int i;
- for (i=0; i<NUM_GAME_BUTTONS; i++)
+ for (i = 0; i < NUM_GAME_BUTTONS; i++)
UnmapGadget(game_gadget[i]);
}
int i;
/* initialize pixmap array for special X11 tile clipping to Pixmap 'None' */
- for (i=0; i<NUM_TILES; i++)
+ for (i = 0; i < NUM_TILES; i++)
tile_clipmask[i] = None;
#if defined(TARGET_X11)
clip_gc_valuemask, &clip_gc_values);
#if 0
- for (i=0; i<NUM_BITMAPS; i++)
+ for (i = 0; i < NUM_BITMAPS; i++)
{
if (pix[i]->clip_mask)
{
clip_gc_valuemask, &clip_gc_values);
/* create only those clipping Pixmaps we really need */
- for (i=0; tile_needs_clipping[i].start>=0; i++)
+ for (i = 0; tile_needs_clipping[i].start >= 0; i++)
{
int j;
- for (j=0; j<tile_needs_clipping[i].count; j++)
+ for (j = 0; j < tile_needs_clipping[i].count; j++)
{
int tile = tile_needs_clipping[i].start + j;
int graphic = tile;
#if defined(TARGET_X11)
int i;
- for (i=0; i<NUM_TILES; i++)
+ for (i = 0; i < NUM_TILES; i++)
{
if (tile_clipmask[i] != None)
{
tile_clip_gc = None;
#if 0
- for (i=0; i<NUM_BITMAPS; i++)
+ for (i = 0; i < NUM_BITMAPS; i++)
{
if (pix[i] != NULL && pix[i]->stored_clip_gc)
{
int i;
/* initialize normal images from static configuration */
- for (i=0; element_to_graphic[i].element > -1; i++)
+ for (i = 0; element_to_graphic[i].element > -1; i++)
CreateImageWithSmallImages(element_to_graphic[i].graphic);
/* initialize special images from static configuration */
- for (i=0; element_to_special_graphic[i].element > -1; i++)
+ for (i = 0; element_to_special_graphic[i].element > -1; i++)
CreateImageWithSmallImages(element_to_special_graphic[i].graphic);
/* initialize images from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
if (property_mapping[i].artwork_index < MAX_NUM_ELEMENTS)
CreateImageWithSmallImages(property_mapping[i].artwork_index);
}
/* always start with reliable default values (normal font graphics) */
#if 1
- for (i=0; i < NUM_FONTS; i++)
+ for (i = 0; i < NUM_FONTS; i++)
font_info[i].graphic = IMG_FONT_INITIAL_1;
#else
- for (i=0; i < NUM_FONTS; i++)
+ for (i = 0; i < NUM_FONTS; i++)
font_info[i].graphic = FONT_INITIAL_1;
#endif
/* initialize normal font/graphic mapping from static configuration */
- for (i=0; font_to_graphic[i].font_nr > -1; i++)
+ for (i = 0; font_to_graphic[i].font_nr > -1; i++)
{
int font_nr = font_to_graphic[i].font_nr;
int special = font_to_graphic[i].special;
}
/* always start with reliable default values (special font graphics) */
- for (i=0; i < NUM_FONTS; i++)
+ for (i = 0; i < NUM_FONTS; i++)
{
- for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ for (j = 0; j < NUM_SPECIAL_GFX_ARGS; j++)
{
font_info[i].special_graphic[j] = font_info[i].graphic;
font_info[i].special_bitmap_id[j] = i;
}
/* initialize special font/graphic mapping from static configuration */
- for (i=0; font_to_graphic[i].font_nr > -1; i++)
+ for (i = 0; font_to_graphic[i].font_nr > -1; i++)
{
int font_nr = font_to_graphic[i].font_nr;
int special = font_to_graphic[i].special;
}
/* initialize special element/graphic mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int font_nr = property_mapping[i].base_index - MAX_NUM_ELEMENTS;
int special = property_mapping[i].ext3_index;
/* ---------- initialize font bitmap definitions ---------- */
- for (i=0; i < NUM_FONTS; i++)
+ for (i = 0; i < NUM_FONTS; i++)
{
if (i < NUM_INITIAL_FONTS)
{
continue;
}
- for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ for (j = 0; j < NUM_SPECIAL_GFX_ARGS; j++)
{
int font_bitmap_id = font_info[i].special_bitmap_id[j];
int graphic = font_info[i].special_graphic[j];
int i, act, dir;
/* set values to -1 to identify later as "uninitialized" values */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
- for (act=0; act<NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
{
element_info[i].graphic[act] = -1;
element_info[i].crumbled[act] = -1;
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
{
element_info[i].direction_graphic[act][dir] = -1;
element_info[i].direction_crumbled[act][dir] = -1;
}
/* initialize normal element/graphic mapping from static configuration */
- for (i=0; element_to_graphic[i].element > -1; i++)
+ for (i = 0; element_to_graphic[i].element > -1; i++)
{
int element = element_to_graphic[i].element;
int action = element_to_graphic[i].action;
}
/* initialize normal element/graphic mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int element = property_mapping[i].base_index;
int action = property_mapping[i].ext1_index;
if (crumbled)
{
if (direction < 0)
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
element_info[element].direction_crumbled[action][dir] = -1;
if (direction > -1)
else
{
if (direction < 0)
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
element_info[element].direction_graphic[action][dir] = -1;
if (direction > -1)
}
/* now copy all graphics that are defined to be cloned from other graphics */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
int graphic = element_info[i].graphic[ACTION_DEFAULT];
int crumbled_like, diggable_like;
if (crumbled_like != -1 && element_info[i].crumbled[ACTION_DEFAULT] == -1)
{
- for (act=0; act<NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
element_info[i].crumbled[act] =
element_info[crumbled_like].crumbled[act];
- for (act=0; act<NUM_ACTIONS; act++)
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (act = 0; act < NUM_ACTIONS; act++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
element_info[i].direction_crumbled[act][dir] =
element_info[crumbled_like].direction_crumbled[act][dir];
}
{
element_info[i].graphic[ACTION_DIGGING] =
element_info[diggable_like].graphic[ACTION_DIGGING];
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
element_info[i].direction_graphic[ACTION_DIGGING][dir] =
element_info[diggable_like].direction_graphic[ACTION_DIGGING][dir];
}
#if 1
/* now set all undefined/invalid graphics to -1 to set to default after it */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
- for (act=0; act<NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
{
int graphic;
if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
element_info[i].crumbled[act] = -1;
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
{
graphic = element_info[i].direction_graphic[act][dir];
if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
#endif
/* now set all '-1' values to element specific default values */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
int default_graphic = element_info[i].graphic[ACTION_DEFAULT];
int default_crumbled = element_info[i].crumbled[ACTION_DEFAULT];
if (default_crumbled == -1)
default_crumbled = IMG_EMPTY;
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
{
default_direction_graphic[dir] =
element_info[i].direction_graphic[ACTION_DEFAULT][dir];
default_direction_crumbled[dir] = default_crumbled;
}
- for (act=0; act<NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
{
boolean act_remove = ((IS_DIGGABLE(i) && act == ACTION_DIGGING) ||
(IS_SNAPPABLE(i) && act == ACTION_SNAPPING) ||
if (default_action_crumbled == -1)
default_action_crumbled = default_crumbled;
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
{
int default_action_direction_graphic = element_info[i].graphic[act];
int default_action_direction_crumbled = element_info[i].crumbled[act];
#if 1
/* set animation mode to "none" for each graphic with only 1 frame */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
- for (act=0; act<NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
{
int graphic = element_info[i].graphic[act];
int crumbled = element_info[i].crumbled[act];
if (graphic_info[crumbled].anim_frames == 1)
graphic_info[crumbled].anim_mode = ANIM_NONE;
- for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ for (dir = 0; dir < NUM_DIRECTIONS; dir++)
{
graphic = element_info[i].direction_graphic[act][dir];
crumbled = element_info[i].direction_crumbled[act][dir];
#if DEBUG
if (options.verbose)
{
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
if (element_info[i].graphic[ACTION_DEFAULT] == IMG_CHAR_QUESTION &&
i != EL_CHAR_QUESTION)
Error(ERR_RETURN, "warning: no graphic for element '%s' (%d)",
int i, j;
/* always start with reliable default values */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
- for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ for (j = 0; j < NUM_SPECIAL_GFX_ARGS; j++)
element_info[i].special_graphic[j] =
element_info[i].graphic[ACTION_DEFAULT];
/* initialize special element/graphic mapping from static configuration */
- for (i=0; element_to_special_graphic[i].element > -1; i++)
+ for (i = 0; element_to_special_graphic[i].element > -1; i++)
{
int element = element_to_special_graphic[i].element;
int special = element_to_special_graphic[i].special;
}
/* initialize special element/graphic mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int element = property_mapping[i].base_index;
int special = property_mapping[i].ext3_index;
#if 1
/* now set all undefined/invalid graphics to default */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
- for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ for (j = 0; j < NUM_SPECIAL_GFX_ARGS; j++)
if (graphic_info[element_info[i].special_graphic[j]].bitmap == NULL)
element_info[i].special_graphic[j] =
element_info[i].graphic[ACTION_DEFAULT];
{
int i;
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
if (strcmp(element_info[i].token_name, token) == 0)
return i;
int i;
/* get integer values from string parameters */
- for (i=0; i < NUM_GFX_ARGS; i++)
+ for (i = 0; i < NUM_GFX_ARGS; i++)
{
parameter[i] =
get_parameter_value(image_config_suffix[i].token, parameter_raw[i],
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
if (clipmasks_initialized)
{
- for (i=0; i<num_images; i++)
+ for (i = 0; i < num_images; i++)
{
if (graphic_info[i].clip_mask)
XFreePixmap(display, graphic_info[i].clip_mask);
}
#endif
- for (i=0; i<num_images; i++)
+ for (i = 0; i < num_images; i++)
{
struct FileInfo *image = getImageListEntry(i);
Bitmap *src_bitmap;
int i, j, act;
/* set values to -1 to identify later as "uninitialized" values */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
- for (act=0; act < NUM_ACTIONS; act++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ for (act = 0; act < NUM_ACTIONS; act++)
element_info[i].sound[act] = -1;
/* initialize element/sound mapping from static configuration */
- for (i=0; element_to_sound[i].element > -1; i++)
+ for (i = 0; element_to_sound[i].element > -1; i++)
{
int element = element_to_sound[i].element;
int action = element_to_sound[i].action;
if (!is_class)
element_info[element].sound[action] = sound;
else
- for (j=0; j < MAX_NUM_ELEMENTS; j++)
+ for (j = 0; j < MAX_NUM_ELEMENTS; j++)
if (strcmp(element_info[j].class_name,
element_info[element].class_name) == 0)
element_info[j].sound[action] = sound;
}
/* initialize element class/sound mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int element_class = property_mapping[i].base_index - MAX_NUM_ELEMENTS;
int action = property_mapping[i].ext1_index;
if (action < 0)
action = ACTION_DEFAULT;
- for (j=0; j < MAX_NUM_ELEMENTS; j++)
+ for (j = 0; j < MAX_NUM_ELEMENTS; j++)
if (strcmp(element_info[j].class_name,
element_info[element_class].class_name) == 0)
element_info[j].sound[action] = sound;
}
/* initialize element/sound mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int element = property_mapping[i].base_index;
int action = property_mapping[i].ext1_index;
}
/* now set all '-1' values to element specific default values */
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
- for (act=0; act < NUM_ACTIONS; act++)
+ for (act = 0; act < NUM_ACTIONS; act++)
{
/* generic default action sound (defined by "[default]" directive) */
int default_action_sound = element_info[EL_DEFAULT].sound[act];
int i;
/* set values to -1 to identify later as "uninitialized" values */
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
menu.sound[i] = -1;
/* initialize gamemode/sound mapping from static configuration */
- for (i=0; gamemode_to_sound[i].sound > -1; i++)
+ for (i = 0; gamemode_to_sound[i].sound > -1; i++)
{
int gamemode = gamemode_to_sound[i].gamemode;
int sound = gamemode_to_sound[i].sound;
}
/* now set all '-1' values to levelset specific default values */
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
if (menu.sound[i] == -1)
menu.sound[i] = menu.sound[GAME_MODE_DEFAULT];
#if 0
/* TEST ONLY */
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
if (menu.sound[i] != -1)
printf("::: menu.sound[%d] == %d\n", i, menu.sound[i]);
#endif
int i;
/* get integer values from string parameters */
- for (i=0; i < NUM_SND_ARGS; i++)
+ for (i = 0; i < NUM_SND_ARGS; i++)
parameter[i] =
get_parameter_value(sound_config_suffix[i].token, parameter_raw[i],
sound_config_suffix[i].type);
sound_info = checked_calloc(num_sounds * sizeof(struct SoundInfo));
/* initialize sound effect for all elements to "no sound" */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
- for (j=0; j < NUM_ACTIONS; j++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ for (j = 0; j < NUM_ACTIONS; j++)
element_info[i].sound[j] = SND_UNDEFINED;
- for (i=0; i < num_sounds; i++)
+ for (i = 0; i < num_sounds; i++)
{
struct FileInfo *sound = getSoundListEntry(i);
int len_effect_text = strlen(sound->token);
/* determine all loop sounds and identify certain sound classes */
- for (j=0; element_action_info[j].suffix; j++)
+ for (j = 0; element_action_info[j].suffix; j++)
{
int len_action_text = strlen(element_action_info[j].suffix);
/* associate elements and some selected sound actions */
- for (j=0; j < MAX_NUM_ELEMENTS; j++)
+ for (j = 0; j < MAX_NUM_ELEMENTS; j++)
{
if (element_info[j].class_name)
{
#if 0
/* !!! now handled in InitElementSoundInfo() !!! */
/* initialize element/sound mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int element = property_mapping[i].base_index;
int action = property_mapping[i].ext1_index;
int i;
/* set values to -1 to identify later as "uninitialized" values */
- for (i=0; i < MAX_LEVELS; i++)
+ for (i = 0; i < MAX_LEVELS; i++)
levelset.music[i] = -1;
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
menu.music[i] = -1;
/* initialize gamemode/music mapping from static configuration */
- for (i=0; gamemode_to_music[i].music > -1; i++)
+ for (i = 0; gamemode_to_music[i].music > -1; i++)
{
int gamemode = gamemode_to_music[i].gamemode;
int music = gamemode_to_music[i].music;
}
/* initialize gamemode/music mapping from dynamic configuration */
- for (i=0; i < num_property_mappings; i++)
+ for (i = 0; i < num_property_mappings; i++)
{
int prefix = property_mapping[i].base_index;
int gamemode = property_mapping[i].ext1_index;
/* now set all '-1' values to menu specific default values */
/* (undefined values of "levelset.music[]" might stay at "-1" to
allow dynamic selection of music files from music directory!) */
- for (i=0; i < MAX_LEVELS; i++)
+ for (i = 0; i < MAX_LEVELS; i++)
if (levelset.music[i] == -1)
levelset.music[i] = default_levelset_music;
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
if (menu.music[i] == -1)
menu.music[i] = menu.music[GAME_MODE_DEFAULT];
#if 0
/* TEST ONLY */
- for (i=0; i < MAX_LEVELS; i++)
+ for (i = 0; i < MAX_LEVELS; i++)
if (levelset.music[i] != -1)
printf("::: levelset.music[%d] == %d\n", i, levelset.music[i]);
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
if (menu.music[i] != -1)
printf("::: menu.music[%d] == %d\n", i, menu.music[i]);
#endif
int i;
/* get integer values from string parameters */
- for (i=0; i < NUM_MUS_ARGS; i++)
+ for (i = 0; i < NUM_MUS_ARGS; i++)
parameter[i] =
get_parameter_value(music_config_suffix[i].token, parameter_raw[i],
music_config_suffix[i].type);
music_info = checked_calloc(num_music * sizeof(struct MusicInfo));
- for (i=0; i < num_music; i++)
+ for (i = 0; i < num_music; i++)
{
struct FileInfo *music = getMusicListEntry(i);
int len_music_text = strlen(music->token);
/* determine all loop music */
- for (j=0; music_prefix_info[j].prefix; j++)
+ for (j = 0; music_prefix_info[j].prefix; j++)
{
int len_prefix_text = strlen(music_prefix_info[j].prefix);
int i, j, k;
/* always start with reliable default values (element has no properties) */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
- for (j=0; j < NUM_ELEMENT_PROPERTIES; j++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ for (j = 0; j < NUM_ELEMENT_PROPERTIES; j++)
SET_PROPERTY(i, j, FALSE);
/* set all base element properties from above array definitions */
- for (i=0; element_properties[i].elements != NULL; i++)
- for (j=0; (element_properties[i].elements)[j] != -1; j++)
+ for (i = 0; element_properties[i].elements != NULL; i++)
+ for (j = 0; (element_properties[i].elements)[j] != -1; j++)
SET_PROPERTY((element_properties[i].elements)[j],
element_properties[i].property, TRUE);
/* copy properties to some elements that are only stored in level file */
- for (i=0; i < NUM_ELEMENT_PROPERTIES; i++)
- for (j=0; copy_properties[j][0] != -1; j++)
+ for (i = 0; i < NUM_ELEMENT_PROPERTIES; i++)
+ for (j = 0; copy_properties[j][0] != -1; j++)
if (HAS_PROPERTY(copy_properties[j][0], i))
- for (k=1; k<=4; k++)
+ for (k = 1; k <= 4; k++)
SET_PROPERTY(copy_properties[j][k], i, TRUE);
}
#endif
/* set all special, combined or engine dependent element properties */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
#if 0
- for (j=EP_ACCESSIBLE_OVER; j < NUM_ELEMENT_PROPERTIES; j++)
+ for (j = EP_ACCESSIBLE_OVER; j < NUM_ELEMENT_PROPERTIES; j++)
SET_PROPERTY(i, j, FALSE);
#endif
/* ---------- WALL ----------------------------------------------------- */
SET_PROPERTY(i, EP_WALL, TRUE); /* default: element is wall */
- for (j=0; no_wall_properties[j] != -1; j++)
+ for (j = 0; no_wall_properties[j] != -1; j++)
if (HAS_PROPERTY(i, no_wall_properties[j]) ||
i >= EL_FIRST_RUNTIME_UNREAL)
SET_PROPERTY(i, EP_WALL, FALSE);
/* ---------- CAN_CHANGE ----------------------------------------------- */
SET_PROPERTY(i, EP_CAN_CHANGE, FALSE); /* default: cannot change */
- for (j=0; j < element_info[i].num_change_pages; j++)
+ for (j = 0; j < element_info[i].num_change_pages; j++)
if (element_info[i].change_page[j].can_change)
SET_PROPERTY(i, EP_CAN_CHANGE, TRUE);
#if 0
/* determine inactive elements (used for engine main loop optimization) */
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
{
boolean active = FALSE;
- for (j=0; i < NUM_ELEMENT_PROPERTIES; j++)
+ for (j = 0; i < NUM_ELEMENT_PROPERTIES; j++)
{
if (HAS_PROPERTY(i, j))
active = TRUE;
};
/* special EM style gems behaviour */
- for (i=0; ep_em_slippery_wall[i] != -1; i++)
+ for (i = 0; ep_em_slippery_wall[i] != -1; i++)
SET_PROPERTY(ep_em_slippery_wall[i], EP_EM_SLIPPERY_WALL,
level.em_slippery_gems);
}
/* set uninitialized push delay values of custom elements in older levels */
- for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
int element = EL_CUSTOM_START + i;
printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
printf("\n");
- for (i=0; image_config[i].token != NULL; i++)
+ for (i = 0; image_config[i].token != NULL; i++)
printf("# %s\n", getFormattedSetupEntry(image_config[i].token,
image_config[i].value));
printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
printf("\n");
- for (i=0; sound_config[i].token != NULL; i++)
+ for (i = 0; sound_config[i].token != NULL; i++)
printf("# %s\n", getFormattedSetupEntry(sound_config[i].token,
sound_config[i].value));
printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
printf("\n");
- for (i=0; music_config[i].token != NULL; i++)
+ for (i = 0; music_config[i].token != NULL; i++)
printf("# %s\n", getFormattedSetupEntry(music_config[i].token,
music_config[i].value));
printf("# (The entries below are default and therefore commented out.)\n");
printf("\n");
- for (i=0; helpanim_config[i].token != NULL; i++)
+ for (i = 0; helpanim_config[i].token != NULL; i++)
{
printf("# %s\n", getFormattedSetupEntry(helpanim_config[i].token,
helpanim_config[i].value));
printf("# (The entries below are default and therefore commented out.)\n");
printf("\n");
- for (i=0; helptext_config[i].token != NULL; i++)
+ for (i = 0; helptext_config[i].token != NULL; i++)
printf("# %s\n", getFormattedSetupEntry(helptext_config[i].token,
helptext_config[i].value));
/* choose default local player */
local_player = &stored_player[0];
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].connected = FALSE;
local_player->connected = TRUE;
/* dynamically determine list of generic tokens to be ignored */
num_ignore_generic_tokens = 0;
- for (i=0; ignore_generic_tokens[i] != NULL; i++)
+ for (i = 0; ignore_generic_tokens[i] != NULL; i++)
num_ignore_generic_tokens++;
/* dynamically determine list of image tokens to be ignored */
num_ignore_image_tokens = num_ignore_generic_tokens;
- for (i=0; image_config_vars[i].token != NULL; i++)
+ for (i = 0; image_config_vars[i].token != NULL; i++)
num_ignore_image_tokens++;
ignore_image_tokens =
checked_malloc((num_ignore_image_tokens + 1) * sizeof(char *));
- for (i=0; i < num_ignore_generic_tokens; i++)
+ for (i = 0; i < num_ignore_generic_tokens; i++)
ignore_image_tokens[i] = ignore_generic_tokens[i];
- for (i=0; i < num_ignore_image_tokens - num_ignore_generic_tokens; i++)
+ for (i = 0; i < num_ignore_image_tokens - num_ignore_generic_tokens; i++)
ignore_image_tokens[num_ignore_generic_tokens + i] =
image_config_vars[i].token;
ignore_image_tokens[num_ignore_image_tokens] = NULL;
num_ignore_sound_tokens = num_ignore_generic_tokens;
ignore_sound_tokens =
checked_malloc((num_ignore_sound_tokens + 1) * sizeof(char *));
- for (i=0; i < num_ignore_generic_tokens; i++)
+ for (i = 0; i < num_ignore_generic_tokens; i++)
ignore_sound_tokens[i] = ignore_generic_tokens[i];
ignore_sound_tokens[num_ignore_sound_tokens] = NULL;
num_ignore_music_tokens = num_ignore_generic_tokens;
ignore_music_tokens =
checked_malloc((num_ignore_music_tokens + 1) * sizeof(char *));
- for (i=0; i < num_ignore_generic_tokens; i++)
+ for (i = 0; i < num_ignore_generic_tokens; i++)
ignore_music_tokens[i] = ignore_generic_tokens[i];
ignore_music_tokens[num_ignore_music_tokens] = NULL;
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
image_id_prefix[i] = element_info[i].token_name;
- for (i=0; i < NUM_FONTS; i++)
+ for (i = 0; i < NUM_FONTS; i++)
image_id_prefix[MAX_NUM_ELEMENTS + i] = font_info[i].token_name;
image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS] = NULL;
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
sound_id_prefix[i] = element_info[i].token_name;
- for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
sound_id_prefix[MAX_NUM_ELEMENTS + i] =
get_string_in_brackets(element_info[i].class_name);
sound_id_prefix[2 * MAX_NUM_ELEMENTS] = NULL;
- for (i=0; i < NUM_MUSIC_PREFIXES; i++)
+ for (i = 0; i < NUM_MUSIC_PREFIXES; i++)
music_id_prefix[i] = music_prefix_info[i].prefix;
music_id_prefix[MAX_LEVELS] = NULL;
- for (i=0; i < NUM_ACTIONS; i++)
+ for (i = 0; i < NUM_ACTIONS; i++)
action_id_suffix[i] = element_action_info[i].suffix;
action_id_suffix[NUM_ACTIONS] = NULL;
- for (i=0; i < NUM_DIRECTIONS; i++)
+ for (i = 0; i < NUM_DIRECTIONS; i++)
direction_id_suffix[i] = element_direction_info[i].suffix;
direction_id_suffix[NUM_DIRECTIONS] = NULL;
- for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
special_id_suffix[i] = special_suffix_info[i].suffix;
special_id_suffix[NUM_SPECIAL_GFX_ARGS] = NULL;
- for (i=0; i < MAX_LEVELS; i++)
+ for (i = 0; i < MAX_LEVELS; i++)
level_id_suffix[i] = get_level_id_suffix(i);
level_id_suffix[MAX_LEVELS] = NULL;
int i, j;
/* determine settings for initial font (for displaying startup messages) */
- for (i=0; image_config[i].token != NULL; i++)
+ for (i = 0; image_config[i].token != NULL; i++)
{
- for (j=0; j < NUM_INITIAL_FONTS; j++)
+ for (j = 0; j < NUM_INITIAL_FONTS; j++)
{
char font_token[128];
int len_font_token;
}
}
- for (j=0; j < NUM_INITIAL_FONTS; j++)
+ for (j = 0; j < NUM_INITIAL_FONTS; j++)
{
font_initial[j].num_chars = DEFAULT_NUM_CHARS_PER_FONT;
font_initial[j].num_chars_per_line = DEFAULT_NUM_CHARS_PER_LINE;
bitmap_font_initial = LoadCustomImage(filename_font_initial);
- for (j=0; j < NUM_INITIAL_FONTS; j++)
+ for (j = 0; j < NUM_INITIAL_FONTS; j++)
font_initial[j].bitmap = bitmap_font_initial;
InitFontGraphicInfo();
ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
ClearRectangle(bitmap_db_door, 0, 0, 3 * DXSIZE, DYSIZE + VYSIZE);
- for (x=0; x<MAX_BUF_XSIZE; x++)
- for (y=0; y<MAX_BUF_YSIZE; y++)
+ for (x = 0; x < MAX_BUF_XSIZE; x++)
+ for (y = 0; y < MAX_BUF_YSIZE; y++)
redraw[x][y] = 0;
redraw_tiles = 0;
redraw_mask = REDRAW_ALL;
xpos, ypos);
/* middle part of gadget */
- for (i=0; i<num_steps; i++)
+ for (i=0; i < num_steps; i++)
BlitBitmapOnBackground(gd->bitmap, drawto,
gd->x, gd->y + gi->border.ysize,
gi->width, design_body,
xpos, ypos);
/* middle part of gadget */
- for (i=0; i<num_steps; i++)
+ for (i=0; i < num_steps; i++)
BlitBitmapOnBackground(gd->bitmap, drawto,
gd->x + gi->border.xsize, gd->y,
design_body, gi->height,
h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
if (NULL == h->table) { free(h); return NULL; } /*oom*/
- for (i=0;i<size;i++) { h->table[i] = NULL; }
+ for (i=0; i < size; i++) { h->table[i] = NULL; }
h->tablelength = size;
h->entrycount = 0;
h->hashfn = hashf;
image->bytes_per_row = width * bytes_per_pixel;
image->rgb.used = 0;
- for (i=0; i<MAX_COLORS; i++)
+ for (i = 0; i < MAX_COLORS; i++)
image->rgb.color_used[i] = FALSE;
image->type = (depth < 8 ? IMAGETYPE_BITMAP :
* the corresponding image pixmap
*/
- for (y=0; y<image->height; y++)
+ for (y = 0; y < image->height; y++)
{
bitmask = 0x01; /* start with leftmost bit in the byte */
dst_ptr2 = dst_ptr; /* start with leftmost byte in the row */
- for (x=0; x<image->width; x++)
+ for (x = 0; x < image->width; x++)
{
- for (i=0; i<image->bytes_per_pixel; i++)
+ for (i = 0; i < image->bytes_per_pixel; i++)
if (*src_ptr++) /* source pixel solid? (pixel index != 0) */
*dst_ptr2 |= bitmask; /* then write a bit into the image mask */
pixmap_format = XListPixmapFormats(display, &num_pixmap_formats);
/* find format that matches the given depth */
- for (i=0; i<num_pixmap_formats; i++)
+ for (i = 0; i < num_pixmap_formats; i++)
if (pixmap_format[i].depth == depth)
bits_per_pixel = pixmap_format[i].bits_per_pixel;
/* calculate number of distinct colors in each band */
redcolors = greencolors = bluecolors = 1;
- for (pixval=1; pixval; pixval <<= 1)
+ for (pixval = 1; pixval; pixval <<= 1)
{
if (pixval & visual->red_mask)
redcolors <<= 1;
redbottom = greenbottom = bluebottom = 0;
redtop = greentop = bluetop = 0;
- for (a=0; a<visual->map_entries; a++)
+ for (a = 0; a < visual->map_entries; a++)
{
if (redbottom < 256)
redtop = redbottom + redstep;
ximageinfo->cmap = global_cmap;
- for (a=0; a<MAX_COLORS; a++)
+ for (a = 0; a < MAX_COLORS; a++)
{
XColor xcolor2;
unsigned short mask;
/* allocate the rest of the color cells read/write */
global_cmap_index =
(Pixel *)checked_malloc(sizeof(Pixel) * NOFLASH_COLORS);
- for (i=0; i<NOFLASH_COLORS; i++)
+ for (i = 0; i < NOFLASH_COLORS; i++)
if (!XAllocColorCells(display, global_cmap, FALSE, NULL, 0,
global_cmap_index + i, 1))
break;
/* to minimize colormap flashing, copy default colors and try
to keep them as near as possible to the old values */
- for(i=0; i<num_cmap_entries; i++)
+ for (i = 0; i < num_cmap_entries; i++)
{
xcolor2.pixel = *(global_cmap_index + i);
XQueryColor(display, DefaultColormap(display, screen), &xcolor2);
while (!color_found)
{
- for (i=num_cmap_entries-1; i>=0; i--)
+ for (i = num_cmap_entries - 1; i >= 0; i--)
{
xcolor2.pixel = *(global_cmap_index + i);
xcolor2 = xcolor_private[xcolor2.pixel];
{
case IMAGETYPE_RGB:
{
- for (y=0; y<image->height; y++) /* general case */
+ for (y = 0; y < image->height; y++) /* general case */
{
- for (x=0; x<image->width; x++)
+ for (x = 0; x < image->width; x++)
{
pixval = *src_ptr++;
pixval =
case IMAGETYPE_TRUECOLOR:
{
- for (y=0; y<image->height; y++) /* general case */
+ for (y = 0; y < image->height; y++) /* general case */
{
- for (x=0; x<image->width; x++)
+ for (x = 0; x < image->width; x++)
{
pixval = memory_to_value(src_ptr, image->bytes_per_pixel);
pixval =
{
if (display_bytes_per_pixel == 1) /* special case */
{
- for (y=0; y<image->height; y++)
- for (x=0; x<image->width; x++)
+ for (y = 0; y < image->height; y++)
+ for (x = 0; x < image->width; x++)
*dst_ptr++ = ximageinfo->index[c + *src_ptr++];
}
else /* general case */
{
- for (y=0; y<image->height; y++)
+ for (y = 0; y < image->height; y++)
{
- for (x=0; x<image->width; x++)
+ for (x = 0; x < image->width; x++)
{
value_to_memory(ximageinfo->index[c + *src_ptr++],
dst_ptr, display_bytes_per_pixel);
row_skip = col_skip * src_width;
/* scale image down by scaling factor 'zoom_factor' */
- for (y=0; y < src_height; y += zoom_factor, src_ptr += row_skip)
- for (x=0; x < src_width; x += zoom_factor, src_ptr += col_skip)
- for (i=0; i < bytes_per_pixel; i++)
+ for (y = 0; y < src_height; y += zoom_factor, src_ptr += row_skip)
+ for (x = 0; x < src_width; x += zoom_factor, src_ptr += col_skip)
+ for (i = 0; i < bytes_per_pixel; i++)
*dst_ptr++ = *src_ptr++;
/* copy scaled image to destination pixmap */
int num_list_entries = image_info->num_file_list_entries;
int i;
- for (i=0; i < num_list_entries; i++)
+ for (i = 0; i < num_list_entries; i++)
if (strcmp(file_list[i].token, token) == 0)
return i;
image_info->dynamic_file_list = NULL;
image_info->num_suffix_list_entries = 0;
- for (i=0; config_suffix_list[i].token != NULL; i++)
+ for (i = 0; config_suffix_list[i].token != NULL; i++)
image_info->num_suffix_list_entries++;
image_info->suffix_list = config_suffix_list;
/* ---------- initialize base prefix and suffixes lists ---------- */
image_info->num_base_prefixes = 0;
- for (i=0; base_prefixes[i] != NULL; i++)
+ for (i = 0; base_prefixes[i] != NULL; i++)
image_info->num_base_prefixes++;
image_info->num_ext1_suffixes = 0;
- for (i=0; ext1_suffixes[i] != NULL; i++)
+ for (i = 0; ext1_suffixes[i] != NULL; i++)
image_info->num_ext1_suffixes++;
image_info->num_ext2_suffixes = 0;
- for (i=0; ext2_suffixes[i] != NULL; i++)
+ for (i = 0; ext2_suffixes[i] != NULL; i++)
image_info->num_ext2_suffixes++;
image_info->num_ext3_suffixes = 0;
- for (i=0; ext3_suffixes[i] != NULL; i++)
+ for (i = 0; ext3_suffixes[i] != NULL; i++)
image_info->num_ext3_suffixes++;
image_info->num_ignore_tokens = 0;
- for (i=0; ignore_tokens[i] != NULL; i++)
+ for (i = 0; ignore_tokens[i] != NULL; i++)
image_info->num_ignore_tokens++;
image_info->base_prefixes = base_prefixes;
{
int i;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
char *device_name = setup.input[i].joy.device_name;
{
*name = "[undefined]";
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
{
if (*joysymbol == translate_joy[i].joysymbol)
{
{
*joysymbol = 0;
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
{
if (strcmp(*name, translate_joy[i].name) == 0)
{
int i;
int distance = 100;
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
if (setup.input[i].joy.xleft >= setup.input[i].joy.xmiddle)
setup.input[i].joy.xleft = setup.input[i].joy.xmiddle - distance;
int i;
int result = 0;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
result |= Joystick(i);
return result;
int i;
int result = JOY_BUTTON_NOT_PRESSED;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
result = JoystickButton(i);
if (result != JOY_BUTTON_NOT_PRESSED)
{
int i;
- for (i=0; i<line_length; i++)
+ for (i = 0; i < line_length; i++)
fprintf(stream, "%s", line_string);
fprintf(stream, "\n");
{
unsigned long actual_counter;
- while(1)
+ while (1)
{
actual_counter = Counter();
char *s_lower = getStringToLower(s);
int result = -1;
- for (i=0; number_text[i][0] != NULL; i++)
- for (j=0; j < 3; j++)
+ for (i = 0; number_text[i][0] != NULL; i++)
+ for (j = 0; j < 3; j++)
if (strcmp(s_lower, number_text[i][j]) == 0)
result = i;
file_list = checked_calloc(num_file_list_entries * sizeof(struct FileInfo));
- for (i=0; suffix_list[i].token != NULL; i++)
+ for (i = 0; suffix_list[i].token != NULL; i++)
num_suffix_list_entries++;
/* always start with reliable default values */
- for (i=0; i<num_file_list_entries; i++)
+ for (i = 0; i < num_file_list_entries; i++)
{
file_list[i].token = NULL;
file_list[i].default_parameter = checked_calloc(parameter_array_size);
file_list[i].parameter = checked_calloc(parameter_array_size);
- for (j=0; j<num_suffix_list_entries; j++)
+ for (j = 0; j < num_suffix_list_entries; j++)
{
setString(&file_list[i].default_parameter[j], suffix_list[j].value);
setString(&file_list[i].parameter[j], suffix_list[j].value);
}
list_pos = 0;
- for (i=0; config_list[i].token != NULL; i++)
+ for (i = 0; config_list[i].token != NULL; i++)
{
int len_config_token = strlen(config_list[i].token);
int len_config_value = strlen(config_list[i].value);
boolean is_file_entry = TRUE;
- for (j=0; suffix_list[j].token != NULL; j++)
+ for (j = 0; suffix_list[j].token != NULL; j++)
{
int len_suffix = strlen(suffix_list[j].token);
}
/* the following tokens are no file definitions, but other config tokens */
- for (j=0; ignore_tokens[j] != NULL; j++)
+ for (j = 0; ignore_tokens[j] != NULL; j++)
if (strcmp(config_list[i].token, ignore_tokens[j]) == 0)
is_file_entry = FALSE;
setString(&file_list_entry->filename, filename);
/* when file definition found, set all parameters to default values */
- for (i=0; suffix_list[i].token != NULL; i++)
+ for (i = 0; suffix_list[i].token != NULL; i++)
setString(&file_list_entry->parameter[i], suffix_list[i].value);
file_list_entry->redefined = TRUE;
#endif
/* check for config tokens that can be build by base token and suffixes */
- for (i=0; suffix_list[i].token != NULL; i++)
+ for (i = 0; suffix_list[i].token != NULL; i++)
{
char *token = getStringCat2(file_list_entry->token, suffix_list[i].token);
char *value = getHashEntry(setup_file_hash, token);
return;
/* read parameters for all known config file tokens */
- for (i=0; i<num_file_list_entries; i++)
+ for (i = 0; i < num_file_list_entries; i++)
read_token_parameters(setup_file_hash, suffix_list, &file_list[i]);
/* set all tokens that can be ignored here to "known" keyword */
- for (i=0; i < num_ignore_tokens; i++)
+ for (i = 0; i < num_ignore_tokens; i++)
setHashEntry(setup_file_hash, ignore_tokens[i], known_token_value);
/* copy all unknown config file tokens to extra config list */
boolean parameter_suffix_found = FALSE;
/* skip all parameter definitions (handled by read_token_parameters()) */
- for (i=0; i < num_suffix_list_entries && !parameter_suffix_found; i++)
+ for (i = 0; i < num_suffix_list_entries && !parameter_suffix_found; i++)
{
int len_suffix = strlen(suffix_list[i].token);
/* ---------- step 0: search for matching base prefix ---------- */
start_pos = 0;
- for (i=0; i < num_base_prefixes && !base_prefix_found; i++)
+ for (i = 0; i < num_base_prefixes && !base_prefix_found; i++)
{
char *base_prefix = base_prefixes[i];
int len_base_prefix = strlen(base_prefix);
/* ---------- step 1: search for matching first suffix ---------- */
start_pos += len_base_prefix;
- for (j=0; j < num_ext1_suffixes && !ext1_suffix_found; j++)
+ for (j = 0; j < num_ext1_suffixes && !ext1_suffix_found; j++)
{
char *ext1_suffix = ext1_suffixes[j];
int len_ext1_suffix = strlen(ext1_suffix);
/* ---------- step 2: search for matching second suffix ---------- */
- for (k=0; k < num_ext2_suffixes && !ext2_suffix_found; k++)
+ for (k = 0; k < num_ext2_suffixes && !ext2_suffix_found; k++)
{
char *ext2_suffix = ext2_suffixes[k];
int len_ext2_suffix = strlen(ext2_suffix);
/* ---------- step 3: search for matching third suffix ---------- */
- for (l=0; l < num_ext3_suffixes && !ext3_suffix_found; l++)
+ for (l = 0; l < num_ext3_suffixes && !ext3_suffix_found; l++)
{
char *ext3_suffix = ext3_suffixes[l];
int len_ext3_suffix = strlen(ext3_suffix);
freeSetupFileHash(extra_file_hash);
#if 0
- for (i=0; i<num_file_list_entries; i++)
+ for (i = 0; i < num_file_list_entries; i++)
{
printf("'%s' ", file_list[i].token);
if (file_list[i].filename)
DrawInitText(ARTWORKINFO_FILENAME(artwork_info->type), 150, FC_YELLOW);
/* always start with reliable default values */
- for (i=0; i<num_file_list_entries; i++)
+ for (i = 0; i < num_file_list_entries; i++)
{
setString(&file_list[i].filename, file_list[i].default_filename);
- for (j=0; j<num_suffix_list_entries; j++)
+ for (j = 0; j < num_suffix_list_entries; j++)
setString(&file_list[i].parameter[j], file_list[i].default_parameter[j]);
file_list[i].redefined = FALSE;
/* free previous dynamic artwork file array */
if (artwork_info->dynamic_file_list != NULL)
{
- for (i=0; i<artwork_info->num_dynamic_file_list_entries; i++)
+ for (i = 0; i < artwork_info->num_dynamic_file_list_entries; i++)
{
free(artwork_info->dynamic_file_list[i].token);
free(artwork_info->dynamic_file_list[i].filename);
num_file_list_entries);
#endif
- for(i=0; i<num_file_list_entries; i++)
+ for (i = 0; i < num_file_list_entries; i++)
{
#if 0
if (strcmp(file_list[i].token, "background") == 0)
num_dynamic_file_list_entries);
#endif
- for(i=0; i<num_dynamic_file_list_entries; i++)
+ for (i = 0; i < num_dynamic_file_list_entries; i++)
LoadArtworkToList(artwork_info, &artwork_info->dynamic_artwork_list[i],
dynamic_file_list[i].filename, i);
if (*list == NULL)
return;
- for(i=0; i<*num_list_entries; i++)
+ for (i = 0; i < *num_list_entries; i++)
deleteArtworkListEntry(artwork_info, &(*list)[i]);
free(*list);
{
int i;
- for (i=0; i<MAX_EVENT_BUFFER; i++)
+ for (i = 0; i < MAX_EVENT_BUFFER; i++)
event_buffer[i].type = 0;
- for (i=0; i<MAX_SCANCODES; i++)
+ for (i = 0; i < MAX_SCANCODES; i++)
key_press_state[i] = KeyReleaseMask;
last_mouse_pos = mouse_pos;
b >>= 10;
/* try to use existing colors from the global colormap */
- for (i=0; i<global_colormap_entries_used; i++)
+ for (i = 0; i < global_colormap_entries_used; i++)
{
if (r == global_colormap[i].r &&
g == global_colormap[i].g &&
clear(bitmap);
/* try to use existing colors from the global colormap */
- for (i=0; i<MAX_COLORS; i++)
+ for (i = 0; i < MAX_COLORS; i++)
{
if (!image->rgb.color_used[i])
continue;
}
/* copy bitmap data */
- for (y=0; y<image->height; y++)
- for (x=0; x<image->width; x++)
+ for (y = 0; y < image->height; y++)
+ for (x = 0; x < image->width; x++)
putpixel(bitmap, x, y, pixel_mapping[*src_ptr++]);
return bitmap;
{
int i;
- for (i=0; i<MAX_SCANCODES; i++)
+ for (i = 0; i < MAX_SCANCODES; i++)
{
int scancode, new_state, event_type;
char key_pressed;
/* mouse button event */
if (mouse_b != last_mouse_b)
{
- for (i=0; i<3; i++) /* check all three mouse buttons */
+ for (i = 0; i < 3; i++) /* check all three mouse buttons */
{
int bitmask = (1 << i);
install_joystick(JOY_TYPE_AUTODETECT) == 0)
joystick.status = JOYSTICK_ACTIVATED;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
char *device_name = setup.input[i].joy.device_name;
int joystick_nr = getJoystickNrFromDeviceName(device_name);
return NULL;
/* read 256 colors from PCX colormap */
- for (i=0; i<PCX_MAXCOLORS; i++)
+ for (i = 0; i < PCX_MAXCOLORS; i++)
{
image->rgb.red[i] = *buffer_ptr++ << 8;
image->rgb.green[i] = *buffer_ptr++ << 8;
while (value != PCX_256COLORS_MAGIC);
/* read 256 colors from PCX colormap */
- for(i = 0; i < PCX_MAXCOLORS; i++)
+ for (i = 0; i < PCX_MAXCOLORS; i++)
{
image->rgb.red[i] = (byte)fgetc(file) << 8;
image->rgb.green[i] = (byte)fgetc(file) << 8;
}
else
{
- for(i = 0; i < num_colors; i++)
+ for (i = 0; i < num_colors; i++)
{
image->rgb.red[i] = pcx->palette[i][0] << 8;
image->rgb.green[i] = pcx->palette[i][1] << 8;
if (pcx_depth == 8)
{
/* determine number of used colormap entries for 8-bit PCX images */
- for (i=0; i<PCX_MAXCOLORS; i++)
+ for (i = 0; i < PCX_MAXCOLORS; i++)
if (image->rgb.color_used[i])
image->rgb.used++;
}
fullscreen_yoffset = 0;
#ifdef FULLSCREEN_BUG
- for (i=0; screen_xy[i][0] != -1; i++)
+ for (i = 0; screen_xy[i][0] != -1; i++)
{
if (video.width <= screen_xy[i][0] && video.height <= screen_xy[i][1])
{
int i, x, y;
int line_width = 4;
- for (i=0; i<num_points - 1; i++)
+ for (i = 0; i < num_points - 1; i++)
{
- for (x=0; x<line_width; x++)
+ for (x = 0; x < line_width; x++)
{
- for (y=0; y<line_width; y++)
+ for (y = 0; y < line_width; y++)
{
int dx = x - line_width / 2;
int dy = y - line_width / 2;
{
int x, y;
- for (y=src_y; y < src_y + height; y++)
+ for (y = src_y; y < src_y + height; y++)
{
- for (x=src_x; x < src_x + width; x++)
+ for (x = src_x; x < src_x + width; x++)
{
Uint32 pixel = SDLGetPixel(bitmap, x, y);
{
int x, y;
- for (y=0; y < height; y++)
+ for (y = 0; y < height; y++)
{
- for (x=0; x < width; x++)
+ for (x = 0; x < width; x++)
{
Uint32 pixel = SDLGetPixel(src_bitmap, src_x + x, src_y + y);
else
{
/* copy palette */
- for (i=0; i < zoom_src->format->palette->ncolors; i++)
+ for (i = 0; i < zoom_src->format->palette->ncolors; i++)
zoom_dst->format->palette->colors[i] =
zoom_src->format->palette->colors[i];
zoom_dst->format->palette->ncolors = zoom_src->format->palette->ncolors;
}
}
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
{
char *device_name = setup.input[i].joy.device_name;
int joystick_nr = getJoystickNrFromDeviceName(device_name);
while (node)
{
- for (i=0; i<(depth + 1) * 3; i++)
+ for (i = 0; i < (depth + 1) * 3; i++)
printf(" ");
#if 1
compare_function);
/* update the linkage of list elements with the sorted node array */
- for (i=0; i<num_nodes - 1; i++)
+ for (i = 0; i < num_nodes - 1; i++)
sort_array[i]->next = sort_array[i + 1];
sort_array[num_nodes - 1]->next = NULL;
/* start with the token and some spaces to format output line */
sprintf(entry, "%s:", token);
- for (i=strlen(entry); i<TOKEN_VALUE_POSITION; i++)
+ for (i = strlen(entry); i < TOKEN_VALUE_POSITION; i++)
strcat(entry, " ");
/* continue with the token's value */
return NULL;
}
- while(!feof(file))
+ while (!feof(file))
{
/* read next line of input file */
if (!fgets(line, MAX_LINE_LEN, file))
/* set all structure fields according to the token/value pairs */
ldi = *leveldir_new;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
setSetupInfo(levelinfo_tokens, i,
getHashEntry(setup_file_hash, levelinfo_tokens[i].text));
*leveldir_new = ldi;
/* set all structure fields according to the token/value pairs */
ldi = *artwork_new;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
setSetupInfo(levelinfo_tokens, i,
getHashEntry(setup_file_hash, levelinfo_tokens[i].text));
*artwork_new = ldi;
getCookie("LEVELINFO")));
ldi = *level_info;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
if (i != LEVELINFO_TOKEN_IDENTIFIER &&
i != LEVELINFO_TOKEN_NAME_SORTING &&
i != LEVELINFO_TOKEN_IMPORTED_FROM)
{
/* add at least one whitespace */
strcat(line, " ");
- for (i=strlen(line); i<TOKEN_COMMENT_POSITION; i++)
+ for (i = strlen(line); i < TOKEN_COMMENT_POSITION; i++)
strcat(line, " ");
strcat(line, "# ");
int i;
/* look for available audio devices, starting with preferred ones */
- for (i=0; i<sizeof(audio_device_name)/sizeof(char *); i++)
+ for (i = 0; i < sizeof(audio_device_name)/sizeof(char *); i++)
if ((audio_device_fd = OpenAudioDevice(audio_device_name[i])) >= 0)
break;
{
int i;
- for(i=0; i<audio.num_channels; i++)
+ for (i = 0; i < audio.num_channels; i++)
mixer[i].active = FALSE;
mixer_active_channels = 0;
}
}
/* check if (and how often) this sound sample is already playing */
- for (k=0, i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (k = 0, i = audio.first_sound_channel; i < audio.num_channels; i++)
if (mixer[i].active && SAME_SOUND_DATA(mixer[i], snd_ctrl))
k++;
/* reset expiration delay for already playing loop sounds */
if (k > 0 && IS_LOOP(snd_ctrl))
{
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
if (mixer[i].active && SAME_SOUND_DATA(mixer[i], snd_ctrl))
{
int longest = 0, longest_nr = audio.first_sound_channel;
/* look for oldest equal sound */
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
int playing_time = playing_current - mixer[i].playing_starttime;
int actual;
if (mixer_active_channels ==
audio.num_channels - (mixer[audio.music_channel].active ? 0 : 1))
{
- for (i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
if (!mixer[i].active)
{
#if 0
#if DEBUG
/* print some debugging information about audio channel usage */
- for (i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
Error(ERR_RETURN, "Mixer_InsertSound: %d [%d]: %ld (%ld)",
i, mixer[i].active, mixer[i].data_len, (long)mixer[i].data_ptr);
#endif
#endif
- for (i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
int playing_time = playing_current - mixer[i].playing_starttime;
int actual = 1000 * playing_time / mixer[i].data_len;
}
/* add the new sound to the mixer */
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
#if 0
printf("CHECKING CHANNEL %d FOR SOUND %d ...\n", i, snd_ctrl.nr);
#endif
/* deactivate channels that have expired since the last request */
- for (i=0; i<audio.num_channels; i++)
+ for (i = 0; i < audio.num_channels; i++)
if (mixer[i].active && Mixer_ChannelExpired(i))
Mixer_StopChannel(i);
if (IS_RELOADING(snd_ctrl)) /* load new sound or music files */
{
Mixer_StopMusicChannel();
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
Mixer_StopChannel(i);
#if defined(AUDIO_UNIX_NATIVE)
return;
}
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
if (SAME_SOUND_NR(mixer[i], snd_ctrl) || ALL_SOUNDS(snd_ctrl))
Mixer_FadeChannel(i);
}
return;
}
- for(i=audio.first_sound_channel; i<audio.num_channels; i++)
+ for (i = audio.first_sound_channel; i < audio.num_channels; i++)
if (SAME_SOUND_NR(mixer[i], snd_ctrl) || ALL_SOUNDS(snd_ctrl))
Mixer_StopChannel(i);
return;
/* initialize stereo position conversion information */
- for(i=0; i<=SOUND_MAX_LEFT2RIGHT; i++)
+ for (i = 0; i <= SOUND_MAX_LEFT2RIGHT; i++)
stereo_volume[i] =
(int)sqrt((float)(SOUND_MAX_LEFT2RIGHT * SOUND_MAX_LEFT2RIGHT - i * i));
{
byte *sample_ptr = (byte *)snd_ctrl->data_ptr + num_channels * sample_pos;
- for (i=0; i<num_output_channels; i++)
+ for (i = 0; i < num_output_channels; i++)
{
int offset = (snd_ctrl->num_channels == 1 ? 0 : i);
- for (j=0; j<sample_size; j++)
+ for (j = 0; j < sample_size; j++)
buffer_ptr[output_stepsize * j + i] =
((short)(sample_ptr[stepsize * j + offset] ^ 0x80)) << 8;
}
{
short *sample_ptr= (short *)snd_ctrl->data_ptr + num_channels * sample_pos;
- for (i=0; i<num_output_channels; i++)
+ for (i = 0; i < num_output_channels; i++)
{
int offset = (snd_ctrl->num_channels == 1 ? 0 : i);
- for (j=0; j<sample_size; j++)
+ for (j = 0; j < sample_size; j++)
buffer_ptr[output_stepsize * j + i] =
sample_ptr[stepsize * j + offset];
}
memset(premix_last_buffer, 0,
max_sample_size * num_output_channels * sizeof(long));
- for(i=0; i<audio.num_channels; i++)
+ for (i = 0; i < audio.num_channels; i++)
{
void *sample_ptr;
int sample_len;
/* adjust volume of actual sound sample */
if (mixer[i].volume != SOUND_MAX_VOLUME)
- for(j=0; j<sample_size * num_output_channels; j++)
+ for (j = 0; j < sample_size * num_output_channels; j++)
premix_first_buffer[j] =
mixer[i].volume * (long)premix_first_buffer[j] / SOUND_MAX_VOLUME;
int left_volume = SOUND_VOLUME_LEFT(mixer[i].stereo_position);
int right_volume = SOUND_VOLUME_RIGHT(mixer[i].stereo_position);
- for(j=0; j<sample_size; j++)
+ for (j = 0; j < sample_size; j++)
{
premix_first_buffer[2 * j + 0] =
left_volume * premix_first_buffer[2 * j + 0] / SOUND_MAX_LEFT2RIGHT;
}
/* fill the last mixing buffer with stereo or mono sound */
- for(j=0; j<sample_size * num_output_channels; j++)
+ for (j = 0; j < sample_size * num_output_channels; j++)
premix_last_buffer[j] += premix_first_buffer[j];
/* delete completed sound entries from the mixer */
}
/* prepare final playing buffer according to system audio format */
- for(i=0; i<max_sample_size * num_output_channels; i++)
+ for (i = 0; i < max_sample_size * num_output_channels; i++)
{
/* cut off at 17 bit value */
if (premix_last_buffer[i] < -65535)
/* adjust volume of actual sound sample */
if (mixer[i].volume != SOUND_MAX_VOLUME)
- for(j=0; j<sample_size; j++)
+ for (j = 0; j < sample_size; j++)
premix_first_buffer[j] =
mixer[i].volume * (long)premix_first_buffer[j] / SOUND_MAX_VOLUME;
/* might be needed for u-law /dev/audio */
#if 1
- for(j=0; j<sample_size; j++)
+ for (j = 0; j < sample_size; j++)
playing_buffer[j] =
linear_to_ulaw(premix_first_buffer[j]);
#endif
if (mixer[i].playing_pos >= mixer[i].data_len)
Mixer_StopChannel(i);
- for(i=0; i<sample_size; i++)
+ for (i = 0; i < sample_size; i++)
playing_buffer[i] = (premix_first_buffer[i] >> 8) ^ 0x80;
/* finally play the sound fragment */
FD_ZERO(&mixer_fdset);
FD_SET(audio.mixer_pipe[0], &mixer_fdset);
- while(1) /* wait for sound playing commands from client */
+ while (1) /* wait for sound playing commands from client */
{
struct timeval delay = { 0, 0 };
int i;
if (snd_ctrl->format == AUDIO_FORMAT_U8)
- for (i=0; i<sample_size; i++)
+ for (i = 0; i < sample_size; i++)
*buffer_ptr++ =
((short)(((byte *)sample_ptr)[i] ^ 0x80)) << 8;
else /* AUDIO_FORMAT_S16 */
- for (i=0; i<sample_size; i++)
+ for (i = 0; i < sample_size; i++)
*buffer_ptr++ =
((short *)sample_ptr)[i];
}
boolean music_already_used = FALSE;
int i;
- for (i=0; i < num_music; i++)
+ for (i = 0; i < num_music; i++)
{
struct FileInfo *music = getMusicListEntry(i);
sound_info->dynamic_file_list = NULL;
sound_info->num_suffix_list_entries = 0;
- for (i=0; config_suffix_list[i].token != NULL; i++)
+ for (i = 0; config_suffix_list[i].token != NULL; i++)
sound_info->num_suffix_list_entries++;
sound_info->suffix_list = config_suffix_list;
/* ---------- initialize base prefix and suffixes lists ---------- */
sound_info->num_base_prefixes = 0;
- for (i=0; base_prefixes[i] != NULL; i++)
+ for (i = 0; base_prefixes[i] != NULL; i++)
sound_info->num_base_prefixes++;
sound_info->num_ext1_suffixes = 0;
- for (i=0; ext1_suffixes[i] != NULL; i++)
+ for (i = 0; ext1_suffixes[i] != NULL; i++)
sound_info->num_ext1_suffixes++;
sound_info->num_ext2_suffixes = 0;
- for (i=0; ext2_suffixes[i] != NULL; i++)
+ for (i = 0; ext2_suffixes[i] != NULL; i++)
sound_info->num_ext2_suffixes++;
sound_info->num_ext3_suffixes = 0;
- for (i=0; ext3_suffixes[i] != NULL; i++)
+ for (i = 0; ext3_suffixes[i] != NULL; i++)
sound_info->num_ext3_suffixes++;
sound_info->num_ignore_tokens = 0;
- for (i=0; ignore_tokens[i] != NULL; i++)
+ for (i = 0; ignore_tokens[i] != NULL; i++)
sound_info->num_ignore_tokens++;
sound_info->base_prefixes = base_prefixes;
music_info->dynamic_file_list = NULL;
music_info->num_suffix_list_entries = 0;
- for (i=0; config_suffix_list[i].token != NULL; i++)
+ for (i = 0; config_suffix_list[i].token != NULL; i++)
music_info->num_suffix_list_entries++;
music_info->suffix_list = config_suffix_list;
/* ---------- initialize base prefix and suffixes lists ---------- */
music_info->num_base_prefixes = 0;
- for (i=0; base_prefixes[i] != NULL; i++)
+ for (i = 0; base_prefixes[i] != NULL; i++)
music_info->num_base_prefixes++;
music_info->num_ext1_suffixes = 0;
- for (i=0; ext1_suffixes[i] != NULL; i++)
+ for (i = 0; ext1_suffixes[i] != NULL; i++)
music_info->num_ext1_suffixes++;
music_info->num_ext2_suffixes = 0;
- for (i=0; ext2_suffixes[i] != NULL; i++)
+ for (i = 0; ext2_suffixes[i] != NULL; i++)
music_info->num_ext2_suffixes++;
music_info->num_ext3_suffixes = 0;
- for (i=0; ext3_suffixes[i] != NULL; i++)
+ for (i = 0; ext3_suffixes[i] != NULL; i++)
music_info->num_ext3_suffixes++;
music_info->num_ignore_tokens = 0;
- for (i=0; ignore_tokens[i] != NULL; i++)
+ for (i = 0; ignore_tokens[i] != NULL; i++)
music_info->num_ignore_tokens++;
music_info->base_prefixes = base_prefixes;
if (Music_NoConf == NULL)
return;
- for(i=0; i < num_music_noconf; i++)
+ for (i = 0; i < num_music_noconf; i++)
FreeMusic(Music_NoConf[i]);
free(Music_NoConf);
int tile_ysteps = (bitmap_ysize + tile_ysize - 1) / tile_ysize;
int x, y;
- for (y=0; y < tile_ysteps; y++)
+ for (y = 0; y < tile_ysteps; y++)
{
- for (x=0; x < tile_xsteps; x++)
+ for (x = 0; x < tile_xsteps; x++)
{
int draw_x = dest_x + x * tile_xsize;
int draw_y = dest_y + y * tile_ysize;
{
int x, y;
- for (x=0; x<line_width; x++)
+ for (x = 0; x < line_width; x++)
{
- for (y=0; y<line_width; y++)
+ for (y = 0; y < line_width; y++)
{
int dx = x - line_width / 2;
int dy = y - line_width / 2;
int line_width = 4;
int i;
- for (i=0; i<num_points - 1; i++)
+ for (i = 0; i < num_points - 1; i++)
DrawLine(bitmap, points[i].x, points[i].y,
points[i + 1].x, points[i + 1].y, pixel, line_width);
sscanf(image[0], " %d %d ", &cursor->width, &cursor->height);
i = -1;
- for (y=0; y < cursor->width; y++)
+ for (y = 0; y < cursor->width; y++)
{
- for (x=0; x < cursor->height; x++)
+ for (x = 0; x < cursor->height; x++)
{
int bit_nr = x % 8;
int bit_mask = 0x01 << (bit_order_msb ? 7 - bit_nr : bit_nr );
/* always start with reliable default values */
joystick.status = JOYSTICK_NOT_AVAILABLE;
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
joystick.fd[i] = -1; /* joystick device closed */
#if defined(TARGET_SDL)
clip_gc_valuemask, &clip_gc_values);
/* create only those clipping Pixmaps we really need */
- for (i=0; i < gfx.num_fonts; i++)
+ for (i = 0; i < gfx.num_fonts; i++)
{
if (gfx.font_bitmap_info[i].bitmap == NULL)
continue;
gfx.font_bitmap_info[i].clip_mask =
checked_calloc(gfx.font_bitmap_info[i].num_chars * sizeof(Pixmap));
- for (j=0; j < gfx.font_bitmap_info[i].num_chars; j++)
+ for (j = 0; j < gfx.font_bitmap_info[i].num_chars; j++)
{
Bitmap *src_bitmap = gfx.font_bitmap_info[i].bitmap;
Pixmap src_pixmap = src_bitmap->clip_mask;
if (gfx.num_fonts == 0 || gfx.font_bitmap_info[0].bitmap == NULL)
return;
- for (i=0; i < gfx.num_fonts; i++)
+ for (i = 0; i < gfx.num_fonts; i++)
{
if (gfx.font_bitmap_info[i].clip_mask)
{
- for (j=0; j < gfx.font_bitmap_info[i].num_chars; j++)
+ for (j = 0; j < gfx.font_bitmap_info[i].num_chars; j++)
XFreePixmap(display, gfx.font_bitmap_info[i].clip_mask[j]);
free(gfx.font_bitmap_info[i].clip_mask);
}
char buffer[MAX_OUTPUT_LINESIZE + 1];
int i;
- for (i=0; i < line_length && *text; i++)
+ for (i = 0; i < line_length && *text; i++)
if ((buffer[i] = *text++) == '\n')
break;
buffer[MIN(i, area_xsize)] = '\0';
XCreateGC(display, new_window->drawable, gc_valuemask, &gc_values);
/* create GCs for line drawing (black and white) */
- for(i=0; i<2; i++)
+ for (i = 0; i < 2; i++)
{
gc_values.graphics_exposures = False;
gc_values.foreground = (i ? pen_fg : pen_bg);
realbuffer[0] = realbuffer[1] = realbuffer[2] = 0;
realbuffer[3] = (unsigned char)len;
- for (player=first_player; player; player=player->next)
- if (player != except && (player->active || !activeonly) && player->introduced)
+ for (player = first_player; player; player = player->next)
+ if (player != except && player->introduced &&
+ (player->active || !activeonly))
addtobuffer(player, realbuffer, 4 + len);
}
first_player = player->next;
else
{
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
if (v->next && v->next == player)
{
{
struct NetworkServerPlayerInfo *player, *v;
unsigned char nxn;
+ boolean again = TRUE;
player = checked_malloc(sizeof (struct NetworkServerPlayerInfo));
nxn = 1;
+#if 1
+ while (again)
+ {
+ again = FALSE;
+ v = player->next;
+
+ while (v)
+ {
+ if (v->number == nxn)
+ {
+ nxn++;
+
+ again = TRUE;
+ break;
+ }
+ v = v->next;
+ }
+ }
+#else
again:
v = player->next;
- while(v)
+ while (v)
{
if (v->number == nxn)
{
}
v = v->next;
}
+#endif
player->number = nxn;
if (options.verbose)
Error(ERR_NETWORK_SERVER, "client %d (%s) wants to switch to # %d",
player->number, player->player_name, nr_wanted);
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
if (v->number == nr_wanted)
{
len=16;
memcpy(player->player_name, &buffer[2], len-2);
player->player_name[len-2] = 0;
- for (i=0; i<len-2; i++)
+ for (i = 0; i < len - 2; i++)
{
if (player->player_name[i] < ' ' ||
((unsigned char)(player->player_name[i]) > 0x7e &&
if (!player->introduced)
{
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
if (v != player && v->introduced)
{
(buffer[4] << 8) + buffer[5],
&buffer[6]);
- for (w=first_player; w; w=w->next)
+ for (w = first_player; w; w = w->next)
if (w->introduced)
w->active = 1;
ServerFrameCounter = 0;
/* reset player actions */
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
v->action = 0;
v->action_received = FALSE;
int i;
/* store player action */
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
if (v->number == player->number)
{
}
/* check if server received action from each player */
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
if (!v->action_received)
return;
}
/* initialize all player actions to zero */
- for (i=0; i<last_client_nr; i++)
+ for (i = 0; i < last_client_nr; i++)
buffer[6 + i] = 0;
/* broadcast actions of all players to all players */
- for (v=first_player; v; v=v->next)
+ for (v = first_player; v; v = v->next)
{
buffer[6 + v->number-1] = v->action;
v->action = 0;
{
/* become a daemon, breaking all ties with the controlling terminal */
options.verbose = FALSE;
- for (i=0; i<255; i++)
+ for (i = 0; i < 255; i++)
{
if (i != lfd)
close(i);
PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, PROTOCOL_VERSION_3);
}
- while(1)
+ while (1)
{
interrupt = 0;
- for (player=first_player; player; player=player->next)
+ for (player = first_player; player; player = player->next)
flushuser(player);
FD_ZERO(&fds);
else if (player_nr == first_player.nr)
return("you");
else
- for (player=&first_player; player; player=player->next)
+ for (player = &first_player; player; player = player->next)
if (player->nr == player_nr && player->name && strlen(player->name))
return(player->name);
StartNetworkServer(port);
/* wait for server to start up and try connecting several times */
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
{
Delay(500); /* wait 500 ms == 0.5 seconds */
close(sfd);
printf("OP_PLAYER_CONNECTED: %d\n", new_client_nr);
Error(ERR_NETWORK_CLIENT, "new client %d connected", new_client_nr);
- for (player=&first_player; player; player=player->next)
+ for (player = &first_player; player; player = player->next)
{
if (player->nr == new_client_nr)
Error(ERR_EXIT, "multiplayer server sent duplicate player id");
Error(ERR_NETWORK_CLIENT, "client %d (%s) disconnected",
player_nr, getNetworkPlayerName(buffer[0]));
- for (player=&first_player; player; player=player->next)
+ for (player = &first_player; player; player = player->next)
if (player->next == player_disconnected)
player->next = player_disconnected->next;
free(player_disconnected);
}
/* copy valid player actions */
- for (i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].effective_action =
(i < len - 6 && stored_player[i].active ? buffer[6 + i] : 0);
mSY + 3 * 32 + 1 + 7, FONT_TEXT_3, "ONLY");
}
- for(i=0; i<8; i++)
+ for (i = 0; i < 8; i++)
initCursor(i, (i == 1 || i == 6 ? IMG_MENU_BUTTON_RIGHT :IMG_MENU_BUTTON));
drawCursorXY(level_width/32 + 4, 1, IMG_MENU_BUTTON_LEFT);
{
if (!infoscreen_frame[i - start])
infoscreen_step[i - start]++;
- while(helpanim_info[j].element != -1)
+ while (helpanim_info[j].element != -1)
j++;
}
UnmapAllGadgets();
CloseDoor(DOOR_CLOSE_2);
- for(i=0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
+ for (i = 0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
infoscreen_step[i] = infoscreen_frame[i] = 0;
infoscreen_musicpos = 0;
infoscreen_state = 0;
LoadMusicInfo();
num_infoscreen_elements = 0;
- for (i=0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
+ for (i = 0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
if (helpanim_info[i].element == HELPANIM_LIST_NEXT)
num_infoscreen_elements++;
UnmapAllGadgets();
CloseDoor(DOOR_CLOSE_2);
- for(i=0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
+ for (i = 0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
infoscreen_step[i] = infoscreen_frame[i] = 0;
infoscreen_musicpos = 0;
infoscreen_state = 0;
LoadMusicInfo();
num_infoscreen_elements = 0;
- for (i=0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
+ for (i = 0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
if (helpanim_info[i].element == HELPANIM_LIST_NEXT)
num_infoscreen_elements++;
{
if (infoscreen_state < num_infoscreen_element_pages - 1)
{
- for(i=0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
+ for (i = 0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++)
infoscreen_step[i] = infoscreen_frame[i] = 0;
infoscreen_state++;
SXSIZE - 32 + menu.scrollbar_xoffset,
MAX_MENU_ENTRIES_ON_SCREEN * 32);
- for(i=0; i<num_page_entries; i++)
+ for (i = 0; i < num_page_entries; i++)
{
TreeInfo *node, *node_first;
int entry_pos = first_entry + i;
/* let BackToFront() redraw only what is needed */
redraw_mask = last_redraw_mask | REDRAW_TILES;
- for (x=0; x<SCR_FIELDX; x++)
+ for (x = 0; x < SCR_FIELDX; x++)
MarkTileDirty(x, 1);
}
DrawText(mSX + 80, mSY + 8, "Hall Of Fame", FONT_TITLE_1);
DrawTextFCentered(46, FONT_TITLE_2, "HighScores of Level %d", level_nr);
- for(i=0; i<NUM_MENU_ENTRIES_ON_SCREEN; i++)
+ for (i = 0; i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
int entry = first_entry + i;
boolean active = (entry == highlight_position);
DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1);
num_setup_info = 0;
- for(i=0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
+ for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
void *value_ptr = setup_info[i].value;
int ypos = MENU_SCREEN_START_YPOS + i;
}
else if (button == MB_MENU_LEAVE)
{
- for (y=0; y<num_setup_info; y++)
+ for (y = 0; y < num_setup_info; y++)
{
if (setup_info[y].type & TYPE_LEAVE_MENU)
{
DrawText(mSX+32, mSY+10*32, "Snap Field:", FONT_VALUE_OLD);
DrawText(mSX+32, mSY+12*32, "Place Bomb:", FONT_VALUE_OLD);
- for (i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
{
int ypos = 6 + i + (i > 3 ? i-3 : 0);
DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32,
getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD);
- while(!finished)
+ while (!finished)
{
if (PendingEvent()) /* got event */
{
key = *customize_step[step_nr].key;
/* check if key already used */
- for (i=0; i<step_nr; i++)
+ for (i = 0; i < step_nr; i++)
if (*customize_step[i].key == key)
break;
if (i < step_nr)
ClearWindow();
- for(y=0; y < 3; y++)
+ for (y = 0; y < 3; y++)
{
- for(x=0; x < 3; x++)
+ for (x = 0; x < 3; x++)
{
DrawGraphic(xpos + x - 1, ypos + y - 1, IMG_MENU_CALIBRATE_BLUE, 0);
check[x][y] = FALSE;
DrawGraphic(xpos + last_x, ypos + last_y, IMG_MENU_CALIBRATE_RED, 0);
BackToFront();
- while(Joystick(player_nr) & JOY_BUTTON); /* wait for released button */
+ while (Joystick(player_nr) & JOY_BUTTON); /* wait for released button */
InitAnimation();
- while(result < 0)
+ while (result < 0)
{
if (PendingEvent()) /* got event */
{
{
ClearWindow();
- DrawText(mSX + 16, mSY + 6*32, " JOYSTICK NOT ", FONT_TITLE_1);
- DrawText(mSX, mSY + 7*32, " AVAILABLE ", FONT_TITLE_1);
+ DrawText(mSX + 16, mSY + 6 * 32, " JOYSTICK NOT ", FONT_TITLE_1);
+ DrawText(mSX, mSY + 7 * 32, " AVAILABLE ", FONT_TITLE_1);
BackToFront();
Delay(2000); /* show error message for two seconds */
}
unsigned long event_mask;
int i;
- for (i=0; i<NUM_SCREEN_SCROLLBUTTONS; i++)
+ for (i = 0; i < NUM_SCREEN_SCROLLBUTTONS; i++)
{
Bitmap *gd_bitmap_unpressed, *gd_bitmap_pressed;
int gfx_unpressed, gfx_pressed;
{
int i;
- for (i=0; i<NUM_SCREEN_SCROLLBARS; i++)
+ for (i = 0; i < NUM_SCREEN_SCROLLBARS; i++)
{
Bitmap *gd_bitmap_unpressed, *gd_bitmap_pressed;
#if !defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
int i;
- for (i=0; i < NUM_SCROLLBAR_BITMAPS; i++)
+ for (i = 0; i < NUM_SCROLLBAR_BITMAPS; i++)
{
scrollbar_bitmap[i] = CreateBitmap(TILEX, TILEY, DEFAULT_DEPTH);
int i;
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
- for (i=0; i < NUM_SCROLLBAR_BITMAPS; i++)
+ for (i = 0; i < NUM_SCROLLBAR_BITMAPS; i++)
{
/* prevent freeing clip mask and GC twice */
scrollbar_bitmap[i]->clip_mask = None;
}
#endif
- for (i=0; i<NUM_SCREEN_GADGETS; i++)
+ for (i = 0; i < NUM_SCREEN_GADGETS; i++)
FreeGadget(screen_gadget[i]);
}
if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
return;
- for (i=0; i<NUM_SCREEN_GADGETS; i++)
+ for (i = 0; i < NUM_SCREEN_GADGETS; i++)
MapGadget(screen_gadget[i]);
}
{
int i;
- for (i=0; i<NUM_SCREEN_GADGETS; i++)
+ for (i = 0; i < NUM_SCREEN_GADGETS; i++)
UnmapGadget(screen_gadget[i]);
}
VY + VIDEO_REC_LABEL_YPOS);
}
- for(i=0;i<10;i++)
+ for (i = 0; i < 10; i++)
{
if (state & (1<<i))
{
level.game_version);
#endif
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
tape.player_participates[i] = FALSE;
}
{
boolean changed_events = FALSE;
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (tape.pos[tape.counter].action[i] != action[i])
changed_events = TRUE;
if (tape.pos[tape.counter].delay == 0) /* store new action */
{
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
tape.pos[tape.counter].action[i] = action[i];
tape.pos[tape.counter].delay++;
return NULL;
}
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
action[i] = tape.pos[tape.counter].action[i];
tape.delay_played++;
if (TAPE_IS_EMPTY(tape))
return(0);
- for(i=0;i<tape.length;i++)
+ for (i = 0; i < tape.length; i++)
tape_length += tape.pos[i].delay;
return(tape_length * GAME_FRAME_DELAY / 1000);
printf_line("=", 79);
printf("\n");
- for (i=0; i<MAX_NUM_AUTOPLAY_LEVELS; i++)
+ for (i = 0; i < MAX_NUM_AUTOPLAY_LEVELS; i++)
levels_failed[i] = FALSE;
autoplay_initialized = TRUE;
if (num_levels_played != num_levels_solved)
{
printf(", FAILED:");
- for (i=0; i<MAX_NUM_AUTOPLAY_LEVELS; i++)
+ for (i = 0; i < MAX_NUM_AUTOPLAY_LEVELS; i++)
if (levels_failed[i])
printf(" %03d", i);
}
{
int i;
- for (i=0; i<NUM_TAPE_BUTTONS; i++)
+ for (i = 0; i < NUM_TAPE_BUTTONS; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
struct GadgetInfo *gi;
{
int i;
- for (i=0; i<NUM_TAPE_BUTTONS; i++)
+ for (i = 0; i < NUM_TAPE_BUTTONS; i++)
FreeGadget(tape_gadget[i]);
}
{
int i;
- for (i=0; i<NUM_TAPE_BUTTONS; i++)
+ for (i = 0; i < NUM_TAPE_BUTTONS; i++)
if (i != TAPE_CTRL_ID_INDEX)
MapGadget(tape_gadget[i]);
{
int i;
- for (i=0; i<NUM_TAPE_BUTTONS; i++)
+ for (i = 0; i < NUM_TAPE_BUTTONS; i++)
UnmapGadget(tape_gadget[i]);
}
if (setup.direct_draw)
SetDrawtoField(DRAW_BACKBUFFER);
- for(xx=BX1; xx<=BX2; xx++)
- for(yy=BY1; yy<=BY2; yy++)
+ for (xx = BX1; xx <= BX2; xx++)
+ for (yy = BY1; yy <= BY2; yy++)
if (xx >= x1 && xx <= x2 && yy >= y1 && yy <= y2)
DrawScreenField(xx, yy);
DrawAllPlayers();
if (redraw_mask & REDRAW_TILES)
{
- for(x=0; x<SCR_FIELDX; x++)
- for(y=0; y<SCR_FIELDY; y++)
+ for (x = 0; x < SCR_FIELDX; x++)
+ for (y =0 ; y < SCR_FIELDY; y++)
if (redraw[redraw_x1 + x][redraw_y1 + y])
BlitBitmap(buffer, window,
FX + x * TILEX, FX + y * TILEY, TILEX, TILEY,
FlushDisplay();
- for(x=0; x<MAX_BUF_XSIZE; x++)
- for(y=0; y<MAX_BUF_YSIZE; y++)
+ for (x = 0; x < MAX_BUF_XSIZE; x++)
+ for (y = 0; y < MAX_BUF_YSIZE; y++)
redraw[x][y] = 0;
redraw_tiles = 0;
redraw_mask = REDRAW_NONE;
ClearRectangle(window, REAL_SX,REAL_SY,FULL_SXSIZE,FULL_SYSIZE);
FlushDisplay();
- for(i=0;i<2*FULL_SYSIZE;i++)
+ for (i = 0; i < 2 * FULL_SYSIZE; i++)
{
- for(y=0;y<FULL_SYSIZE;y++)
+ for (y = 0; y < FULL_SYSIZE; y++)
{
BlitBitmap(backbuffer, window,
REAL_SX,REAL_SY+i, FULL_SXSIZE,1, REAL_SX,REAL_SY+i);
#endif
#if 0
- for(i=1;i<FULL_SYSIZE;i+=2)
+ for (i = 1; i < FULL_SYSIZE; i+=2)
BlitBitmap(backbuffer, window,
REAL_SX,REAL_SY+i, FULL_SXSIZE,1, REAL_SX,REAL_SY+i);
FlushDisplay();
BorderElement = EL_EMPTY;
- for(y=0; y<lev_fieldy && BorderElement == EL_EMPTY; y++)
+ for (y = 0; y < lev_fieldy && BorderElement == EL_EMPTY; y++)
{
- for(x=0; x<lev_fieldx; x++)
+ for (x = 0; x < lev_fieldx; x++)
{
if (!IS_INDESTRUCTIBLE(Feld[x][y]))
BorderElement = EL_STEELWALL;
{
int i;
- for(i=0; i<MAX_PLAYERS; i++)
+ for (i = 0; i < MAX_PLAYERS; i++)
if (stored_player[i].active)
DrawPlayer(&stored_player[i]);
}
getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
- for(i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0];
int yy = y + xy[i][1];
getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
#endif
- for(i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0];
int yy = y + xy[i][1];
};
int i;
- for(i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
{
int xx = x + xy[i][0];
int yy = y + xy[i][1];
int ystep = (ystart < yend || xstep == 0 ? 1 : 0);
int x, y;
- for (x=xstart, y=ystart; x <= xend && y <= yend; x += xstep, y += ystep)
+ for (x = xstart, y = ystart; x <= xend && y <= yend; x += xstep, y += ystep)
{
int xsize = (action == ACTION_CLOSING ? xend - (x - xstart) : x) + 2;
int ysize = (action == ACTION_CLOSING ? yend - (y - ystart) : y) + 2;
SetDrawtoField(DRAW_BACKBUFFER);
- for (yy=0; yy < ysize; yy++) for (xx=0; xx < xsize; xx++)
+ for (yy = 0; yy < ysize; yy++) for (xx = 0; xx < xsize; xx++)
DrawEnvelopeBackground(envelope_nr, sx,sy, xx,yy, xsize, ysize, font_nr);
DrawTextToTextArea(SX + sx + font_width, SY + sy + font_height,
SetDrawBackgroundMask(REDRAW_NONE);
ClearWindow();
- for(x=BX1; x<=BX2; x++)
- for(y=BY1; y<=BY2; y++)
+ for (x = BX1; x <= BX2; x++)
+ for (y = BY1; y <= BY2; y++)
DrawScreenField(x, y);
redraw_mask |= REDRAW_FIELD;
{
int x,y;
- for(x=0; x<size_x; x++)
- for(y=0; y<size_y; y++)
+ for (x = 0; x < size_x; x++)
+ for (y = 0; y < size_y; y++)
DrawMiniElementOrWall(x, y, scroll_x, scroll_y);
redraw_mask |= REDRAW_FIELD;
xpos += MICRO_TILEX;
ypos += MICRO_TILEY;
- for(x=-1; x<=STD_LEV_FIELDX; x++)
+ for (x = -1; x <= STD_LEV_FIELDX; x++)
{
- for(y=-1; y<=STD_LEV_FIELDY; y++)
+ for (y = -1; y <= STD_LEV_FIELDY; y++)
{
int lx = from_x + x, ly = from_y + y;
game_status = GAME_MODE_PSEUDO_DOOR;
/* write text for request */
- for(ty=0; ty < MAX_REQUEST_LINES; ty++)
+ for (ty = 0; ty < MAX_REQUEST_LINES; ty++)
{
char text_line[MAX_REQUEST_LINE_LEN + 1];
int tx, tl, tc;
if (!*text)
break;
- for(tl=0,tx=0; tx < MAX_REQUEST_LINE_LEN; tl++,tx++)
+ for (tl = 0, tx = 0; tx < MAX_REQUEST_LINE_LEN; tl++, tx++)
{
tc = *(text + tx);
if (!tc || tc == ' ')
SetMouseCursor(CURSOR_DEFAULT);
#endif
- while(result < 0)
+ while (result < 0)
{
if (PendingEvent())
{
PlaySoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE);
}
- for(x = start; x <= end && !(door_1_done && door_2_done); x += stepsize)
+ for (x = start; x <= end && !(door_1_done && door_2_done); x += stepsize)
{
Bitmap *bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
GC gc = bitmap->stored_clip_gc;
{
int i;
- for (i=0; i<NUM_TOOL_BUTTONS; i++)
+ for (i = 0; i < NUM_TOOL_BUTTONS; i++)
{
Bitmap *gd_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
Bitmap *deco_bitmap = None;
{
int i;
- for (i=0; i<NUM_TOOL_BUTTONS; i++)
+ for (i = 0; i < NUM_TOOL_BUTTONS; i++)
FreeGadget(tool_gadget[i]);
}
{
int i;
- for (i=0; i<NUM_TOOL_BUTTONS; i++)
+ for (i = 0; i < NUM_TOOL_BUTTONS; i++)
UnmapGadget(tool_gadget[i]);
}