예제 #1
0
        public SfxData LoadSfxData(string path)
        {
            var bytes = File.ReadAllBytes(path);

            var id = Path.GetFileNameWithoutExtension(path);

            var sfx_data = new SfxData()
            {
                Id   = id,
                Data = bytes
            };

            return(sfx_data);
        }
예제 #2
0
        public unsafe Effect LoadEffect(SfxData sfx_data)
        {
            var wav = new Wav();

            fixed(byte *p = sfx_data.Data)
            {
                var ptr = (IntPtr)p;

                wav.loadMem(ptr, (uint)sfx_data.Data.Length, aCopy: true);
            }

            var effect = new Effect(wav)
            {
                Id = sfx_data.Id
            };

            return(effect);
        }