2 |
2 |
3 /** @file sound.cpp */ |
3 /** @file sound.cpp */ |
4 |
4 |
5 #include "stdafx.h" |
5 #include "stdafx.h" |
6 #include "openttd.h" |
6 #include "openttd.h" |
7 #include "functions.h" |
|
8 #include "landscape.h" |
7 #include "landscape.h" |
9 #include "map.h" |
|
10 #include "mixer.h" |
8 #include "mixer.h" |
11 #include "sound.h" |
9 #include "sound_func.h" |
12 #include "vehicle.h" |
|
13 #include "window.h" |
|
14 #include "viewport.h" |
|
15 #include "fileio.h" |
10 #include "fileio.h" |
16 #include "newgrf_sound.h" |
11 #include "newgrf_sound.h" |
17 #include "helpers.hpp" |
|
18 #include "fios.h" |
12 #include "fios.h" |
|
13 #include "window_gui.h" |
|
14 #include "core/alloc_func.hpp" |
|
15 #include "map_func.h" |
|
16 #include "vehicle_base.h" |
19 |
17 |
20 static uint _file_count; |
18 static uint _file_count; |
21 static FileEntry *_files; |
19 static FileEntry *_files; |
|
20 MusicFileSettings msf; |
22 |
21 |
23 // Number of levels of panning per side |
22 // Number of levels of panning per side |
24 #define PANNING_LEVELS 16 |
23 #define PANNING_LEVELS 16 |
25 |
24 |
26 |
25 |
155 MxActivateChannel(mc); |
154 MxActivateChannel(mc); |
156 } |
155 } |
157 |
156 |
158 |
157 |
159 static const byte _vol_factor_by_zoom[] = {255, 190, 134, 87}; |
158 static const byte _vol_factor_by_zoom[] = {255, 190, 134, 87}; |
160 assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END); |
159 assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END - ZOOM_LVL_BEGIN); |
161 |
160 |
162 static const byte _sound_base_vol[] = { |
161 static const byte _sound_base_vol[] = { |
163 128, 90, 128, 128, 128, 128, 128, 128, |
162 128, 90, 128, 128, 128, 128, 128, 128, |
164 128, 90, 90, 128, 128, 128, 128, 128, |
163 128, 90, 90, 128, 128, 128, 128, 128, |
165 128, 128, 128, 80, 128, 128, 128, 128, |
164 128, 128, 128, 80, 128, 128, 128, 128, |