protected override Stream OpenStream(string assetName)
        {
            if (!assetName.StartsWith("tmod:"))
            {
                return(base.OpenStream(assetName));
            }

            if (!assetName.EndsWith(".xnb"))
            {
                assetName += ".xnb";
            }

            return(ModContent.OpenRead(assetName));
        }
Beispiel #2
0
        private void EnsureLoaded()
        {
            if (instance != null)
            {
                return;
            }

            stream = ModContent.OpenRead(path, true);
            PrepareStream();

            instance = new DynamicSoundEffectInstance(sampleRate, channels);
            buffer   = new byte[bufferLength];           // could use a buffer pool but swapping music isn't likely to thrash the GC too much

            CheckBuffer();
        }
Beispiel #3
0
        protected override Stream OpenStream(string assetName)
        {
            if (!assetName.StartsWith("tmod:"))
            {
                if (alternateContentManager != null && File.Exists(Path.Combine(alternateContentManager.RootDirectory, assetName + ".xnb")))
                {
                    try {
                        return(alternateContentManager.OpenStream(assetName));
                    }
                    catch {}
                }
                return(base.OpenStream(assetName));
            }

            if (!assetName.EndsWith(".xnb"))
            {
                assetName += ".xnb";
            }

            return(ModContent.OpenRead(assetName));
        }