diff -r 18508a7ae7d2 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Nov 16 09:40:22 2008 +0100 +++ b/src/settings_gui.cpp Sun Nov 16 10:14:48 2008 +0100 @@ -594,6 +594,8 @@ PatchEntry(const char *nm); void Init(); + void Draw(GameSettings *patches_ptr, int x, int y, int state); +private: void DrawPatch(GameSettings *patches_ptr, const SettingDesc *sd, int x, int y, int state); }; @@ -617,6 +619,26 @@ assert(setting != NULL); } +/** + * Draw a row in the settings panel + * @param patches_ptr Pointer to current values of all settings + * @param x Left-most position in window/panel to start drawing + * @param y Upper-most position in window/panel to start drawing + * @param state State of the left + right arrow buttons to draw for the setting + */ +void PatchEntry::Draw(GameSettings *patches_ptr, int x, int y, int state) +{ + DrawPatch(patches_ptr, setting, x, y, state); +} + +/** + * Draw setting value (button + text + current value) + * @param patches_ptr Pointer to current values of all settings + * @param sd Pointer to value description of setting to draw + * @param x Left-most position in window/panel to start drawing + * @param y Upper-most position in window/panel to start drawing + * @param state State of the left + right arrow buttons to draw for the setting + */ void PatchEntry::DrawPatch(GameSettings *patches_ptr, const SettingDesc *sd, int x, int y, int state) { const SettingDescBase *sdb = &sd->desc; @@ -874,8 +896,7 @@ int x = SETTINGTREE_LEFT_OFFSET; int y = SETTINGTREE_TOP_OFFSET; for (uint i = vscroll.pos; i != page->num && i < vscroll.pos + vscroll.cap; i++) { - const SettingDesc *sd = page->entries[i].setting; - page->entries[i].DrawPatch(patches_ptr, sd, x, y, this->click - (i * 2)); + page->entries[i].Draw(patches_ptr, x, y, this->click - (i * 2)); y += SETTING_HEIGHT; } }