Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vdu.cpp File Reference
#include "vdu.h"
#include "cmd/unit_util.h"
#include "hud.h"
#include "vs_globals.h"
#include "cockpit.h"
#include "cmd/script/mission.h"
#include "cmd/script/flightgroup.h"
#include "cmd/script/msgcenter.h"
#include "cmd/images.h"
#include "cmd/planet.h"
#include "cmd/beam.h"
#include "config_xml.h"
#include "xml_support.h"
#include "gfx/animation.h"
#include "gfx/vsimage.h"
#include "galaxy_gen.h"
#include "universe_util.h"
#include "networking/netclient.h"
#include "vsfilesystem.h"

Go to the source code of this file.

Classes

struct  colorstring
 
struct  retString128
 

Macros

#define MangleString(a, b)   (a)
 
#define RETURN_STATIC_SPRITE(name)
 
#define REPORTITEM(percent_working, max_functionality, print_percent_working, component_string)
 
#define REPORTINTEGRATED(which, which_key, which_name_default)
 
#define REPORTINTEGRATEDFLAG(which, which_key, which_name_default)
 

Functions

template<typename T >
mymin (T a, T b)
 
template<typename T >
mymax (T a, T b)
 
string reformatName (string nam)
 
string getUnitNameAndFgNoBase (Unit *target)
 
int vdu_lookup (char *&s)
 
int parse_vdu_type (const char *x)
 
char tohexdigit (int x)
 
GFXColor colLerp (GFXColor a, GFXColor b, float bweight)
 
colorstring colToString (GFXColor col)
 
GFXColor getDamageColor (float armor, bool gradient=false)
 
static void DrawHUDSprite (VDU *thus, VSSprite *s, float per, float &sx, float &sy, float &w, float &h, float aup, float aright, float aleft, float adown, float hull, bool drawsprite, bool invertsprite)
 
static void DrawShield (float fs, float rs, float ls, float bs, float x, float y, float w, float h, bool invert, GFXColor outershield, GFXColor middleshield, GFXColor innershield)
 
VSSpritegetTargetQuadShield ()
 
VSSpritegetTargetDualShield ()
 
VSSpritegetJumpImage ()
 
VSSpritegetSunImage ()
 
VSSpritegetPlanetImage ()
 
VSSpritegetNavImage ()
 
double DistanceTwoTargets (Unit *parent, Unit *target)
 
retString128 PrettyDistanceString (double distance)
 
static float OneOfFour (float a, float b, float c, float d)
 
static float TwoOfFour (float a, float b, float c, float d)
 
static void DrawGun (Vector pos, float w, float h, weapon_info::MOUNT_SIZE sz)
 
GFXColor MountColor (Mount *mnt)
 
char printHex (unsigned int hex)
 
const char * GetColorFromSuccess (float suc)
 
void DrawObjectivesTextPlane (TextPlane *tp, int scrolloffset, Unit *parent)
 
void UpdateViewstyle (VIEWSTYLE &vs)
 

Variables

const std::string vdu_modes []
 ALERT to change must change enum in class. More...
 
const char * DamagedCategory
 
static char suc_col_str [8] = "#000000"
 
static const char suc_gt_plusone [8] = "#00FF00"
 
static const char suc_gt_minusone [8] = "#FF0000"
 

Macro Definition Documentation

#define MangleString (   a,
  b 
)    (a)

Definition at line 376 of file vdu.cpp.

Referenced by VDU::Draw().

#define REPORTINTEGRATED (   which,
  which_key,
  which_name_default 
)
Value:
do { \
static string name = vs_config->getVariable( "graphics", "hud", which_key, which_name_default ); \
if (!name.empty()) { \
REPORTITEM( parent->pImage->which##Functionality, parent->pImage->which##FunctionalityMax, \
print_percent_working, \
name \
); \
} \
} while(0)
#define REPORTINTEGRATEDFLAG (   which,
  which_key,
  which_name_default 
)
Value:
do { \
static string name = vs_config->getVariable( "graphics", "hud", which_key, which_name_default ); \
if (!name.empty()) { \
REPORTITEM( ((parent->damages & which) ? 0.1 : 1.0), 1.0, \
false, \
name \
); \
} \
} while(0)
#define REPORTITEM (   percent_working,
  max_functionality,
  print_percent_working,
  component_string 
)
Value:
do { \
GFXColor final_color( (chdamaged[0]*percent_working)+( cdamaged[0]*(1.0-percent_working) ), \
(chdamaged[1]*percent_working)+( cdamaged[1]*(1.0-percent_working) ), \
(chdamaged[2]*percent_working)+( cdamaged[2]*(1.0-percent_working) ), \
(chdamaged[3]*percent_working)+( cdamaged[3]*(1.0-percent_working) ) ); \
if (percent_working == 0.0) \
final_color = GFXColor( cdestroyed[0], cdestroyed[1], cdestroyed[2], cdestroyed[3] ); /*dead = grey*/ \
std::string trailer; \
if (percent_working < max_functionality) \
retval += colToString( final_color ).str; \
else \
retval += fpstring.str; \
trailer = fpstring.str; \
retval += component_string; \
if (print_percent_working) \
retval += string( " (" )+tostring( int(percent_working*100) )+string( "%)" ); \
retval += trailer+std::string( "\n" ); \
} while(0)
#define RETURN_STATIC_SPRITE (   name)
Value:
do { \
static VSSprite s( name ".sprite" ); \
static VSSprite sCompat( name ".spr" ); \
if ( s.LoadSuccess() ) \
return &s; \
else \
return &sCompat; \
} \
while (0)

Definition at line 681 of file vdu.cpp.

Referenced by getJumpImage(), getNavImage(), getPlanetImage(), getSunImage(), getTargetDualShield(), and getTargetQuadShield().

Function Documentation

GFXColor colLerp ( GFXColor  a,
GFXColor  b,
float  bweight 
)

Definition at line 156 of file vdu.cpp.

References GFXColor::a, GFXColor::b, GFXColor::g, and GFXColor::r.

Referenced by MountColor().

157 {
158  float aweight = 1-bweight;
159  return GFXColor( a.r*aweight+b.r*bweight,
160  a.g*aweight+b.g*bweight,
161  a.b*aweight+b.b*bweight,
162  a.a*aweight+b.a*bweight );
163 }
colorstring colToString ( GFXColor  col)

Definition at line 170 of file vdu.cpp.

References b, GFXColor::b, GFXColor::g, g, GFXColor::r, colorstring::str, and tohexdigit().

171 {
172  unsigned char r = (unsigned char) (col.r*255);
173  unsigned char g = (unsigned char) (col.g*255);
174  unsigned char b = (unsigned char) (col.b*255);
175  colorstring ret;
176  ret.str[0] = '#';
177  ret.str[7] = '\0';
178  ret.str[1] = tohexdigit( r/16 );
179  ret.str[2] = tohexdigit( r%16 );
180  ret.str[3] = tohexdigit( g/16 );
181  ret.str[4] = tohexdigit( g%16 );
182  ret.str[5] = tohexdigit( b/16 );
183  ret.str[6] = tohexdigit( b%16 );
184  return ret;
185 }
double DistanceTwoTargets ( Unit parent,
Unit target 
)

Definition at line 722 of file vdu.cpp.

References Unit::isUnit(), Magnitude(), PLANETPTR, Unit::Position(), and Unit::rSize().

723 {
724  double tmp =
725  ( ( parent->Position()-target->Position() ).Magnitude()-( (target->isUnit() == PLANETPTR) ? target->rSize() : 0 ) );
726  if (tmp < 0) return 0;
727  return tmp;
728 }
static void DrawGun ( Vector  pos,
float  w,
float  h,
weapon_info::MOUNT_SIZE  sz 
)
static

Definition at line 1200 of file vdu.cpp.

References weapon_info::CAPSHIPHEAVYMISSILE, g_game, GFXBegin(), GFXEnd(), GFXLINE, GFXPOINT, GFXPointSize(), GFXVertex3d(), GFXVertexf(), weapon_info::HEAVY, weapon_info::HEAVYMISSILE, weapon_info::LIGHT, weapon_info::MEDIUM, weapon_info::NOWEAP, weapon_info::SPECIAL, weapon_info::SPECIALMISSILE, game_data_t::x_resolution, and game_data_t::y_resolution.

1201 {
1202  w = fabs( w );
1203  h = fabs( h );
1204  float oox = 1./g_game.x_resolution;
1205  float ooy = 1./g_game.y_resolution;
1206  pos.j -= h/3.8;
1207  if (sz == weapon_info::NOWEAP) {
1208  GFXPointSize( 4 );
1209  GFXBegin( GFXPOINT );
1210  GFXVertexf( pos );
1211  GFXEnd();
1212  GFXPointSize( 1 );
1213  } else if (sz < weapon_info::SPECIAL) {
1214  GFXBegin( GFXLINE );
1215  GFXVertex3d( pos.i+oox, pos.j, 0 );
1216  GFXVertex3d( pos.i+oox, pos.j-h/15, 0 );
1217  GFXVertex3d( pos.i-oox, pos.j, 0 );
1218  GFXVertex3d( pos.i-oox, pos.j-h/15, 0 );
1219  GFXVertex3d( pos.i+oox, pos.j-h/15, 0 );
1220  GFXVertex3d( pos.i-oox, pos.j-h/15, 0 );
1221  if (sz == weapon_info::LIGHT) {
1222  GFXVertex3d( pos.i, pos.j, 0 );
1223  GFXVertex3d( pos.i, pos.j+h/4, 0 );
1224  GFXVertex3d( pos.i, pos.j+h/4+ooy*2, 0 );
1225  GFXVertex3d( pos.i, pos.j+h/4+ooy*5, 0 );
1226  } else if (sz == weapon_info::MEDIUM) {
1227  GFXVertex3d( pos.i, pos.j, 0 );
1228  GFXVertex3d( pos.i, pos.j+h/5, 0 );
1229  GFXVertex3d( pos.i, pos.j+h/5+ooy*4, 0 );
1230  GFXVertex3d( pos.i, pos.j+h/5+ooy*5, 0 );
1231  GFXVertex3d( pos.i+oox, pos.j+h/5+ooy*2, 0 );
1232  GFXVertex3d( pos.i-oox, pos.j+h/5+ooy*2, 0 );
1233  } else if (sz == weapon_info::HEAVY) {
1234  GFXVertex3d( pos.i, pos.j, 0 );
1235  GFXVertex3d( pos.i, pos.j+h/5, 0 );
1236  GFXVertex3d( pos.i, pos.j+h/5+ooy*4, 0 );
1237  GFXVertex3d( pos.i, pos.j+h/5+ooy*5, 0 );
1238  GFXVertex3d( pos.i+2*oox, pos.j+h/5+ooy*3, 0 );
1239  GFXVertex3d( pos.i, pos.j+h/5+ooy*2, 0 );
1240  GFXVertex3d( pos.i-2*oox, pos.j+h/5+ooy*3, 0 );
1241  GFXVertex3d( pos.i, pos.j+h/5+ooy*2, 0 );
1242  } else {
1243  //capship gun
1244  GFXVertex3d( pos.i, pos.j, 0 );
1245  GFXVertex3d( pos.i, pos.j+h/6, 0 );
1246  GFXVertex3d( pos.i, pos.j+h/6+ooy*6, 0 );
1247  GFXVertex3d( pos.i, pos.j+h/6+ooy*7, 0 );
1248  GFXVertex3d( pos.i-oox, pos.j+h/6+ooy*2, 0 );
1249  GFXVertex3d( pos.i+oox, pos.j+h/6+ooy*2, 0 );
1250  GFXVertex3d( pos.i-2*oox, pos.j+h/6+ooy*4, 0 );
1251  GFXVertex3d( pos.i+2*oox, pos.j+h/6+ooy*4, 0 );
1252  }
1253  GFXEnd();
1254  } else if (sz == weapon_info::SPECIAL || sz == weapon_info::SPECIALMISSILE) {
1255  GFXPointSize( 4 );
1256  GFXBegin( GFXPOINT );
1257  GFXVertexf( pos );
1258  GFXEnd();
1259  GFXPointSize( 1 ); //classified... FIXME
1260  } else if (sz < weapon_info::HEAVYMISSILE) {
1261  GFXBegin( GFXLINE );
1262  GFXVertex3d( pos.i, pos.j-h/8, 0 );
1263  GFXVertex3d( pos.i, pos.j+h/8, 0 );
1264  GFXVertex3d( pos.i+2*oox, pos.j-h/8+2*ooy, 0 );
1265  GFXVertex3d( pos.i-2*oox, pos.j-h/8+2*ooy, 0 );
1266  GFXEnd();
1267  } else if (sz <= weapon_info::CAPSHIPHEAVYMISSILE) {
1268  GFXBegin( GFXLINE );
1269  GFXVertex3d( pos.i, pos.j-h/6, 0 );
1270  GFXVertex3d( pos.i, pos.j+h/6, 0 );
1271  GFXVertex3d( pos.i+3*oox, pos.j-h/6+2*ooy, 0 );
1272  GFXVertex3d( pos.i-3*oox, pos.j-h/6+2*ooy, 0 );
1273  GFXVertex3d( pos.i+oox, pos.j-h/6, 0 );
1274  GFXVertex3d( pos.i+oox, pos.j+h/9, 0 );
1275  GFXVertex3d( pos.i-oox, pos.j-h/6, 0 );
1276  GFXVertex3d( pos.i-oox, pos.j+h/9, 0 );
1277  GFXEnd();
1278  }
1279 }
static void DrawHUDSprite ( VDU thus,
VSSprite s,
float  per,
float sx,
float sy,
float w,
float h,
float  aup,
float  aright,
float  aleft,
float  adown,
float  hull,
bool  drawsprite,
bool  invertsprite 
)
static

Definition at line 236 of file vdu.cpp.

References ALWAYS, CULLFACE, VSSprite::DrawHere(), getDamageColor(), VSSprite::GetPosition(), VSSprite::GetSize(), VSSprite::getTexture(), VegaConfig::getVariable(), GFXAlphaTest(), GFXBegin(), GFXBlendMode(), GFXColorf(), GFXDisable(), GFXEnable(), GFXEnd(), GFXQUAD, GFXTexCoord2f(), GFXVertexf(), GREATER, INVSRCALPHA, Texture::MakeActive(), ONE, XMLSupport::parse_bool(), XMLSupport::parse_float(), VSSprite::SetPosition(), VSSprite::SetSize(), SRCALPHA, Vector, vs_config, and ZERO.

Referenced by DrawShield().

250 {
251  static bool HighQTargetVSSprites =
252  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "high_quality_sprites", "false" ) );
253  float nw, nh;
254  thus->GetPosition( sx, sy );
255  thus->GetSize( w, h );
256 
257  //Use margins specified from config file
258  static float width_factor = XMLSupport::parse_float( vs_config->getVariable( "graphics", "reduced_vdus_width", "0" ) );
259  static float height_factor = XMLSupport::parse_float( vs_config->getVariable( "graphics", "reduced_vdus_height", "0" ) );
260  w = w-width_factor;
261  h = h+height_factor;
262 
263  h = -fabs( h*per );
264  if (!s) {
265  h = -h;
266  w = fabs( w*per );
267  } else {
268  if (HighQTargetVSSprites) {
270  } else {
271  GFXBlendMode( ONE, ZERO );
272  GFXAlphaTest( GREATER, .4 );
273  }
274  s->SetPosition( sx, sy );
275  s->GetSize( nw, nh );
276  w = fabs( nw*h/nh );
277  s->SetSize( w, invertsprite ? -h : h );
278  Texture *spritetex = s->getTexture();
279  if (drawsprite && spritetex) {
280  static const float middle_point =
281  XMLSupport::parse_float( vs_config->getVariable( "graphics", "hud", "armor_hull_size", ".55" ) );
282  static bool top_view = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "top_view", "false" ) );
283  float middle_point_small = 1-middle_point;
284  Vector ll, lr, ur, ul, mll, mlr, mur, mul;
285  spritetex->MakeActive();
286  GFXDisable( CULLFACE );
287  s->DrawHere( ll, lr, ur, ul );
288  mll = middle_point*ll+middle_point_small*ur;
289  mlr = middle_point*lr+middle_point_small*ul;
290  mur = middle_point*ur+middle_point_small*ll;
291  mul = middle_point*ul+middle_point_small*lr;
292  GFXBegin( GFXQUAD );
293  GFXColorf( getDamageColor( top_view ? adown : aleft ) );
294  GFXTexCoord2f( 0, 0 );
295  GFXVertexf( ul );
296  GFXColorf( getDamageColor( top_view ? adown : aup ) );
297  GFXTexCoord2f( 1, 0 );
298  GFXVertexf( ur );
299  GFXColorf( getDamageColor( hull, true ) );
300  GFXTexCoord2f( middle_point, middle_point_small );
301  GFXVertexf( mur );
302  GFXColorf( getDamageColor( hull, true ) );
303  GFXTexCoord2f( middle_point_small, middle_point_small );
304  GFXVertexf( mul );
305  GFXColorf( getDamageColor( top_view ? aright : aup ) );
306  GFXTexCoord2f( 1, 0 );
307  GFXVertexf( ur );
308  GFXColorf( getDamageColor( aright ) );
309  GFXTexCoord2f( 1, 1 );
310  GFXVertexf( lr );
311  GFXColorf( getDamageColor( hull, true ) );
312  GFXTexCoord2f( middle_point, middle_point );
313  GFXVertexf( mlr );
314  GFXColorf( getDamageColor( hull, true ) );
315  GFXTexCoord2f( middle_point, middle_point_small );
316  GFXVertexf( mur );
317  GFXColorf( getDamageColor( top_view ? aup : aright ) );
318  GFXTexCoord2f( 1, 1 );
319  GFXVertexf( lr );
320  GFXColorf( getDamageColor( top_view ? aup : adown ) );
321  GFXTexCoord2f( 0, 1 );
322  GFXVertexf( ll );
323  GFXColorf( getDamageColor( hull, true ) );
324  GFXTexCoord2f( middle_point_small, middle_point );
325  GFXVertexf( mll );
326  GFXColorf( getDamageColor( hull, true ) );
327  GFXTexCoord2f( middle_point, middle_point );
328  GFXVertexf( mlr );
329  GFXColorf( getDamageColor( top_view ? aleft : adown ) );
330  GFXTexCoord2f( 0, 1 );
331  GFXVertexf( ll );
332  GFXColorf( getDamageColor( aleft ) );
333  GFXTexCoord2f( 0, 0 );
334  GFXVertexf( ul );
335  GFXTexCoord2f( middle_point_small, middle_point_small );
336  GFXColorf( getDamageColor( hull, true ) );
337  GFXVertexf( mul );
338  GFXColorf( getDamageColor( hull, true ) );
339  GFXTexCoord2f( middle_point_small, middle_point );
340  GFXVertexf( mll );
341  GFXColorf( getDamageColor( hull, true ) );
342  GFXTexCoord2f( middle_point_small, middle_point_small );
343  GFXVertexf( mul );
344  GFXColorf( getDamageColor( hull, true ) );
345  GFXTexCoord2f( middle_point, middle_point_small );
346  GFXVertexf( mur );
347  GFXColorf( getDamageColor( hull, true ) );
348  GFXTexCoord2f( middle_point, middle_point );
349  GFXVertexf( mlr );
350  GFXColorf( getDamageColor( hull, true ) );
351  GFXTexCoord2f( middle_point_small, middle_point );
352  GFXVertexf( mll );
353  GFXEnd();
354 
355  GFXEnable( CULLFACE );
356  }
357  s->SetSize( nw, nh );
358  h = fabs( h );
359  if (HighQTargetVSSprites)
360  GFXBlendMode( ONE, ZERO );
361  else
362  GFXAlphaTest( ALWAYS, 0 );
363  }
364 }
void DrawObjectivesTextPlane ( TextPlane tp,
int  scrolloffset,
Unit parent 
)

Definition at line 1726 of file vdu.cpp.

References active_missions, TextPlane::bgcol, TextPlane::Draw(), GetColorFromSuccess(), VegaConfig::getVariable(), j, mission_name, XMLSupport::parse_bool(), XMLSupport::parse_float(), XMLSupport::tostring(), and vs_config.

Referenced by NavigationSystem::DrawObjectives().

1727 {
1728  std::string rez( "\n" );
1729  for (unsigned int i = 0; i < active_missions.size(); ++i)
1730  if ( !active_missions[i]->objectives.empty() ) {
1731  rez += "#FFFFFF";
1732  static bool force_anonymous_missions =
1733  XMLSupport::parse_bool( vs_config->getVariable( "general", "force_anonymous_mission_names", "true" ) );
1734  if (active_missions[i]->mission_name.empty() || force_anonymous_missions)
1735  rez += "Mission "+XMLSupport::tostring( (int) i )+"\n";
1736  else
1737  rez += active_missions[i]->mission_name+"\n";
1738  vector< Mission::Objective >::iterator j = active_missions[i]->objectives.begin();
1739  for (; j != active_missions[i]->objectives.end(); ++j)
1740  if (j->getOwner() == NULL || j->getOwner() == parent) {
1741  if ( (*j).objective.length() ) {
1742  rez += GetColorFromSuccess( (*j).completeness );
1743  rez += (*j).objective;
1744  rez += '\n';
1745  }
1746  }
1747  rez += '\n';
1748  }
1749  static float background_alpha =
1750  XMLSupport::parse_float( vs_config->getVariable( "graphics", "hud", "text_background_alpha", "0.0625" ) );
1751  GFXColor tpbg = tp->bgcol;
1752  bool automatte = (0 == tpbg.a);
1753  if (automatte) tp->bgcol = GFXColor( 0, 0, 0, background_alpha );
1754  tp->Draw( rez, scrolloffset, false, false, automatte );
1755  tp->bgcol = tpbg;
1756 }
static void DrawShield ( float  fs,
float  rs,
float  ls,
float  bs,
float  x,
float  y,
float  w,
float  h,
bool  invert,
GFXColor  outershield,
GFXColor  middleshield,
GFXColor  innershield 
)
static

Definition at line 401 of file vdu.cpp.

References GFXColor::a, DrawHUDSprite(), f, Unit::getHudImage(), Unit::GetHullPercent(), VSSprite::GetPosition(), VSSprite::GetSize(), VegaConfig::getVariable(), GFXBegin(), GFXBlendMode(), GFXColor4f(), GFXColorf(), GFXDisable(), GFXEnable(), GFXEnd(), GFXLINE, GFXPopBlendMode(), GFXPushBlendMode(), GFXVertex3d(), INVSRCALPHA, mymax(), mymin, XMLSupport::parse_bool(), XMLSupport::parse_float(), SMOOTH, SRCALPHA, TEXTURE0, vs_config, x, and y.

413 {
414  //FIXME why is this static?
415  GFXEnable( SMOOTH );
418  GFXBegin( GFXLINE );
419  if (invert) {
420  float tmp = fs;
421  fs = bs;
422  bs = tmp;
423  }
424  GFXColor shcolor[4][3] = {
425  {innershield, middleshield, outershield},
426  {innershield, middleshield, outershield},
427  {innershield, middleshield, outershield},
428  {innershield, middleshield, outershield}
429  };
430  static bool do_shield_fade = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "shield_vdu_fade", "true" ) );
431 
432  static float shthresh[3] = {
433  XMLSupport::parse_float( vs_config->getVariable( "graphics", "hud",
434  "shield_vdu_thresh0",
435  do_shield_fade ? "0" : ".25" ) ),
436  XMLSupport::parse_float( vs_config->getVariable( "graphics", "hud",
437  "shield_vdu_thresh1",
438  do_shield_fade ? ".33" : ".50" ) ),
439  XMLSupport::parse_float( vs_config->getVariable( "graphics", "hud",
440  "shield_vdu_thresh2",
441  do_shield_fade ? ".66" : ".75" ) )
442  }; //PM me if you don't know why I did this.
443  float shtrans[3] = {1.0f, 1.0f, 1.0f};
444  if (do_shield_fade) {
445  shcolor[0][0].a *= mymax( 0.0f, mymin( 1.0f, (fs-shthresh[0])/(shthresh[1]-shthresh[0])*shtrans[0] ) );
446  shcolor[0][1].a *= mymax( 0.0f, mymin( 1.0f, (fs-shthresh[1])/(shthresh[2]-shthresh[1])*shtrans[1] ) );
447  shcolor[0][2].a *= mymax( 0.0f, mymin( 1.0f, (fs-shthresh[2])/(1.0f-shthresh[2])*shtrans[2] ) );
448  shcolor[1][0].a *= mymax( 0.0f, mymin( 1.0f, (rs-shthresh[0])/(shthresh[1]-shthresh[0])*shtrans[0] ) );
449  shcolor[1][1].a *= mymax( 0.0f, mymin( 1.0f, (rs-shthresh[1])/(shthresh[2]-shthresh[1])*shtrans[1] ) );
450  shcolor[1][2].a *= mymax( 0.0f, mymin( 1.0f, (rs-shthresh[2])/(1.0f-shthresh[2])*shtrans[2] ) );
451  shcolor[2][0].a *= mymax( 0.0f, mymin( 1.0f, (ls-shthresh[0])/(shthresh[1]-shthresh[0])*shtrans[0] ) );
452  shcolor[2][1].a *= mymax( 0.0f, mymin( 1.0f, (ls-shthresh[1])/(shthresh[2]-shthresh[1])*shtrans[1] ) );
453  shcolor[2][2].a *= mymax( 0.0f, mymin( 1.0f, (ls-shthresh[2])/(1.0f-shthresh[2])*shtrans[2] ) );
454  shcolor[3][0].a *= mymax( 0.0f, mymin( 1.0f, (bs-shthresh[0])/(shthresh[1]-shthresh[0])*shtrans[0] ) );
455  shcolor[3][1].a *= mymax( 0.0f, mymin( 1.0f, (bs-shthresh[1])/(shthresh[2]-shthresh[1])*shtrans[1] ) );
456  shcolor[3][2].a *= mymax( 0.0f, mymin( 1.0f, (bs-shthresh[2])/(1.0f-shthresh[2])*shtrans[2] ) );
457  }
458  if (fs > shthresh[0]) {
459  GFXColorf( shcolor[0][0] );
460  GFXVertex3d( (double) x-w/8, y+h/2, 0. );
461  GFXVertex3d( (double) x-w/3, y+.9*h/2, 0. );
462  GFXVertex3d( (double) x+w/8, y+h/2, 0. );
463  GFXVertex3d( (double) x+w/3, y+.9*h/2, 0. );
464  GFXVertex3d( (double) x+w/8, y+h/2, 0. );
465  GFXVertex3d( (double) x-w/8, y+h/2, 0. );
466  }
467  if (fs > shthresh[1]) {
468  GFXColorf( shcolor[0][1] );
469  GFXVertex3d( (double) x-w/8, y+1.1*h/2, 0. );
470  GFXVertex3d( (double) x+w/8, y+1.1*h/2, 0. );
471  GFXVertex3d( (double) x-w/8, y+1.1*h/2, 0. );
472  GFXVertex3d( (double) x-w/3, y+h/2, 0. );
473  GFXVertex3d( (double) x+w/8, y+1.1*h/2, 0. );
474  GFXVertex3d( (double) x+w/3, y+h/2, 0. );
475  }
476  if (fs > shthresh[2]) {
477  GFXColorf( shcolor[0][2] );
478  GFXVertex3d( (double) x-w/8, y+1.2*h/2, 0. );
479  GFXVertex3d( (double) x+w/8, y+1.2*h/2, 0. );
480  GFXVertex3d( (double) x-w/8, y+1.2*h/2, 0. );
481  GFXVertex3d( (double) x-w/3, y+1.1*h/2, 0. );
482  GFXVertex3d( (double) x+w/8, y+1.2*h/2, 0. );
483  GFXVertex3d( (double) x+w/3, y+1.1*h/2, 0. );
484  }
485  if (rs > shthresh[0]) {
486  GFXColorf( shcolor[1][0] );
487  GFXVertex3d( (double) x+1*w/2, y-h/8, 0. );
488  GFXVertex3d( (double) x+.9*w/2, y-h/3, 0. );
489  GFXVertex3d( (double) x+1*w/2, y+h/8, 0. );
490  GFXVertex3d( (double) x+1*w/2, y-h/8, 0. );
491  GFXVertex3d( (double) x+.9*w/2, y+h/3, 0. );
492  GFXVertex3d( (double) x+1*w/2, y+h/8, 0. );
493  }
494  if (rs > shthresh[1]) {
495  GFXColorf( shcolor[1][1] );
496  GFXVertex3d( (double) x+1.1*w/2, y-h/8, 0. );
497  GFXVertex3d( (double) x+1*w/2, y-h/3, 0. );
498  GFXVertex3d( (double) x+1.1*w/2, y+h/8, 0. );
499  GFXVertex3d( (double) x+1.1*w/2, y-h/8, 0. );
500  GFXVertex3d( (double) x+1*w/2, y+h/3, 0. );
501  GFXVertex3d( (double) x+1.1*w/2, y+h/8, 0. );
502  }
503  if (rs > shthresh[2]) {
504  GFXColorf( shcolor[1][2] );
505  GFXVertex3d( (double) x+1.2*w/2, y-h/8, 0. );
506  GFXVertex3d( (double) x+1.1*w/2, y-h/3, 0. );
507  GFXVertex3d( (double) x+1.2*w/2, y+h/8, 0. );
508  GFXVertex3d( (double) x+1.2*w/2, y-h/8, 0. );
509  GFXVertex3d( (double) x+1.1*w/2, y+h/3, 0. );
510  GFXVertex3d( (double) x+1.2*w/2, y+h/8, 0. );
511  }
512  if (ls > shthresh[0]) {
513  GFXColorf( shcolor[2][0] );
514  GFXVertex3d( (double) x-1*w/2, y-h/8, 0. );
515  GFXVertex3d( (double) x-.9*w/2, y-h/3, 0. );
516  GFXVertex3d( (double) x-1*w/2, y+h/8, 0. );
517  GFXVertex3d( (double) x-1*w/2, y-h/8, 0. );
518  GFXVertex3d( (double) x-.9*w/2, y+h/3, 0. );
519  GFXVertex3d( (double) x-1*w/2, y+h/8, 0. );
520  }
521  if (ls > shthresh[1]) {
522  GFXColorf( shcolor[2][1] );
523  GFXVertex3d( (double) x-1.1*w/2, y-h/8, 0. );
524  GFXVertex3d( (double) x-1*w/2, y-h/3, 0. );
525  GFXVertex3d( (double) x-1.1*w/2, y+h/8, 0. );
526  GFXVertex3d( (double) x-1.1*w/2, y-h/8, 0. );
527  GFXVertex3d( (double) x-1*w/2, y+h/3, 0. );
528  GFXVertex3d( (double) x-1.1*w/2, y+h/8, 0. );
529  }
530  if (ls > shthresh[2]) {
531  GFXColorf( shcolor[2][2] );
532  GFXVertex3d( (double) x-1.2*w/2, y-h/8, 0. );
533  GFXVertex3d( (double) x-1.1*w/2, y-h/3, 0. );
534  GFXVertex3d( (double) x-1.2*w/2, y+h/8, 0. );
535  GFXVertex3d( (double) x-1.2*w/2, y-h/8, 0. );
536  GFXVertex3d( (double) x-1.1*w/2, y+h/3, 0. );
537  GFXVertex3d( (double) x-1.2*w/2, y+h/8, 0. );
538  }
539  if (bs > shthresh[0]) {
540  GFXColorf( shcolor[3][0] );
541  GFXVertex3d( (double) x-w/8, y-h/2, 0. );
542  GFXVertex3d( (double) x-w/3, y-.9*h/2, 0. );
543  GFXVertex3d( (double) x+w/8, y-h/2, 0. );
544  GFXVertex3d( (double) x+w/3, y-.9*h/2, 0. );
545  GFXVertex3d( (double) x+w/8, y-h/2, 0. );
546  GFXVertex3d( (double) x-w/8, y-h/2, 0. );
547  }
548  if (bs > shthresh[1]) {
549  GFXColorf( shcolor[3][1] );
550  GFXVertex3d( (double) x-w/8, y-1.1*h/2, 0. );
551  GFXVertex3d( (double) x+w/8, y-1.1*h/2, 0. );
552  GFXVertex3d( (double) x-w/8, y-1.1*h/2, 0. );
553  GFXVertex3d( (double) x-w/3, y-h/2, 0. );
554  GFXVertex3d( (double) x+w/8, y-1.1*h/2, 0. );
555  GFXVertex3d( (double) x+w/3, y-h/2, 0. );
556  }
557  if (bs > shthresh[2]) {
558  GFXColorf( shcolor[3][2] );
559  GFXVertex3d( (double) x-w/8, y-1.2*h/2, 0. );
560  GFXVertex3d( (double) x+w/8, y-1.2*h/2, 0. );
561  GFXVertex3d( (double) x-w/8, y-1.2*h/2, 0. );
562  GFXVertex3d( (double) x-w/3, y-1.1*h/2, 0. );
563  GFXVertex3d( (double) x+w/8, y-1.2*h/2, 0. );
564  GFXVertex3d( (double) x+w/3, y-1.1*h/2, 0. );
565  }
566  GFXEnd();
567  GFXDisable( SMOOTH );
568  GFXPopBlendMode();
569 }
const char* GetColorFromSuccess ( float  suc)
inline

Definition at line 1696 of file vdu.cpp.

References int, printHex(), suc_col_str, suc_gt_minusone, and suc_gt_plusone.

Referenced by DrawObjectivesTextPlane().

1697 {
1698  if (suc >= 1)
1699  return suc_gt_plusone;
1700  if (suc <= -1)
1701  return suc_gt_minusone;
1702  suc += 1.;
1703  suc *= 128;
1704  unsigned int tmp2 = (unsigned int) suc;
1705  unsigned int tmp1 = (unsigned int) (255-suc);
1706  suc_col_str[0] = '#';
1707  suc_col_str[1] = printHex( tmp1/16 );
1708  suc_col_str[2] = printHex( tmp1%16 );
1709  suc_col_str[3] = printHex( tmp2/16 );
1710  suc_col_str[4] = printHex( tmp2%16 );
1711  suc_col_str[5] = '0';
1712  suc_col_str[6] = '0';
1713 
1714  return suc_col_str;
1715 }
GFXColor getDamageColor ( float  armor,
bool  gradient = false 
)

Definition at line 212 of file vdu.cpp.

References VegaConfig::getColor(), and vs_config.

Referenced by DrawHUDSprite().

213 {
214  static bool init = false;
215  static float damaged[4] = {1, 0, 0, 1};
216  static float half_damaged[4] = {1, 1, 0, 1};
217  static float full[4] = {1, 1, 1, 1};
218  if (!init) {
219  vs_config->getColor( "default", "hud_target_damaged", damaged, true );
220  vs_config->getColor( "default", "hud_target_half_damaged", half_damaged, true );
221  vs_config->getColor( "default", "hud_target_full", full, true );
222  init = true;
223  }
224  if (armor >= .9)
225  return GFXColor( full[0], full[1], full[2], full[3] );
226  float avghalf = armor >= .3 ? 1 : 0;
227  if (gradient && armor >= .3)
228  avghalf = (armor-.3)/.6;
229  float avgdamaged = 1-avghalf;
230  return GFXColor( half_damaged[0]*avghalf+damaged[0]*avgdamaged,
231  half_damaged[1]*avghalf+damaged[1]*avgdamaged,
232  half_damaged[2]*avghalf+damaged[2]*avgdamaged,
233  half_damaged[3]*avghalf+damaged[3]*avgdamaged );
234 }
VSSprite* getJumpImage ( )

Definition at line 702 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

703 {
704  RETURN_STATIC_SPRITE( "jump-hud" );
705 }
VSSprite* getNavImage ( )

Definition at line 717 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

718 {
719  RETURN_STATIC_SPRITE( "nav-hud" );
720 }
VSSprite* getPlanetImage ( )

Definition at line 712 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

713 {
714  RETURN_STATIC_SPRITE( "planet-hud" );
715 }
VSSprite* getSunImage ( )

Definition at line 707 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

708 {
709  RETURN_STATIC_SPRITE( "sun-hud" );
710 }
VSSprite* getTargetDualShield ( )

Definition at line 697 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

698 {
699  RETURN_STATIC_SPRITE( "shield_dual" );
700 }
VSSprite* getTargetQuadShield ( )

Definition at line 692 of file vdu.cpp.

References RETURN_STATIC_SPRITE.

693 {
694  RETURN_STATIC_SPRITE( "shield_quad" );
695 }
string getUnitNameAndFgNoBase ( Unit target)

Definition at line 60 of file vdu.cpp.

References Unit::getFgSubnumber(), Unit::getFlightgroup(), Unit::getFullname(), VegaConfig::getVariable(), Unit::isUnit(), Flightgroup::name, Unit::name, Network, XMLSupport::parse_bool(), PLANETPTR, reformatName(), XMLSupport::tostring(), UNITPTR, and vs_config.

Referenced by drawdescription(), and CockpitKeys::TextMessageCallback().

61 {
62  Flightgroup *fg = target->getFlightgroup();
63  if (target->isUnit() == PLANETPTR) {
64  string hr = ( (Planet*) target )->getHumanReadablePlanetType();
65  if ( !hr.empty() )
66  return hr+string( ":" )+reformatName( target->name );
67  } else if (target->isUnit() == UNITPTR) {
68  if (fg) {
69  int fgsnumber = target->getFgSubnumber();
70  string fgnstring = XMLSupport::tostring( fgsnumber );
71  static bool confignums =
72  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "print_fg_sub_id", "false" ) );
73  string fgname;
74  if (fg->name != "Base" && fg->name != "Asteroid" && fg->name != "Nebula") {
75  static bool printfgname =
76  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "print_fg_name", "true" ) );
77  static bool printshiptype =
78  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "print_ship_type", "true" ) );
79  if (printfgname)
80  fgname += fg->name
81  +(printshiptype ? ( ( confignums && ("" != fgnstring) ) ? " =" : " : " ) : "");
82  if ( confignums && ("" != fgnstring) )
83  fgname += fgnstring+"= ";
84  if (printshiptype)
85  return fgname+reformatName( target->getFullname() );
86  return fgname;
87  } else if (fg->name == "Base") {
88  static bool namecolonname =
89  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "basename:basename", "true" ) );
90  if ( namecolonname == false || reformatName( target->name ) == ( reformatName( target->getFullname() ) ) ) {
91  std::string retval( reformatName( target->getFullname() ) );
92  if ( confignums && ("" != fgnstring) ) retval += " : "+fgnstring;
93  return retval;
94  } else {
95  if ( reformatName( target->name ) == ( reformatName( target->getFullname() ) ) ) {
96  std::string retval( reformatName(
97  target->name )+" "
98  +( ( confignums && ("" != fgnstring) ) ? (": "+fgnstring) : "" ) );
99  return retval;
100  } else {
101  std::string retval( reformatName( target->name )+" : "+target->getFullname() );
102  return retval;
103  }
104  }
105  }
106  } else if (Network != NULL) {
107  std::string retval( reformatName( target->name )+":"+target->getFullname() );
108  return retval;
109  }
110  }
111  return reformatName( target->name );
112 }
GFXColor MountColor ( Mount mnt)

Definition at line 1562 of file vdu.cpp.

References Mount::ACTIVE, Mount::ammo, weapon_info::BEAM, colLerp(), Mount::DESTROYED, Mount::functionality, Mount::REF::gun, Mount::INACTIVE, Mount::ref, weapon_info::Refire(), Mount::REF::refire, Beam::refireTime(), Mount::status, weapon_info::type, Mount::type, and Mount::UNCHOSEN.

1563 {
1564  GFXColor mountcolor;
1565  switch (mnt->ammo != 0 ? mnt->status : 127)
1566  {
1567  case Mount::ACTIVE: {
1568  if (mnt->functionality == 1)
1569  {
1570  float ref = 1;
1571  float tref = mnt->type->Refire();
1572  float cref = 0;
1573  if (mnt->type->type == weapon_info::BEAM) {
1574  if (mnt->ref.gun)
1575  cref = mnt->ref.gun->refireTime();
1576  } else {
1577  cref = mnt->ref.refire;
1578  }
1579  if (cref < tref)
1580  ref = cref/tref;
1581  if (ref == 1.0)
1582  mountcolor = GFXColor( 0, 1, .2 );
1583  else
1584  mountcolor = colLerp( GFXColor( .2, .2, .2 ), GFXColor( 0, 1, 1 ), ref );
1585  } else // damaged
1586  {
1587  mountcolor = colLerp( GFXColor( 1, 0, 0 ), GFXColor( 0, 1, .2 ), mnt->functionality );
1588  }
1589  break;
1590  }
1591  case Mount::DESTROYED:
1592  mountcolor = GFXColor( 1, 0, 0, 1 );
1593  break;
1594  case Mount::INACTIVE:
1595  mountcolor = GFXColor( 1, 1, 1, 1 );
1596  break;
1597  case Mount::UNCHOSEN:
1598  mountcolor = GFXColor( 1, 1, 1, 1 );
1599  break;
1600  case 127:
1601  mountcolor = GFXColor( 0, .2, 0, 1 );
1602  break;
1603  default:
1604  mountcolor = GFXColor( 0, 1, .2, 1 );
1605  break;
1606  }
1607  return mountcolor;
1608 }
template<typename T >
T mymax ( a,
b 
)
inline

Definition at line 32 of file vdu.cpp.

References b.

33 {
34  return (a > b) ? a : b;
35 }
template<typename T >
T mymin ( a,
b 
)
inline

Draws VDU parts Draws shield, armor, comm strings and animation, messages, manifest, target info, and objectives

Definition at line 26 of file vdu.cpp.

References b.

27 {
28  return (a < b) ? a : b;
29 }
static float OneOfFour ( float  a,
float  b,
float  c,
float  d 
)
static

Definition at line 764 of file vdu.cpp.

765 {
766  int aa = a != 0 ? 1 : 0;
767  int bb = b != 0 ? 1 : 0;
768  int cc = c != 0 ? 1 : 0;
769  int dd = d != 0 ? 1 : 0;
770  if (aa+bb+cc+dd == 4)
771  return 1;
772  if (aa+bb+cc+dd == 3)
773  return .85;
774  if (aa+bb+cc+dd == 2)
775  return .4;
776  return 0;
777 }
int parse_vdu_type ( const char *  x)

Definition at line 137 of file vdu.cpp.

References vdu_lookup().

138 {
139  char *mystr = strdup( x );
140  char *s = mystr;
141  int retval = 0;
142  while (s[0] != '\0')
143  retval |= vdu_lookup( s );
144  free( mystr );
145  return retval;
146 }
retString128 PrettyDistanceString ( double  distance)

Definition at line 735 of file vdu.cpp.

References VegaConfig::getVariable(), XMLSupport::parse_bool(), XMLSupport::parse_float(), retString128::str, and vs_config.

736 {
737  //OVERRUN
738  struct retString128 qr;
739  static float game_speed = XMLSupport::parse_float( vs_config->getVariable( "physics", "game_speed", "1" ) );
740  static bool lie = XMLSupport::parse_bool( vs_config->getVariable( "physics", "game_speed_lying", "true" ) );
741  if (lie) {
742  sprintf( qr.str, "%.2lf", distance/game_speed );
743  } else {
744  if (distance < 20000) //use meters up to 20,000 m
745  sprintf( qr.str, "%.0lf meters", distance );
746  else if (distance < 100000) //use kilometers with two decimals up to 100 km
747  sprintf( qr.str, "%.2lf kilometers", distance/1000 );
748  else if (distance < 299792458) //use kilometers without decimals up to 299792.458 km
749  sprintf( qr.str, "%.0lf kilometers", distance/1000 );
750  else if ( distance < (120*299792458.) ) //use light seconds up to 120
751  sprintf( qr.str, "%.2lf light seconds", distance/299792458 );
752  else if ( distance < (120*60*299792458.) ) //use light minutes up to 120
753  sprintf( qr.str, "%.2lf light minutes", distance/(60*299792458.) );
754  else if ( distance < (48*3600*299792458.) ) //use light hours up to 48
755  sprintf( qr.str, "%.2lf light hours", distance/(3600*299792458.) );
756  else if ( distance < (365*24*3600*299792458.) ) //use light days up to 365
757  sprintf( qr.str, "%.2lf light days", distance/(24*3600*299792458.) );
758  else //use light years
759  sprintf( qr.str, "%.2lf lightyears", distance/(365*24*3600*299792458.) );
760  }
761  return qr;
762 }
char printHex ( unsigned int  hex)

Definition at line 1685 of file vdu.cpp.

Referenced by GetColorFromSuccess().

1686 {
1687  if (hex < 10)
1688  return hex+'0';
1689  return hex-10+'A';
1690 }
string reformatName ( string  nam)

Definition at line 52 of file vdu.cpp.

Referenced by getUnitNameAndFgNoBase().

53 {
54  nam = nam.substr( 0, nam.find( "." ) );
55  if ( nam.length() )
56  nam[0] = toupper( nam[0] );
57  return nam;
58 }
char tohexdigit ( int  x)

Definition at line 148 of file vdu.cpp.

Referenced by colToString().

149 {
150  if (x <= 9 && x >= 0)
151  return (char) (x+'0');
152  else
153  return (char) (x-10+'A');
154 }
static float TwoOfFour ( float  a,
float  b,
float  c,
float  d 
)
static

Definition at line 779 of file vdu.cpp.

780 {
781  int aa = a != 0 ? 1 : 0;
782  int bb = b != 0 ? 1 : 0;
783  int cc = c != 0 ? 1 : 0;
784  int dd = d != 0 ? 1 : 0;
785  if (aa+bb+cc+dd == 4)
786  return 1;
787  if (aa+bb+cc+dd == 3)
788  return 1;
789  if (aa+bb+cc+dd == 2)
790  return .8;
791  if (aa+bb+cc+dd == 1)
792  return .4;
793  return 0;
794 }
void UpdateViewstyle ( VIEWSTYLE vs)

Definition at line 1958 of file vdu.cpp.

References CP_BACK, CP_CHASE, CP_FIXED, CP_FIXEDPOS, CP_FIXEDPOSTARGET, CP_FRONT, CP_LEFT, CP_NUMVIEWS, CP_PAN, CP_PANINSIDE, CP_PANTARGET, CP_RIGHT, CP_TARGET, and CP_VIEWTARGET.

Referenced by VDU::SwitchMode().

1959 {
1960  switch (vs)
1961  {
1962  case CP_FRONT:
1963  vs = CP_TARGET;
1964  break;
1965  case CP_BACK:
1966  vs = CP_FRONT;
1967  break;
1968  case CP_LEFT:
1969  vs = CP_BACK;
1970  break;
1971  case CP_RIGHT:
1972  vs = CP_LEFT;
1973  break;
1974  case CP_CHASE:
1975  vs = CP_TARGET;
1976  break;
1977  case CP_PAN:
1978  vs = CP_CHASE;
1979  break;
1980  case CP_PANTARGET:
1981  vs = CP_CHASE;
1982  break;
1983  case CP_TARGET:
1984  vs = CP_PANTARGET;
1985  break;
1986  case CP_VIEWTARGET: //FIXME cases not previously handled in switch --added by chuck_starchaser; please verify correctness
1987  case CP_PANINSIDE:
1988  case CP_FIXED:
1989  case CP_FIXEDPOS:
1990  case CP_FIXEDPOSTARGET:
1991  case CP_NUMVIEWS:
1992  default:
1993  break;
1994  }
1995 }
int vdu_lookup ( char *&  s)

Definition at line 114 of file vdu.cpp.

References i, j, and vdu_modes.

Referenced by parse_vdu_type().

115 {
116 #ifdef _WIN32
117 #define strcasecmp stricmp
118 #endif
119  int retval = 0;
120  char *t = strdup( s );
121  int i;
122  for (i = 0; t[i] != '\0'; i++)
123  if ( isspace( t[i] ) ) {
124  s += i+1;
125  break;
126  }
127  if (t[i] == '\0')
128  s[0] = '\0';
129  t[i] = '\0';
130  for (unsigned int j = 0; j < ( ( sizeof (vdu_modes)/sizeof (std::string) ) ); j++)
131  if ( 0 == strcasecmp( t, vdu_modes[j].c_str() ) )
132  retval |= (1<<j);
133  free( t );
134  return retval;
135 }

Variable Documentation

const char* DamagedCategory

Definition at line 4970 of file unit_generic.cpp.

char suc_col_str[8] = "#000000"
static

Definition at line 1692 of file vdu.cpp.

Referenced by GetColorFromSuccess().

const char suc_gt_minusone[8] = "#FF0000"
static

Definition at line 1694 of file vdu.cpp.

Referenced by GetColorFromSuccess().

const char suc_gt_plusone[8] = "#00FF00"
static

Definition at line 1693 of file vdu.cpp.

Referenced by GetColorFromSuccess().

const std::string vdu_modes[]
Initial value:
=
{"Target", "Nav", "Objectives", "Comm", "Weapon", "Damage", "Shield", "Manifest", "TargetManifest", "View", "Message"}

ALERT to change must change enum in class.

Definition at line 49 of file vdu.cpp.

Referenced by vdu_lookup().