src/music_gui.cpp
branchNewGRF_ports
changeset 10724 68a692eacf22
parent 6877 889301acc299
child 10731 67db0d431d5e
--- a/src/music_gui.cpp	Fri Apr 25 02:15:34 2008 +0000
+++ b/src/music_gui.cpp	Mon May 26 20:45:25 2008 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file music_gui.cpp */
+/** @file music_gui.cpp GUI for the music playback. */
 
 #include "stdafx.h"
 #include "openttd.h"
@@ -204,7 +204,7 @@
 		w->SetWidgetDisabledState(11, msf.playlist <= 3);
 		w->LowerWidget(3);
 		w->LowerWidget(4);
-		DrawWindowWidgets(w);
+		w->DrawWidgets();
 
 		GfxFillRect(3, 23, 3 + 177, 23 + 191, 0);
 		GfxFillRect(251, 23, 251 + 177, 23 + 191, 0);
@@ -256,7 +256,7 @@
 				if (p[i] == 0) {
 					p[i] = y + 1;
 					p[i + 1] = 0;
-					SetWindowDirty(w);
+					w->SetDirty();
 					SelectSongToPlay();
 					break;
 				}
@@ -276,13 +276,13 @@
 				p[i] = p[i + 1];
 				}
 
-			SetWindowDirty(w);
+			w->SetDirty();
 			SelectSongToPlay();
 		} break;
 
 		case 11: // clear
 			_playlists[msf.playlist][0] = 0;
-			SetWindowDirty(w);
+			w->SetDirty();
 			StopMusic();
 			SelectSongToPlay();
 			break;
@@ -295,7 +295,7 @@
 
 		case 5: case 6: case 7: case 8: case 9: case 10: /* set playlist */
 			msf.playlist = e->we.click.widget - 5;
-			SetWindowDirty(w);
+			w->SetDirty();
 			InvalidateWindow(WC_MUSIC_WINDOW, 0);
 			StopMusic();
 			SelectSongToPlay();
@@ -334,7 +334,7 @@
 
 static void ShowMusicTrackSelection()
 {
-	AllocateWindowDescFront(&_music_track_selection_desc, 0);
+	AllocateWindowDescFront<Window>(&_music_track_selection_desc, 0);
 }
 
 static void MusicWindowWndProc(Window *w, WindowEvent *e)
@@ -346,7 +346,7 @@
 
 		w->RaiseWidget(7);
 		w->RaiseWidget(9);
-		DrawWindowWidgets(w);
+		w->DrawWidgets();
 
 		GfxFillRect(187, 16, 200, 33, 0);
 
@@ -440,7 +440,7 @@
 				*vol = new_vol;
 				if (vol == &msf.music_vol)
 					MusicVolumeChanged(new_vol);
-				SetWindowDirty(w);
+				w->SetDirty();
 			}
 
 			_left_button_clicked = false;
@@ -455,7 +455,7 @@
 			break;
 		case 12: case 13: case 14: case 15: case 16: case 17: // playlist
 			msf.playlist = e->we.click.widget - 12;
-			SetWindowDirty(w);
+			w->SetDirty();
 			InvalidateWindow(WC_MUSIC_TRACK_SELECTION, 0);
 			StopMusic();
 			SelectSongToPlay();
@@ -463,7 +463,7 @@
 		}
 		break;
 
-	case WE_MOUSELOOP:
+	case WE_TICK:
 		InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 7);
 		break;
 	}
@@ -502,5 +502,5 @@
 
 void ShowMusicWindow()
 {
-	AllocateWindowDescFront(&_music_window_desc, 0);
+	AllocateWindowDescFront<Window>(&_music_window_desc, 0);
 }