gosu 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +108 -14
  3. data/dependencies/SDL/include/SDL_assert.h +81 -50
  4. data/dependencies/SDL/include/SDL_atomic.h +135 -35
  5. data/dependencies/SDL/include/SDL_audio.h +960 -355
  6. data/dependencies/SDL/include/SDL_bits.h +11 -6
  7. data/dependencies/SDL/include/SDL_blendmode.h +91 -14
  8. data/dependencies/SDL/include/SDL_clipboard.h +30 -7
  9. data/dependencies/SDL/include/SDL_config.h +277 -27
  10. data/dependencies/SDL/include/SDL_config_android.h +13 -38
  11. data/dependencies/SDL/include/SDL_config_iphoneos.h +21 -62
  12. data/dependencies/SDL/include/SDL_config_macosx.h +23 -92
  13. data/dependencies/SDL/include/SDL_config_minimal.h +1 -4
  14. data/dependencies/SDL/include/SDL_config_pandora.h +15 -22
  15. data/dependencies/SDL/include/SDL_config_psp.h +16 -37
  16. data/dependencies/SDL/include/SDL_config_windows.h +28 -91
  17. data/dependencies/SDL/include/SDL_config_winrt.h +33 -61
  18. data/dependencies/SDL/include/SDL_config_wiz.h +28 -56
  19. data/dependencies/SDL/include/SDL_copying.h +1 -1
  20. data/dependencies/SDL/include/SDL_cpuinfo.h +331 -71
  21. data/dependencies/SDL/include/SDL_egl.h +906 -280
  22. data/dependencies/SDL/include/SDL_endian.h +101 -47
  23. data/dependencies/SDL/include/SDL_error.h +70 -19
  24. data/dependencies/SDL/include/SDL_events.h +387 -79
  25. data/dependencies/SDL/include/SDL_filesystem.h +73 -64
  26. data/dependencies/SDL/include/SDL_gamecontroller.h +585 -125
  27. data/dependencies/SDL/include/SDL_gesture.h +36 -6
  28. data/dependencies/SDL/include/SDL_haptic.h +304 -210
  29. data/dependencies/SDL/include/SDL_hidapi.h +451 -0
  30. data/dependencies/SDL/include/SDL_hints.h +1286 -897
  31. data/dependencies/SDL/include/SDL_joystick.h +577 -130
  32. data/dependencies/SDL/include/SDL_keyboard.h +162 -63
  33. data/dependencies/SDL/include/SDL_keycode.h +7 -5
  34. data/dependencies/SDL/include/SDL_loadso.h +42 -8
  35. data/dependencies/SDL/include/SDL_locale.h +34 -32
  36. data/dependencies/SDL/include/SDL_log.h +212 -19
  37. data/dependencies/SDL/include/SDL_main.h +72 -17
  38. data/dependencies/SDL/include/SDL_messagebox.h +70 -23
  39. data/dependencies/SDL/include/SDL_metal.h +27 -32
  40. data/dependencies/SDL/include/SDL_misc.h +19 -15
  41. data/dependencies/SDL/include/SDL_mouse.h +262 -110
  42. data/dependencies/SDL/include/SDL_mutex.h +286 -66
  43. data/dependencies/SDL/include/SDL_name.h +1 -1
  44. data/dependencies/SDL/include/SDL_opengl.h +1 -1
  45. data/dependencies/SDL/include/SDL_opengles.h +1 -1
  46. data/dependencies/SDL/include/SDL_opengles2.h +2 -2
  47. data/dependencies/SDL/include/SDL_pixels.h +199 -34
  48. data/dependencies/SDL/include/SDL_platform.h +39 -2
  49. data/dependencies/SDL/include/SDL_power.h +23 -10
  50. data/dependencies/SDL/include/SDL_quit.h +1 -1
  51. data/dependencies/SDL/include/SDL_rect.h +78 -28
  52. data/dependencies/SDL/include/SDL_render.h +1204 -472
  53. data/dependencies/SDL/include/SDL_revision.h +2 -2
  54. data/dependencies/SDL/include/SDL_rwops.h +605 -33
  55. data/dependencies/SDL/include/SDL_scancode.h +1 -1
  56. data/dependencies/SDL/include/SDL_sensor.h +76 -42
  57. data/dependencies/SDL/include/SDL_shape.h +38 -27
  58. data/dependencies/SDL/include/SDL_stdinc.h +96 -24
  59. data/dependencies/SDL/include/SDL_surface.h +571 -139
  60. data/dependencies/SDL/include/SDL_system.h +339 -101
  61. data/dependencies/SDL/include/SDL_syswm.h +50 -20
  62. data/dependencies/SDL/include/SDL_test.h +1 -1
  63. data/dependencies/SDL/include/SDL_test_assert.h +2 -2
  64. data/dependencies/SDL/include/SDL_test_common.h +23 -6
  65. data/dependencies/SDL/include/SDL_test_compare.h +1 -1
  66. data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
  67. data/dependencies/SDL/include/SDL_test_font.h +3 -3
  68. data/dependencies/SDL/include/SDL_test_fuzzer.h +28 -26
  69. data/dependencies/SDL/include/SDL_test_harness.h +6 -6
  70. data/dependencies/SDL/include/SDL_test_images.h +1 -1
  71. data/dependencies/SDL/include/SDL_test_log.h +1 -1
  72. data/dependencies/SDL/include/SDL_test_md5.h +1 -1
  73. data/dependencies/SDL/include/SDL_test_memory.h +1 -1
  74. data/dependencies/SDL/include/SDL_test_random.h +2 -2
  75. data/dependencies/SDL/include/SDL_thread.h +226 -128
  76. data/dependencies/SDL/include/SDL_timer.h +129 -22
  77. data/dependencies/SDL/include/SDL_touch.h +48 -8
  78. data/dependencies/SDL/include/SDL_types.h +1 -1
  79. data/dependencies/SDL/include/SDL_version.h +72 -46
  80. data/dependencies/SDL/include/SDL_video.h +1266 -460
  81. data/dependencies/SDL/include/SDL_vulkan.h +100 -161
  82. data/dependencies/SDL/include/begin_code.h +22 -1
  83. data/dependencies/SDL/include/close_code.h +1 -1
  84. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  85. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  86. data/dependencies/SDL_sound/SDL_sound.c +83 -7
  87. data/dependencies/SDL_sound/SDL_sound.h +4 -4
  88. data/dependencies/SDL_sound/SDL_sound_aiff.c +9 -12
  89. data/dependencies/SDL_sound/SDL_sound_au.c +7 -7
  90. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +3 -3
  91. data/dependencies/SDL_sound/SDL_sound_flac.c +1 -1
  92. data/dependencies/SDL_sound/SDL_sound_internal.h +17 -10
  93. data/dependencies/SDL_sound/SDL_sound_modplug.c +25 -27
  94. data/dependencies/SDL_sound/SDL_sound_mp3.c +5 -17
  95. data/dependencies/SDL_sound/SDL_sound_raw.c +11 -11
  96. data/dependencies/SDL_sound/SDL_sound_shn.c +8 -7
  97. data/dependencies/SDL_sound/SDL_sound_voc.c +6 -4
  98. data/dependencies/SDL_sound/SDL_sound_vorbis.c +6 -11
  99. data/dependencies/SDL_sound/SDL_sound_wav.c +35 -29
  100. data/dependencies/SDL_sound/dr_flac.h +618 -220
  101. data/dependencies/SDL_sound/dr_mp3.h +263 -94
  102. data/dependencies/SDL_sound/libmodplug/fastmix.c +58 -64
  103. data/dependencies/SDL_sound/libmodplug/libmodplug.h +25 -103
  104. data/dependencies/SDL_sound/libmodplug/load_669.c +14 -17
  105. data/dependencies/SDL_sound/libmodplug/load_amf.c +11 -7
  106. data/dependencies/SDL_sound/libmodplug/load_ams.c +65 -22
  107. data/dependencies/SDL_sound/libmodplug/load_dbm.c +8 -4
  108. data/dependencies/SDL_sound/libmodplug/load_dmf.c +55 -25
  109. data/dependencies/SDL_sound/libmodplug/load_far.c +9 -13
  110. data/dependencies/SDL_sound/libmodplug/load_gdm.c +448 -0
  111. data/dependencies/SDL_sound/libmodplug/load_it.c +45 -49
  112. data/dependencies/SDL_sound/libmodplug/load_mdl.c +80 -53
  113. data/dependencies/SDL_sound/libmodplug/load_med.c +20 -12
  114. data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
  115. data/dependencies/SDL_sound/libmodplug/load_mt2.c +29 -17
  116. data/dependencies/SDL_sound/libmodplug/load_okt.c +12 -8
  117. data/dependencies/SDL_sound/libmodplug/load_psm.c +101 -78
  118. data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -17
  119. data/dependencies/SDL_sound/libmodplug/load_s3m.c +9 -7
  120. data/dependencies/SDL_sound/libmodplug/load_stm.c +3 -2
  121. data/dependencies/SDL_sound/libmodplug/load_ult.c +2 -2
  122. data/dependencies/SDL_sound/libmodplug/load_umx.c +315 -35
  123. data/dependencies/SDL_sound/libmodplug/load_xm.c +25 -21
  124. data/dependencies/SDL_sound/libmodplug/mmcmp.c +295 -149
  125. data/dependencies/SDL_sound/libmodplug/modplug.c +7 -123
  126. data/dependencies/SDL_sound/libmodplug/modplug.h +32 -29
  127. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +0 -1
  128. data/dependencies/SDL_sound/libmodplug/snd_flt.c +2 -2
  129. data/dependencies/SDL_sound/libmodplug/snd_fx.c +24 -18
  130. data/dependencies/SDL_sound/libmodplug/sndfile.c +55 -156
  131. data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -12
  132. data/dependencies/SDL_sound/libmodplug/tables.h +10 -15
  133. data/dependencies/SDL_sound/stb_vorbis.h +508 -325
  134. data/dependencies/{al_soft → mojoAL}/AL/al.h +38 -30
  135. data/dependencies/{al_soft → mojoAL}/AL/alc.h +27 -56
  136. data/dependencies/mojoAL/mojoal.c +4594 -0
  137. data/ext/gosu/extconf.rb +29 -30
  138. data/include/Gosu/Audio.hpp +70 -85
  139. data/include/Gosu/Color.hpp +19 -11
  140. data/include/Gosu/Font.hpp +40 -44
  141. data/include/Gosu/Graphics.hpp +58 -71
  142. data/include/Gosu/GraphicsBase.hpp +26 -33
  143. data/include/Gosu/Image.hpp +56 -62
  144. data/include/Gosu/ImageData.hpp +23 -27
  145. data/include/Gosu/Inspection.hpp +1 -4
  146. data/include/Gosu/TextInput.hpp +34 -40
  147. data/include/Gosu/Version.hpp +1 -1
  148. data/include/Gosu/Window.hpp +71 -70
  149. data/lib/SDL2.dll +0 -0
  150. data/lib/gosu/compat.rb +24 -37
  151. data/lib/gosu.rb +2 -2
  152. data/lib64/SDL2.dll +0 -0
  153. data/src/Audio.cpp +86 -86
  154. data/src/AudioFile.hpp +6 -6
  155. data/src/AudioFileAudioToolbox.cpp +1 -1
  156. data/src/AudioFileSDLSound.cpp +1 -1
  157. data/src/AudioImpl.hpp +5 -5
  158. data/src/BitmapIO.cpp +0 -20
  159. data/src/BlockAllocator.cpp +2 -1
  160. data/src/Channel.cpp +22 -20
  161. data/src/Color.cpp +12 -9
  162. data/src/EmptyImageData.hpp +15 -17
  163. data/src/FileUnix.cpp +1 -1
  164. data/src/FileWin.cpp +1 -1
  165. data/src/Font.cpp +48 -53
  166. data/src/Graphics.cpp +135 -143
  167. data/src/Image.cpp +41 -42
  168. data/src/Input.cpp +1 -1
  169. data/src/InputUIKit.cpp +1 -1
  170. data/src/LargeImageData.cpp +108 -101
  171. data/src/LargeImageData.hpp +17 -15
  172. data/src/Log.hpp +6 -6
  173. data/src/Macro.cpp +35 -37
  174. data/src/Macro.hpp +11 -11
  175. data/src/Math.cpp +8 -1
  176. data/src/Resolution.cpp +12 -7
  177. data/src/RubyGosu.cxx +5 -5
  178. data/src/TexChunk.cpp +50 -41
  179. data/src/TexChunk.hpp +22 -22
  180. data/src/Text.cpp +37 -37
  181. data/src/TextBuilder.cpp +60 -57
  182. data/src/TextBuilder.hpp +20 -20
  183. data/src/TextInput.cpp +127 -135
  184. data/src/TrueTypeFont.cpp +107 -107
  185. data/src/TrueTypeFont.hpp +39 -38
  186. data/src/TrueTypeFontApple.cpp +19 -22
  187. data/src/TrueTypeFontUnix.cpp +21 -26
  188. data/src/TrueTypeFontWin.cpp +30 -30
  189. data/src/Window.cpp +95 -86
  190. data/src/WindowUIKit.cpp +46 -49
  191. metadata +7 -17
  192. data/dependencies/SDL/include/SDL_config_os2.h +0 -188
  193. data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
  194. data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
  195. data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
  196. data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
  197. data/dependencies/al_soft/AL/alext.h +0 -585
  198. data/dependencies/al_soft/AL/efx-creative.h +0 -3
  199. data/dependencies/al_soft/AL/efx-presets.h +0 -402
  200. data/dependencies/al_soft/AL/efx.h +0 -762
  201. data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
  202. data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
  203. data/lib/OpenAL32.dll +0 -0
  204. data/lib64/OpenAL32.dll +0 -0
@@ -8,9 +8,6 @@
8
8
  #include "libmodplug.h"
9
9
  #include <math.h>
10
10
 
11
- // 4x256 taps polyphase FIR resampling filter
12
- extern short int gFastSinc[];
13
- extern short int gKaiserSinc[]; // 8-taps polyphase
14
11
  /*
15
12
  *-----------------------------------------------------------------------------
16
13
  cubic spline interpolation doc,
@@ -67,9 +64,9 @@ extern short int gKaiserSinc[]; // 8-taps polyphase
67
64
  #define SPLINE_FRACBITS 10
68
65
  #define SPLINE_LUTLEN (1L<<SPLINE_FRACBITS)
69
66
 
70
- signed short CzCUBICSPLINE_lut[4*(1L<<SPLINE_FRACBITS)];
67
+ static signed short CzCUBICSPLINE_lut[4*(1L<<SPLINE_FRACBITS)];
71
68
 
72
- static void initCzCUBICSPLINE()
69
+ static void initCzCUBICSPLINE(void)
73
70
  {
74
71
  int _LIi;
75
72
  int _LLen = (1L<<SPLINE_FRACBITS);
@@ -105,9 +102,9 @@ static void initCzCUBICSPLINE()
105
102
  fir interpolation doc,
106
103
  (derived from "an engineer's guide to fir digital filters", n.j. loy)
107
104
 
108
- calculate coefficients for ideal lowpass filter (with cutoff = fc in
105
+ calculate coefficients for ideal lowpass filter (with cutoff = fc in
109
106
  0..1 (mapped to 0..nyquist))
110
- c[-N..N] = (i==0) ? fc : SDL_sin(fc*pi*i)/(pi*i)
107
+ c[-N..N] = (i==0) ? fc : sin(fc*pi*i)/(pi*i)
111
108
 
112
109
  then apply selected window to coefficients
113
110
  c[-N..N] *= w(0..N)
@@ -147,9 +144,9 @@ static void initCzCUBICSPLINE()
147
144
  #define M_zEPS 1e-8
148
145
  #define M_zBESSELEPS 1e-21
149
146
 
150
- static float CzWINDOWEDFIR_coef( int _PCnr, float _POfs, float _PCut, int _PWidth, int _PType )
147
+ static float CzWINDOWEDFIR_coef( int _PCnr, float _POfs, float _PCut, int _PWidth, int _PType )
151
148
  //OLD args to coef: float _PPos, float _PFc, int _PLen )
152
- {
149
+ {
153
150
  double _LWidthM1 = _PWidth-1;
154
151
  double _LWidthM1Half = 0.5*_LWidthM1;
155
152
  double _LPosU = ((double)_PCnr - _POfs);
@@ -159,9 +156,9 @@ static void initCzCUBICSPLINE()
159
156
  if( SDL_fabs(_LPos)<M_zEPS ) {
160
157
  _LWc = 1.0;
161
158
  _LSi = _PCut;
162
- } else {
159
+ } else {
163
160
  switch( _PType )
164
- {
161
+ {
165
162
  case WFIR_HANN:
166
163
  _LWc = 0.50 - 0.50 * SDL_cos(_LPIdl*_LPosU);
167
164
  break;
@@ -203,19 +200,19 @@ static void initCzCUBICSPLINE()
203
200
  _LSi = SDL_sin(_PCut*_LPos)/_LPos;
204
201
  }
205
202
  return (float)(_LWc*_LSi);
206
- }
203
+ }
207
204
 
208
205
  static signed short CzWINDOWEDFIR_lut[WFIR_LUTLEN*WFIR_WIDTH];
209
206
 
210
- static void initCzWINDOWEDFIR()
211
- {
207
+ static void initCzWINDOWEDFIR(void)
208
+ {
212
209
  int _LPcl;
213
210
  float _LPcllen = (float)(1L<<WFIR_FRACBITS); // number of precalculated lines for 0..1 (-1..0)
214
211
  float _LNorm = 1.0f / (float)(2.0f * _LPcllen);
215
212
  float _LCut = WFIR_CUTOFF;
216
213
  float _LScale = (float)WFIR_QUANTSCALE;
217
214
  for( _LPcl=0;_LPcl<WFIR_LUTLEN;_LPcl++ )
218
- {
215
+ {
219
216
  float _LGain,_LCoefs[WFIR_WIDTH];
220
217
  float _LOfs = ((float)_LPcl-_LPcllen)*_LNorm;
221
218
  int _LCc,_LIdx = _LPcl<<WFIR_LOG2WIDTH;
@@ -225,7 +222,7 @@ static void initCzWINDOWEDFIR()
225
222
  _LGain = 1.0f/_LGain;
226
223
  for( _LCc=0;_LCc<WFIR_WIDTH;_LCc++ )
227
224
  { float _LCoef = (float)floor( 0.5 + _LScale*_LCoefs[_LCc]*_LGain );
228
- CzWINDOWEDFIR_lut[_LIdx+_LCc] = (signed short)( (_LCoef<-_LScale)?-_LScale:((_LCoef>_LScale)?_LScale:_LCoef) );
225
+ CzWINDOWEDFIR_lut[_LIdx+_LCc] = (signed short)( (_LCoef<-_LScale)?-_LScale:((_LCoef>_LScale)?_LScale:_LCoef) );
229
226
  }
230
227
  }
231
228
  }
@@ -620,11 +617,9 @@ typedef VOID (MPPASMCALL * LPMIXINTERFACE)(MODCHANNEL *, int *, int *);
620
617
  /////////////////////////////////////////////////////
621
618
  //
622
619
 
623
- void MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples);
624
- void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UINT nSamples);
620
+ static void MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples);
621
+ static void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UINT nSamples);
625
622
  void MPPASMCALL X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs);
626
- void X86_StereoMixToFloat(const int *, float *, float *, UINT nCount);
627
- void X86_FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount);
628
623
 
629
624
  /////////////////////////////////////////////////////
630
625
  // Mono samples functions
@@ -1226,88 +1221,88 @@ END_RAMPMIX_STFLT_INTERFACE()
1226
1221
  #define MIXNDX_SPLINESRC 0x20
1227
1222
  #define MIXNDX_FIRSRC 0x30
1228
1223
 
1229
- const LPMIXINTERFACE gpMixFunctionTable[2*2*16] =
1224
+ static const LPMIXINTERFACE gpMixFunctionTable[2*2*16] =
1230
1225
  {
1231
1226
  // No SRC
1232
1227
  Mono8BitMix, Mono16BitMix, Stereo8BitMix, Stereo16BitMix,
1233
- Mono8BitRampMix, Mono16BitRampMix, Stereo8BitRampMix,
1228
+ Mono8BitRampMix, Mono16BitRampMix, Stereo8BitRampMix,
1234
1229
  Stereo16BitRampMix,
1235
1230
  // No SRC, Filter
1236
- FilterMono8BitMix, FilterMono16BitMix, FilterStereo8BitMix,
1237
- FilterStereo16BitMix, FilterMono8BitRampMix, FilterMono16BitRampMix,
1231
+ FilterMono8BitMix, FilterMono16BitMix, FilterStereo8BitMix,
1232
+ FilterStereo16BitMix, FilterMono8BitRampMix, FilterMono16BitRampMix,
1238
1233
  FilterStereo8BitRampMix, FilterStereo16BitRampMix,
1239
1234
  // Linear SRC
1240
1235
  Mono8BitLinearMix, Mono16BitLinearMix, Stereo8BitLinearMix,
1241
1236
  Stereo16BitLinearMix, Mono8BitLinearRampMix, Mono16BitLinearRampMix,
1242
1237
  Stereo8BitLinearRampMix,Stereo16BitLinearRampMix,
1243
1238
  // Linear SRC, Filter
1244
- FilterMono8BitLinearMix, FilterMono16BitLinearMix,
1239
+ FilterMono8BitLinearMix, FilterMono16BitLinearMix,
1245
1240
  FilterStereo8BitLinearMix, FilterStereo16BitLinearMix,
1246
1241
  FilterMono8BitLinearRampMix, FilterMono16BitLinearRampMix,
1247
1242
  FilterStereo8BitLinearRampMix, FilterStereo16BitLinearRampMix,
1248
1243
 
1249
1244
  // FirFilter SRC
1250
- Mono8BitSplineMix, Mono16BitSplineMix, Stereo8BitSplineMix,
1245
+ Mono8BitSplineMix, Mono16BitSplineMix, Stereo8BitSplineMix,
1251
1246
  Stereo16BitSplineMix, Mono8BitSplineRampMix, Mono16BitSplineRampMix,
1252
1247
  Stereo8BitSplineRampMix,Stereo16BitSplineRampMix,
1253
1248
  // Spline SRC, Filter
1254
- FilterMono8BitSplineMix, FilterMono16BitSplineMix,
1249
+ FilterMono8BitSplineMix, FilterMono16BitSplineMix,
1255
1250
  FilterStereo8BitSplineMix, FilterStereo16BitSplineMix,
1256
1251
  FilterMono8BitSplineRampMix, FilterMono16BitSplineRampMix,
1257
1252
  FilterStereo8BitSplineRampMix, FilterStereo16BitSplineRampMix,
1258
1253
 
1259
1254
  // FirFilter SRC
1260
1255
  Mono8BitFirFilterMix, Mono16BitFirFilterMix, Stereo8BitFirFilterMix,
1261
- Stereo16BitFirFilterMix, Mono8BitFirFilterRampMix,
1262
- Mono16BitFirFilterRampMix, Stereo8BitFirFilterRampMix,
1256
+ Stereo16BitFirFilterMix, Mono8BitFirFilterRampMix,
1257
+ Mono16BitFirFilterRampMix, Stereo8BitFirFilterRampMix,
1263
1258
  Stereo16BitFirFilterRampMix,
1264
1259
  // FirFilter SRC, Filter
1265
- FilterMono8BitFirFilterMix, FilterMono16BitFirFilterMix,
1260
+ FilterMono8BitFirFilterMix, FilterMono16BitFirFilterMix,
1266
1261
  FilterStereo8BitFirFilterMix, FilterStereo16BitFirFilterMix,
1267
1262
  FilterMono8BitFirFilterRampMix, FilterMono16BitFirFilterRampMix,
1268
1263
  FilterStereo8BitFirFilterRampMix, FilterStereo16BitFirFilterRampMix
1269
1264
  };
1270
1265
 
1271
- const LPMIXINTERFACE gpFastMixFunctionTable[2*2*16] =
1266
+ static const LPMIXINTERFACE gpFastMixFunctionTable[2*2*16] =
1272
1267
  {
1273
1268
  // No SRC
1274
1269
  FastMono8BitMix, FastMono16BitMix, Stereo8BitMix, Stereo16BitMix,
1275
1270
  FastMono8BitRampMix, FastMono16BitRampMix, Stereo8BitRampMix,
1276
1271
  Stereo16BitRampMix,
1277
1272
  // No SRC, Filter
1278
- FilterMono8BitMix, FilterMono16BitMix, FilterStereo8BitMix,
1273
+ FilterMono8BitMix, FilterMono16BitMix, FilterStereo8BitMix,
1279
1274
  FilterStereo16BitMix, FilterMono8BitRampMix, FilterMono16BitRampMix,
1280
1275
  FilterStereo8BitRampMix, FilterStereo16BitRampMix,
1281
1276
  // Linear SRC
1282
1277
  FastMono8BitLinearMix, FastMono16BitLinearMix, Stereo8BitLinearMix,
1283
- Stereo16BitLinearMix, FastMono8BitLinearRampMix,
1284
- FastMono16BitLinearRampMix, Stereo8BitLinearRampMix,
1278
+ Stereo16BitLinearMix, FastMono8BitLinearRampMix,
1279
+ FastMono16BitLinearRampMix, Stereo8BitLinearRampMix,
1285
1280
  Stereo16BitLinearRampMix,
1286
1281
  // Linear SRC, Filter
1287
- FilterMono8BitLinearMix, FilterMono16BitLinearMix,
1282
+ FilterMono8BitLinearMix, FilterMono16BitLinearMix,
1288
1283
  FilterStereo8BitLinearMix, FilterStereo16BitLinearMix,
1289
- FilterMono8BitLinearRampMix, FilterMono16BitLinearRampMix,
1284
+ FilterMono8BitLinearRampMix, FilterMono16BitLinearRampMix,
1290
1285
  FilterStereo8BitLinearRampMix, FilterStereo16BitLinearRampMix,
1291
1286
 
1292
1287
  // Spline SRC
1293
- Mono8BitSplineMix, Mono16BitSplineMix, Stereo8BitSplineMix,
1288
+ Mono8BitSplineMix, Mono16BitSplineMix, Stereo8BitSplineMix,
1294
1289
  Stereo16BitSplineMix, Mono8BitSplineRampMix, Mono16BitSplineRampMix,
1295
1290
  Stereo8BitSplineRampMix, Stereo16BitSplineRampMix,
1296
1291
  // Spline SRC, Filter
1297
- FilterMono8BitSplineMix, FilterMono16BitSplineMix,
1292
+ FilterMono8BitSplineMix, FilterMono16BitSplineMix,
1298
1293
  FilterStereo8BitSplineMix, FilterStereo16BitSplineMix,
1299
- FilterMono8BitSplineRampMix, FilterMono16BitSplineRampMix,
1294
+ FilterMono8BitSplineRampMix, FilterMono16BitSplineRampMix,
1300
1295
  FilterStereo8BitSplineRampMix, FilterStereo16BitSplineRampMix,
1301
1296
 
1302
1297
  // FirFilter SRC
1303
1298
  Mono8BitFirFilterMix, Mono16BitFirFilterMix, Stereo8BitFirFilterMix,
1304
- Stereo16BitFirFilterMix, Mono8BitFirFilterRampMix,
1305
- Mono16BitFirFilterRampMix, Stereo8BitFirFilterRampMix,
1299
+ Stereo16BitFirFilterMix, Mono8BitFirFilterRampMix,
1300
+ Mono16BitFirFilterRampMix, Stereo8BitFirFilterRampMix,
1306
1301
  Stereo16BitFirFilterRampMix,
1307
1302
  // FirFilter SRC, Filter
1308
- FilterMono8BitFirFilterMix, FilterMono16BitFirFilterMix,
1303
+ FilterMono8BitFirFilterMix, FilterMono16BitFirFilterMix,
1309
1304
  FilterStereo8BitFirFilterMix, FilterStereo16BitFirFilterMix,
1310
- FilterMono8BitFirFilterRampMix, FilterMono16BitFirFilterRampMix,
1305
+ FilterMono8BitFirFilterRampMix, FilterMono16BitFirFilterRampMix,
1311
1306
  FilterStereo8BitFirFilterRampMix, FilterStereo16BitFirFilterRampMix,
1312
1307
  };
1313
1308
 
@@ -1330,7 +1325,7 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
1330
1325
  LONG nDelta = ((nLoopStart - pChn->nPos) << 16) - (pChn->nPosLo & 0xffff);
1331
1326
  pChn->nPos = nLoopStart | (nDelta>>16);
1332
1327
  pChn->nPosLo = nDelta & 0xffff;
1333
- if (((LONG)pChn->nPos < nLoopStart) ||
1328
+ if (((LONG)pChn->nPos < nLoopStart) ||
1334
1329
  (pChn->nPos >= (nLoopStart+pChn->nLength)/2))
1335
1330
  {
1336
1331
  pChn->nPos = nLoopStart; pChn->nPosLo = 0;
@@ -1346,7 +1341,7 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
1346
1341
  }
1347
1342
  } else
1348
1343
  {
1349
- // We probably didn't hit the loop end yet
1344
+ // We probably didn't hit the loop end yet
1350
1345
  // (first loop), so we do nothing
1351
1346
  if ((LONG)pChn->nPos < 0) pChn->nPos = 0;
1352
1347
  }
@@ -1369,8 +1364,8 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
1369
1364
  LONG nDeltaLo = 0x10000 - (pChn->nPosLo & 0xffff);
1370
1365
  pChn->nPos = pChn->nLength - nDeltaHi - (nDeltaLo>>16);
1371
1366
  pChn->nPosLo = nDeltaLo & 0xffff;
1372
- if ((pChn->nPos <= pChn->nLoopStart) ||
1373
- (pChn->nPos >= pChn->nLength))
1367
+ if ((pChn->nPos <= pChn->nLoopStart) ||
1368
+ (pChn->nPos >= pChn->nLength))
1374
1369
  pChn->nPos = pChn->nLength-1;
1375
1370
  } else
1376
1371
  {
@@ -1381,7 +1376,7 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
1381
1376
  }
1382
1377
  // Restart at loop start
1383
1378
  pChn->nPos += nLoopStart - pChn->nLength;
1384
- if ((LONG)pChn->nPos < nLoopStart)
1379
+ if ((LONG)pChn->nPos < nLoopStart)
1385
1380
  pChn->nPos = pChn->nLoopStart;
1386
1381
  }
1387
1382
  }
@@ -1430,7 +1425,7 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
1430
1425
  {
1431
1426
  LPLONG pOfsL, pOfsR;
1432
1427
  DWORD nchused, nchmixed;
1433
- UINT nrampsamples;
1428
+ UINT nrampsamples;
1434
1429
 
1435
1430
  if (!count) return 0;
1436
1431
  if (_this->gnChannels > 2) X86_InitMixBuffer(_this->MixRearBuffer, count*2);
@@ -1439,13 +1434,13 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
1439
1434
  {
1440
1435
  const LPMIXINTERFACE *pMixFuncTable;
1441
1436
  MODCHANNEL * const pChannel = &_this->Chn[_this->ChnMix[nChn]];
1442
- UINT nFlags, nMasterCh;
1437
+ UINT nFlags;//, nMasterCh
1443
1438
  LONG nSmpCount;
1444
1439
  int nsamples;
1445
1440
  int *pbuffer;
1446
1441
 
1447
1442
  if (!pChannel->pCurrentSample) continue;
1448
- nMasterCh = (_this->ChnMix[nChn] < _this->m_nChannels) ? _this->ChnMix[nChn]+1 : pChannel->nMasterChn;
1443
+ //nMasterCh = (_this->ChnMix[nChn] < _this->m_nChannels) ? _this->ChnMix[nChn]+1 : pChannel->nMasterChn;
1449
1444
  pOfsR = &_this->gnDryROfsVol;
1450
1445
  pOfsL = &_this->gnDryLOfsVol;
1451
1446
  nFlags = 0;
@@ -1457,7 +1452,7 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
1457
1452
  if (!(pChannel->dwFlags & CHN_NOIDO))
1458
1453
  {
1459
1454
  // use hq-fir mixer?
1460
- if( (_this->gdwSoundSetup & (SNDMIX_HQRESAMPLER|SNDMIX_ULTRAHQSRCMODE)) ==
1455
+ if( (_this->gdwSoundSetup & (SNDMIX_HQRESAMPLER|SNDMIX_ULTRAHQSRCMODE)) ==
1461
1456
  (SNDMIX_HQRESAMPLER|SNDMIX_ULTRAHQSRCMODE) )
1462
1457
  nFlags += MIXNDX_FIRSRC;
1463
1458
  else if( (_this->gdwSoundSetup & (SNDMIX_HQRESAMPLER)) == SNDMIX_HQRESAMPLER )
@@ -1619,7 +1614,7 @@ DWORD MPPASMCALL X86_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount
1619
1614
  int vumin = *lpMin, vumax = *lpMax;
1620
1615
  int n,p ;
1621
1616
  unsigned char* buf = (unsigned char*)lp16 ;
1622
-
1617
+
1623
1618
  for ( i=0; i<lSampleCount; i++)
1624
1619
  {
1625
1620
  n = pBuffer[i];
@@ -1632,14 +1627,14 @@ DWORD MPPASMCALL X86_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount
1632
1627
  else if (n > vumax)
1633
1628
  vumax = n;
1634
1629
  p = n >> (8-MIXING_ATTENUATION) ; // 24-bit signed
1635
- #ifdef WORDS_BIGENDIAN
1636
- buf[i*3+0] = p & 0xFF0000 >> 24;
1637
- buf[i*3+1] = p & 0x00FF00 >> 16 ;
1638
- buf[i*3+2] = p & 0x0000FF ;
1630
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1631
+ buf[i*3+0] = (p >> 16) & 0xFF;
1632
+ buf[i*3+1] = (p >> 8) & 0xFF;
1633
+ buf[i*3+2] = (p >> 0) & 0xFF;
1639
1634
  #else
1640
- buf[i*3+0] = p & 0x0000FF ;
1641
- buf[i*3+1] = p & 0x00FF00 >> 16;
1642
- buf[i*3+2] = p & 0xFF0000 >> 24;
1635
+ buf[i*3+0] = (p >> 0) & 0xFF;
1636
+ buf[i*3+1] = (p >> 8) & 0xFF;
1637
+ buf[i*3+2] = (p >> 16) & 0xFF;
1643
1638
  #endif
1644
1639
  }
1645
1640
  *lpMin = vumin;
@@ -1654,7 +1649,7 @@ DWORD MPPASMCALL X86_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount
1654
1649
  UINT i ;
1655
1650
  int vumin = *lpMin, vumax = *lpMax;
1656
1651
  int32_t *p = (int32_t *)lp16;
1657
-
1652
+
1658
1653
  for ( i=0; i<lSampleCount; i++)
1659
1654
  {
1660
1655
  int n = pBuffer[i];
@@ -1675,12 +1670,11 @@ DWORD MPPASMCALL X86_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount
1675
1670
 
1676
1671
  //---GCCFIX: Asm replaced with C function
1677
1672
  // Will fill in later.
1678
- void MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples)
1673
+ static void MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples)
1679
1674
  {
1680
1675
  SDL_memset(pBuffer, 0, nSamples * sizeof(int));
1681
1676
  }
1682
1677
 
1683
-
1684
1678
  //---GCCFIX: Asm replaced with C function
1685
1679
  // Multichannel not supported.
1686
1680
  void MPPASMCALL X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nSamples)
@@ -1727,7 +1721,7 @@ void MPPASMCALL X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLON
1727
1721
 
1728
1722
  //---GCCFIX: Asm replaced with C function
1729
1723
  // Will fill in later.
1730
- void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UINT nSamples)
1724
+ static void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UINT nSamples)
1731
1725
  {
1732
1726
  int rofs = pChannel->nROfs;
1733
1727
  int lofs = pChannel->nLOfs;
@@ -9,36 +9,33 @@
9
9
  #ifndef _INCL_LIBMODPLUG_H_
10
10
  #define _INCL_LIBMODPLUG_H_
11
11
 
12
- #include "SDL.h"
13
-
14
- #if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
15
- #pragma GCC visibility push(hidden)
12
+ #define __SDL_SOUND_INTERNAL__
13
+ #include "SDL_sound_internal.h"
14
+
15
+ #if defined(HAVE_LIBC) && defined(__WATCOMC__) /* Watcom has issues... */
16
+ #define SDL_cos cos
17
+ #define SDL_fabs fabs
18
+ #define SDL_log log
19
+ #define SDL_pow pow
20
+ #define SDL_sin sin
21
+ #define SDL_sinf sin
22
+ #define SDL_abs abs
16
23
  #endif
17
24
 
18
25
  #ifdef _WIN32
19
26
 
20
- #ifdef MSC_VER
27
+ #ifdef _MSC_VER
21
28
  #pragma warning (disable:4201)
22
29
  #pragma warning (disable:4514)
23
30
  #endif
24
31
 
32
+ #ifndef WIN32_LEAN_AND_MEAN
25
33
  #define WIN32_LEAN_AND_MEAN
34
+ #endif
26
35
  #include <windows.h>
27
- #include <windowsx.h>
28
- #include <mmsystem.h>
29
- #include <stdio.h>
30
- #include <malloc.h>
31
- #include <stdint.h>
32
-
33
- #define srandom(_seed) srand(_seed)
34
- #define random() rand()
35
36
 
36
37
  #else
37
38
 
38
- #include <stdlib.h>
39
- #include <stdio.h>
40
- #include <string.h>
41
-
42
39
  typedef Sint8 CHAR;
43
40
  typedef Uint8 UCHAR;
44
41
  typedef Uint8* PUCHAR;
@@ -61,20 +58,7 @@ typedef const char* LPCSTR;
61
58
  typedef void* PVOID;
62
59
  typedef void VOID;
63
60
 
64
- inline LONG MulDiv (long a, long b, long c)
65
- {
66
- // if (!c) return 0;
67
- return ((uint64_t) a * (uint64_t) b ) / c;
68
- }
69
-
70
61
  #define LPCTSTR LPCSTR
71
- #define WAVE_FORMAT_PCM 1
72
- //#define ENABLE_EQ
73
-
74
- #define GHND 0
75
-
76
- #define GlobalAllocPtr(x, size) ((int8_t *) SDL_calloc(1, (size)))
77
- #define GlobalFreePtr(p) SDL_free((void *)(p))
78
62
 
79
63
  #ifndef FALSE
80
64
  #define FALSE 0
@@ -86,44 +70,8 @@ inline LONG MulDiv (long a, long b, long c)
86
70
 
87
71
  #endif // _WIN32
88
72
 
89
-
90
- typedef struct {
91
- char *mm;
92
- int sz;
93
- int pos;
94
- int error;
95
- } MMFILE;
96
-
97
- void mmfclose(MMFILE *mmfile);
98
- int mmfeof(MMFILE *mmfile);
99
- int mmfgetc(MMFILE *mmfile);
100
- void mmfgets(char buf[], unsigned int bufsz, MMFILE *mmfile);
101
- long mmftell(MMFILE *mmfile);
102
- void mmfseek(MMFILE *mmfile, long p, int whence);
103
- BYTE mmreadUBYTE(MMFILE *mmfile);
104
- void mmreadUBYTES(BYTE *buf, long sz, MMFILE *mmfile);
105
- void mmreadSBYTES(char *buf, long sz, MMFILE *mmfile);
106
- char *rwops_fgets(char *buf, int buflen, SDL_RWops *rwops);
107
-
108
- #define MMSTREAM SDL_RWops
109
- #define _mm_fopen(name,mode) SDL_RWFromFile(name, mode)
110
- #define _mm_fgets(f,buf,sz) rwops_fgets(buf,sz,f)
111
- #define _mm_fseek(f,pos,whence) SDL_RWseek(f,pos,whence)
112
- #define _mm_ftell(f) SDL_RWtell(f)
113
- #define _mm_read_UBYTES(buf,sz,f) SDL_RWread(f, buf, 1, sz)
114
- #define _mm_read_SBYTES(buf,sz,f) SDL_RWread(f, buf, 1, sz)
115
- #define _mm_feof(f) (SDL_RWtell(f) >= SDL_RWsize(f))
116
- #define _mm_fclose(f) SDL_RWclose(f)
117
- #define DupStr(h,buf,sz) SDL_strdup(buf)
118
- #define _mm_calloc(h,n,sz) SDL_calloc(n,sz)
119
- #define _mm_recalloc(h,buf,sz,elsz) SDL_realloc(buf,sz)
120
- #define _mm_free(h,p) SDL_free(p)
121
-
122
-
123
73
  #define MODPLUG_EXPORT
124
74
 
125
-
126
-
127
75
  /*
128
76
  * This source code is public domain.
129
77
  *
@@ -131,6 +79,8 @@ char *rwops_fgets(char *buf, int buflen, SDL_RWops *rwops);
131
79
  * Adam Goode <adam@evdebs.org> (endian and char fixes for PPC)
132
80
  */
133
81
 
82
+ extern void init_modplug_filters(void);
83
+
134
84
  #ifndef LPCBYTE
135
85
  typedef const BYTE * LPCBYTE;
136
86
  #endif
@@ -153,7 +103,6 @@ typedef const BYTE * LPCBYTE;
153
103
  #define MAX_EQ_BANDS 6
154
104
  #define MAX_MIXPLUGINS 8
155
105
 
156
-
157
106
  #define MOD_TYPE_NONE 0x00
158
107
  #define MOD_TYPE_MOD 0x01
159
108
  #define MOD_TYPE_S3M 0x02
@@ -171,7 +120,6 @@ typedef const BYTE * LPCBYTE;
171
120
  #define MOD_TYPE_DSM 0x2000
172
121
  #define MOD_TYPE_MDL 0x4000
173
122
  #define MOD_TYPE_OKT 0x8000
174
- #define MOD_TYPE_MID 0x10000
175
123
  #define MOD_TYPE_DMF 0x20000
176
124
  #define MOD_TYPE_PTM 0x40000
177
125
  #define MOD_TYPE_DBM 0x80000
@@ -179,13 +127,10 @@ typedef const BYTE * LPCBYTE;
179
127
  #define MOD_TYPE_AMF0 0x200000
180
128
  #define MOD_TYPE_PSM 0x400000
181
129
  #define MOD_TYPE_J2B 0x800000
182
- #define MOD_TYPE_ABC 0x1000000
183
- #define MOD_TYPE_PAT 0x2000000
130
+ #define MOD_TYPE_GDM 0x40000000 // Fake type
184
131
  #define MOD_TYPE_UMX 0x80000000 // Fake type
185
132
  #define MAX_MODTYPE 24
186
133
 
187
-
188
-
189
134
  // Channel flags:
190
135
  // Bits 0-7: Sample Flags
191
136
  #define CHN_16BIT 0x01
@@ -218,7 +163,6 @@ typedef const BYTE * LPCBYTE;
218
163
  #define CHN_REVERB 0x4000000
219
164
  #define CHN_NOREVERB 0x8000000
220
165
 
221
-
222
166
  #define ENV_VOLUME 0x0001
223
167
  #define ENV_VOLSUSTAIN 0x0002
224
168
  #define ENV_VOLLOOP 0x0004
@@ -267,7 +211,6 @@ typedef const BYTE * LPCBYTE;
267
211
  #define CMD_SETENVPOSITION 30
268
212
  #define CMD_MIDI 31
269
213
 
270
-
271
214
  // Volume Column commands
272
215
  #define VOLCMD_VOLUME 1
273
216
  #define VOLCMD_PANNING 2
@@ -438,7 +381,6 @@ enum {
438
381
  NUM_REVERBTYPES
439
382
  };
440
383
 
441
-
442
384
  enum {
443
385
  SRCMODE_NEAREST,
444
386
  SRCMODE_LINEAR,
@@ -447,7 +389,6 @@ enum {
447
389
  NUM_SRC_MODES
448
390
  };
449
391
 
450
-
451
392
  // Sample Struct
452
393
  typedef struct _MODINSTRUMENT
453
394
  {
@@ -467,7 +408,6 @@ typedef struct _MODINSTRUMENT
467
408
  BYTE nVibRate;
468
409
  } MODINSTRUMENT;
469
410
 
470
-
471
411
  // Instrument Struct
472
412
  typedef struct _INSTRUMENTHEADER
473
413
  {
@@ -515,7 +455,6 @@ typedef struct _INSTRUMENTHEADER
515
455
  CHAR filename[12];
516
456
  } INSTRUMENTHEADER;
517
457
 
518
-
519
458
  // Channel Struct
520
459
  typedef struct _MODCHANNEL
521
460
  {
@@ -576,7 +515,6 @@ typedef struct _MODCHANNEL
576
515
  BYTE nActiveMacro, nPadding;
577
516
  } MODCHANNEL;
578
517
 
579
-
580
518
  typedef struct _MODCHANNELSETTINGS
581
519
  {
582
520
  UINT nPan;
@@ -585,7 +523,6 @@ typedef struct _MODCHANNELSETTINGS
585
523
  UINT nMixPlugin;
586
524
  } MODCHANNELSETTINGS;
587
525
 
588
-
589
526
  typedef struct _MODCOMMAND
590
527
  {
591
528
  BYTE note;
@@ -610,7 +547,6 @@ enum {
610
547
  MIDIOUT_PROGRAM,
611
548
  };
612
549
 
613
-
614
550
  typedef struct MODMIDICFG
615
551
  {
616
552
  char szMidiGlb[9*32]; // changed from CHAR
@@ -637,7 +573,7 @@ typedef struct CSoundFile
637
573
  UINT m_nType, m_nSamples, m_nInstruments;
638
574
  UINT m_nTickCount, m_nTotalCount, m_nPatternDelay, m_nFrameDelay;
639
575
  UINT m_nMusicSpeed, m_nMusicTempo;
640
- UINT m_nNextRow, m_nRow;
576
+ UINT m_nNextRow, m_nRow, m_nNextStartRow;
641
577
  UINT m_nPattern,m_nCurrentPattern,m_nNextPattern,m_nRestartPos;
642
578
  UINT m_nMasterVolume, m_nGlobalVolume, m_nSongPreAmp;
643
579
  UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide;
@@ -654,6 +590,7 @@ typedef struct CSoundFile
654
590
  UINT m_nMaxMixChannels;
655
591
  DWORD gdwSoundSetup, gdwMixingFreq, gnBitsPerSample, gnChannels;
656
592
  UINT gnVolumeRampSamples;
593
+
657
594
  UINT gSampleSize;
658
595
  int MixSoundBuffer[MIXBUFFERSIZE*4];
659
596
  #ifndef MODPLUG_NO_REVERB
@@ -721,8 +658,8 @@ typedef struct CSoundFile
721
658
  int gbInitPlugins;
722
659
  } CSoundFile;
723
660
 
724
- typedef struct _ModPlug_Settings ModPlug_Settings;
725
- CSoundFile *new_CSoundFile(LPCBYTE lpStream, DWORD dwMemLength, const ModPlug_Settings *settings);
661
+ struct _ModPlug_Settings;
662
+ CSoundFile *new_CSoundFile(LPCBYTE lpStream, DWORD dwMemLength, const struct _ModPlug_Settings *settings);
726
663
  void delete_CSoundFile(CSoundFile *_this);
727
664
 
728
665
  UINT CSoundFile_GetMaxPosition(CSoundFile *_this);
@@ -752,15 +689,8 @@ void delete_CSoundFile(CSoundFile *_this);
752
689
  BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
753
690
  BOOL CSoundFile_ReadMT2(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
754
691
  BOOL CSoundFile_ReadPSM(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
755
- BOOL CSoundFile_ReadJ2B(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
692
+ BOOL CSoundFile_ReadGDM(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
756
693
  BOOL CSoundFile_ReadUMX(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
757
- BOOL CSoundFile_ReadABC(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
758
- BOOL CSoundFile_ReadMID(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
759
- BOOL CSoundFile_ReadPAT(CSoundFile *_this, LPCBYTE lpStream, DWORD dwMemLength);
760
-
761
- BOOL CSoundFile_TestABC(LPCBYTE lpStream, DWORD dwMemLength);
762
- BOOL CSoundFile_TestMID(LPCBYTE lpStream, DWORD dwMemLength);
763
- BOOL CSoundFile_TestPAT(LPCBYTE lpStream, DWORD dwMemLength);
764
694
 
765
695
  // MOD Convert function
766
696
  void CSoundFile_ConvertModCommand(CSoundFile *_this, MODCOMMAND *);
@@ -854,9 +784,6 @@ void delete_CSoundFile(CSoundFile *_this);
854
784
  BOOL CSoundFile_ITInstrToMPT(const void *p, INSTRUMENTHEADER *penv, UINT trkvers);
855
785
 
856
786
  UINT CSoundFile_LoadMixPlugins(CSoundFile *_this, const void *pData, UINT nLen);
857
- #ifndef NO_FILTER
858
- DWORD CSoundFile_CutOffToFrequency(CSoundFile *_this, UINT nCutOff, int flt_modifier); // [0-255] => [1-10KHz]
859
- #endif
860
787
 
861
788
  DWORD CSoundFile_TransposeToFrequency(int transp, int ftune);
862
789
  int CSoundFile_FrequencyToTranspose(DWORD freq);
@@ -869,7 +796,6 @@ void delete_CSoundFile(CSoundFile *_this);
869
796
  UINT CSoundFile_Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc);
870
797
 
871
798
 
872
-
873
799
  #pragma pack(1)
874
800
 
875
801
  typedef struct tagITFILEHEADER
@@ -898,7 +824,6 @@ typedef struct tagITFILEHEADER
898
824
  BYTE chnvol[64];
899
825
  } ITFILEHEADER;
900
826
 
901
-
902
827
  typedef struct tagITENVELOPE
903
828
  {
904
829
  BYTE flags;
@@ -929,13 +854,13 @@ typedef struct tagITOLDINSTRUMENT
929
854
  WORD trkvers;
930
855
  BYTE nos;
931
856
  BYTE reserved2;
857
+ CHAR name[26];
932
858
  WORD reserved3[3];
933
859
  BYTE keyboard[240];
934
860
  BYTE volenv[200];
935
861
  BYTE nodes[50];
936
862
  } ITOLDINSTRUMENT;
937
863
 
938
-
939
864
  // Impulse Instrument Format
940
865
  typedef struct tagITINSTRUMENT
941
866
  {
@@ -955,6 +880,7 @@ typedef struct tagITINSTRUMENT
955
880
  WORD trkvers;
956
881
  BYTE nos;
957
882
  BYTE reserved1;
883
+ CHAR name[26];
958
884
  BYTE ifc;
959
885
  BYTE ifr;
960
886
  BYTE mch;
@@ -967,7 +893,6 @@ typedef struct tagITINSTRUMENT
967
893
  BYTE dummy[4]; // was 7, but IT v2.17 saves 554 bytes
968
894
  } ITINSTRUMENT;
969
895
 
970
-
971
896
  // IT Sample Format
972
897
  typedef struct ITSAMPLESTRUCT
973
898
  {
@@ -977,6 +902,7 @@ typedef struct ITSAMPLESTRUCT
977
902
  BYTE gvl;
978
903
  BYTE flags;
979
904
  BYTE vol;
905
+ CHAR name[26];
980
906
  BYTE cvt;
981
907
  BYTE dfp;
982
908
  DWORD length;
@@ -994,8 +920,4 @@ typedef struct ITSAMPLESTRUCT
994
920
 
995
921
  #pragma pack()
996
922
 
997
- extern BYTE autovibit2xm[8];
998
- extern BYTE autovibxm2it[8];
999
-
1000
923
  #endif
1001
-