Exemplo n.º 1
0
/*
=================
HUD_DrawTransparentTriangles

Render any triangles with transparent rendermode needs here
=================
*/
void DLLEXPORT HUD_DrawTransparentTriangles( void )
{
	ProcessFXObjects();
	ProcessRain();
	DrawRain();
	DrawFXObjects();
#if defined( TEST_IT )
//	Draw_Triangles();
#endif
}
Exemplo n.º 2
0
void Game_Screen::Update() {
	if (data.tint_time_left > 0) {
		data.tint_current_red = interpolate(data.tint_time_left, data.tint_current_red, data.tint_finish_red);
		data.tint_current_green = interpolate(data.tint_time_left, data.tint_current_green, data.tint_finish_green);
		data.tint_current_blue = interpolate(data.tint_time_left, data.tint_current_blue, data.tint_finish_blue);
		data.tint_current_sat = interpolate(data.tint_time_left, data.tint_current_sat, data.tint_finish_sat);
		data.tint_time_left--;
	}

	if (data.flash_time_left > 0) {
		data.flash_current_level = interpolate(data.flash_time_left, data.flash_current_level / 31, 0);
		data.flash_time_left--;
		if (data.flash_time_left <= 0)
			data.flash_time_left = data.flash_continuous ? flash_period : 0;
	}

    if (data.shake_continuous || data.shake_time_left > 0 || data.shake_position != 0) {
		double delta = (data.shake_strength * data.shake_speed * shake_direction) / 10.0;
		if (data.shake_time_left <= 1 && data.shake_position * (data.shake_position + delta) < 0)
			data.shake_position = 0;
		else
			data.shake_position += delta;
		if (data.shake_position > data.shake_strength * 2)
			shake_direction = -1;
		if (data.shake_position < -data.shake_strength * 2)
			shake_direction = 1;

		if (data.shake_time_left > 0)
			data.shake_time_left--;
	}

	std::vector<EASYRPG_SHARED_PTR<Picture> >::const_iterator it;
	for (it = pictures.begin(); it != pictures.end(); it++) {
		if(*it) { (*it)->Update(); }
	}

	if (!movie_filename.empty()) {
		/* update movie */
	}

	switch (data.weather) {
		case Weather_None:
			break;
		case Weather_Rain:
			InitWeather();
			InitSnowRain();
			UpdateSnowRain(4);
			DrawRain();
			break;
		case Weather_Snow:
			InitWeather();
			InitSnowRain();
			UpdateSnowRain(2);
			DrawSnow();
			break;
		case Weather_Fog:
			InitWeather();
			DrawFog();
			break;
		case Weather_Sandstorm:
			InitWeather();
			DrawSandstorm();
			break;
	}

	if (animation != NULL) {
		animation->Update();
		if (animation->IsDone()) {
			animation.reset();
		}
	}
}