CSPspEmu.Hle.Formats.Font.BitReader.ReadBitsAt C# (CSharp) Method

ReadBitsAt() public static method

public static ReadBitsAt ( byte Data, int Offset, int Count ) : uint
Data byte
Offset int
Count int
return uint
        public static uint ReadBitsAt(byte[] Data, int Offset, int Count)
        {
            var BitReader = new BitReader(Data);
            BitReader.Position = Offset;
            return BitReader.ReadBits(Count);
        }

Usage Example

Example #1
0
        public int GetGlyphId(char Char)
        {
            if (Char < Header.FirstGlyph)
            {
                return(-1);
            }
            if (Char > Header.LastGlyph)
            {
                return(-1);
            }
            int glyphPos = Char - Header.FirstGlyph;

            //Console.WriteLine("Offset: {0}, Size: {1}", glyphPos * header.charMapBpe, header.charMapBpe);
            return((int)BitReader.ReadBitsAt(PackedCharMap, glyphPos * Header.TableCharMapBpe, Header.TableCharMapBpe));
        }