#include <time.h>
#include <stdlib.h>

#include "../common/structs.h"

extern scene_data* main_scene;

/*
 * adds noise to the buffer
 * hopefully someone has seeded the number generator
 */
void noise()
{
	unsigned char* i;
	unsigned char* max = main_scene->frame_buffer + 
		(main_scene->width * main_scene->height * 3);

	for(i = main_scene->frame_buffer; i < max; i++)
	{
		if(*i < 235)
			*i = *i + rand()%20;

		//RAND_MAX
	}

}
