1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
if (!surface_exists(lighting_surface)) |
4 |
lighting_surface = surface_create(camera_get_view_width(view_camera[0]), camera_get_view_height(view_camera[0])); |
5 |
if (surface_exists(lighting_surface)) |
6 |
{ |
7 |
var view_x = camera_get_view_x(view_camera[0]); |
8 |
var view_y = camera_get_view_y(view_camera[0]); |
9 |
surface_set_target(lighting_surface); |
10 |
draw_set_color(c_black); |
11 |
draw_set_alpha(darkness_alpha); |
12 |
draw_rectangle(0, 0, room_width, room_height, false); |
13 |
draw_set_alpha(1); |
14 |
gpu_set_blendmode(bm_subtract); |
15 |
draw_sprite_ext(sprite_index, image_index, x - view_x, y - view_y, image_xscale, image_yscale, image_angle, c_white, 1); |
16 |
gpu_set_blendmode(bm_normal); |
17 |
surface_reset_target(); |
18 |
draw_surface(lighting_surface, view_x, view_y); |
19 |
} |