rnd-19981017-1
[rocksndiamonds.git] / src / sound.h
index 384f77cf7b6bda5de951ffa1b60de579977d7476..4b17f3acd8b5c9bc3ebd73a07a152b3bad10c758 100644 (file)
@@ -1,13 +1,12 @@
 /***********************************************************
 *  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+*  (c) 1995-98 Artsoft Entertainment                       *
+*              Holger Schemel                              *
+*              Oststrasse 11a                              *
+*              33604 Bielefeld                             *
+*              phone: ++49 +521 290471                     *
+*              email: aeglos@valinor.owl.de                *
 *----------------------------------------------------------*
 *  sound.c                                                 *
 ***********************************************************/
@@ -15,8 +14,8 @@
 #ifndef SOUND_H
 #define SOUND_H
 
-#include "main.h"
 #include <math.h>
+#include "main.h"
 
 #ifdef linux
 #include <linux/soundcard.h>
@@ -40,9 +39,14 @@ extern void ioctl(long, long, void *);
 #define HPUX_AUDIO
 #endif /* _HPUX_SOURCE */
 
+#ifndef MSDOS
 #define MAX_SOUNDS_PLAYING     16
+#else
+#define MAX_SOUNDS_PLAYING     8
+#endif
 
 /* some values for PlaySound(), StopSound() and friends */
+#ifndef MSDOS
 #define PSND_SILENCE           0
 #define PSND_MAX_VOLUME_BITS   7
 #define PSND_MIN_VOLUME                0
@@ -56,6 +60,16 @@ extern void ioctl(long, long, void *);
 #define PSND_MAX_RIGHT         (+PSND_MAX_STEREO)
 #define PSND_MAX_LEFT2RIGHT_BITS (PSND_MAX_STEREO_BITS+1)
 #define PSND_MAX_LEFT2RIGHT    (1 << PSND_MAX_LEFT2RIGHT_BITS)
+#else
+#define PSND_SILENCE           0
+#define PSND_MIN_VOLUME                0
+#define PSND_MAX_VOLUME                255
+#define PSND_NO_LOOP           0
+#define PSND_LOOP              1
+#define PSND_MAX_LEFT          0
+#define PSND_MAX_RIGHT         255
+#define PSND_MIDDLE            128
+#endif
 
 #define SSND_FADE_SOUND                (1<<0)
 #define SSND_FADE_ALL_SOUNDS   (1<<1)
@@ -110,9 +124,13 @@ struct SoundHeader_8SVX
 
 struct SoundInfo
 { 
-  char *name;
-  char *file_ptr, *data_ptr;
+  unsigned char *name;
+  unsigned char *file_ptr;
+  char *data_ptr;
   long file_len, data_len;
+#ifdef MSDOS
+  SAMPLE *sample_ptr;
+#endif
 };
 
 struct SoundControl
@@ -120,20 +138,20 @@ struct SoundControl
   int nr;
   int volume;
   int stereo;
-  BOOL active;
-  BOOL loop;
-  BOOL fade_sound;
-  BOOL stop_sound;
-  BOOL stop_all_sounds;
+  boolean active;
+  boolean loop;
+  boolean fade_sound;
+  boolean stop_sound;
+  boolean stop_all_sounds;
   int playingtime;
   long playingpos;
   long data_len;
   char *data_ptr;
+#ifdef MSDOS
+  int voice;
+#endif
 };
 
-/* function from "misc.c" */
-unsigned long be2long(unsigned long *);
-
 /* sound server functions */
 void SoundServer(void);
 void SoundServer_InsertNewSound(struct SoundControl);
@@ -144,11 +162,11 @@ unsigned char linear_to_ulaw(int);
 int ulaw_to_linear(unsigned char);
 
 /* application functions */
-BOOL LoadSound(struct SoundInfo *);
+boolean LoadSound(struct SoundInfo *);
 void PlaySound(int);
 void PlaySoundStereo(int, int);
 void PlaySoundLoop(int);
-void PlaySoundExt(int, int, int, BOOL);
+void PlaySoundExt(int, int, int, boolean);
 void FadeSound(int);
 void FadeSounds(void);
 void StopSound(int);