Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_d3d_draw_wall

(view raw script w/o annotations or w/e)
1
function d3d_draw_wall(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) //gml_Script_d3d_draw_wall
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 __xdiff = __x2 - __x1
13
    var __ydiff = __y2 - __y1
14
    var __lsquared = __xdiff * __xdiff + __ydiff * __ydiff
15
    if (__lsquared == 0)
16
        return 0;
17
    var __l = sqrt(__lsquared)
18
    var __nx = __ydiff / __l
19
    var __ny = (-__xdiff) / __l
20
    var __oldrep = gpu_get_texrepeat()
21
    gpu_set_texrepeat(true)
22
    d3d_primitive_begin_texture(6, __tex)
23
    d3d_vertex_normal_texture(__x1, __y1, __z1, __nx, __ny, 0, 0, 0)
24
    d3d_vertex_normal_texture(__x2, __y2, __z1, __nx, __ny, 0, __hrepeat, 0)
25
    d3d_vertex_normal_texture(__x2, __y2, __z2, __nx, __ny, 0, __hrepeat, __vrepeat)
26
    d3d_vertex_normal_texture(__x1, __y1, __z2, __nx, __ny, 0, 0, __vrepeat)
27
    d3d_primitive_end()
28
    gpu_set_texrepeat(__oldrep)
29
}