gosu 1.4.5.pre1 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +1 -0
  3. data/dependencies/SDL/include/SDL_assert.h +4 -2
  4. data/dependencies/SDL/include/SDL_atomic.h +20 -0
  5. data/dependencies/SDL/include/SDL_audio.h +40 -4
  6. data/dependencies/SDL/include/SDL_blendmode.h +4 -6
  7. data/dependencies/SDL/include/SDL_clipboard.h +47 -0
  8. data/dependencies/SDL/include/SDL_config.h +71 -45
  9. data/dependencies/SDL/include/SDL_cpuinfo.h +39 -4
  10. data/dependencies/SDL/include/SDL_egl.h +59 -9
  11. data/dependencies/SDL/include/SDL_endian.h +34 -3
  12. data/dependencies/SDL/include/SDL_events.h +32 -1
  13. data/dependencies/SDL/include/SDL_filesystem.h +5 -1
  14. data/dependencies/SDL/include/SDL_gamecontroller.h +78 -5
  15. data/dependencies/SDL/include/SDL_guid.h +100 -0
  16. data/dependencies/SDL/include/SDL_hints.h +645 -43
  17. data/dependencies/SDL/include/SDL_joystick.h +127 -7
  18. data/dependencies/SDL/include/SDL_keyboard.h +38 -1
  19. data/dependencies/SDL/include/SDL_keycode.h +6 -1
  20. data/dependencies/SDL/include/SDL_log.h +2 -2
  21. data/dependencies/SDL/include/SDL_main.h +42 -2
  22. data/dependencies/SDL/include/SDL_metal.h +2 -1
  23. data/dependencies/SDL/include/SDL_mouse.h +12 -1
  24. data/dependencies/SDL/include/SDL_opengl.h +0 -51
  25. data/dependencies/SDL/include/SDL_opengl_glext.h +2260 -231
  26. data/dependencies/SDL/include/SDL_opengles2_gl2.h +374 -339
  27. data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +3479 -1496
  28. data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +6 -9
  29. data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +43 -14
  30. data/dependencies/SDL/include/SDL_platform.h +32 -6
  31. data/dependencies/SDL/include/SDL_rect.h +154 -2
  32. data/dependencies/SDL/include/SDL_render.h +46 -17
  33. data/dependencies/SDL/include/SDL_revision.h +6 -1
  34. data/dependencies/SDL/include/SDL_rwops.h +1 -15
  35. data/dependencies/SDL/include/SDL_scancode.h +46 -21
  36. data/dependencies/SDL/include/SDL_sensor.h +24 -3
  37. data/dependencies/SDL/include/SDL_stdinc.h +119 -8
  38. data/dependencies/SDL/include/SDL_surface.h +3 -1
  39. data/dependencies/SDL/include/SDL_system.h +66 -6
  40. data/dependencies/SDL/include/SDL_syswm.h +2 -0
  41. data/dependencies/SDL/include/SDL_test_common.h +1 -0
  42. data/dependencies/SDL/include/SDL_test_font.h +90 -3
  43. data/dependencies/SDL/include/SDL_thread.h +3 -3
  44. data/dependencies/SDL/include/SDL_touch.h +8 -0
  45. data/dependencies/SDL/include/SDL_version.h +19 -3
  46. data/dependencies/SDL/include/SDL_video.h +71 -9
  47. data/dependencies/SDL/include/begin_code.h +4 -4
  48. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  49. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  50. data/dependencies/SDL_sound/SDL_sound.c +210 -71
  51. data/dependencies/SDL_sound/SDL_sound.h +1 -1
  52. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +111 -168
  53. data/dependencies/SDL_sound/SDL_sound_flac.c +0 -6
  54. data/dependencies/SDL_sound/SDL_sound_internal.h +27 -5
  55. data/dependencies/SDL_sound/SDL_sound_modplug.c +20 -8
  56. data/dependencies/SDL_sound/SDL_sound_mp3.c +11 -7
  57. data/dependencies/SDL_sound/SDL_sound_raw.c +1 -1
  58. data/dependencies/SDL_sound/SDL_sound_shn.c +1 -5
  59. data/dependencies/SDL_sound/SDL_sound_voc.c +1 -1
  60. data/dependencies/SDL_sound/SDL_sound_vorbis.c +2 -4
  61. data/dependencies/SDL_sound/SDL_sound_wav.c +44 -20
  62. data/dependencies/SDL_sound/dr_flac.h +237 -95
  63. data/dependencies/SDL_sound/dr_mp3.h +46 -33
  64. data/dependencies/SDL_sound/libmodplug/fastmix.c +53 -39
  65. data/dependencies/SDL_sound/libmodplug/libmodplug.h +0 -12
  66. data/dependencies/SDL_sound/libmodplug/load_669.c +37 -32
  67. data/dependencies/SDL_sound/libmodplug/load_amf.c +57 -44
  68. data/dependencies/SDL_sound/libmodplug/load_ams.c +127 -100
  69. data/dependencies/SDL_sound/libmodplug/load_dbm.c +40 -37
  70. data/dependencies/SDL_sound/libmodplug/load_dmf.c +61 -49
  71. data/dependencies/SDL_sound/libmodplug/load_dsm.c +18 -13
  72. data/dependencies/SDL_sound/libmodplug/load_far.c +31 -24
  73. data/dependencies/SDL_sound/libmodplug/load_gdm.c +27 -21
  74. data/dependencies/SDL_sound/libmodplug/load_it.c +106 -91
  75. data/dependencies/SDL_sound/libmodplug/load_mdl.c +43 -35
  76. data/dependencies/SDL_sound/libmodplug/load_med.c +66 -52
  77. data/dependencies/SDL_sound/libmodplug/load_mod.c +30 -26
  78. data/dependencies/SDL_sound/libmodplug/load_mt2.c +61 -50
  79. data/dependencies/SDL_sound/libmodplug/load_mtm.c +23 -17
  80. data/dependencies/SDL_sound/libmodplug/load_okt.c +18 -16
  81. data/dependencies/SDL_sound/libmodplug/load_psm.c +44 -32
  82. data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -14
  83. data/dependencies/SDL_sound/libmodplug/load_s3m.c +59 -53
  84. data/dependencies/SDL_sound/libmodplug/load_stm.c +23 -18
  85. data/dependencies/SDL_sound/libmodplug/load_ult.c +33 -29
  86. data/dependencies/SDL_sound/libmodplug/load_xm.c +64 -57
  87. data/dependencies/SDL_sound/libmodplug/mmcmp.c +2 -1
  88. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +30 -20
  89. data/dependencies/SDL_sound/libmodplug/snd_flt.c +6 -4
  90. data/dependencies/SDL_sound/libmodplug/snd_fx.c +91 -65
  91. data/dependencies/SDL_sound/libmodplug/sndfile.c +91 -66
  92. data/dependencies/SDL_sound/libmodplug/sndmix.c +58 -35
  93. data/dependencies/SDL_sound/stb_vorbis.h +14 -9
  94. data/dependencies/mojoAL/mojoal.c +41 -24
  95. data/dependencies/utf8proc/utf8proc.c +1 -1
  96. data/dependencies/utf8proc/utf8proc.h +1 -1
  97. data/dependencies/utf8proc/utf8proc_data.h +3366 -3184
  98. data/lib/SDL2.dll +0 -0
  99. data/lib64/SDL2.dll +0 -0
  100. data/src/Window.cpp +3 -0
  101. metadata +5 -4
@@ -54,8 +54,9 @@ static VOID AMF_Unpack(MODCOMMAND *pPat, const BYTE *pTrack, UINT nRows, UINT nC
54
54
  UINT row = pTrack[0];
55
55
  UINT cmd = pTrack[1];
56
56
  UINT arg = pTrack[2];
57
+ MODCOMMAND *m;
57
58
  if (row >= nRows) break;
58
- MODCOMMAND *m = pPat + row * nChannels;
59
+ m = pPat + row * nChannels;
59
60
  if (cmd < 0x7F) // note+vol
60
61
  {
61
62
  m->note = cmd+1;
@@ -158,9 +159,10 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
158
159
  {
159
160
  const AMFFILEHEADER *pfh = (AMFFILEHEADER *)lpStream;
160
161
  DWORD dwMemPos;
162
+ UINT i;
161
163
 
162
164
  if ((!lpStream) || (dwMemLength < 2048)) return FALSE;
163
- if ((!SDL_strncmp((LPCTSTR)lpStream, "ASYLUM Music Format V1.0", 25)) && (dwMemLength > 4096))
165
+ if ((!SDL_strncmp((LPCSTR)lpStream, "ASYLUM Music Format V1.0", 25)) && (dwMemLength > 4096))
164
166
  {
165
167
  UINT numorders, numpats, numsamples;
166
168
 
@@ -177,14 +179,14 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
177
179
  _this->m_nSamples = 31;
178
180
  _this->m_nDefaultTempo = 125;
179
181
  _this->m_nDefaultSpeed = 6;
180
- for (UINT iOrd=0; iOrd<MAX_ORDERS; iOrd++)
182
+ for (i=0; i<MAX_ORDERS; i++)
181
183
  {
182
- _this->Order[iOrd] = (iOrd < numorders) ? lpStream[dwMemPos+iOrd] : 0xFF;
184
+ _this->Order[i] = (i < numorders) ? lpStream[dwMemPos+i] : 0xFF;
183
185
  }
184
186
  dwMemPos = 294; // ???
185
- for (UINT iSmp=0; iSmp<numsamples; iSmp++)
187
+ for (i=0; i<numsamples; i++)
186
188
  {
187
- MODINSTRUMENT *psmp = &_this->Ins[iSmp+1];
189
+ MODINSTRUMENT *psmp = &_this->Ins[i+1];
188
190
  psmp->nFineTune = MOD2XMFineTune(lpStream[dwMemPos+22]);
189
191
  psmp->nVolume = lpStream[dwMemPos+23];
190
192
  psmp->nGlobalVol = 64;
@@ -200,17 +202,19 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
200
202
  {
201
203
  psmp->nLoopStart = psmp->nLoopEnd = 0;
202
204
  }
203
- if ((psmp->nLength) && (iSmp>31)) _this->m_nSamples = iSmp+1;
205
+ if ((psmp->nLength) && (i>31)) _this->m_nSamples = i+1;
204
206
  dwMemPos += 37;
205
207
  }
206
- for (UINT iPat=0; iPat<numpats; iPat++)
208
+ for (i=0; i<numpats; i++)
207
209
  {
208
210
  MODCOMMAND *p = CSoundFile_AllocatePattern(64, _this->m_nChannels);
211
+ const UCHAR *pin;
212
+ UINT j;
209
213
  if (!p) break;
210
- _this->Patterns[iPat] = p;
211
- _this->PatternSize[iPat] = 64;
212
- const UCHAR *pin = lpStream + dwMemPos;
213
- for (UINT i=0; i<8*64; i++)
214
+ _this->Patterns[i] = p;
215
+ _this->PatternSize[i] = 64;
216
+ pin = lpStream + dwMemPos;
217
+ for (j=0; j<8*64; j++)
214
218
  {
215
219
  p->note = 0;
216
220
 
@@ -232,9 +236,9 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
232
236
  dwMemPos += 64*32;
233
237
  }
234
238
  // Read samples
235
- for (UINT iData=0; iData<_this->m_nSamples; iData++)
239
+ for (i=0; i<_this->m_nSamples; i++)
236
240
  {
237
- MODINSTRUMENT *psmp = &_this->Ins[iData+1];
241
+ MODINSTRUMENT *psmp = &_this->Ins[i+1];
238
242
  if (psmp->nLength)
239
243
  {
240
244
  if (dwMemPos > dwMemLength) return FALSE;
@@ -243,10 +247,16 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
243
247
  }
244
248
  return TRUE;
245
249
  }
250
+ else /**/
251
+ {
246
252
  ////////////////////////////
247
253
  // DSM/AMF
248
254
  USHORT *ptracks[MAX_PATTERNS];
249
255
  DWORD sampleseekpos[MAX_SAMPLES];
256
+ USHORT *pTrackMap;
257
+ BYTE **pTrackData;
258
+ UINT maxsampleseekpos;
259
+ UINT realtrackcnt;
250
260
 
251
261
  if ((pfh->szAMF[0] != 'A') || (pfh->szAMF[1] != 'M') || (pfh->szAMF[2] != 'F')
252
262
  || (pfh->version < 10) || (pfh->version > 14) || (!bswapLE16(pfh->numtracks))
@@ -264,7 +274,7 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
264
274
  {
265
275
  signed char *panpos = (signed char *)(lpStream + dwMemPos);
266
276
  UINT nchannels = (pfh->version >= 13) ? 32 : 16;
267
- for (UINT i=0; i<nchannels; i++)
277
+ for (i=0; i<nchannels; i++)
268
278
  {
269
279
  int pan = (panpos[i] + 64) * 2;
270
280
  if (pan < 0) pan = 0;
@@ -274,7 +284,7 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
274
284
  dwMemPos += nchannels;
275
285
  } else
276
286
  {
277
- for (UINT i=0; i<16; i++)
287
+ for (i=0; i<16; i++)
278
288
  {
279
289
  _this->ChnSettings[i].nPan = (lpStream[dwMemPos+i] & 1) ? 0x30 : 0xD0;
280
290
  }
@@ -290,33 +300,33 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
290
300
  dwMemPos += 2;
291
301
  }
292
302
  // Setup sequence list
293
- for (UINT iOrd=0; iOrd<MAX_ORDERS; iOrd++)
303
+ for (i=0; i<MAX_ORDERS; i++)
294
304
  {
295
305
  if (dwMemPos + 4 > dwMemLength) return TRUE;
296
- _this->Order[iOrd] = 0xFF;
297
- if (iOrd < pfh->numorders)
306
+ _this->Order[i] = 0xFF;
307
+ if (i < pfh->numorders)
298
308
  {
299
- _this->Order[iOrd] = iOrd;
300
- _this->PatternSize[iOrd] = 64;
309
+ _this->Order[i] = i;
310
+ _this->PatternSize[i] = 64;
301
311
  if (pfh->version >= 14)
302
312
  {
303
313
  if (dwMemPos + _this->m_nChannels * sizeof(USHORT) + 2 > dwMemLength) return FALSE;
304
- _this->PatternSize[iOrd] = bswapLE16(*(USHORT *)(lpStream+dwMemPos));
314
+ _this->PatternSize[i] = bswapLE16(*(USHORT *)(lpStream+dwMemPos));
305
315
  dwMemPos += 2;
306
316
  } else
307
317
  {
308
318
  if (dwMemPos + _this->m_nChannels * sizeof(USHORT) > dwMemLength) return FALSE;
309
319
  }
310
- ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos);
320
+ ptracks[i] = (USHORT *)(lpStream+dwMemPos);
311
321
  dwMemPos += _this->m_nChannels * sizeof(USHORT);
312
322
  }
313
323
  }
314
324
  if (dwMemPos + _this->m_nSamples * (sizeof(AMFSAMPLE)+8) > dwMemLength) return TRUE;
315
325
  // Read Samples
316
- UINT maxsampleseekpos = 0;
317
- for (UINT iIns=0; iIns<_this->m_nSamples; iIns++)
326
+ maxsampleseekpos = 0;
327
+ for (i=0; i<_this->m_nSamples; i++)
318
328
  {
319
- MODINSTRUMENT *pins = &_this->Ins[iIns+1];
329
+ MODINSTRUMENT *pins = &_this->Ins[i+1];
320
330
  const AMFSAMPLE *psh = (AMFSAMPLE *)(lpStream + dwMemPos);
321
331
 
322
332
  dwMemPos += sizeof(AMFSAMPLE);
@@ -335,10 +345,10 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
335
345
  pins->nLoopEnd = pins->nLength;
336
346
  dwMemPos += 2;
337
347
  }
338
- sampleseekpos[iIns] = 0;
348
+ sampleseekpos[i] = 0;
339
349
  if ((psh->type) && (bswapLE32(psh->offset) < dwMemLength-1))
340
350
  {
341
- sampleseekpos[iIns] = bswapLE32(psh->offset);
351
+ sampleseekpos[i] = bswapLE32(psh->offset);
342
352
  if (bswapLE32(psh->offset) > maxsampleseekpos)
343
353
  maxsampleseekpos = bswapLE32(psh->offset);
344
354
  if ((pins->nLoopEnd > pins->nLoopStart + 2)
@@ -346,38 +356,39 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
346
356
  }
347
357
  }
348
358
  // Read Track Mapping Table
349
- USHORT *pTrackMap = (USHORT *)(lpStream+dwMemPos);
350
- UINT realtrackcnt = 0;
359
+ pTrackMap = (USHORT *)(lpStream+dwMemPos);
360
+ realtrackcnt = 0;
351
361
  dwMemPos += pfh->numtracks * sizeof(USHORT);
352
362
  if (dwMemPos >= dwMemLength)
353
363
  return TRUE;
354
364
 
355
- for (UINT iTrkMap=0; iTrkMap<pfh->numtracks; iTrkMap++)
365
+ for (i=0; i<pfh->numtracks; i++)
356
366
  {
357
- if (realtrackcnt < pTrackMap[iTrkMap]) realtrackcnt = pTrackMap[iTrkMap];
367
+ if (realtrackcnt < pTrackMap[i]) realtrackcnt = pTrackMap[i];
358
368
  }
359
369
  // Store tracks positions
360
- BYTE **pTrackData = (BYTE **) SDL_calloc(realtrackcnt, sizeof(BYTE*));
370
+ pTrackData = (BYTE **) SDL_calloc(realtrackcnt, sizeof(BYTE*));
361
371
  if (!pTrackData) return TRUE;/*FIXME: return FALSE? */
362
- for (UINT iTrack=0; iTrack<realtrackcnt; iTrack++) if (dwMemPos <= dwMemLength - 3)
372
+ for (i=0; i<realtrackcnt; i++) if (dwMemPos <= dwMemLength - 3)
363
373
  {
364
374
  UINT nTrkSize = bswapLE16(*(USHORT *)(lpStream+dwMemPos));
365
375
  nTrkSize += (UINT)lpStream[dwMemPos+2] << 16;
366
376
  if (dwMemPos + nTrkSize * 3 + 3 <= dwMemLength)
367
377
  {
368
- pTrackData[iTrack] = (BYTE *)(lpStream + dwMemPos);
378
+ pTrackData[i] = (BYTE *)(lpStream + dwMemPos);
369
379
  }
370
380
  dwMemPos += nTrkSize * 3 + 3;
371
381
  }
372
382
  // Create the patterns from the list of tracks
373
- for (UINT iPat=0; iPat<pfh->numorders; iPat++)
383
+ for (i=0; i<pfh->numorders; i++)
374
384
  {
375
- MODCOMMAND *p = CSoundFile_AllocatePattern(_this->PatternSize[iPat], _this->m_nChannels);
385
+ MODCOMMAND *p = CSoundFile_AllocatePattern(_this->PatternSize[i], _this->m_nChannels);
386
+ UINT ch;
376
387
  if (!p) break;
377
- _this->Patterns[iPat] = p;
378
- for (UINT iChn=0; iChn<_this->m_nChannels; iChn++)
388
+ _this->Patterns[i] = p;
389
+ for (ch=0; ch<_this->m_nChannels; ch++)
379
390
  {
380
- UINT nTrack = bswapLE16(ptracks[iPat][iChn]);
391
+ UINT nTrack = bswapLE16(ptracks[i][ch]);
381
392
  if ((nTrack) && (nTrack <= pfh->numtracks))
382
393
  {
383
394
  UINT realtrk = bswapLE16(pTrackMap[nTrack-1]);
@@ -386,7 +397,7 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
386
397
  realtrk--;
387
398
  if ((realtrk < realtrackcnt) && (pTrackData[realtrk]))
388
399
  {
389
- AMF_Unpack(p+iChn, pTrackData[realtrk], _this->PatternSize[iPat], _this->m_nChannels);
400
+ AMF_Unpack(p+ch, pTrackData[realtrk], _this->PatternSize[i], _this->m_nChannels);
390
401
  }
391
402
  }
392
403
  }
@@ -394,15 +405,17 @@ BOOL CSoundFile_ReadAMF(CSoundFile *_this, LPCBYTE lpStream, const DWORD dwMemLe
394
405
  }
395
406
  SDL_free(pTrackData);
396
407
  // Read Sample Data
397
- for (UINT iSeek=1; iSeek<=maxsampleseekpos; iSeek++)
408
+ for (i=1; i<=maxsampleseekpos; i++)
398
409
  {
410
+ UINT smp;
399
411
  if (dwMemPos >= dwMemLength) break;
400
- for (UINT iSmp=0; iSmp<_this->m_nSamples; iSmp++) if (iSeek == sampleseekpos[iSmp])
412
+ for (smp=0; smp<_this->m_nSamples; smp++) if (i == sampleseekpos[smp])
401
413
  {
402
- MODINSTRUMENT *pins = &_this->Ins[iSmp+1];
414
+ MODINSTRUMENT *pins = &_this->Ins[smp+1];
403
415
  dwMemPos += CSoundFile_ReadSample(_this, pins, RS_PCM8U, (LPCSTR)(lpStream+dwMemPos), dwMemLength-dwMemPos);
404
416
  break;
405
417
  }
406
418
  }
407
419
  return TRUE;
420
+ } /**/
408
421
  }