Open source remastering of the Freespace 2 engine
hudets.h File Reference
#include "hud/hud.h"

Go to the source code of this file.


class  HudGaugeEts
class  HudGaugeEtsWeapons
class  HudGaugeEtsShields
class  HudGaugeEtsEngines
class  HudGaugeEtsRetail


#define ENERGY_DIVERT_DELTA   0.2f
#define NUM_ENERGY_LEVELS   13
#define ZERO_INDEX   0
#define ONE_THIRD_INDEX   4
#define ONE_HALF_INDEX   6
#define ALL_INDEX   12
#define HAS_ENGINES   (1<<0)
#define HAS_SHIELDS   (1<<1)
#define HAS_WEAPONS   (1<<2)
#define ETS_RECHARGE_RATE   4.0f




void update_ets (object *obj, float fl_frametime)
void ets_init_ship (object *obj)
void ai_manage_ets (object *obj)
void increase_recharge_rate (object *obj, SYSTEM_TYPE enum_value)
void decrease_recharge_rate (object *obj, SYSTEM_TYPE enum_value)
void set_default_recharge_rates (object *obj)
void transfer_energy_to_shields (object *obj)
void transfer_energy_to_weapons (object *obj)
float ets_get_max_speed (object *objp, float engine_energy)
void sanity_check_ets_inputs (int(&ets_indexes)[num_retail_ets_gauges])
bool validate_ship_ets_indxes (const int &ship_idx, int(&ets_indexes)[num_retail_ets_gauges])
void zero_one_ets (int *reduce, int *add1, int *add2)


const int num_retail_ets_gauges = 3
float Energy_levels []
int Weapon_energy_cheat

Macro Definition Documentation


Definition at line 27 of file hudets.h.

#define ALL_INDEX   12

Definition at line 32 of file hudets.h.

#define ENERGY_DIVERT_DELTA   0.2f

Definition at line 19 of file hudets.h.

#define ETS_RECHARGE_RATE   4.0f

Definition at line 38 of file hudets.h.

#define HAS_ENGINES   (1<<0)

Definition at line 34 of file hudets.h.

#define HAS_SHIELDS   (1<<1)

Definition at line 35 of file hudets.h.

#define HAS_WEAPONS   (1<<2)

Definition at line 36 of file hudets.h.


Definition at line 22 of file hudets.h.


Definition at line 20 of file hudets.h.


Definition at line 21 of file hudets.h.


Definition at line 25 of file hudets.h.

#define NUM_ENERGY_LEVELS   13

Definition at line 24 of file hudets.h.

#define ONE_HALF_INDEX   6

Definition at line 31 of file hudets.h.

#define ONE_THIRD_INDEX   4

Definition at line 30 of file hudets.h.

#define ZERO_INDEX   0

Definition at line 29 of file hudets.h.

Enumeration Type Documentation


Definition at line 45 of file hudets.h.

Function Documentation

void ai_manage_ets ( object obj)

Definition at line 200 of file hudets.cpp.

void decrease_recharge_rate ( object obj,
SYSTEM_TYPE  enum_value 

Definition at line 473 of file hudets.cpp.

float ets_get_max_speed ( object objp,
float  engine_energy 

Definition at line 147 of file hudets.cpp.

void ets_init_ship ( object obj)

Definition at line 34 of file hudets.cpp.

void increase_recharge_rate ( object obj,
SYSTEM_TYPE  enum_value 

Definition at line 349 of file hudets.cpp.

void sanity_check_ets_inputs ( int(&)  ets_indexes[num_retail_ets_gauges])

ensure input ETS indexs are valid. If not, "fix" them by moving outliers towards the middle index

Definition at line 681 of file hudets.cpp.

void set_default_recharge_rates ( object obj)

Definition at line 275 of file hudets.cpp.

void transfer_energy_to_shields ( object obj)

Definition at line 614 of file hudets.cpp.

void transfer_energy_to_weapons ( object obj)

Definition at line 632 of file hudets.cpp.

void update_ets ( object obj,
float  fl_frametime 

Definition at line 63 of file hudets.cpp.

bool validate_ship_ets_indxes ( const int ship_idx,
int(&)  ets_indexes[num_retail_ets_gauges] 

adjust input ETS indexes to handle missing systems on the target ship return true if indexes are valid to be set

Definition at line 722 of file hudets.cpp.

void zero_one_ets ( int reduce,
int add1,
int add2 

decrease one ets index to zero & adjust others up

Definition at line 651 of file hudets.cpp.

Variable Documentation

float Energy_levels[]

Definition at line 26 of file hudets.cpp.

const int num_retail_ets_gauges = 3

Definition at line 40 of file hudets.h.

int Weapon_energy_cheat

Definition at line 27 of file hudets.cpp.