示例#1
0
        public static void ReadDeltaUsercmd(sizebuf_t msg_read, usercmd_t from, usercmd_t move)
        {
            Int32 bits;

            move.Set(from);
            bits = ReadByte(msg_read);
            if ((bits & CM_ANGLE1) != 0)
            {
                move.angles[0] = ReadShort(msg_read);
            }
            if ((bits & CM_ANGLE2) != 0)
            {
                move.angles[1] = ReadShort(msg_read);
            }
            if ((bits & CM_ANGLE3) != 0)
            {
                move.angles[2] = ReadShort(msg_read);
            }
            if ((bits & CM_FORWARD) != 0)
            {
                move.forwardmove = ReadShort(msg_read);
            }
            if ((bits & CM_SIDE) != 0)
            {
                move.sidemove = ReadShort(msg_read);
            }
            if ((bits & CM_UP) != 0)
            {
                move.upmove = ReadShort(msg_read);
            }
            if ((bits & CM_BUTTONS) != 0)
            {
                move.buttons = ( Byte )ReadByte(msg_read);
            }
            if ((bits & CM_IMPULSE) != 0)
            {
                move.impulse = ( Byte )ReadByte(msg_read);
            }
            move.msec       = ( Byte )ReadByte(msg_read);
            move.lightlevel = ( Byte )ReadByte(msg_read);
        }