2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Hud/HUDObserver.cpp $
20 #include "hudobserver.h"
21 #include "freespace.h"
24 #include "missiongoals.h"
28 #include "hudtargetbox.h"
32 #include "hudconfig.h"
33 #include "alphacolors.h"
35 // use these to redirect Player_ship and Player_ai when switching into ai mode
40 // initialize observer hud stuff
41 void hud_observer_init(ship *shipp,ai_info *aip)
43 // setup the pseduo ship and ai
44 memcpy(&Hud_obs_ship,shipp,sizeof(ship));
45 memcpy(&Hud_obs_ai,aip,sizeof(ai_info));
47 HUD_config.is_observer = 1;
48 HUD_config.show_flags = HUD_observer_default_flags;
49 HUD_config.show_flags2 = HUD_observer_default_flags2;
51 HUD_config.popup_flags = 0x0;
52 HUD_config.popup_flags2 = 0x0;
54 // shutdown any playing static animations
55 hud_targetbox_static_init();
58 void hud_obs_render_player(int loc,net_player *pl)
62 void hud_obs_render_players_all()
66 // render kills and stats information for all players
68 for(idx=0;idx<MAX_PLAYERS;idx++){
69 if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(Net_players[idx]) && !MULTI_PERM_OBSERVER(Net_players[idx]) ){
70 hud_obs_render_player(count,&Net_players[idx]);
75 void hud_render_observer()
77 Assert((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER));
79 // render individual player text
80 hud_obs_render_players_all();