Пример #1
0
void HUD::on_render()
{
	if(!gameclient.snap.gameobj)
		return;
		
	width = 300*gfx_screenaspect();

	bool spectate = false;
	if(gameclient.snap.local_info && gameclient.snap.local_info->team == -1)
		spectate = true;
	
	if(!config.cl_clear_hud && !config.cl_clear_all && gameclient.snap.local_character && !spectate && !(gameclient.snap.gameobj && gameclient.snap.gameobj->game_over))
	{
		render_healthandammo();
		render_speed();
	}

	render_goals();
	render_fps();
	if(client_state() != CLIENTSTATE_DEMOPLAYBACK)
		render_connectionwarning();
	render_teambalancewarning();
	if(config.cl_render_vote && !config.cl_clear_all)	
		render_voting();
	if(config.cl_render_crosshair && !config.cl_clear_hud && !config.cl_clear_all)
		render_cursor();
	if(config.cl_render_viewmode && !config.cl_clear_hud && !config.cl_clear_all && spectate && !(gameclient.snap.gameobj && gameclient.snap.gameobj->game_over))
		render_spectate();
}
Пример #2
0
void SpaceScene::render()
{
	window->clear();

	// render the stars in the background
	render_starscape();

	// render directional arrow to center if far
	SDL_Point coordinates = protagonist->getShip()->getCoordinates();
	if (static_cast<int>(abs(coordinates.x)) > 2000  || static_cast<int>(abs(coordinates.y) > 2000))
		render_arrow(coordinates);

	// celestials
	for (std::deque<Celestial>::iterator it = begin(*(system->getCelestials())); it != end(*(system->getCelestials())); ++it) {
		render(*it);
	}

	// any asteroids

	// allies

	// projectiles

	// enemies

	// finally, render the player
	protagonist->getShip()->update();
	render(protagonist->getShip());

	// render the mouse, if it's on the screen
	if (++cursor_frames < 300) {
		render_cursor();
	}

	if (show_fps) {
		render_fps();
	}

	window->present();
}
Пример #3
0
void obj::scene::render_hud() {
    go2d();

    if (will_render_fps) render_fps();
}