// This is one of the plasma clouds which appears at the top and bottom of the screen and scrolls and colour-cycles and whatnot.

#define completion_effect_brightness_percentage			v0

#define interpolation_speed		V0
#define colour_divider			v1
#define global_colour_percentage	v2
#define effect_level			v3

	let draw_override = DRAW_OVERRIDE_OVERRIDE_ALWAYS

	set_private_co_ords

	let base_frame = 2
	let interpolation_speed = 25

	let draw_order = 16

	let counter = 9000
	let colour_divider = 140

	let opengl_booleans = opengl_boolean_blend_add
	let opengl_booleans = opengl_booleans + opengl_boolean_vertex_colour

	let opengl_booleans = opengl_booleans + OPENGL_BOOLEAN_SCALE_AND_ROTATE
	let opengl_booleans = opengl_booleans + OPENGL_BOOLEAN_FILTERED

	LET OPENGL_BOOLEANS = OPENGL_BOOLEANS + OPENGL_BOOLEAN_INTERPOLATED

	if world_y = 480 then
		// If we're at the top we need to draw our shit upside-down.
		let OPENGL_ANGLE = 18000
		let counter = counter + 18000
		let interpolation_speed = -interpolation_speed
	end_if

	let sprite = clouds[arb]

	let current_frame = base_frame
	let interpolated_frame = base_frame + 1
	let draw_mode = DRAW_MODE_SPRITE

start
	let counter = counter + 100

	let temp_1 = 2000 sin counter
	let opengl_scale_x = 30000
	let opengl_scale_y = 10000 + temp_1

	let temp_2 = counter / colour_divider
	let temp_2 = temp_2 mod 360

	let temp_3 = 192 % parent.completion_effect_brightness_percentage
	GET_VERTEX_COLOURS_FROM_HSL temp_2 256 temp_3

	let INTERPOLATION_X_PERCENTAGE = INTERPOLATION_X_PERCENTAGE + interpolation_speed !< 0 !> 10000
end




