Fix the content packs.

This commit is contained in:
Alexander 2015-08-22 23:14:12 -04:00
parent 53c054a0b3
commit d53f0238ac

View file

@ -1,5 +1,5 @@
from panda3d.core import * from panda3d.core import *
import __builtin__, os, sys, glob import __builtin__, os, sys
import aes import aes
import niraidata import niraidata
@ -45,6 +45,7 @@ abort = False
# Packs # Packs
pack = os.environ.get('TT_STRIDE_CONTENT_PACK') pack = os.environ.get('TT_STRIDE_CONTENT_PACK')
import glob
if pack and pack != 'default': if pack and pack != 'default':
print 'Loading content pack', pack print 'Loading content pack', pack
for file in glob.glob('resources/%s/*.mf' % pack): for file in glob.glob('resources/%s/*.mf' % pack):
@ -53,15 +54,9 @@ if pack and pack != 'default':
names = mf.getSubfileNames() names = mf.getSubfileNames()
for name in names: for name in names:
ext = os.path.splitext(name)[1] ext = os.path.splitext(name)[1]
if ext not in ('.jpg', '.jpeg', '.ogg', '.rgb'): if ext not in ['.jpg', '.jpeg', '.ogg', '.rgb']:
mf.removeSubfile(name) mf.removeSubfile(name)
vfs.mount(mf, Filename('/'), 0)
mf.flush()
if not vfs.mount(mf, '/', 0):
print 'Unable to mount %s' % filename
abort = True
break
if not abort: if not abort:
# Run # Run