diff options
| -rw-r--r-- | sdl.cpp | 7 | ||||
| -rw-r--r-- | windows.cpp | 5 |
2 files changed, 10 insertions, 2 deletions
@@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.15 2001/11/06 07:47:01 strigeus + * fixed integer overflow for large sounds + * * Revision 1.14 2001/11/05 20:45:07 strigeus * fixed playSfxSound types * @@ -423,7 +426,9 @@ void playSfxSound(void *sound, uint32 size, uint rate) { _sfx_pos = 0; _sfx_fp_speed = (1<<16) * rate / 22050; _sfx_fp_pos = 0; - debug(1, "size=%d, rate=%d", size, rate); +// debug(1, "size=%d, rate=%d", size, rate); + + while (size&0xFFFF0000) size>>=1, rate>>=1; _sfx_size = size * 22050 / rate; } diff --git a/windows.cpp b/windows.cpp index a0edf79cda..c0505968c7 100644 --- a/windows.cpp +++ b/windows.cpp @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.11 2001/11/06 07:47:00 strigeus + * fixed integer overflow for large sounds + * * Revision 1.10 2001/11/05 20:44:34 strigeus * speech support * @@ -873,7 +876,7 @@ void playSfxSound(void *sound, uint32 size, uint rate) { _sfx_pos = 0; _sfx_fp_speed = (1<<16) * rate / 22050; _sfx_fp_pos = 0; - debug(1, "size=%d, rate=%d", size, rate); + while (size&0xFFFF0000) size>>=1, rate>>=1; _sfx_size = size * 22050 / rate; } |
