2 * $Logfile: /Freespace2/code/Hud/HUDObserver.cpp $
12 #include "hudobserver.h"
13 #include "freespace.h"
16 #include "missiongoals.h"
20 #include "hudtargetbox.h"
24 #include "hudconfig.h"
25 #include "alphacolors.h"
27 // use these to redirect Player_ship and Player_ai when switching into ai mode
32 // initialize observer hud stuff
33 void hud_observer_init(ship *shipp,ai_info *aip)
35 // setup the pseduo ship and ai
36 memcpy(&Hud_obs_ship,shipp,sizeof(ship));
37 memcpy(&Hud_obs_ai,aip,sizeof(ai_info));
39 HUD_config.is_observer = 1;
40 HUD_config.show_flags = HUD_observer_default_flags;
41 HUD_config.show_flags2 = HUD_observer_default_flags2;
43 HUD_config.popup_flags = 0x0;
44 HUD_config.popup_flags2 = 0x0;
46 // shutdown any playing static animations
47 hud_targetbox_static_init();
50 void hud_obs_render_player(int loc,net_player *pl)
54 void hud_obs_render_players_all()
58 // render kills and stats information for all players
60 for(idx=0;idx<MAX_PLAYERS;idx++){
61 if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(Net_players[idx]) && !MULTI_PERM_OBSERVER(Net_players[idx]) ){
62 hud_obs_render_player(count,&Net_players[idx]);
67 void hud_render_observer()
69 Assert((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER));
71 // render individual player text
72 hud_obs_render_players_all();