function scr_rhythmgame_draw_backing(arg0, arg1, arg2 = false, arg3 = 0) { if (arg2) fade = 0; if (fade == 1 && brightness == 1) draw_set_color(c_gray); else draw_set_color(merge_color(c_black, c_gray, fade * brightness)); var _gray = merge_color(c_black, c_gray, brightness); draw_set_color(c_black); var _flash = 0; var _ts = signature; var _bpm = bpm; var _posoffset = startoffset; var _rts = max(4, floor(signature)); draw_set_color(c_red); if (arg2) { var _sigmul = _ts % 1; if (_sigmul == 0) _sigmul = 1; draw_text(10, 80, "Time Signature: " + string(_ts / _sigmul) + "/" + string(4 / _sigmul)); draw_text(10, 100, "BPM: " + string(_bpm)); } draw_set_color(c_black); var _bpm_mul = 1; if (bpm_count > 1) _bpm_mul = _bpm / bpm_change[0]; if (invc > 0 && fade == 1) _flash = remap_clamped(0, 6, 0, 1, hurt_flash); draw_set_alpha(0.75); ossafe_fill_rectangle(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, false); draw_set_alpha(1); draw_set_blend_mode(bm_normal); var _lead = floor_to_multiple(16, _ts); var _lead_num = _lead / _ts; var whitebar = -1; var _bpmi = bpm_index; var _notespacing = notespacing; if (signature_index != 0 && bpm_index != 0) _posoffset = max(bpm_time[_bpmi], signature_time[signature_index]); else if (signature_index != 0) _posoffset = signature_time[signature_index]; else if (bpm_index != 0) _posoffset = bpm_time[_bpmi]; var linegap = arg0 * _notespacing; var linestart = bottomy + (((trackpos - _posoffset) % (_notespacing * _ts)) * arg0); draw_set_color(_gray); var liney = linestart; draw_set_color(_gray); var _bpm_changed = true; var _next_bpm = _bpm; var _next_bpm_time = -1; if (bpm_count > 1 && _bpmi < (bpm_count - 1)) { _next_bpm = bpm_change[_bpmi + 1]; _next_bpm_time = bpm_time[_bpmi + 1]; _bpm_changed = false; } var nextBar = floor(trackpos / meter); var _ts_changed = true; var _next_ts = _ts; var _next_ts_time = -1; if (signature_count > 1 && signature_index < (signature_count - 1)) { _next_ts = signature_change[signature_index + 1]; _next_ts_time = signature_time[signature_index + 1]; _ts_changed = false; } var _barcount = 0; var _pregap = linegap; if (bpm_index > 0 && ((trackpos + ((bottomy - liney) / arg0)) - 0.5) < bpm_time[bpm_index]) _pregap = (60 / bpm_change[bpm_index - 1]) * arg0; draw_set_color(c_gray); if (signature_index > 0) { var _last_ts = _ts; if ((trackpos - 0.5) < signature_time[signature_index]) _last_ts = signature_change[signature_index - 1]; if ((_last_ts % 1) != 0) liney -= (linegap / 2); } for (var i = 0; i < _rts; i++) { liney += _pregap; if (!arg2 && (liney + 1) > (bottomy + 50)) break; d_line(arg1 - 40, liney, arg1 + 40, liney); } liney = linestart; var _eighths = (_ts % 1) == 0.5; var _oddts = false; if (_eighths) { if (((trackpos - signature_time[signature_index]) % (_ts * 2)) >= _ts) _oddts = true; } for (var i = 0; i < max(20, _rts * 2); i++) { if (i > 0) liney -= linegap; if (!arg2 && (liney - 1) < (bottomy - 202)) { if (!(_eighths && _barcount <= 0 && ((liney - 1) + (linegap / 2)) > (bottomy - 202))) break; } else if (!arg2 && (liney + 1) > (bottomy + 50)) { if (_barcount <= 0) _barcount = _ts - 1; else _barcount--; continue; } if (_barcount <= 0) { if (_eighths) { if (i != 0) liney += (linegap / 2); } ossafe_fill_rectangle(arg1 - 40, liney - 1, arg1 + 40, liney + 1, false); var linetime = trackpos + ((bottomy - liney) / arg0); if (arg2) { draw_text(arg1 - 60, liney - 1 - 8, nextBar + (i / _ts) + 1); draw_text(arg1 + 60, liney - 1 - 8, linetime); } if (!_ts_changed && (linetime + 0.5) > _next_ts_time) { _ts = _next_ts; _ts_changed = true; } if (!_bpm_changed && (linetime + 0.5) > _next_bpm_time) { if (arg2) { draw_sprite_ext(spr_arrow_9x9, 0, arg1 + 100, (liney - 1 - 1) + 2, 1, (_next_bpm > _bpm) ? -1 : 1, 0, c_white, 1); draw_text(arg1 + 110, liney - 1 - 8, string(_next_bpm) + " BPM"); } _bpm_changed = true; _bpm = _next_bpm; linegap = (60 / _bpm) * arg0; } _barcount = _ts - 1; } else { _barcount--; d_line(arg1 - 40, liney, arg1 + 40, liney); } } if (_flash > 0) { draw_set_blend_mode(bm_add); var _flashCol = merge_color(c_black, c_red, _flash * fade * brightness); ossafe_fill_rectangle_color(arg1 - 40, bottomy - 200, arg1 + 40, bottomy + 50, c_black, c_black, _flashCol, _flashCol, false); draw_set_blend_mode(bm_normal); } draw_set_color(c_white); }