Exemple #1
0
        /// Upack and Decompress the values from our bitstream.
        private void ReadValues(byte[] bitstream, ref int readpos)
        {
            /// ------------------------------------------------------------------ ///
            /// ---  Unpack all of our compressed values from the bitstream  ----- ///
            /// ------------------------------------------------------------------ ///

            meterval = meterCrusher.Read(bitstream, ref readpos).Decompress();

            //// Read our packed bits out and restore them
            color = new Color(
                colorCrusher.Read(bitstream, ref readpos).Decompress(),
                colorCrusher.Read(bitstream, ref readpos).Decompress(),
                colorCrusher.Read(bitstream, ref readpos).Decompress()
                );

            if (bitstream.ReadBool(ref readpos))
            {
                /// Read the compressed transform values in from the bitstream.
                /// We pass it our destination CompressedMatrix class to hold the compressed version of the Matrix.
                sharedCrusher.Crusher.Read(compMatrix, bitstream, ref readpos);
            }

            flasherIsOn = bitstream.ReadBool(ref readpos);

            /// ------------------------------------------------------------------ ///
            /// ----------- End reading from the bitstream ----------------------- ///
            /// ------------------------------------------------------------------ ///
        }
        public static float ReadAndDecompress(this FloatCrusher fc, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling)
        {
            CompressedFloat c = fc.Read(ref bitstream, bcl);

            return(fc.Decompress(c));
        }