Skip to content
Permalink
Browse files

Updated Visual C++ project

  • Loading branch information
slouken committed May 11, 2006
1 parent ccd47f0 commit 58e19d818c4779206d1194446bb01b6626776d28
Showing with 17 additions and 10 deletions.
  1. BIN VisualC.zip
  2. +1 −1 effect_stereoreverse.c
  3. +2 −2 load_voc.c
  4. +7 −0 mikmod/mikmod_internals.h
  5. +1 −1 music.c
  6. +1 −1 timidity/readmidi.c
  7. +5 −5 timidity/resample.c
BIN +64.5 KB (120%) VisualC.zip
Binary file not shown.
@@ -74,7 +74,7 @@ static void _Eff_reversestereo8(int chan, void *stream, int len, void *udata)
/* get the last two bytes if len is not divisible by four... */
if (len % sizeof (Uint32) != 0) {
Uint16 *p = (Uint16 *) (((Uint8 *) stream) + (len - 2));
*p = (((*p) & 0xFF00) >> 8) | (((*ptr) & 0x00FF) << 8);
*p = (Uint16)((((*p) & 0xFF00) >> 8) | (((*ptr) & 0x00FF) << 8));
len -= 2;
}

@@ -244,7 +244,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec)
* Adjust period.
*/
if ((v->rate != -1) && (uc != v->rate))
period = (period * (256 - uc))/(256 - v->rate);
period = (Uint16)((period * (256 - uc))/(256 - v->rate));
else
v->rate = uc;
v->rest = period;
@@ -434,7 +434,7 @@ SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc,
fillptr = ((Uint8 *) ptr) + (*audio_len - v.rest);
}

spec->samples = (*audio_len / v.size);
spec->samples = (Uint16)(*audio_len / v.size);

was_error = 0; /* success, baby! */

@@ -88,6 +88,13 @@ extern MikMod_handler_t _mm_errorhandler;

/*========== Memory allocation */

/* _mm_malloc and _mm_free are defined in malloc.h in Visual C++ 6 */
#ifdef _mm_malloc
#undef _mm_malloc
#endif
#ifdef _mm_free
#undef _mm_free
#endif
extern void* _mm_malloc(size_t);
extern void* _mm_calloc(size_t,size_t);
#define _mm_free(p) { if (p) free(p); p = NULL; }
@@ -868,7 +868,7 @@ int music_internal_position(double position)
#ifdef MP3_MUSIC
case MUS_MP3:
if ( position > 0.0 ) {
SMPEG_skip(music_playing->data.mp3, position);
SMPEG_skip(music_playing->data.mp3, (float)position);
} else {
SMPEG_rewind(music_playing->data.mp3);
SMPEG_play(music_playing->data.mp3);
@@ -91,7 +91,7 @@ static int sysex(uint32 len, uint8 *syschan, uint8 *sysa, uint8 *sysb, SDL_RWops
{
unsigned char *s=(unsigned char *)safe_malloc(len);
int id, model, ch, port, adhi, adlo, cd, dta, dtb, dtc;
if (len != SDL_RWread(rw, s, 1, len))
if (len != (uint32)SDL_RWread(rw, s, 1, len))
{
free(s);
return 0;
@@ -38,18 +38,18 @@
# define RESAMPLATION \
v1=src[ofs>>FRACTION_BITS];\
v2=src[(ofs>>FRACTION_BITS)+1];\
*dest++ = v1 + (iplookup[(((v2-v1)<<5) & 0x03FE0) | \
((ofs & FRACTION_MASK) >> (FRACTION_BITS-5))]);
*dest++ = (resample_t)(v1 + (iplookup[(((v2-v1)<<5) & 0x03FE0) | \
((ofs & FRACTION_MASK) >> (FRACTION_BITS-5))]));
# else
# define RESAMPLATION \
v1=src[ofs>>FRACTION_BITS];\
v2=src[(ofs>>FRACTION_BITS)+1];\
*dest++ = v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
*dest++ = (resample_t)(v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
# endif
# define INTERPVARS sample_t v1, v2
#else
/* Earplugs recommended for maximum listening enjoyment */
# define RESAMPLATION *dest++=src[ofs>>FRACTION_BITS];
# define RESAMPLATION *dest++ = src[ofs>>FRACTION_BITS];
# define INTERPVARS
#endif

@@ -734,7 +734,7 @@ void pre_resample(Sample * sp)
{
v1 = src[ofs >> FRACTION_BITS];
v2 = src[(ofs >> FRACTION_BITS) + 1];
*dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);
*dest++ = (resample_t)(v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
}
else
*dest++ = src[ofs >> FRACTION_BITS];

0 comments on commit 58e19d8

Please sign in to comment.