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
unit_xml.h File Reference
#include "unit_generic.h"

Go to the source code of this file.

Enumerations

enum  UNITLOADTYPE { DEFAULT, NO_MESH }
 

Functions

void addShieldMesh (Unit::XML *xml, const char *filename, const float scale, int faction, class Flightgroup *fg)
 
void addRapidMesh (Unit::XML *xml, const char *filename, const float scale, int faction, class Flightgroup *fg)
 
void pushMesh (Unit::XML *xml, const char *filename, const float scale, int faction, class Flightgroup *fg, int startframe, double texturestarttime)
 
MountcreateMount (const std::string &name, int ammo, int volume, float xyscale=0, float zscale=0)
 
VSSpritecreateVSSprite (const char *file)
 
bool isVSSpriteLoaded (const VSSprite *)
 
void deleteVSSprite (VSSprite *)
 
void cache_ani (string s)
 

Variables

UNITLOADTYPE current_unit_load_mode
 

Enumeration Type Documentation

Enumerator
DEFAULT 
NO_MESH 

Definition at line 25 of file unit_xml.h.

25 {DEFAULT, NO_MESH};

Function Documentation

void addRapidMesh ( Unit::XML xml,
const char *  filename,
const float  scale,
int  faction,
class Flightgroup fg 
)

Definition at line 464 of file unit_xml.cpp.

References Mesh::LoadMesh(), Unit::XML::rapidmesh, and Vector.

465 {
466  xml->rapidmesh = Mesh::LoadMesh( filename, Vector( scale, scale, scale ), faction, fg );
467 }
void addShieldMesh ( Unit::XML xml,
const char *  filename,
const float  scale,
int  faction,
class Flightgroup fg 
)

Definition at line 453 of file unit_xml.cpp.

References VegaConfig::getVariable(), Mesh::LoadMesh(), ONE, XMLSupport::parse_bool(), Mesh::SetBlendMode(), Mesh::setEnvMap(), Mesh::setLighting(), Unit::XML::shieldmesh, Vector, and vs_config.

454 {
455  static bool forceit = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "forceOneOneShieldBlend", "true" ) );
456  xml->shieldmesh = Mesh::LoadMesh( filename, Vector( scale, scale, scale ), faction, fg );
457  if (xml->shieldmesh && forceit) {
458  xml->shieldmesh->SetBlendMode( ONE, ONE, true );
459  xml->shieldmesh->setEnvMap( false, true );
460  xml->shieldmesh->setLighting( true, true );
461  }
462 }
void cache_ani ( string  s)

Definition at line 47 of file unit_functions.cpp.

References tempcache.

Referenced by Unit::LoadRow().

48 {
49  tempcache.insert( s );
50 }
Mount* createMount ( const std::string &  name,
int  ammo,
int  volume,
float  xyscale = 0,
float  zscale = 0 
)
VSSprite* createVSSprite ( const char *  file)

Definition at line 25 of file unit_functions.cpp.

Referenced by Unit::LoadRow().

26 {
27  return new VSSprite( file );
28 }
void deleteVSSprite ( VSSprite )

Definition at line 33 of file unit_functions.cpp.

Referenced by Unit::LoadRow().

34 {
35  delete sprite;
36 }
bool isVSSpriteLoaded ( const VSSprite )

Definition at line 29 of file unit_functions.cpp.

References VSSprite::LoadSuccess().

Referenced by Unit::LoadRow().

30 {
31  return sprite->LoadSuccess();
32 }
void pushMesh ( Unit::XML xml,
const char *  filename,
const float  scale,
int  faction,
class Flightgroup fg,
int  startframe,
double  texturestarttime 
)

Variable Documentation

UNITLOADTYPE current_unit_load_mode