@@ -3,14 +3,14 @@ package net.mullvad.mullvadvpn.lib.map.internal.shapes
3
3
import android.content.res.Resources
4
4
import android.opengl.GLES20
5
5
import android.opengl.Matrix
6
+ import java.nio.ByteBuffer
6
7
import net.mullvad.mullvadvpn.lib.map.R
7
8
import net.mullvad.mullvadvpn.lib.map.data.GlobeColors
8
9
import net.mullvad.mullvadvpn.lib.map.internal.IndexBufferWithLength
9
10
import net.mullvad.mullvadvpn.lib.map.internal.VERTEX_COMPONENT_SIZE
10
11
import net.mullvad.mullvadvpn.lib.map.internal.initArrayBuffer
11
12
import net.mullvad.mullvadvpn.lib.map.internal.initIndexBuffer
12
13
import net.mullvad.mullvadvpn.lib.map.internal.initShaderProgram
13
- import java.nio.ByteBuffer
14
14
15
15
class Globe (resources : Resources ) {
16
16
private val vertexShaderCode =
@@ -42,7 +42,12 @@ class Globe(resources: Resources) {
42
42
private val uniformLocation: UniformLocation
43
43
44
44
private data class AttribLocations (val vertexPosition : Int )
45
- private data class UniformLocation (val color : Int , val projectionMatrix : Int , val modelViewMatrix : Int )
45
+
46
+ private data class UniformLocation (
47
+ val color : Int ,
48
+ val projectionMatrix : Int ,
49
+ val modelViewMatrix : Int
50
+ )
46
51
47
52
private val landIndices: IndexBufferWithLength
48
53
private val landContour: IndexBufferWithLength
@@ -57,8 +62,7 @@ class Globe(resources: Resources) {
57
62
val landVertByteBuffer = ByteBuffer .wrap(landVertByteArray)
58
63
landVertexBuffer = initArrayBuffer(landVertByteBuffer)
59
64
60
- val landTriangleIndicesStream =
61
- resources.openRawResource(R .raw.land_triangle_indices)
65
+ val landTriangleIndicesStream = resources.openRawResource(R .raw.land_triangle_indices)
62
66
val landTriangleIndicesByteArray = landTriangleIndicesStream.use { it.readBytes() }
63
67
val landTriangleIndicesBuffer = ByteBuffer .wrap(landTriangleIndicesByteArray)
64
68
landIndices = initIndexBuffer(landTriangleIndicesBuffer)
0 commit comments