FS2_Open
Open source remastering of the Freespace 2 engine
hudobserver.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #include "hud/hudconfig.h"
13 #include "hud/hudobserver.h"
14 #include "hud/hudtargetbox.h"
15 #include "network/multi.h"
16 #include "ship/ship.h"
17 
18 
19 // use these to redirect Player_ship and Player_ai when switching into ai mode
22 
27 {
28  // setup the pseduo ship and ai
29  memcpy(&Hud_obs_ai, aip, sizeof(ai_info));
30  // (we used to do a memcpy here, but that doesn't work any longer, so let's just assign the values we need)
31  Hud_obs_ship.clear();
32  strcpy_s(Hud_obs_ship.ship_name, shipp->ship_name);
33  Hud_obs_ship.team = shipp->team;
34  Hud_obs_ship.ai_index = shipp->ai_index;
35  Hud_obs_ship.flags = shipp->flags;
36  Hud_obs_ship.flags2 = shipp->flags2;
37  Hud_obs_ship.ship_info_index = shipp->ship_info_index;
38  Hud_obs_ship.objnum = shipp->objnum;
39  Hud_obs_ship.wingnum = shipp->wingnum;
40  Hud_obs_ship.alt_type_index = shipp->alt_type_index;
41  Hud_obs_ship.callsign_index = shipp->callsign_index;
42  memcpy(&Hud_obs_ship.np_updates, shipp->np_updates, MAX_PLAYERS * sizeof(np_update));
43  Hud_obs_ship.ship_max_hull_strength = shipp->ship_max_hull_strength;
45  memcpy(&Hud_obs_ship.weapons, &shipp->weapons, sizeof(ship_weapon));
46 
50 
51  HUD_config.popup_flags = 0x0;
53 
54  // shutdown any playing static animations
56 }
57 
59 {
60 }
61 
63 {
64  int idx,count;
65 
66  // render kills and stats information for all players
67  count = 0;
68  for(idx=0;idx<MAX_PLAYERS;idx++){
71  }
72  }
73 }
74 
79 {
81 
82  // render individual player text
84 }
int HUD_observer_default_flags2
Definition: hudconfig.cpp:131
int team
Definition: ship.h:606
np_update np_updates[MAX_PLAYERS]
Definition: ship.h:731
int objnum
Definition: ship.h:537
int Game_mode
Definition: systemvars.cpp:24
int alt_type_index
Definition: ship.h:556
ship_weapon weapons
Definition: ship.h:658
net_player * Net_player
Definition: multi.cpp:94
void hud_obs_render_players_all()
Definition: hudobserver.cpp:62
void clear()
Definition: ship.cpp:5552
float ship_max_shield_strength
Definition: ship.h:596
#define MULTI_STANDALONE(np)
Definition: multi.h:139
Assert(pm!=NULL)
int ai_index
Definition: ship.h:538
#define NETINFO_FLAG_OBSERVER
Definition: multi.h:605
void hud_init_target_static()
Definition: ai.h:329
uint flags
Definition: ship.h:644
int flags
Definition: multi.h:463
ship * shipp
Definition: lua.cpp:9162
ai_info Hud_obs_ai
Definition: hudobserver.cpp:21
void hud_render_observer()
Definition: hudobserver.cpp:78
float ship_max_hull_strength
Definition: ship.h:597
#define GM_MULTIPLAYER
Definition: systemvars.h:18
int wingnum
Definition: ship.h:623
#define MAX_PLAYERS
Definition: pstypes.h:32
int callsign_index
Definition: ship.h:557
Definition: ship.h:534
int idx
Definition: multiui.cpp:761
#define MULTI_PERM_OBSERVER(np)
Definition: multi.h:142
void hud_observer_init(ship *shipp, ai_info *aip)
Definition: hudobserver.cpp:26
#define MULTI_CONNECTED(np)
Definition: multi.h:136
void hud_obs_render_player(int loc, net_player *pl)
Definition: hudobserver.cpp:58
int ship_info_index
Definition: ship.h:539
HUD_CONFIG_TYPE HUD_config
Definition: hudconfig.cpp:49
int HUD_observer_default_flags
Definition: hudconfig.cpp:120
GLint GLsizei count
Definition: Gl.h:1491
uint flags2
Definition: ship.h:645
net_player Net_players[MAX_PLAYERS]
Definition: multi.cpp:93
ship Hud_obs_ship
Definition: hudobserver.cpp:20
char ship_name[NAME_LENGTH]
Definition: ship.h:604
#define strcpy_s(...)
Definition: safe_strings.h:67