Ejemplo n.º 1
0
    // Token: 0x0600005B RID: 91 RVA: 0x00004A40 File Offset: 0x00002C40
    private static void gmPadVibDMain(MTS_TASK_TCB tcb)
    {
        AppMain.GMS_PAD_VIB_WORK work = (AppMain.GMS_PAD_VIB_WORK)tcb.work;
        if (AppMain.ObjObjectPauseCheck(0U) != 0U)
        {
            if ((work.flag & 2U) == 0U)
            {
                work.flag |= 2U;
            }

            return;
        }

        work.flag &= 4294967293U;
        if (work.time > 0f)
        {
            work.time_count = AppMain.ObjTimeCountUpF(work.time_count);
            if (work.time_count >= work.time)
            {
                work.vib_type = 0;
                work.prio     = 0U;
                work.time     = -1f;
                work.flag    |= 2U;
            }
        }

        switch (work.vib_type)
        {
        case 0:
            AoPad.AoPadSetVibration(0, 0);
            return;

        case 1:
            break;

        case 2:
            if (work.time - work.time_count < work.add_dec_time)
            {
                float num = (work.time - work.time_count) / work.add_dec_time;
                work.left_vib  = (ushort)AppMain.nnRoundOff((float)work.left_vib * num + 0.5f);
                work.right_vib = (ushort)AppMain.nnRoundOff((float)work.right_vib * num + 0.5f);
                return;
            }

            break;

        case 3:
            if (work.time_count < work.add_dec_time)
            {
                float num = work.time_count / work.add_dec_time;
                work.left_vib  = (ushort)AppMain.nnRoundOff((float)work.left_vib * num + 0.5f);
                work.right_vib = (ushort)AppMain.nnRoundOff((float)work.right_vib * num + 0.5f);
                return;
            }

            break;

        case 4:
            work.int_count = AppMain.ObjTimeCountUpF(work.int_count);
            if ((work.flag & 1U) != 0U)
            {
                if (work.int_count >= work.int_stop_time)
                {
                    work.int_count = 0f;
                    work.flag     &= 4294967294U;
                    return;
                }
            }
            else if (work.int_count >= work.int_stop_time)
            {
                work.int_count = 0f;
                work.flag     |= 1U;
            }

            break;

        default:
            return;
        }

        AoPad.AoPadSetVibration(work.left_vib, work.right_vib);
        tcb.work = work;
    }
Ejemplo n.º 2
0
    // Token: 0x0600005B RID: 91 RVA: 0x00004A40 File Offset: 0x00002C40
    private void gmPadVibDMain(AppMain.MTS_TASK_TCB tcb)
    {
        AppMain.GMS_PAD_VIB_WORK gms_PAD_VIB_WORK = (AppMain.GMS_PAD_VIB_WORK)tcb.work;
        if (AppMain.ObjObjectPauseCheck(0U) != 0U)
        {
            if ((gms_PAD_VIB_WORK.flag & 2U) == 0U)
            {
                gms_PAD_VIB_WORK.flag |= 2U;
            }
            return;
        }
        gms_PAD_VIB_WORK.flag &= 4294967293U;
        if (gms_PAD_VIB_WORK.time > 0f)
        {
            gms_PAD_VIB_WORK.time_count = AppMain.ObjTimeCountUpF(gms_PAD_VIB_WORK.time_count);
            if (gms_PAD_VIB_WORK.time_count >= gms_PAD_VIB_WORK.time)
            {
                gms_PAD_VIB_WORK.vib_type = 0;
                gms_PAD_VIB_WORK.prio     = 0U;
                gms_PAD_VIB_WORK.time     = -1f;
            }
        }
        switch (gms_PAD_VIB_WORK.vib_type)
        {
        case 0:
        case 1:
            break;

        case 2:
            if (gms_PAD_VIB_WORK.time - gms_PAD_VIB_WORK.time_count < gms_PAD_VIB_WORK.add_dec_time)
            {
                float num = (gms_PAD_VIB_WORK.time - gms_PAD_VIB_WORK.time_count) / gms_PAD_VIB_WORK.add_dec_time;
                AppMain.nnRoundOff(( float )gms_PAD_VIB_WORK.left_vib * num + 0.5f);
                AppMain.nnRoundOff(( float )gms_PAD_VIB_WORK.right_vib * num + 0.5f);
                return;
            }
            break;

        case 3:
            if (gms_PAD_VIB_WORK.time_count < gms_PAD_VIB_WORK.add_dec_time)
            {
                float num = gms_PAD_VIB_WORK.time_count / gms_PAD_VIB_WORK.add_dec_time;
                AppMain.nnRoundOff(( float )gms_PAD_VIB_WORK.left_vib * num + 0.5f);
                AppMain.nnRoundOff(( float )gms_PAD_VIB_WORK.right_vib * num + 0.5f);
                return;
            }
            break;

        case 4:
            gms_PAD_VIB_WORK.int_count = AppMain.ObjTimeCountUpF(gms_PAD_VIB_WORK.int_count);
            if ((gms_PAD_VIB_WORK.flag & 1U) != 0U)
            {
                if (gms_PAD_VIB_WORK.int_count >= gms_PAD_VIB_WORK.int_stop_time)
                {
                    gms_PAD_VIB_WORK.int_count = 0f;
                    gms_PAD_VIB_WORK.flag     &= 4294967294U;
                    return;
                }
            }
            else if (gms_PAD_VIB_WORK.int_count >= gms_PAD_VIB_WORK.int_stop_time)
            {
                gms_PAD_VIB_WORK.int_count = 0f;
                gms_PAD_VIB_WORK.flag     |= 1U;
            }
            break;

        default:
            return;
        }
    }
Ejemplo n.º 3
0
    private void gmPadVibDMain(AppMain.MTS_TASK_TCB tcb)
    {
        AppMain.GMS_PAD_VIB_WORK work = (AppMain.GMS_PAD_VIB_WORK)tcb.work;
        if (AppMain.ObjObjectPauseCheck(0U) != 0U)
        {
            if (((int)work.flag & 2) != 0)
            {
                return;
            }
            work.flag |= 2U;
        }
        else
        {
            work.flag &= 4294967293U;
            if ((double)work.time > 0.0)
            {
                work.time_count = AppMain.ObjTimeCountUpF(work.time_count);
                if ((double)work.time_count >= (double)work.time)
                {
                    work.vib_type = 0;
                    work.prio     = 0U;
                    work.time     = -1f;
                }
            }
            switch (work.vib_type)
            {
            case 2:
                if ((double)work.time - (double)work.time_count >= (double)work.add_dec_time)
                {
                    break;
                }
                float  num1 = (work.time - work.time_count) / work.add_dec_time;
                double num2 = (double)AppMain.nnRoundOff((float)((double)work.left_vib * (double)num1 + 0.5));
                double num3 = (double)AppMain.nnRoundOff((float)((double)work.right_vib * (double)num1 + 0.5));
                break;

            case 3:
                if ((double)work.time_count >= (double)work.add_dec_time)
                {
                    break;
                }
                float  num4 = work.time_count / work.add_dec_time;
                double num5 = (double)AppMain.nnRoundOff((float)((double)work.left_vib * (double)num4 + 0.5));
                double num6 = (double)AppMain.nnRoundOff((float)((double)work.right_vib * (double)num4 + 0.5));
                break;

            case 4:
                work.int_count = AppMain.ObjTimeCountUpF(work.int_count);
                if (((int)work.flag & 1) != 0)
                {
                    if ((double)work.int_count < (double)work.int_stop_time)
                    {
                        break;
                    }
                    work.int_count = 0.0f;
                    work.flag     &= 4294967294U;
                    break;
                }
                if ((double)work.int_count < (double)work.int_stop_time)
                {
                    break;
                }
                work.int_count = 0.0f;
                work.flag     |= 1U;
                break;
            }
        }
    }