예제 #1
0
    // Token: 0x06000A33 RID: 2611 RVA: 0x0005BD90 File Offset: 0x00059F90
    private void amTpUpdateStatus(AppMain.AMS_TP_TOUCH_STATUS status, AppMain.AMS_TP_TOUCH_CORE core)
    {
        bool flag  = (core.sampling_flag & 1) != 0;
        bool flag2 = (status.flag & 1) != 0;
        bool flag3 = flag ^ flag2;

        AppMain.AMM_TP_BIT_SET16(ref status.flag, 7, (core.sampling_flag & 128) != 0);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 1, flag2);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 0, flag);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 2, flag3 && flag);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 3, flag3 && flag2);
        status.prev[0] = status.on[0];
        status.prev[1] = status.on[1];
        ushort[] sampling_buf = core.sampling_buf;
        status.on[0] = sampling_buf[0];
        status.on[1] = sampling_buf[1];
        if ((status.flag & 4) != 0)
        {
            status.push[0] = status.on[0];
            status.push[1] = status.on[1];
        }
        else if ((status.flag & 8) != 0)
        {
            status.pull[0] = status.prev[0];
            status.pull[1] = status.prev[1];
        }
        if (status.core != core)
        {
            status.core = core;
        }
    }
예제 #2
0
    private void amTpUpdateStatus(AppMain.AMS_TP_TOUCH_STATUS status, AppMain.AMS_TP_TOUCH_CORE core)
    {
        bool b1   = ((int)core.sampling_flag & 1) != 0;
        bool b2   = ((int)status.flag & 1) != 0;
        bool flag = b1 ^ b2;

        AppMain.AMM_TP_BIT_SET16(ref status.flag, 7, ((int)core.sampling_flag & 128) != 0);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 1, b2);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 0, b1);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 2, flag & b1);
        AppMain.AMM_TP_BIT_SET16(ref status.flag, 3, flag & b2);
        status.prev[0] = status.on[0];
        status.prev[1] = status.on[1];
        ushort[] samplingBuf = core.sampling_buf;
        status.on[0] = samplingBuf[0];
        status.on[1] = samplingBuf[1];
        if (((int)status.flag & 4) != 0)
        {
            status.push[0] = status.on[0];
            status.push[1] = status.on[1];
        }
        else if (((int)status.flag & 8) != 0)
        {
            status.pull[0] = status.prev[0];
            status.pull[1] = status.prev[1];
        }
        if (status.core == core)
        {
            return;
        }
        status.core = core;
    }
 // Token: 0x060029D7 RID: 10711 RVA: 0x00158CAC File Offset: 0x00156EAC
 public virtual void Update()
 {
     if (this.IsValid() && !this.m_flag[0])
     {
         for (int i = 0; i < AppMain._am_tp_touch.Length; i++)
         {
             bool is_on = false;
             AppMain.AMS_TP_TOUCH_STATUS ams_TP_TOUCH_STATUS = AppMain._am_tp_touch[i];
             bool    flag;
             IntPair move;
             if (AppMain.amTpIsTouchOn(i))
             {
                 flag = AppMain.amTpIsTouchPush(i);
                 if (flag)
                 {
                     this.m_pos[i] = new IntPair((int)ams_TP_TOUCH_STATUS.push[0], (int)ams_TP_TOUCH_STATUS.push[1]);
                 }
                 IntPair intPair = new IntPair((int)ams_TP_TOUCH_STATUS.on[0], (int)ams_TP_TOUCH_STATUS.on[1]);
                 if (!this.m_flag[1])
                 {
                     is_on = this.hitTest(intPair, (uint)i);
                 }
                 move          = intPair - this.m_pos[i];
                 this.m_pos[i] = intPair;
             }
             else
             {
                 flag = AppMain.amTpIsTouchPull(i);
                 move = new IntPair((int)ams_TP_TOUCH_STATUS.pull[0], (int)ams_TP_TOUCH_STATUS.pull[1]) - this.m_pos[i];
                 if (flag)
                 {
                     this.m_pos[i] = default(IntPair);
                 }
             }
             T t = this.m_state[i];
             t.Push(is_on, flag, move);
         }
     }
 }
예제 #4
0
 public virtual void Update()
 {
     if (!this.IsValid() || this.m_flag[0])
     {
         return;
     }
     for (int index = 0; index < AppMain._am_tp_touch.Length; ++index)
     {
         bool is_on = false;
         AppMain.AMS_TP_TOUCH_STATUS amsTpTouchStatus = AppMain._am_tp_touch[index];
         bool    is_edge;
         IntPair move;
         if (AppMain.amTpIsTouchOn(index))
         {
             is_edge = AppMain.amTpIsTouchPush(index);
             if (is_edge)
             {
                 this.m_pos[index] = new IntPair((int)amsTpTouchStatus.push[0], (int)amsTpTouchStatus.push[1]);
             }
             IntPair pos = new IntPair((int)amsTpTouchStatus.on[0], (int)amsTpTouchStatus.on[1]);
             if (!this.m_flag[1])
             {
                 is_on = this.hitTest(pos, (uint)index);
             }
             move = pos - this.m_pos[index];
             this.m_pos[index] = pos;
         }
         else
         {
             is_edge = AppMain.amTpIsTouchPull(index);
             move    = new IntPair((int)amsTpTouchStatus.pull[0], (int)amsTpTouchStatus.pull[1]) - this.m_pos[index];
             if (is_edge)
             {
                 this.m_pos[index] = new IntPair();
             }
         }
         this.m_state[index].Push(is_on, is_edge, move);
     }
 }