1 |
function d3d_draw_floor(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) //gml_Script_d3d_draw_floor |
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 __zdiff = __z2 - __z1 |
14 |
var __lsquared = __xdiff * __xdiff + __zdiff * __zdiff |
15 |
if (__lsquared == 0) |
16 |
return 0; |
17 |
var __l = sqrt(__lsquared) |
18 |
var __nx = (-__zdiff) / __l |
19 |
var __nz = __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, 0, __nz, 0, 0) |
24 |
d3d_vertex_normal_texture(__x1, __y2, __z1, __nx, 0, __nz, 0, __vrepeat) |
25 |
d3d_vertex_normal_texture(__x2, __y2, __z2, __nx, 0, __nz, __hrepeat, __vrepeat) |
26 |
d3d_vertex_normal_texture(__x2, __y1, __z2, __nx, 0, __nz, __hrepeat, 0) |
27 |
d3d_primitive_end() |
28 |
gpu_set_texrepeat(__oldrep) |
29 |
} |