static void InitLevelInfo(void);
static void InitArtworkInfo(void);
static void InitNetworkServer(void);
+static void InitMixer(void);
static void InitSound(void);
static void InitGfx(void);
static void InitGfxBackground(void);
static void InitGadgets(void);
static void InitElementProperties(void);
+static void Execute_Debug_Command(char *);
void OpenAll(void)
{
+ if (options.debug_command)
+ {
+ Execute_Debug_Command(options.debug_command);
+
+ exit(0);
+ }
+
if (options.serveronly)
{
#if defined(PLATFORM_UNIX)
InitArtworkInfo(); /* needed before loading gfx, sound & music */
InitCounter();
- InitSound();
+ InitMixer();
InitJoysticks();
InitRND(NEW_RANDOMIZE);
InitLevelInfo();
InitGadgets(); /* needs to know number of level series */
+ InitSound(); /* needs to know current level directory */
InitGfxBackground();
InitToons();
#endif
}
-void InitSound()
+static void InitMixer()
{
- int i;
-
OpenAudio();
+ InitSoundList(sound_effects, NUM_SOUND_EFFECTS);
- for(i=0; i<NUM_SOUNDS; i++)
- {
- if (!LoadCustomSound(sound_name[i]))
- {
- Error(ERR_WARN, "sounds deactivated");
-
- audio.sound_available = FALSE;
- audio.loops_available = FALSE;
- audio.sound_enabled = FALSE;
-
- return;
- }
- }
-
- num_bg_loops = LoadCustomMusic();
+ StartMixer();
+}
- StartSoundserver();
+static void InitSound()
+{
+ InitReloadSounds(artwork.snd_current->name);
+ InitReloadMusic(artwork.mus_current->name);
}
-void InitTileClipmasks()
+static void InitTileClipmasks()
{
#if defined(TARGET_X11)
- GC copy_clipmask_gc;
XGCValues clip_gc_values;
unsigned long clip_gc_valuemask;
#if defined(TARGET_X11_NATIVE)
+ GC copy_clipmask_gc;
+
static struct
{
int start;
for(i=0; i<NUM_BITMAPS; i++)
{
- if (pix[i]->stored_clip_gc)
+ if (pix[i] != NULL && pix[i]->stored_clip_gc)
{
XFreeGC(display, pix[i]->stored_clip_gc);
pix[i]->stored_clip_gc = None;
DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW);
DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED);
-#if defined(PLATFORM_MSDOS)
- DrawInitText(PROGRAM_DOS_PORT_STRING, 210, FC_BLUE);
- rest(200);
-#endif
- DrawInitText("Loading graphics:",120,FC_GREEN);
+
+ DrawInitText("Loading graphics:", 120, FC_GREEN);
for(i=0; i<NUM_PICTURES; i++)
{
Elementeigenschaften1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
}
+void Execute_Debug_Command(char *command)
+{
+ if (strcmp(command, "create soundinfo.conf") == 0)
+ {
+ int i;
+
+ printf("# You can configure additional/alternative sound effects here\n");
+ printf("# (The sounds below are default and therefore commented out.)\n");
+ printf("\n");
+
+ for (i=0; i<NUM_SOUND_EFFECTS; i++)
+ printf("# %s\n",
+ getFormattedSetupEntry(sound_effects[i].text,
+ sound_effects[i].default_filename));
+ }
+}
+
void CloseAllAndExit(int exit_value)
{
int i;
StopSounds();
- FreeSounds(NUM_SOUNDS);
- CloseAudio();
+ FreeAllSounds();
+ FreeAllMusic();
+ CloseAudio(); /* called after freeing sounds (needed for SDL) */
FreeTileClipmasks();
for(i=0; i<NUM_BITMAPS; i++)