]> icculus.org git repositories - taylor/freespace2.git/blob - src/hud/hudobserver.cpp
Initial revision
[taylor/freespace2.git] / src / hud / hudobserver.cpp
1 /*
2  * $Logfile: /Freespace2/code/Hud/HUDObserver.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * $NoKeywords: $
8  *
9  */
10
11 #include "hud.h"
12 #include "hudobserver.h"
13 #include "freespace.h"
14 #include "multi.h"
15 #include "font.h"
16 #include "missiongoals.h"
17 #include "3d.h"
18 #include "linklist.h"
19 #include "debris.h"
20 #include "hudtargetbox.h"
21 #include "sound.h"
22 #include "gamesnd.h"
23 #include "radar.h"
24 #include "hudconfig.h"
25 #include "alphacolors.h"
26
27 // use these to redirect Player_ship and Player_ai when switching into ai mode
28 ship Hud_obs_ship;
29 ai_info Hud_obs_ai;
30
31
32 // initialize observer hud stuff
33 void hud_observer_init(ship *shipp,ai_info *aip)
34 {
35         // setup the pseduo ship and ai
36         memcpy(&Hud_obs_ship,shipp,sizeof(ship));
37         memcpy(&Hud_obs_ai,aip,sizeof(ai_info));
38
39         HUD_config.is_observer = 1;
40         HUD_config.show_flags = HUD_observer_default_flags;
41         HUD_config.show_flags2 = HUD_observer_default_flags2;
42
43         HUD_config.popup_flags = 0x0;
44         HUD_config.popup_flags2 = 0x0;
45
46         // shutdown any playing static animations
47         hud_targetbox_static_init();
48 }
49
50 void hud_obs_render_player(int loc,net_player *pl)
51 {
52 }
53
54 void hud_obs_render_players_all()
55 {
56         int idx,count;
57
58         // render kills and stats information for all players
59         count = 0;
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]);
63                 }
64         }
65 }
66
67 void hud_render_observer()
68 {
69         Assert((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER));
70
71         // render individual player text
72         hud_obs_render_players_all();
73 }