.class public Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;
.super Ljava/lang/Object;
.source "AndroidMultiTouchHandler.java"

# interfaces
.implements Lcom/badlogic/gdx/backends/android/AndroidTouchHandler;


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 30
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private a(I)I
    .locals 2

    if-eqz p1, :cond_5

    const/4 v0, 0x1

    if-ne p1, v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v1, 0x2

    if-ne p1, v1, :cond_1

    return v0

    :cond_1
    const/4 v0, 0x4

    if-ne p1, v0, :cond_2

    return v1

    :cond_2
    const/16 v1, 0x8

    if-ne p1, v1, :cond_3

    const/4 p1, 0x3

    return p1

    :cond_3
    const/16 v1, 0x10

    if-ne p1, v1, :cond_4

    return v0

    :cond_4
    const/4 p1, -0x1

    return p1

    :cond_5
    :goto_0
    const/4 p1, 0x0

    return p1
.end method

.method private a(Lcom/badlogic/gdx/backends/android/AndroidInput;IIIIIJ)V
    .locals 1

    .line 137
    iget-object v0, p1, Lcom/badlogic/gdx/backends/android/AndroidInput;->b:Lcom/badlogic/gdx/utils/Pool;

    invoke-virtual {v0}, Lcom/badlogic/gdx/utils/Pool;->d()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;

    .line 138
    iput-wide p7, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->a:J

    .line 139
    iput p5, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->g:I

    .line 140
    iput p3, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->c:I

    .line 141
    iput p4, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->d:I

    .line 142
    iput p2, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->b:I

    .line 143
    iput p6, v0, Lcom/badlogic/gdx/backends/android/AndroidInput$TouchEvent;->f:I

    .line 144
    iget-object p1, p1, Lcom/badlogic/gdx/backends/android/AndroidInput;->e:Ljava/util/ArrayList;

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method


# virtual methods
.method public a(Landroid/view/MotionEvent;Lcom/badlogic/gdx/backends/android/AndroidInput;)V
    .locals 21

    move-object/from16 v0, p1

    move-object/from16 v10, p2

    .line 32
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    and-int/lit16 v1, v1, 0xff

    .line 33
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v2

    const v3, 0xff00

    and-int/2addr v2, v3

    shr-int/lit8 v2, v2, 0x8

    .line 34
    invoke-virtual {v0, v2}, Landroid/view/MotionEvent;->getPointerId(I)I

    move-result v3

    .line 40
    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v11

    .line 41
    monitor-enter p2

    const/16 v13, 0x14

    const/4 v14, -0x1

    const/4 v9, 0x0

    packed-switch v1, :pswitch_data_0

    goto/16 :goto_6

    .line 81
    :pswitch_0
    :try_start_0
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getPointerCount()I

    move-result v15

    const/4 v8, 0x0

    :goto_0
    if-ge v8, v15, :cond_a

    .line 84
    invoke-virtual {v0, v8}, Landroid/view/MotionEvent;->getPointerId(I)I

    move-result v1

    .line 85
    invoke-virtual {v0, v8}, Landroid/view/MotionEvent;->getX(I)F

    move-result v2

    float-to-int v9, v2

    .line 86
    invoke-virtual {v0, v8}, Landroid/view/MotionEvent;->getY(I)F

    move-result v2

    float-to-int v7, v2

    .line 87
    invoke-virtual {v10, v1}, Lcom/badlogic/gdx/backends/android/AndroidInput;->c(I)I

    move-result v6

    if-ne v6, v14, :cond_0

    move/from16 v16, v8

    goto :goto_2

    :cond_0
    if-lt v6, v13, :cond_1

    goto/16 :goto_6

    .line 90
    :cond_1
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->k:[I

    aget v5, v1, v6

    if-eq v5, v14, :cond_2

    const/4 v3, 0x2

    move-object/from16 v1, p0

    move-object/from16 v2, p2

    move v4, v9

    move/from16 v16, v5

    move v5, v7

    move/from16 v17, v6

    move/from16 v18, v7

    move/from16 v7, v16

    move/from16 v16, v8

    move/from16 v19, v9

    move-wide v8, v11

    .line 92
    invoke-direct/range {v1 .. v9}, Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;->a(Lcom/badlogic/gdx/backends/android/AndroidInput;IIIIIJ)V

    goto :goto_1

    :cond_2
    move/from16 v17, v6

    move/from16 v18, v7

    move/from16 v16, v8

    move/from16 v19, v9

    const/4 v3, 0x4

    const/4 v7, 0x0

    move-object/from16 v1, p0

    move-object/from16 v2, p2

    move/from16 v4, v19

    move/from16 v5, v18

    move-wide v8, v11

    .line 94
    invoke-direct/range {v1 .. v9}, Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;->a(Lcom/badlogic/gdx/backends/android/AndroidInput;IIIIIJ)V

    .line 95
    :goto_1
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->h:[I

    iget-object v2, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->f:[I

    aget v2, v2, v17

    sub-int v9, v19, v2

    aput v9, v1, v17

    .line 96
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->i:[I

    iget-object v2, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->g:[I

    aget v2, v2, v17

    sub-int v7, v18, v2

    aput v7, v1, v17

    .line 97
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->f:[I

    aput v19, v1, v17

    .line 98
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->g:[I

    aput v18, v1, v17

    :goto_2
    add-int/lit8 v8, v16, 0x1

    goto :goto_0

    .line 64
    :pswitch_1
    invoke-virtual {v10, v3}, Lcom/badlogic/gdx/backends/android/AndroidInput;->c(I)I

    move-result v15

    if-ne v15, v14, :cond_3

    goto/16 :goto_6

    :cond_3
    if-lt v15, v13, :cond_4

    goto/16 :goto_6

    .line 67
    :cond_4
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->l:[I

    aput v14, v1, v15

    .line 68
    invoke-virtual {v0, v2}, Landroid/view/MotionEvent;->getX(I)F

    move-result v1

    float-to-int v13, v1

    .line 69
    invoke-virtual {v0, v2}, Landroid/view/MotionEvent;->getY(I)F

    move-result v0

    float-to-int v7, v0

    .line 70
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->k:[I

    aget v6, v0, v15

    if-eq v6, v14, :cond_5

    const/4 v2, 0x1

    move-object/from16 v0, p0

    move-object/from16 v1, p2

    move v3, v13

    move v4, v7

    move v5, v15

    move v14, v7

    move-wide v7, v11

    .line 71
    invoke-direct/range {v0 .. v8}, Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;->a(Lcom/badlogic/gdx/backends/android/AndroidInput;IIIIIJ)V

    goto :goto_3

    :cond_5
    move v14, v7

    .line 72
    :goto_3
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->f:[I

    aput v13, v0, v15

    .line 73
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->g:[I

    aput v14, v0, v15

    .line 74
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->h:[I

    aput v9, v0, v15

    .line 75
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->i:[I

    aput v9, v0, v15

    .line 76
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->j:[Z

    aput-boolean v9, v0, v15

    .line 77
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->k:[I

    aput v9, v0, v15

    goto/16 :goto_6

    .line 45
    :pswitch_2
    invoke-virtual/range {p2 .. p2}, Lcom/badlogic/gdx/backends/android/AndroidInput;->d()I

    move-result v15

    if-lt v15, v13, :cond_6

    goto :goto_6

    .line 47
    :cond_6
    iget-object v1, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->l:[I

    aput v3, v1, v15

    .line 48
    invoke-virtual {v0, v2}, Landroid/view/MotionEvent;->getX(I)F

    move-result v1

    float-to-int v13, v1

    .line 49
    invoke-virtual {v0, v2}, Landroid/view/MotionEvent;->getY(I)F

    move-result v1

    float-to-int v7, v1

    .line 50
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    const/16 v2, 0xe

    if-lt v1, v2, :cond_7

    :try_start_1
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getButtonState()I

    move-result v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-object/from16 v8, p0

    :try_start_2
    invoke-direct {v8, v0}, Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;->a(I)I

    move-result v0

    move v6, v0

    goto :goto_4

    :catchall_0
    move-exception v0

    move-object/from16 v8, p0

    goto :goto_7

    :cond_7
    move-object/from16 v8, p0

    const/4 v6, 0x0

    :goto_4
    if-eq v6, v14, :cond_8

    const/4 v2, 0x0

    move-object/from16 v0, p0

    move-object/from16 v1, p2

    move v3, v13

    move v4, v7

    move v5, v15

    move/from16 v20, v6

    move/from16 v16, v7

    move-wide v7, v11

    .line 51
    invoke-direct/range {v0 .. v8}, Lcom/badlogic/gdx/backends/android/AndroidMultiTouchHandler;->a(Lcom/badlogic/gdx/backends/android/AndroidInput;IIIIIJ)V

    goto :goto_5

    :cond_8
    move/from16 v20, v6

    move/from16 v16, v7

    .line 52
    :goto_5
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->f:[I

    aput v13, v0, v15

    .line 53
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->g:[I

    aput v16, v0, v15

    .line 54
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->h:[I

    aput v9, v0, v15

    .line 55
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->i:[I

    aput v9, v0, v15

    .line 56
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->j:[Z

    move/from16 v1, v20

    if-eq v1, v14, :cond_9

    const/4 v9, 0x1

    :cond_9
    aput-boolean v9, v0, v15

    .line 57
    iget-object v0, v10, Lcom/badlogic/gdx/backends/android/AndroidInput;->k:[I

    aput v1, v0, v15

    .line 102
    :cond_a
    :goto_6
    monitor-exit p2
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    .line 103
    sget-object v0, Lcom/badlogic/gdx/Gdx;->a:Lcom/badlogic/gdx/Application;

    invoke-interface {v0}, Lcom/badlogic/gdx/Application;->getGraphics()Lcom/badlogic/gdx/Graphics;

    move-result-object v0

    invoke-interface {v0}, Lcom/badlogic/gdx/Graphics;->i()V

    return-void

    :catchall_1
    move-exception v0

    .line 102
    :goto_7
    :try_start_3
    monitor-exit p2
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    throw v0

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_2
        :pswitch_1
        :pswitch_0
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method

.method public a(Landroid/content/Context;)Z
    .locals 1

    .line 148
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object p1

    const-string v0, "android.hardware.touchscreen.multitouch"

    invoke-virtual {p1, v0}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z

    move-result p1

    return p1
.end method
