//-------------------------------------------------------------------------------------------------
void prime() {
//-------------------------------------------------------------------------------------------------
	generate_perlin(-1);
	send_texture();
	generate_perlin(-1);
	send_texture();
}
Beispiel #2
0
void surface_height::generate_perlin(PERLIN_CONFIG *p_config)
{
  int width = width_get();
  int height = height_get();
  
  generate_perlin(p_config, 0, 0, width, height);
}
//-------------------------------------------------------------------------------------------------
void update() {
//-------------------------------------------------------------------------------------------------
	int frames = gametime::frames_passed();

	cloud_offset += wind * (float)frames;

	generate_perlin(frames*100000);
	if( writey >= datasize ) {
		if( current_texture_slot != next_texture_slot ) {
			send_texture();
		}
	}

	debug1 += 0.01f;
	set_density((sin(debug1)+1.0f)/4.0f);
	set_density((float)fmod(abs(Ingame::test.angle/8.0), 1.0));
	//set_density(0.3);
	//set_density(0.1);

	if( frames == 0 ) return;
	float t =(float)frames;
	mu += t * 0.0001f;
	//mu += t * 0.01f;
	if( mu >= 1.0f ) {
		mu = 1.0f;
		if( current_texture_slot == next_texture_slot ) {
			mu = 0.0f;
			current_texture_slot++;
			if( current_texture_slot > 2 ) current_texture_slot = 0;

		}
	}
}