Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript___d3d_model_add_vertex

(view raw script w/o annotations or w/e)
1
function __d3d_model_add_vertex(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8, argument9) //gml_Script___d3d_model_add_vertex
2
{
3
    var m = argument0
4
    var i = (2 << 0)
5
    var uv_i = (5 << 0)
6
    var colarrayi = (18 << 0)
7
    var colnum = (15 << 0)
8
    switch m[(12 << 0)]
9
    {
10
        case 1:
11
            i = (0 << 0)
12
            uv_i = (3 << 0)
13
            colarrayi = (16 << 0)
14
            colnum = (13 << 0)
15
            break
16
        case 2:
17
        case 3:
18
            i = (1 << 0)
19
            uv_i = (4 << 0)
20
            colarrayi = (17 << 0)
21
            colnum = (14 << 0)
22
            break
23
    }
24
25
    var colarray = m[colarrayi]
26
    var b = m[i]
27
    if (b == undefined)
28
    {
29
        b = buffer_create(36, buffer_grow, 1)
30
        array_set(m, i, b)
31
    }
32
    var uvb = m[uv_i]
33
    if (uvb == undefined)
34
    {
35
        uvb = buffer_create(8, buffer_grow, 1)
36
        array_set(m, uv_i, uvb)
37
    }
38
    var globalcol = false
39
    if (argument7 == 65536)
40
        globalcol = true
41
    var c = m[(11 << 0)]
42
    switch m[(12 << 0)]
43
    {
44
        case 1:
45
        case 2:
46
        case 4:
47
            buffer_write(b, buffer_f32, argument1)
48
            buffer_write(b, buffer_f32, argument2)
49
            buffer_write(b, buffer_f32, argument3)
50
            buffer_write(b, buffer_f32, argument4)
51
            buffer_write(b, buffer_f32, argument5)
52
            buffer_write(b, buffer_f32, argument6)
53
            buffer_write(b, buffer_u32, argument7)
54
            buffer_write(b, buffer_f32, argument8)
55
            buffer_write(b, buffer_f32, argument9)
56
            buffer_write(uvb, buffer_f32, argument8)
57
            buffer_write(uvb, buffer_f32, argument9)
58
            c++
59
            if globalcol
60
            {
61
                colarray[m[colnum]] = buffer_tell(b) - 12
62
                array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
63
            }
64
            break
65
        case 3:
66
            if (c >= 2)
67
            {
68
                buffer_write(b, buffer_f32, m[(19 << 0)])
69
                buffer_write(b, buffer_f32, m[(20 << 0)])
70
                buffer_write(b, buffer_f32, m[(21 << 0)])
71
                buffer_write(b, buffer_f32, m[(22 << 0)])
72
                buffer_write(b, buffer_f32, m[(23 << 0)])
73
                buffer_write(b, buffer_f32, m[(24 << 0)])
74
                buffer_write(b, buffer_u32, m[(25 << 0)])
75
                buffer_write(b, buffer_f32, m[(26 << 0)])
76
                buffer_write(b, buffer_f32, m[(27 << 0)])
77
                buffer_write(uvb, buffer_f32, m[(26 << 0)])
78
                buffer_write(uvb, buffer_f32, m[(27 << 0)])
79
                c++
80
                if globalcol
81
                {
82
                    colarray[m[colnum]] = buffer_tell(b) - 12
83
                    array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
84
                }
85
            }
86
            array_set(m, (19 << 0), argument1)
87
            array_set(m, (20 << 0), argument2)
88
            array_set(m, (21 << 0), argument3)
89
            array_set(m, (22 << 0), argument4)
90
            array_set(m, (23 << 0), argument5)
91
            array_set(m, (24 << 0), argument6)
92
            array_set(m, (25 << 0), argument7)
93
            array_set(m, (26 << 0), argument8)
94
            array_set(m, (27 << 0), argument9)
95
            buffer_write(b, buffer_f32, argument1)
96
            buffer_write(b, buffer_f32, argument2)
97
            buffer_write(b, buffer_f32, argument3)
98
            buffer_write(b, buffer_f32, argument4)
99
            buffer_write(b, buffer_f32, argument5)
100
            buffer_write(b, buffer_f32, argument6)
101
            buffer_write(b, buffer_u32, argument7)
102
            buffer_write(b, buffer_f32, argument8)
103
            buffer_write(b, buffer_f32, argument9)
104
            buffer_write(uvb, buffer_f32, argument8)
105
            buffer_write(uvb, buffer_f32, argument9)
106
            c++
107
            if globalcol
108
            {
109
                colarray[m[colnum]] = buffer_tell(b) - 12
110
                array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
111
            }
112
            break
113
        case 5:
114
            if (c >= 3)
115
            {
116
                buffer_write(b, buffer_f32, m[(19 << 0)])
117
                buffer_write(b, buffer_f32, m[(20 << 0)])
118
                buffer_write(b, buffer_f32, m[(21 << 0)])
119
                buffer_write(b, buffer_f32, m[(22 << 0)])
120
                buffer_write(b, buffer_f32, m[(23 << 0)])
121
                buffer_write(b, buffer_f32, m[(24 << 0)])
122
                buffer_write(b, buffer_u32, m[(25 << 0)])
123
                buffer_write(b, buffer_f32, m[(26 << 0)])
124
                buffer_write(b, buffer_f32, m[(27 << 0)])
125
                buffer_write(uvb, buffer_f32, m[(26 << 0)])
126
                buffer_write(uvb, buffer_f32, m[(27 << 0)])
127
                c++
128
                buffer_write(b, buffer_f32, m[(28 << 0)])
129
                buffer_write(b, buffer_f32, m[(29 << 0)])
130
                buffer_write(b, buffer_f32, m[(30 << 0)])
131
                buffer_write(b, buffer_f32, m[(31 << 0)])
132
                buffer_write(b, buffer_f32, m[(32 << 0)])
133
                buffer_write(b, buffer_f32, m[(33 << 0)])
134
                buffer_write(b, buffer_u32, m[(34 << 0)])
135
                buffer_write(b, buffer_f32, m[(35 << 0)])
136
                buffer_write(b, buffer_f32, m[(36 << 0)])
137
                buffer_write(uvb, buffer_f32, m[(35 << 0)])
138
                buffer_write(uvb, buffer_f32, m[(36 << 0)])
139
                c++
140
                if globalcol
141
                {
142
                    colarray[m[colnum]] = buffer_tell(b) - 48
143
                    array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
144
                    colarray[m[colnum]] = buffer_tell(b) - 12
145
                    array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
146
                }
147
            }
148
            array_set(m, (19 << 0), m[(28 << 0)])
149
            array_set(m, (20 << 0), m[(29 << 0)])
150
            array_set(m, (21 << 0), m[(30 << 0)])
151
            array_set(m, (22 << 0), m[(31 << 0)])
152
            array_set(m, (23 << 0), m[(32 << 0)])
153
            array_set(m, (24 << 0), m[(33 << 0)])
154
            array_set(m, (25 << 0), m[(34 << 0)])
155
            array_set(m, (26 << 0), m[(35 << 0)])
156
            array_set(m, (27 << 0), m[(36 << 0)])
157
            array_set(m, (28 << 0), argument1)
158
            array_set(m, (29 << 0), argument2)
159
            array_set(m, (30 << 0), argument3)
160
            array_set(m, (31 << 0), argument4)
161
            array_set(m, (32 << 0), argument5)
162
            array_set(m, (33 << 0), argument6)
163
            array_set(m, (34 << 0), argument7)
164
            array_set(m, (35 << 0), argument8)
165
            array_set(m, (36 << 0), argument9)
166
            buffer_write(b, buffer_f32, argument1)
167
            buffer_write(b, buffer_f32, argument2)
168
            buffer_write(b, buffer_f32, argument3)
169
            buffer_write(b, buffer_f32, argument4)
170
            buffer_write(b, buffer_f32, argument5)
171
            buffer_write(b, buffer_f32, argument6)
172
            buffer_write(b, buffer_u32, argument7)
173
            buffer_write(b, buffer_f32, argument8)
174
            buffer_write(b, buffer_f32, argument9)
175
            buffer_write(uvb, buffer_f32, argument8)
176
            buffer_write(uvb, buffer_f32, argument9)
177
            if globalcol
178
            {
179
                colarray[m[colnum]] = buffer_tell(b) - 12
180
                array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
181
            }
182
            c++
183
            break
184
        case 6:
185
            if (c == 0)
186
            {
187
                array_set(m, (19 << 0), argument1)
188
                array_set(m, (20 << 0), argument2)
189
                array_set(m, (21 << 0), argument3)
190
                array_set(m, (22 << 0), argument4)
191
                array_set(m, (23 << 0), argument5)
192
                array_set(m, (24 << 0), argument6)
193
                array_set(m, (25 << 0), argument7)
194
                array_set(m, (26 << 0), argument8)
195
                array_set(m, (27 << 0), argument9)
196
            }
197
            if (c >= 3)
198
            {
199
                buffer_write(b, buffer_f32, m[(19 << 0)])
200
                buffer_write(b, buffer_f32, m[(20 << 0)])
201
                buffer_write(b, buffer_f32, m[(21 << 0)])
202
                buffer_write(b, buffer_f32, m[(22 << 0)])
203
                buffer_write(b, buffer_f32, m[(23 << 0)])
204
                buffer_write(b, buffer_f32, m[(24 << 0)])
205
                buffer_write(b, buffer_u32, m[(25 << 0)])
206
                buffer_write(b, buffer_f32, m[(26 << 0)])
207
                buffer_write(b, buffer_f32, m[(27 << 0)])
208
                buffer_write(uvb, buffer_f32, m[(26 << 0)])
209
                buffer_write(uvb, buffer_f32, m[(27 << 0)])
210
                c++
211
                buffer_write(b, buffer_f32, m[(28 << 0)])
212
                buffer_write(b, buffer_f32, m[(29 << 0)])
213
                buffer_write(b, buffer_f32, m[(30 << 0)])
214
                buffer_write(b, buffer_f32, m[(31 << 0)])
215
                buffer_write(b, buffer_f32, m[(32 << 0)])
216
                buffer_write(b, buffer_f32, m[(33 << 0)])
217
                buffer_write(b, buffer_u32, m[(34 << 0)])
218
                buffer_write(b, buffer_f32, m[(35 << 0)])
219
                buffer_write(b, buffer_f32, m[(36 << 0)])
220
                buffer_write(uvb, buffer_f32, m[(35 << 0)])
221
                buffer_write(uvb, buffer_f32, m[(36 << 0)])
222
                c++
223
                if globalcol
224
                {
225
                    colarray[m[colnum]] = buffer_tell(b) - 48
226
                    array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
227
                    colarray[m[colnum]] = buffer_tell(b) - 12
228
                    array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
229
                }
230
            }
231
            array_set(m, (28 << 0), argument1)
232
            array_set(m, (29 << 0), argument2)
233
            array_set(m, (30 << 0), argument3)
234
            array_set(m, (31 << 0), argument4)
235
            array_set(m, (32 << 0), argument5)
236
            array_set(m, (33 << 0), argument6)
237
            array_set(m, (34 << 0), argument7)
238
            array_set(m, (35 << 0), argument8)
239
            array_set(m, (36 << 0), argument9)
240
            buffer_write(b, buffer_f32, argument1)
241
            buffer_write(b, buffer_f32, argument2)
242
            buffer_write(b, buffer_f32, argument3)
243
            buffer_write(b, buffer_f32, argument4)
244
            buffer_write(b, buffer_f32, argument5)
245
            buffer_write(b, buffer_f32, argument6)
246
            buffer_write(b, buffer_u32, argument7)
247
            buffer_write(b, buffer_f32, argument8)
248
            buffer_write(b, buffer_f32, argument9)
249
            buffer_write(uvb, buffer_f32, argument8)
250
            buffer_write(uvb, buffer_f32, argument9)
251
            c++
252
            if globalcol
253
            {
254
                colarray[m[colnum]] = buffer_tell(b) - 12
255
                array_set_post(m, colnum, ((array_get(m, colnum)) + 1))
256
            }
257
            break
258
    }
259
260
    array_set(m, (11 << 0), c)
261
    array_set(m, colarrayi, colarray)
262
}