diff -r 08e7aed96ef9 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Nov 16 14:25:35 2008 +0100 +++ b/src/settings_gui.cpp Sun Nov 16 14:29:34 2008 +0100 @@ -611,7 +611,7 @@ PatchEntry(const char *nm); void Init(); - uint Draw(GameSettings *patches_ptr, int x, int y, uint first_row, uint max_row, uint row = 0); + uint Draw(GameSettings *patches_ptr, int x, int y, uint first_row, uint max_row, uint cur_row = 0); void SetButtons(uint16 new_value); private: @@ -627,7 +627,7 @@ PatchEntry *FindEntry(uint row) const; byte Length() const; - uint Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint row = 0) const; + uint Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint cur_row = 0) const; }; /* == PatchEntry methods == */ @@ -660,27 +660,27 @@ * @param base_y Upper-most position in window/panel to start drawing \a first_row * @param first_row First row number to draw * @param max_row Row-number to stop drawing (the row-number of the row below the last row to draw) - * @param row Current row number (internal variable) + * @param cur_row Current row number (internal variable) * @return Row number of the next row to draw */ -uint PatchEntry::Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint row) +uint PatchEntry::Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint cur_row) { - if (row >= max_row) - return row; + if (cur_row >= max_row) + return cur_row; switch(flags & PEF_KIND_MASK) { case PEF_SETTING_KIND: { - if (row >= first_row) { + if (cur_row >= first_row) { int state = flags & (PEF_LEFT_DEPRESSED | PEF_RIGHT_DEPRESSED); - int y = base_y + (row - first_row) * SETTING_HEIGHT; + int y = base_y + (cur_row - first_row) * SETTING_HEIGHT; DrawPatch(patches_ptr, d.entry.setting, base_x, y, state); } - row++; + cur_row++; break; } default: NOT_REACHED(); } - return row; + return cur_row; } /** @@ -783,20 +783,20 @@ * @param base_y Upper-most position in window/panel to start drawing of row number \a first_row * @param first_row Number of first row to draw * @param max_row Row-number to stop drawing (the row-number of the row below the last row to draw) - * @param row Current row number (internal variable) + * @param cur_row Current row number (internal variable) * @return Row number of the next row to draw */ -uint PatchPage::Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint row) const +uint PatchPage::Draw(GameSettings *patches_ptr, int base_x, int base_y, uint first_row, uint max_row, uint cur_row) const { - if (row >= max_row) - return row; + if (cur_row >= max_row) + return cur_row; for (uint i = 0; i < num; i++) { - row = entries[i].Draw(patches_ptr, base_x, base_y, first_row, max_row, row); - if (row >= max_row) + cur_row = entries[i].Draw(patches_ptr, base_x, base_y, first_row, max_row, cur_row); + if (cur_row >= max_row) break; } - return row; + return cur_row; } static PatchEntry _patches_ui[] = {