File: allow-sound-init-to-fail.patch

package info (click to toggle)
a7xpg 0.11.dfsg1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,864 kB
  • sloc: xml: 56; makefile: 28
file content (35 lines) | stat: -rw-r--r-- 1,342 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
# Distributed under the same license as the game. See debian/copyright.

Index: a7xpg-0.11.dfsg1/src/abagames/util/sdl/Sound.d
===================================================================
--- a7xpg-0.11.dfsg1.orig/src/abagames/util/sdl/Sound.d	2007-11-01 20:44:09.000000000 +0100
+++ a7xpg-0.11.dfsg1/src/abagames/util/sdl/Sound.d	2007-11-01 20:45:41.000000000 +0100
@@ -9,6 +9,7 @@
 import SDL;
 import SDL_mixer;
 import abagames.util.sdl.SDLInitFailedException;
+import std.cstream;
 
 /**
  * BGM/SE.
@@ -30,8 +31,7 @@
 
     if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
       noSound = 1;
-      throw new SDLInitFailedException
-	("Unable to initialize SDL_AUDIO: " ~ string.toString(SDL_GetError()));
+      derr.writeLine("Unable to initialize SDL audio: " ~ string.toString(SDL_GetError()));
     }
 
     audio_rate = 44100;
@@ -40,8 +40,7 @@
     audio_buffers = 4096;
     if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) {
       noSound = 1;
-      throw new SDLInitFailedException
-	("Couldn't open audio: " ~ string.toString(SDL_GetError()));
+      derr.writeLine("Couldn't open audio: " ~ string.toString(SDL_GetError()));
     }
     Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
   }