Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_bg_palette_swap_Draw_0

(view raw script w/o annotations or w/e)
1
if (shader_enabled)
2
{
3
    if (!surface_exists(surf_recolour))
4
        surf_recolour = surface_create(surface_get_width(application_surface), surface_get_height(application_surface));
5
    surface_set_target(surf_recolour);
6
    draw_clear_alpha(c_black, 1);
7
    gpu_set_colorwriteenable(true, true, true, false);
8
    if (global.darkzone != 1)
9
        draw_surface_ext(application_surface, 0, 0, 0.5, 0.5, 0, c_white, 1);
10
    else
11
        draw_surface_ext(application_surface, 0, 0, 1, 1, 0, c_white, 1);
12
    gpu_set_colorwriteenable(true, true, true, true);
13
    surface_reset_target();
14
    pal_swap_set(1493, 1);
15
    draw_surface(surf_recolour, camerax(), cameray());
16
    pal_swap_reset();
17
}