comparison SDL_sound.c @ 441:5b00e43ec23c

Patches to make SDL_sound more Visual C happy.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 31 Jan 2003 01:53:12 +0000
parents ddce7101673e
children d0393837bfac
comparison
equal deleted inserted replaced
440:6d94441c854e 441:5b00e43ec23c
36 #include <stdlib.h> 36 #include <stdlib.h>
37 #include <string.h> 37 #include <string.h>
38 #include <ctype.h> 38 #include <ctype.h>
39 39
40 #include "SDL.h" 40 #include "SDL.h"
41 #include "SDL_thread.h"
41 #include "SDL_sound.h" 42 #include "SDL_sound.h"
42 43
43 #define __SDL_SOUND_INTERNAL__ 44 #define __SDL_SOUND_INTERNAL__
44 #include "SDL_sound_internal.h" 45 #include "SDL_sound_internal.h"
45 46
387 388
388 389
389 Uint32 __Sound_convertMsToBytePos(Sound_AudioInfo *info, Uint32 ms) 390 Uint32 __Sound_convertMsToBytePos(Sound_AudioInfo *info, Uint32 ms)
390 { 391 {
391 /* "frames" == "sample frames" */ 392 /* "frames" == "sample frames" */
392 float frames_per_ms = ((float) info->rate) / 1000.0; 393 float frames_per_ms = ((float) info->rate) / 1000.0f;
393 Uint32 frame_offset = (Uint32) (frames_per_ms * ((float) ms)); 394 Uint32 frame_offset = (Uint32) (frames_per_ms * ((float) ms));
394 Uint32 frame_size = (Uint32) ((info->format & 0xFF) / 8) * info->channels; 395 Uint32 frame_size = (Uint32) ((info->format & 0xFF) / 8) * info->channels;
395 return(frame_offset * frame_size); 396 return(frame_offset * frame_size);
396 } /* __Sound_convertMsToBytePos */ 397 } /* __Sound_convertMsToBytePos */
397 398