diff options
author | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
commit | 116c77c342d0f628235a7f5dbacfbb5bc3fb0829 (patch) | |
tree | d2dd74828426b0c82b4dab368e6aff5ff71f3bad /src/music_gui.cpp | |
parent | 9d7fe9bd8688f2d4123dc98e2b222a5be70b306f (diff) | |
download | openttd-116c77c342d0f628235a7f5dbacfbb5bc3fb0829.tar.xz |
(svn r17572) -Codechange: Use the Window::GetWidget() function to access nested widgets through the nested_array.
Diffstat (limited to 'src/music_gui.cpp')
-rw-r--r-- | src/music_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 802b5137c..aed617587 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -325,7 +325,7 @@ struct MusicTrackSelectionWindow : public Window { { switch (widget) { case MTSW_LIST_LEFT: { // add to playlist - int y = (pt.y - this->nested_array[widget]->pos_y) / FONT_HEIGHT_SMALL; + int y = (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / FONT_HEIGHT_SMALL; if (msf.playlist < 4) return; if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return; @@ -343,7 +343,7 @@ struct MusicTrackSelectionWindow : public Window { } break; case MTSW_LIST_RIGHT: { // remove from playlist - int y = (pt.y - this->nested_array[widget]->pos_y) / FONT_HEIGHT_SMALL; + int y = (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / FONT_HEIGHT_SMALL; if (msf.playlist < 4) return; if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return; @@ -583,11 +583,11 @@ struct MusicWindow : public Window { break; case MW_MUSIC_VOL: case MW_EFFECT_VOL: { // volume sliders - int x = pt.x - this->nested_array[widget]->pos_x; + int x = pt.x - this->GetWidget<NWidgetBase>(widget)->pos_x; byte *vol = (widget == MW_MUSIC_VOL) ? &msf.music_vol : &msf.effect_vol; - byte new_vol = x * 127 / this->nested_array[widget]->current_x; + byte new_vol = x * 127 / this->GetWidget<NWidgetBase>(widget)->current_x; if (new_vol != *vol) { *vol = new_vol; if (widget == MW_MUSIC_VOL) MusicVolumeChanged(new_vol); |