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
warptrail.cpp File Reference
#include "mesh.h"
#include "lin_time.h"
#include "faction_generic.h"
#include "cmd/unit_generic.h"
#include "gfx/camera.h"
#include "config_xml.h"

Go to the source code of this file.

Classes

struct  warptrails
 
struct  WarpTrail
 

Functions

MeshGetWarpMesh (int faction, warptrails *wt)
 
void AddWarp (Unit *un, QVector beg, float tim)
 
void WarpTrailDraw ()
 

Variables

warptrails wt
 

Function Documentation

void AddWarp ( Unit un,
QVector  beg,
float  tim 
)

Definition at line 96 of file warptrail.cpp.

References warptrails::warps.

97 {
98  wt.warps.push_back( new WarpTrail( un, beg, tim ) );
99 }
Mesh * GetWarpMesh ( int  faction,
warptrails wt 
)

Definition at line 106 of file warptrail.cpp.

References StarSystemGent::faction, warptrails::factions, FactionUtil::GetFaction(), Mesh::LoadMesh(), VSFileSystem::LookForFile(), VSFileSystem::MeshFile, VSFileSystem::Ok, and Vector.

Referenced by WarpTrail::Draw().

107 {
108  using namespace VSFileSystem;
109  while ( faction >= static_cast<int>(w->factions.size()) )
110  w->factions.push_back( NULL );
111  string fac = FactionUtil::GetFaction( faction );
112  fac += "_warp.bfxm";
113  VSError err;
114  if ( ( err = LookForFile( fac, MeshFile ) ) > Ok ) {
115  fac = "neutral_warp.bfxm";
116  if ( ( err = LookForFile( fac, MeshFile ) ) > Ok )
117  return NULL;
118  }
119  if (!w->factions[faction])
120  w->factions[faction] = Mesh::LoadMesh( fac.c_str(), Vector( 1, 1, 1 ), faction, NULL );
121  return w->factions[faction];
122 }
void WarpTrailDraw ( )

Definition at line 101 of file warptrail.cpp.

References warptrails::Draw().

102 {
103  wt.Draw();
104 }

Variable Documentation

Definition at line 15 of file warptrail.cpp.

Referenced by Bolt::Draw().