Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_culling_manager_Draw_76

(view raw script w/o annotations or w/e)
1
var __cx = 0;
2
var __cy = 0;
3
if (instance_exists(obj_plat_camera))
4
{
5
    __cx = obj_plat_camera.x - 320;
6
    __cy = obj_plat_camera.y - 240;
7
}
8
else
9
{
10
    __cx = camera_get_view_x(view_camera[0]);
11
    __cy = camera_get_view_y(view_camera[0]);
12
}
13
with (obj_culled_object)
14
{
15
    if (performs_culling_checks)
16
    {
17
        if ((bbox_right + max(cull_buffer, cull_buffer_right)) < __cx || (bbox_left - max(cull_buffer, cull_buffer_left)) > (__cx + 640) || (bbox_bottom + max(cull_buffer, cull_buffer_bottom)) < __cy || (bbox_top - max(cull_buffer, cull_buffer_top)) > (__cy + 480))
18
            is_culled = true;
19
        else
20
            is_culled = false;
21
    }
22
}
23
with (obj_fusuma_door)
24
{
25
    if ((bbox_right + max(cull_buffer, cull_buffer_right)) < __cx || (bbox_left - max(cull_buffer, cull_buffer_left)) > (__cx + 640) || (bbox_bottom + max(cull_buffer, cull_buffer_bottom)) < __cy || (bbox_top - max(cull_buffer, cull_buffer_top)) > (__cy + 480))
26
        is_culled = true;
27
    else
28
        is_culled = false;
29
}
30
with (obj_overworld_foxbullet)
31
{
32
    if ((bbox_right + max(cull_buffer, cull_buffer_right)) < __cx || (bbox_left - max(cull_buffer, cull_buffer_left)) > (__cx + 640) || (bbox_bottom + max(cull_buffer, cull_buffer_bottom)) < __cy || (bbox_top - max(cull_buffer, cull_buffer_top)) > (__cy + 480))
33
        is_culled = true;
34
    else
35
        is_culled = false;
36
}