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
GameStarSystem Class Reference

#include <star_system.h>

Inheritance diagram for GameStarSystem:
StarSystem

Public Member Functions

virtual ~GameStarSystem ()
 
 GameStarSystem (const char *filename, const Vector &centr=Vector(0, 0, 0), const float timeofyear=0)
 
BackgroundgetBackground ()
 
void activateLightMap (int stage=1)
 activates the light map texture More...
 
TexturegetLightMap ()
 
TerraingetTerrain (unsigned int which)
 
unsigned int numTerrain ()
 activates the light map texture More...
 
ContinuousTerraingetContTerrain (unsigned int which)
 
unsigned int numContTerrain ()
 
ClickListgetClickList ()
 
void Draw (bool DrawCockpit=true)
 
void Update (float priority, bool executeDirector)
 update a simulation atom ExecuteDirector must be false if star system is just loaded before mission is loaded More...
 
void SwapIn ()
 re-enables the included lights and terrains More...
 
void SwapOut ()
 Disables included lights and terrains. More...
 
virtual void VolitalizeJumpAnimation (const int ani)
 
virtual void DoJumpingComeSightAndSound (Unit *un)
 
virtual int DoJumpingLeaveSightAndSound (Unit *un)
 
void createBackground (StarSystem::StarXML *xml)
 
- Public Member Functions inherited from StarSystem
 StarSystem ()
 
 StarSystem (const char *filename, const Vector &centroid=Vector(0, 0, 0), const float timeofyear=0)
 
virtual ~StarSystem ()
 
void SetZone (unsigned int zonenum)
 
unsigned int GetZone ()
 
virtual void AddMissileToQueue (class MissileEffect *)
 
virtual void UpdateMissiles ()
 
void UpdateUnitPhysics (bool firstframe)
 
void RequestPhysics (Unit *un, unsigned int queue)
 Requeues the unit so that it is simulated ASAP. More...
 
void Update (float priority, bool executeDirector)
 update a simulation atom ExecuteDirector must be false if star system is just loaded before mission is loaded More...
 
void Update (float priority)
 
unsigned int getCurrentSimFrame () const
 Gets the current simulation frame. More...
 
void ExecuteUnitAI ()
 
std::string getFileName () const
 
std::string getName ()
 
UnitCollectiongetUnitList ()
 Loads the star system from an XML file. More...
 
UnitCollectiongravitationalUnits ()
 
UnitnextSignificantUnit ()
 
void AddUnit (Unit *unit)
 
bool RemoveUnit (Unit *unit)
 Removes from draw list. More...
 
bool JumpTo (Unit *unit, Unit *jumppoint, const std::string &system, bool force=false, bool save_coordinates=false)
 

Static Public Member Functions

static void DrawJumpStars ()
 
- Static Public Member Functions inherited from StarSystem
static void beginElement (void *userData, const XML_Char *name, const XML_Char **atts)
 
static void endElement (void *userData, const XML_Char *name)
 
static void ProcessPendingJumps ()
 

Friends

class Atmosphere
 

Additional Inherited Members

- Public Attributes inherited from StarSystem
struct StarSystem::Statistics stats
 
std::multimap< Unit *, Unit * > last_collisions
 
class CollideTablecollidetable
 
CollideMapcollidemap [2]
 
class bolt_drawbolts
 
- Protected Types inherited from StarSystem
enum  PHYSICS_STAGE { MISSION_SIMULATION, PROCESS_UNIT, PHY_NUM }
 Physics is divided into 3 stages spread over 3 frames. More...
 
- Protected Member Functions inherited from StarSystem
void LoadXML (const char *, const Vector &centroid, const float timeofyear)
 
void beginElement (const std::string &name, const AttributeList &attributes)
 
void endElement (const std::string &name)
 
void AddStarsystemToUniverse (const std::string &filename)
 The Light Map corresponding for the BP for spheremapping. More...
 
void RemoveStarsystemFromUniverse ()
 
- Protected Attributes inherited from StarSystem
struct StarSystem::StarXMLxml
 
enum StarSystem::PHYSICS_STAGE current_stage
 
std::vector< Terrain * > terrains
 Stars, planets, etc. Orbital mechanics precalculated. More...
 
std::vector< ContinuousTerrain * > contterrains
 
UnitCollection drawList
 Everything to be drawn. Folded missiles in here oneday. More...
 
UnitCollection GravitationalUnits
 
UnitCollection physics_buffer [SIM_QUEUE_SIZE+1]
 
unsigned int current_sim_location
 
unsigned char no_collision_time
 Objects subject to global gravitron physics (disabled) More...
 
char * name
 system name More...
 
std::string filename
 
un_iter sigIter
 
double time
 to track the next given physics frame More...
 
Starsstars
 The background associated with this system. More...
 
int lightcontext
 
std::vector< class
MissileEffect * > 
dischargedMissiles
 
unsigned int zone
 

Detailed Description

Star System Scene management for a star system Per-Frame Drawing & Physics simulation

Definition at line 21 of file star_system.h.

Constructor & Destructor Documentation

GameStarSystem::~GameStarSystem ( )
virtual

Definition at line 115 of file star_system.cpp.

References _Universe, StarSystem::bolts, Universe::popActiveStarSystem(), Universe::pushActiveStarSystem(), StarSystem::RemoveStarsystemFromUniverse(), and StarSystem::stars.

116 {
118 #ifdef NV_CUBE_MAP
119  delete LightMap[0];
120  delete LightMap[1];
121  delete LightMap[2];
122  delete LightMap[3];
123  delete LightMap[4];
124  delete LightMap[5];
125 #else
126  delete LightMap[0];
127 #endif
128  delete bg;
129  delete stars;
130  //delete [] name;
131  delete bolts;
132  //delete collidetable;//BAD BAD BAD we need this to happen later!
133 
136 }
GameStarSystem::GameStarSystem ( const char *  filename,
const Vector centr = Vector( 0, 0, 0 ),
const float  timeofyear = 0 
)

adds to jumping table;

Definition at line 46 of file star_system.cpp.

References _Universe, StarSystem::AddStarsystemToUniverse(), StarSystem::bolts, StarSystem::collidetable, StarSystem::current_stage, GFXCreateLightContext(), Atmosphere::Parameters::high_ambient_color, Atmosphere::Parameters::high_color, StarSystem::lightcontext, StarSystem::LoadXML(), Atmosphere::Parameters::low_ambient_color, Atmosphere::Parameters::low_color, StarSystem::MISSION_SIMULATION, StarSystem::name, StarSystem::no_collision_time, Universe::popActiveStarSystem(), Universe::pushActiveStarSystem(), Atmosphere::Parameters::radius, Atmosphere::Parameters::scattering, StarSystem::time, and UpdateTime().

47 {
48  no_collision_time = 0; //(int)(1+2.000/SIMULATION_ATOM);
50  name = NULL;
53  bolts = new bolt_draw;
54  collidetable = new CollideTable( this );
55 
57 
58  LoadXML( filename, centr, timeofyear );
59  if (!name)
60  name = strdup( filename );
62  UpdateTime();
63  time = 0;
64 
66 
67  params.radius = 40000;
68 
69  params.low_color[0] = GFXColor( 0, 0.5, 0.0 );
70 
71  params.low_color[1] = GFXColor( 0, 1.0, 0.0 );
72 
73  params.low_ambient_color[0] = GFXColor( 0.0/255.0, 0.0/255.0, 0.0/255.0 );
74 
75  params.low_ambient_color[1] = GFXColor( 0.0/255.0, 0.0/255.0, 0.0/255.0 );
76 
77  params.high_color[0] = GFXColor( 0.5, 0.0, 0.0 );
78 
79  params.high_color[1] = GFXColor( 1.0, 0.0, 0.0 );
80 
81  params.high_ambient_color[0] = GFXColor( 0, 0, 0 );
82 
83  params.high_ambient_color[1] = GFXColor( 0, 0, 0 );
84 
85  params.scattering = 5;
86 
88 }

Member Function Documentation

void GameStarSystem::activateLightMap ( int  stage = 1)
virtual

activates the light map texture

Reimplemented from StarSystem.

Definition at line 95 of file star_system.cpp.

References CUBE_MAP_GEN, CUBEMAP, GFXActiveTexture(), GFXADDTEXTURE, GFXTextureCoordGenMode(), GFXTextureEnv(), GFXToggleTexture(), Texture::MakeActive(), SPHERE_MAP_GEN, and TEXTURE2D.

96 {
97  GFXActiveTexture( stage );
98 #ifdef NV_CUBE_MAP
99  LightMap[0]->MakeActive( stage );
100 #else
101  LightMap[0]->MakeActive( stage );
102 #endif
103  GFXTextureEnv( stage, GFXADDTEXTURE );
104 #ifdef NV_CUBE_MAP
105  GFXToggleTexture( true, stage, CUBEMAP );
106  GFXTextureCoordGenMode( stage, CUBE_MAP_GEN, NULL, NULL );
107 #else
108  const float tempo[4] = {1, 0, 0, 0};
109  GFXToggleTexture( true, stage, TEXTURE2D );
110  GFXTextureCoordGenMode( stage, SPHERE_MAP_GEN, tempo, tempo );
111 #endif
112  GFXActiveTexture( 0 );
113 }
void GameStarSystem::createBackground ( StarSystem::StarXML xml)
virtual

Reimplemented from StarSystem.

Definition at line 422 of file star_system.cpp.

References StarSystem::StarXML::backgroundColor, StarSystem::StarXML::backgroundDegamma, StarSystem::StarXML::backgroundname, VSFileSystem::VSFile::Close(), CUBEMAP, CUBEMAP_NEGATIVE_X, CUBEMAP_NEGATIVE_Y, CUBEMAP_NEGATIVE_Z, CUBEMAP_POSITIVE_X, CUBEMAP_POSITIVE_Y, CUBEMAP_POSITIVE_Z, DEFAULT_ADDRESS_MODE, EnvironmentMapGeneratorMain(), f, StarSystem::filename, g_game, VegaConfig::getVariable(), GFXFALSE, GFXTRUE, MIPMAP, StarSystem::StarXML::numnearstars, StarSystem::StarXML::numstars, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), XMLSupport::parse_int(), StarSystem::StarXML::reflectivity, vs_options::starblend, StarSystem::stars, StarSystem::StarXML::starsp, BaseUtil::Texture(), TEXTURE2D, TEXTURE_2D, VSFileSystem::TextureFile, TRILINEAR, vs_config, and game_data_t::zfar.

423 {
424 #ifdef NV_CUBE_MAP
425  printf( "using NV_CUBE_MAP\n" );
426  static int max_cube_size = XMLSupport::parse_int( vs_config->getVariable( "graphics", "max_cubemap_size", "1024" ) );
427  LightMap[0] = new Texture( (xml->backgroundname+"_light.cube").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_POSITIVE_X,
428  GFXFALSE, max_cube_size );
429  if ( LightMap[0]->LoadSuccess() && LightMap[0]->isCube() ) {
430  LightMap[1] = LightMap[2] = LightMap[3] = LightMap[4] = LightMap[5] = 0;
431  } else {
432  delete LightMap[0];
433  LightMap[0] = new Texture( (xml->backgroundname+"_right.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_POSITIVE_X,
434  GFXFALSE, max_cube_size );
435  LightMap[1] = new Texture( (xml->backgroundname+"_left.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_NEGATIVE_X,
437  LightMap[0] );
438  LightMap[2] = new Texture( (xml->backgroundname+"_up.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_POSITIVE_Y,
440  LightMap[0] );
441  LightMap[3] = new Texture( (xml->backgroundname+"_down.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_NEGATIVE_Y,
443  LightMap[0] );
444  LightMap[4] = new Texture( (xml->backgroundname+"_front.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_POSITIVE_Z,
446  LightMap[0] );
447  LightMap[5] = new Texture( (xml->backgroundname+"_back.image").c_str(), 1, TRILINEAR, CUBEMAP, CUBEMAP_NEGATIVE_Z,
449  LightMap[0] );
450  }
451 #else
452  string bglight = xml->backgroundname+"_light.image";
453  string bgfile = xml->backgroundname+"_light.image";
454  VSFile f;
456  if (err > Ok)
457  EnvironmentMapGeneratorMain( xml->backgroundname.c_str(), bglight.c_str(), 0, xml->reflectivity, 1 );
458  else
459  f.Close();
460  LightMap[0] = new Texture( bgfile.c_str(), 1, MIPMAP, TEXTURE2D, TEXTURE_2D, GFXTRUE );
461 #endif
462 
463  bg = new Background(
464  xml->backgroundname.c_str(),
465  xml->numstars,
466  g_game.zfar*.9,
467  filename,
468  xml->backgroundColor,
469  xml->backgroundDegamma );
470  stars = new Stars( xml->numnearstars, xml->starsp );
471  stars->SetBlend( game_options.starblend, game_options.starblend );
472 }
void GameStarSystem::DoJumpingComeSightAndSound ( Unit un)
virtual

Reimplemented from StarSystem.

Definition at line 124 of file star_system_jump.cpp.

References AddJumpAnimation(), Unit::GetOrientation(), vs_options::jumpgatesize, Unit::LocalPosition(), q, Unit::rSize(), Vector, and VolatileJumpAnimations.

125 {
126  Vector p, q, r;
127  un->GetOrientation( p, q, r );
128  unsigned int myani = AddJumpAnimation( un->LocalPosition(), un->rSize()*game_options.jumpgatesize, true );
129  VolatileJumpAnimations[myani].a->SetOrientation( p, q, r );
130 }
int GameStarSystem::DoJumpingLeaveSightAndSound ( Unit un)
virtual

Reimplemented from StarSystem.

Definition at line 132 of file star_system_jump.cpp.

References AddJumpAnimation(), AUDCreateSound(), AUDPlay(), Unit::UnitJump::delay, Unit::GetJumpStatus(), Unit::GetOrientation(), Unit::GetVelocity(), vs_options::jumpleave, Unit::LocalPosition(), Unit::Position(), q, Unit::rSize(), and Vector.

133 {
134  int ani;
135  Vector p, q, r;
136  un->GetOrientation( p, q, r );
137  ani = AddJumpAnimation( un->Position()+r.Cast()*un->rSize()*(un->GetJumpStatus().delay+.25), 10*un->rSize() );
138  static int jumpleave = AUDCreateSound( game_options.jumpleave, false );
139  AUDPlay( jumpleave, un->LocalPosition(), un->GetVelocity(), 1 );
140  return ani;
141 }
void GameStarSystem::Draw ( bool  DrawCockpit = true)
virtual

Adds to draw list Draws a frame of action, interpolating between physics frames

this is the final, smoothly calculated cam

Reimplemented from StarSystem.

Definition at line 228 of file star_system.cpp.

References _Universe, Universe::AccessCamera(), Universe::AccessCockpit(), UnitWithinRangeLocator< T >::action, Universe::activeStarSystem(), UnitCollection::UnitIterator::advance(), calc_blend_factor(), cam_setup_phase, StarSystem::collidemap, ConditionalCursorDraw(), StarSystem::contterrains, UnitCollection::createIterator(), Unit::cumulative_transformation, Unit::cur_sim_queue_slot, Unit::curr_physical_state, UnitCollection::UnitIterator::current(), StarSystem::current_stage, DEPTHTEST, DEPTHWRITE, Bolt::Draw(), Background::Draw(), Stars::Draw(), UnitDrawer::draw(), Cockpit::Draw(), vs_options::draw_near_stars_in_front_of_planets, ParticleTrail::DrawAndUpdate(), DrawJumpStars(), UnitDrawer::drawParents(), findObjectsFromPosition(), FOG_OFF, StarSystem::getCurrentSimFrame(), Camera::GetNebula(), Cockpit::GetParent(), Camera::GetPosition(), Cockpit::GetSaveParent(), GFXColor4f(), GFXDisable(), GFXEnable(), GFXFogMode(), GFXGetLightContextAmbient(), GFXLightContextAmbient(), GFXPopGlobalEffects(), GFXTRUE, UnitDrawer::grav_acquire(), StarSystem::GravitationalUnits, i, Identity(), interpolation_blend_factor, Unit::isSubUnit(), LIGHTING, linear_interpolate(), CollideArray::lower_bound(), Magnitude(), UnitDrawer::parent, UnitDrawer::parenttarget, particleTrail, StarSystem::PHY_NUM, StarSystem::physics_buffer, Unit::Position(), vs_options::precull_dist, Unit::prev_physical_state, Halo::ProcessDrawQueue(), Animation::ProcessDrawQueue(), Beam::ProcessDrawQueue(), GamePlanet::ProcessTerrains(), Mesh::ProcessUndrawnMeshes(), Mesh::ProcessZFarMeshes(), queryTime(), QVector, Terrain::RenderAll(), Unit::rSize(), saved_interpolation_blend_factor, Nebula::SetFogState(), Cockpit::SetupViewPort(), Unit::sim_atom_multiplier, SIM_QUEUE_SIZE, SIMULATION_ATOM, StarSystem::stars, Unit::Target(), StarSystem::time, Unit::UNIT_ONLY, AnimatedTexture::UpdateAllFrame(), MeshAnimation::UpdateFrames(), Camera::UpdateGFX(), and WarpTrailDraw().

229 {
230  double starttime = queryTime();
231  GFXEnable( DEPTHTEST );
235  GFXColor4f( 1, 1, 1, 1 );
236  if (DrawCockpit)
238  for (unsigned int i = 0; i < contterrains.size(); ++i)
239  contterrains[i]->AdjustTerrain( this );
240  Unit *par;
241  bool alreadysetviewport = false;
242  if ( ( par = _Universe->AccessCockpit()->GetParent() ) == NULL ) {
244  } else if ( !par->isSubUnit() ) {
245  //now we can assume world is topps
247  par->curr_physical_state,
249  Unit *targ = par->Target();
250  if ( targ && !targ->isSubUnit() ) {
252  targ->curr_physical_state,
254  }
256  alreadysetviewport = true;
257  }
258  double setupdrawtime = queryTime();
259  {
260  cam_setup_phase = true;
261 
262  Unit *saveparent = _Universe->AccessCockpit()->GetSaveParent();
263  Unit *targ = NULL;
264  if (saveparent)
265  targ = saveparent->Target();
266  //Array containing the two interesting units, so as not to have to copy-paste code
267  Unit *camunits[2] = {saveparent, targ};
268  float backup = SIMULATION_ATOM;
269  unsigned int cur_sim_frame = _Universe->activeStarSystem()->getCurrentSimFrame();
270  for (int i = 0; i < 2; ++i) {
271  Unit *unit = camunits[i];
272  //Make sure unit is not null;
273  if ( unit && !unit->isSubUnit() ) {
275  unit->sim_atom_multiplier,
276  unit->cur_sim_queue_slot,
277  cur_sim_frame );
278  SIMULATION_ATOM = backup*unit->sim_atom_multiplier;
279  ( (GameUnit< Unit >*)unit )->GameUnit< Unit >::Draw();
280  }
281  }
283  SIMULATION_ATOM = backup;
284 
285 
288 
289  cam_setup_phase = false;
290  }
291  setupdrawtime = queryTime()-setupdrawtime;
292  GFXDisable( LIGHTING );
293  bg->Draw();
294  double drawtime = queryTime();
295 
296  double maxdrawtime = 0;
297 
298  //Ballpark estimate of when an object of configurable size first becomes one pixel
299 
300  QVector drawstartpos = _Universe->AccessCamera()->GetPosition();
301 
302  Collidable key_iterator( 0, 1, drawstartpos );
304  //Need to draw really big stuff (i.e. planets, deathstars, and other mind-bogglingly big things that shouldn't be culled despited extreme distance
305  Unit *unit;
306  if ( ( drawer.action.parent = _Universe->AccessCockpit()->GetParent() ) != NULL )
307  drawer.action.parenttarget = drawer.action.parent->Target();
308  for (un_iter iter = this->GravitationalUnits.createIterator(); (unit = *iter) != NULL; ++iter) {
309  float distance = ( drawstartpos-unit->Position() ).Magnitude()-unit->rSize();
310  if (distance < game_options.precull_dist)
311  drawer.action.grav_acquire( unit );
312  else
313  drawer.action.draw( unit );
314  }
315  //Need to get iterator to approx camera position
316  CollideMap::iterator parent = collidemap[Unit::UNIT_ONLY]->lower_bound( key_iterator );
317  findObjectsFromPosition( this->collidemap[Unit::UNIT_ONLY], parent, &drawer, drawstartpos, 0, true );
318  drawer.action.drawParents(); //draw units targeted by camera
319  //FIXME maybe we could do bolts & units instead of unit only--and avoid bolt drawing step
320 
321 #if 0
322  for (unsigned int sim_counter = 0; sim_counter <= SIM_QUEUE_SIZE; ++sim_counter) {
323  double tmp = queryTime();
324  Unit *unit;
326  float backup = SIMULATION_ATOM;
327  unsigned int cur_sim_frame = _Universe->activeStarSystem()->getCurrentSimFrame();
328  while ( ( unit = iter.current() ) != NULL ) {
330  unit->sim_atom_multiplier,
331  unit->cur_sim_queue_slot,
332  cur_sim_frame );
333  //if (par&&par->Target()==unit) {
334  //printf ("i:%f s:%f m:%d c:%d l:%d\n",interpolation_blend_factor,saved_interpolation_blend_factor,unit->sim_atom_multiplier,sim_counter,current_sim_location);
335  //}
336  SIMULATION_ATOM = backup*unit->sim_atom_multiplier;
337  ( (GameUnit< Unit >*)unit )->Draw();
338  iter.advance();
339  }
341  SIMULATION_ATOM = backup;
342  tmp = queryTime()-tmp;
343  if (tmp > maxdrawtime) maxdrawtime = tmp;
344  }
345 #endif
346  drawtime = queryTime()-drawtime;
347  WarpTrailDraw();
348 
349  GFXFogMode( FOG_OFF );
350 
351  GFXColor tmpcol( 0, 0, 0, 1 );
352  GFXGetLightContextAmbient( tmpcol );
353  double processmesh = queryTime();
357  GFXEnable( DEPTHTEST );
359  //need to wait for lights to finish
363  processmesh = queryTime()-processmesh;
364  Nebula *neb;
365 
366  Matrix ident;
367  Identity( ident );
368 
370  GFXLightContextAmbient( tmpcol );
371  if ( ( neb = _Universe->AccessCamera()->GetNebula() ) )
372  neb->SetFogState();
374  Bolt::Draw();
375 
376  GFXFogMode( FOG_OFF );
381  ConditionalCursorDraw( false );
382  if (DrawCockpit)
384  double fintime = queryTime()-starttime;
386 }
void GameStarSystem::DrawJumpStars ( )
static

Definition at line 86 of file star_system_jump.cpp.

References a, Unit::UnitJump::delay, Unit::GetJumpStatus(), Unit::GetOrientation(), i, JumpAnimations, vs_options::jumpgatesize, k, pendingjump, Unit::Position(), q, Unit::rSize(), Vector, and VolatileJumpAnimations.

Referenced by Draw().

87 {
88  for (unsigned int kk = 0; kk < pendingjump.size(); ++kk) {
89  int k = pendingjump[kk]->animation;
90  if (k != -1) {
91  Unit *un = pendingjump[kk]->un.GetUnit();
92  if (un) {
93  Vector p, q, r;
94  un->GetOrientation( p, q, r );
95 
96  JumpAnimations[k].a->SetPosition( un->Position()+r.Cast()*un->rSize()*(pendingjump[kk]->delay+.25) );
97  JumpAnimations[k].a->SetOrientation( p, q, r );
98  float dd = un->rSize()*game_options.jumpgatesize
99  *(un->GetJumpStatus().delay-pendingjump[kk]->delay)/(float) un->GetJumpStatus().delay;
100  JumpAnimations[k].a->SetDimensions( dd, dd );
101  }
102  }
103  }
104  unsigned int i;
105  for (i = 0; i < JumpAnimations.size(); ++i)
106  if (JumpAnimations[i].a)
107  JumpAnimations[i].a->Draw();
108  for (i = 0; i < VolatileJumpAnimations.size(); ++i)
109  if (VolatileJumpAnimations[i].a) {
110  float hei, wid;
111  VolatileJumpAnimations[i].a->GetDimensions( hei, wid );
112  VolatileJumpAnimations[i].a->SetDimensions( VolatileJumpAnimations[i].percent*hei,
113  VolatileJumpAnimations[i].percent*wid );
114  if ( VolatileJumpAnimations[i].a->Done() ) {
115  delete VolatileJumpAnimations[i].a;
117  --i;
118  } else {
119  VolatileJumpAnimations[i].a->Draw();
120  }
121  }
122 }
Background* GameStarSystem::getBackground ( )
inlinevirtual

Reimplemented from StarSystem.

Definition at line 36 of file star_system.h.

37  {
38  return bg;
39  }
ClickList * GameStarSystem::getClickList ( )
virtual

Loads the star system from an XML file returns xy sorted bounding spheres of all units in current view

Reimplemented from StarSystem.

Definition at line 138 of file star_system.cpp.

References StarSystem::drawList.

139 {
140  return new ClickList( this, &drawList );
141 }
ContinuousTerrain* GameStarSystem::getContTerrain ( unsigned int  which)
inlinevirtual

Reimplemented from StarSystem.

Definition at line 52 of file star_system.h.

References StarSystem::contterrains.

53  {
54  return contterrains[which];
55  }
Texture * GameStarSystem::getLightMap ( )
virtual

Reimplemented from StarSystem.

Definition at line 90 of file star_system.cpp.

91 {
92  return LightMap[0];
93 }
Terrain* GameStarSystem::getTerrain ( unsigned int  which)
inlinevirtual

Reimplemented from StarSystem.

Definition at line 44 of file star_system.h.

References StarSystem::terrains.

45  {
46  return terrains[which];
47  }
unsigned int GameStarSystem::numContTerrain ( )
inlinevirtual

Reimplemented from StarSystem.

Definition at line 56 of file star_system.h.

References StarSystem::contterrains.

57  {
58  return contterrains.size();
59  }
unsigned int GameStarSystem::numTerrain ( )
inlinevirtual

activates the light map texture

Reimplemented from StarSystem.

Definition at line 48 of file star_system.h.

References StarSystem::terrains.

49  {
50  return terrains.size();
51  }
void GameStarSystem::SwapIn ( )
virtual

re-enables the included lights and terrains

Reimplemented from StarSystem.

Definition at line 149 of file star_system.cpp.

References GFXSetLightContext(), and StarSystem::lightcontext.

150 {
152 }
void GameStarSystem::SwapOut ( )
virtual

Disables included lights and terrains.

Reimplemented from StarSystem.

Definition at line 154 of file star_system.cpp.

155 {}
void GameStarSystem::Update ( float  priority,
bool  executeDirector 
)

update a simulation atom ExecuteDirector must be false if star system is just loaded before mission is loaded

void GameStarSystem::VolitalizeJumpAnimation ( const int  ani)
virtual

Reimplemented from StarSystem.

Definition at line 77 of file star_system_jump.cpp.

References a, AnimationNulls, JumpAnimations, vs_options::jumpanimationshrink, and VolatileJumpAnimations.

78 {
79  if (ani != -1) {
81  JumpAnimations[ani].a = NULL;
82  AnimationNulls.push_back( ani );
83  }
84 }

Friends And Related Function Documentation

friend class Atmosphere
friend

Definition at line 76 of file star_system.h.


The documentation for this class was generated from the following files: