diff pytouhou/formats/std.py @ 321:61adb5453e46

Implement music playback.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 13 Jun 2012 15:29:43 +0200
parents 88361534c77e
children 70e2ed71b09c
line wrap: on
line diff
--- a/pytouhou/formats/std.py
+++ b/pytouhou/formats/std.py
@@ -97,7 +97,8 @@ class Stage(object):
         bgm_c_path = read_string(file, 128, 'ascii')
         bgm_d_path = read_string(file, 128, 'ascii')
 
-        stage.bgms = [(bgm_a, bgm_a_path), (bgm_b, bgm_b_path), (bgm_c, bgm_c_path), (bgm_d, bgm_d_path)] #TODO: handle ' '
+        stage.bgms = [None if bgm[0] == u' ' else bgm
+            for bgm in ((bgm_a, bgm_a_path), (bgm_b, bgm_b_path), (bgm_c, bgm_c_path), (bgm_d, bgm_d_path))]
 
         # Read model definitions
         offsets = unpack('<%s' % ('I' * nb_models), file.read(4 * nb_models))