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

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

            return(ModContent.OpenRead(assetName));
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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));
        }