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
universe_util.cpp File Reference
#include "cmd/script/mission.h"
#include "universe_util.h"
#include "universe.h"
#include "cmd/unit.h"
#include "cmd/unit_factory.h"
#include "cmd/collection.h"
#include "star_system.h"
#include <string>
#include "networking/netclient.h"
#include "cmd/music.h"
#include "audiolib.h"
#include "gfx/animation.h"
#include "lin_time.h"
#include "load_mission.h"
#include "config_xml.h"
#include "vs_globals.h"
#include "gfx/particle.h"
#include "cmd/base.h"
#include "options.h"

Go to the source code of this file.

Namespaces

 UniverseUtil
 

Constant Groups

 UniverseUtil
 

Macros

#define activeSys   _Universe->activeStarSystem()
 

Functions

unsigned int AddAnimation (const QVector &pos, const float size, bool mvolatile, const std::string &name, float percentgrow)
 
void RespawnNow (Cockpit *cp)
 
void TerminateCurrentBase (void)
 
void SetStarSystemLoading (bool value)
 
bool GetStarSystemLoading ()
 
void bootstrap_draw (const std::string &message, Animation *newSplashScreen)
 
AnimationGetSplashScreen ()
 
const vector< string > & ParseDestinations (const string &value)
 
void ClientServerSetLightContext (int lightcontext)
 
void UniverseUtil::playVictoryTune ()
 
int UniverseUtil::musicAddList (string str)
 
void UniverseUtil::musicLayerSkip (int layer)
 this skips the current music track, at a specific layer (and goes to the next in the currently playing list) More...
 
void UniverseUtil::musicLayerStop (int layer)
 this stops the music currently playing at a specific layer - with a nice fadeout More...
 
void UniverseUtil::musicLayerPlaySong (string str, int layer)
 
void UniverseUtil::musicLayerPlayList (int which, int layer)
 this plays msuci from a given list, at a specific layer (where the int is what was returned by musicAddList) More...
 
void UniverseUtil::musicLayerLoopList (int numloops, int layer)
 this plays msuci from a given list, at a specific layer (where the int is what was returned by musicAddList) More...
 
void UniverseUtil::musicLayerSetSoftVolume (float vol, float latency_override, int layer)
 sets the software volume, with smooth transitions (latency_override==-1 uses default transition time) More...
 
void UniverseUtil::musicLayerSetHardVolume (float vol, int layer)
 sets the hardware volume, does not support transitions of any kind. More...
 
void UniverseUtil::musicSetSoftVolume (float vol, float latency_override)
 sets the software volume, with smooth transitions (latency_override==-1 uses default transition time) More...
 
void UniverseUtil::musicSetHardVolume (float vol)
 sets the hardware volume, does not support transitions of any kind. More...
 
void UniverseUtil::musicMute (bool stopSound)
 this mutes sound - or unmutes it More...
 
void UniverseUtil::playSound (string soundName, QVector loc, Vector speed)
 
void UniverseUtil::playSoundCockpit (string soundName)
 
void UniverseUtil::StopAllSounds (void)
 
void UniverseUtil::cacheAnimation (string aniName)
 
void UniverseUtil::playAnimation (string aniName, QVector loc, float size)
 
void UniverseUtil::playAnimationGrow (string aniName, QVector loc, float size, float growpercent)
 
unsigned int UniverseUtil::getCurrentPlayer ()
 
unsigned int UniverseUtil::maxMissions ()
 
void UniverseUtil::addParticle (QVector loc, Vector velocity, Vector color, float size)
 
void UniverseUtil::loadGame (const string &savename)
 
void UniverseUtil::saveGame (const string &savename)
 
void UniverseUtil::showSplashScreen (const string &filename)
 
void UniverseUtil::showSplashMessage (const string &text)
 
void UniverseUtil::showSplashProgress (float progress)
 
void UniverseUtil::hideSplashScreen ()
 
bool UniverseUtil::isSplashScreenShowing ()
 
void UniverseUtil::sendCustom (int cp, string cmd, string args, string id)
 

Variables

vs_options game_options
 needed for assert() calls. More...
 

Macro Definition Documentation

#define activeSys   _Universe->activeStarSystem()

Definition at line 40 of file universe_util.cpp.

Function Documentation

unsigned int AddAnimation ( const QVector pos,
const float  size,
bool  mvolatile,
const std::string &  name,
float  percentgrow 
)

Definition at line 52 of file star_system_jump.cpp.

References AnimationNulls, i, JumpAnimations, MIPMAP, and VolatileJumpAnimations.

53 {
54  std::vector< ResizeAni > *ja = mvolatile ? &VolatileJumpAnimations : &JumpAnimations;
55 
56  Animation *ani = new Animation( name.c_str(), true, .1, MIPMAP, false );
57  unsigned int i;
58  if ( mvolatile || AnimationNulls.empty() ) {
59  i = ja->size();
60  ja->push_back( ResizeAni( ani, percentgrow ) );
61  } else {
62  assert( JumpAnimations[AnimationNulls.back()].a == NULL );
63  JumpAnimations[AnimationNulls.back()] = ResizeAni( ani, percentgrow );
64  i = AnimationNulls.back();
65  AnimationNulls.pop_back();
66  }
67  (*ja)[i].a->SetDimensions( size, size );
68  (*ja)[i].a->SetPosition( pos );
69  return i;
70 }
void ClientServerSetLightContext ( int  lightcontext)

Definition at line 41 of file universe_util.cpp.

References GFXSetLightContext().

42 {
43  GFXSetLightContext( lightcontext );
44 }
Animation* GetSplashScreen ( )

Definition at line 374 of file main.cpp.

References SplashScreen.

Referenced by UniverseUtil::showSplashScreen().

375 {
376  return SplashScreen;
377 }
bool GetStarSystemLoading ( )

Definition at line 366 of file main.cpp.

References BootstrapMyStarSystemLoading.

Referenced by UniverseUtil::isSplashScreenShowing().

367 {
369 }
const vector< string >& ParseDestinations ( const string &  value)

Definition at line 178 of file galaxy.cpp.

179 {
180  static vector< string >rv;
181  rv.clear();
182  string::size_type pos = 0, sep;
183  while ( ( sep = value.find( ' ', pos ) ) != string::npos ) {
184  rv.push_back( value.substr( pos, sep-pos ) );
185  pos = sep+1;
186  }
187  if ( pos < value.length() )
188  rv.push_back( value.substr( pos ) );
189  return rv;
190 }
void RespawnNow ( Cockpit cp)

Definition at line 1799 of file cockpit.cpp.

References _Universe, Universe::AccessCockpit(), and Universe::numPlayers().

1800 {
1801  while ( respawnunit.size() <= _Universe->numPlayers() )
1802  respawnunit.push_back( 0 );
1803  for (unsigned int i = 0; i < _Universe->numPlayers(); i++)
1804  if (_Universe->AccessCockpit( i ) == cp)
1805  respawnunit[i] = 2;
1806 }
void SetStarSystemLoading ( bool  value)

Variable Documentation

vs_options game_options

needed for assert() calls.

Functions for python modules

Draws cockpit parts Draws gauges, info strings, radar, ...

Definition at line 83 of file main.cpp.