Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_d3d_draw_cone

(view raw script w/o annotations or w/e)
1
function d3d_draw_cone(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8, argument9, argument10) //gml_Script_d3d_draw_cone
2
{
3
    var __x1 = argument0
4
    var __y1 = argument1
5
    var __z1 = argument2
6
    var __x2 = argument3
7
    var __y2 = argument4
8
    var __z2 = argument5
9
    var __tex = argument6
10
    var __hrepeat = argument7
11
    var __vrepeat = argument8
12
    var __closed = argument9
13
    var __steps = argument10
14
    if (__steps < 3)
15
        __steps = 3
16
    if (__steps > 128)
17
        __steps = 128
18
    __cc[__steps] = 0
19
    __ss[__steps] = 0
20
    for (var __i = 0; __i <= __steps; __i++)
21
    {
22
        var __rad = __i * 2 * pi / __steps
23
        __cc[__i] = cos(__rad)
24
        __ss[__i] = sin(__rad)
25
    }
26
    var __mx = (__x2 + __x1) / 2
27
    var __my = (__y2 + __y1) / 2
28
    var __rx = (__x2 - __x1) / 2
29
    var __ry = (__y2 - __y1) / 2
30
    var __oldrep = gpu_get_texrepeat()
31
    gpu_set_texrepeat(true)
32
    d3d_primitive_begin_texture(5, __tex)
33
    for (__i = 0; __i <= __steps; __i++)
34
    {
35
        d3d_vertex_normal_texture(__mx, __my, __z2, 0, 0, 1, (__hrepeat * __i / __steps), __vrepeat)
36
        d3d_vertex_normal_texture((__mx + __cc[__i] * __rx), (__my + __ss[__i] * __ry), __z1, __cc[__i], __ss[__i], 0, (__hrepeat * __i / __steps), 0)
37
    }
38
    d3d_primitive_end()
39
    if (__closed == true)
40
    {
41
        d3d_primitive_begin_texture(6, __tex)
42
        d3d_vertex_normal_texture(__mx, __my, __z1, 0, 0, -1, 0, 0)
43
        for (__i = __steps; __i >= 0; __i--)
44
            d3d_vertex_normal_texture((__mx + __cc[__i] * __rx), (__my + __ss[__i] * __ry), __z1, 0, 0, -1, 0, 0)
45
        d3d_primitive_end()
46
    }
47
    gpu_set_texrepeat(__oldrep)
48
}