<commit_before>#include <allegro.h>
#include "modules/ocd3d.h"
#include "main.h"
#include "note.h"

int eof_note_count_colors(EOF_NOTE * np)
{
	int count = 0;

	if(np->note & 1)
	{
		count++;
	}
	if(np->note & 2)
	{
		count++;
	}
	if(np->note & 4)
	{
		count++;
	}
	if(np->note & 8)
	{
		count++;
	}
	if(np->note & 16)
	{
		count++;
	}
	return count;
}

void eof_note_create(EOF_NOTE * np, char g, char y, char r, char b, char p, int pos, int length)
{
	np->note = 0;
	if(g)
	{
		np->note |= 1;
	}
	if(y)
	{
		np->note |= 2;
	}
	if(r)
	{
		np->note |= 4;
	}
	if(b)
	{
		np->note |= 8;
	}
	if(p)
	{
		np->note |= 16;
	}
	np->pos = pos;
	np->length = length;
}

void eof_note_create2(EOF_NOTE * np, char note, unsigned long pos, long length)
{
	np->note = note;
	np->pos = pos;
	np->length = length;
}

int eof_adjust_notes(int offset)
{
	int i, j;

	for(i = 0; i < EOF_MAX_TRACKS; i++)
	{
		for(j = 0; j < eof_song->track[i]->notes; j++)
		{
			eof_song->track[i]->note[j]->pos += offset;
		}
		for(j = 0; j < eof_song->track[i]->solos; j++)
		{
			eof_song->track[i]->solo[j].start_pos += offset;
			eof_song->track[i]->solo[j].end_pos += offset;
		}
		for(j = 0; j < eof_song->track[i]->star_power_paths; j++)
		{
			eof_song->track[i]->star_power_path[j].start_pos += offset;
			eof_song->track[i]->star_power_path[j].end_pos += offset;
		}
	}
	for(j = 0; j < eof_song->vocal_track->lyrics; j++)
	{
		eof_song->vocal_track->lyric[j]->pos += offset;
	}
	for(j = 0; j < eof_song->vocal_track->lines; j++)
	{
		eof_song->vocal_track->line[j].start_pos += offset;
		eof_song->vocal_track->line[j].end_pos += offset;
	}
	for(i = 0; i < eof_song->catalog->entries; i++)
	{
		eof_song->catalog->entry[i].start_pos += offset;
		eof_song->catalog->entry[i].end_pos += offset;
	}
	for(i = 0; i < EOF_MAX_BOOKMARK_ENTRIES; i++)
	{
		if(eof_song->bookmark_pos[i] != 0)
		{
			eof_song->bookmark_pos[i] += offset;
		}
	}
	return 1;
}

int eof_note_draw(EOF_NOTE * np, int p)
{
	int pos = eof_music_pos / eof_zoom;
	int npos;
	int ychart[5] = {20, 40, 60, 80, 100};
	int pcol = p == 1 ? eof_color_white : p == 2 ? makecol(224, 255, 224) : 0;
	int dcol = (np->flags & EOF_NOTE_FLAG_CRAZY) ? eof_color_black : eof_color_white;
	int dcol2;
	int colors[EOF_MAX_FRETS] = {eof_color_green,eof_color_red,eof_color_yellow,eof_color_blue,eof_color_purple};	//Each of the fret colors
	int ncol = makecol(192, 192, 192);	//Note color defaults to silver unless the note is not star power
	int ctr;
	unsigned int mask;	//Used to mask out colors in the for loop
	int radius,dotsize;

	if(eof_inverted_notes)
	{
		ychart[0] = eof_screen_layout.note_y[4];
		ychart[1] = eof_screen_layout.note_y[3];
		ychart[2] = eof_screen_layout.note_y[2];
		ychart[3] = eof_screen_layout.note_y[1];
		ychart[4] = eof_screen_layout.note_y[0];
	}
	else
	{
		ychart[0] = eof_screen_layout.note_y[0];
		ychart[1] = eof_screen_layout.note_y[1];
		ychart[2] = eof_screen_layout.note_y[2];
		ychart[3] = eof_screen_layout.note_y[3];
		ychart[4] = eof_screen_layout.note_y[4];
	}

	if(pos < 300)
	{
		npos = 20 + (np->pos) / eof_zoom;
	}
	else
	{
		npos = 20 - ((pos - 300)) + np->pos / eof_zoom;
	}<commit_msg>Tests the Expert+ double bass drum handling after the change and fixes a superficial problem with the dot color in the note rendering.<commit_after>#include <allegro.h>
#include "modules/ocd3d.h"
#include "main.h"
#include "note.h"

int eof_note_count_colors(EOF_NOTE * np)
{
	int count = 0;

	if(np->note & 1)
	{
		count++;
	}
	if(np->note & 2)
	{
		count++;
	}
	if(np->note & 4)
	{
		count++;
	}
	if(np->note & 8)
	{
		count++;
	}
	if(np->note & 16)
	{
		count++;
	}
	return count;
}

void eof_note_create(EOF_NOTE * np, char g, char y, char r, char b, char p, int pos, int length)
{
	np->note = 0;
	if(g)
	{
		np->note |= 1;
	}
	if(y)
	{
		np->note |= 2;
	}
	if(r)
	{
		np->note |= 4;
	}
	if(b)
	{
		np->note |= 8;
	}
	if(p)
	{
		np->note |= 16;
	}
	np->pos = pos;
	np->length = length;
}

void eof_note_create2(EOF_NOTE * np, char note, unsigned long pos, long length)
{
	np->note = note;
	np->pos = pos;
	np->length = length;
}

int eof_adjust_notes(int offset)
{
	int i, j;

	for(i = 0; i < EOF_MAX_TRACKS; i++)
	{
		for(j = 0; j < eof_song->track[i]->notes; j++)
		{
			eof_song->track[i]->note[j]->pos += offset;
		}
		for(j = 0; j < eof_song->track[i]->solos; j++)
		{
			eof_song->track[i]->solo[j].start_pos += offset;
			eof_song->track[i]->solo[j].end_pos += offset;
		}
		for(j = 0; j < eof_song->track[i]->star_power_paths; j++)
		{
			eof_song->track[i]->star_power_path[j].start_pos += offset;
			eof_song->track[i]->star_power_path[j].end_pos += offset;
		}
	}
	for(j = 0; j < eof_song->vocal_track->lyrics; j++)
	{
		eof_song->vocal_track->lyric[j]->pos += offset;
	}
	for(j = 0; j < eof_song->vocal_track->lines; j++)
	{
		eof_song->vocal_track->line[j].start_pos += offset;
		eof_song->vocal_track->line[j].end_pos += offset;
	}
	for(i = 0; i < eof_song->catalog->entries; i++)
	{
		eof_song->catalog->entry[i].start_pos += offset;
		eof_song->catalog->entry[i].end_pos += offset;
	}
	for(i = 0; i < EOF_MAX_BOOKMARK_ENTRIES; i++)
	{
		if(eof_song->bookmark_pos[i] != 0)
		{
			eof_song->bookmark_pos[i] += offset;
		}
	}
	return 1;
}

int eof_note_draw(EOF_NOTE * np, int p)
{
	int pos = eof_music_pos / eof_zoom;
	int npos;
	int ychart[5] = {20, 40, 60, 80, 100};
	int pcol = p == 1 ? eof_color_white : p == 2 ? makecol(224, 255, 224) : 0;
	int dcol = (np->flags & EOF_NOTE_FLAG_CRAZY) ? eof_color_black : eof_color_white;
	int dcol2;
	int colors[EOF_MAX_FRETS] = {eof_color_green,eof_color_red,eof_color_yellow,eof_color_blue,eof_color_purple};	//Each of the fret colors
	int ncol = makecol(192, 192, 192);	//Note color defaults to silver unless the note is not star power
	int ctr;
	unsigned int mask;	//Used to mask out colors in the for loop
	int radius,dotsize;

//Since Expert+ double bass notation uses the same flag as crazy status, override the dot color for PART DRUMS
	if(eof_selected_track == EOF_TRACK_DRUM)
		dcol = eof_color_white;

	if(eof_inverted_notes)
	{
		ychart[0] = eof_screen_layout.note_y[4];
		ychart[1] = eof_screen_layout.note_y[3];
		ychart[2] = eof_screen_layout.note_y[2];
		ychart[3] = eof_screen_layout.note_y[1];
		ychart[4] = eof_screen_layout.note_y[0];
	}
	else
	{
		ychart[0] = eof_screen_layout.note_y[0];
		ychart[1] = eof_screen_layout.note_y[1];
		ychart[2] = eof_screen_layout.note_y[2];
		ychart[3] = eof_screen_layout.note_y[3];
		ychart[4] = eof_screen_layout.note_y[4];
	}

	if(pos < 300)
	{
		npos = 20 + (np->pos) / eof_zoom;
	}
	else
	{
		npos = 20 - ((pos - 300)) + np->pos / eof_zoom;
	}
{'fraction_non_alphanumeric': 0.17846897176506116, 'fraction_numerical': 0.027178016004831648, 'mean_word_length': 3.6812720848056535, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4252046', 'n_tokens_mistral': 3346, 'n_tokens_neox': 3046, 'n_words': 585}